var kW=Object.defineProperty;var nD=e=>{throw TypeError(e)};var NW=(e,t,n)=>t in e?kW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cS=(e,t,n)=>NW(e,typeof t!="symbol"?t+"":t,n),fS=(e,t,n)=>t.has(e)||nD("Cannot "+n);var W=(e,t,n)=>(fS(e,t,"read from private field"),n?n.call(e):t.get(e)),Pe=(e,t,n)=>t.has(e)?nD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,r)=>(fS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(fS(e,t,"access private method"),n);var Ov=(e,t,n,r)=>({set _(i){ke(e,t,i,n)},get _(){return W(e,t,r)}});function AW(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 dS={exports:{}},Uh={};/**
 * @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 rD;function OW(){if(rD)return Uh;rD=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 Uh.Fragment=t,Uh.jsx=n,Uh.jsxs=n,Uh}var iD;function TW(){return iD||(iD=1,dS.exports=OW()),dS.exports}var m=TW(),hS={exports:{}},ut={};/**
 * @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 aD;function PW(){if(aD)return ut;aD=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"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=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 N=_.prototype=new C;N.constructor=_,w(N,j.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function L(H,U,B){var Q=B.ref;return{$$typeof:e,type:H,key:U,ref:Q!==void 0?Q:null,props:B}}function I(H,U){return L(H.type,U,H.props)}function F(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function $(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(B){return U[B]})}var G=/\/+/g;function D(H,U){return typeof H=="object"&&H!==null&&H.key!=null?$(""+H.key):U.toString(36)}function V(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 z(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 h:return ae=H._init,z(ae(H._payload),U,B,Q,Z)}}if(ae)return Z=Z(H),ae=Q===""?"."+D(H,0):Q,O(Z)?(B="",ae!=null&&(B=ae.replace(G,"$&/")+"/"),z(Z,U,B,"",function(se){return se})):Z!=null&&(F(Z)&&(Z=I(Z,B+(Z.key==null||H&&H.key===Z.key?"":(""+Z.key).replace(G,"$&/")+"/")+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+D(Q,ee),ae+=z(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+D(Q,ee++),ae+=z(Q,U,B,te,Z);else if(te==="object"){if(typeof H.then=="function")return z(V(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 q(H,U,B){if(H==null)return H;var Q=[],Z=0;return z(H,Q,"","",function(te){return U.call(B,te,Z++)}),Q}function X(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)},R={map:q,forEach:function(H,U,B){q(H,function(){U.apply(this,arguments)},B)},count:function(H){var U=0;return q(H,function(){U++}),U},toArray:function(H){return q(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 ut.Activity=d,ut.Children=R,ut.Component=j,ut.Fragment=n,ut.Profiler=i,ut.PureComponent=_,ut.StrictMode=r,ut.Suspense=c,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ut.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},ut.cache=function(H){return function(){return H.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.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 L(H.type,Z,Q)},ut.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},ut.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 L(H,te,Z)},ut.createRef=function(){return{current:null}},ut.forwardRef=function(H){return{$$typeof:l,render:H}},ut.isValidElement=F,ut.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:X}},ut.memo=function(H,U){return{$$typeof:f,type:H,compare:U===void 0?null:U}},ut.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}},ut.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ut.use=function(H){return T.H.use(H)},ut.useActionState=function(H,U,B){return T.H.useActionState(H,U,B)},ut.useCallback=function(H,U){return T.H.useCallback(H,U)},ut.useContext=function(H){return T.H.useContext(H)},ut.useDebugValue=function(){},ut.useDeferredValue=function(H,U){return T.H.useDeferredValue(H,U)},ut.useEffect=function(H,U){return T.H.useEffect(H,U)},ut.useEffectEvent=function(H){return T.H.useEffectEvent(H)},ut.useId=function(){return T.H.useId()},ut.useImperativeHandle=function(H,U,B){return T.H.useImperativeHandle(H,U,B)},ut.useInsertionEffect=function(H,U){return T.H.useInsertionEffect(H,U)},ut.useLayoutEffect=function(H,U){return T.H.useLayoutEffect(H,U)},ut.useMemo=function(H,U){return T.H.useMemo(H,U)},ut.useOptimistic=function(H,U){return T.H.useOptimistic(H,U)},ut.useReducer=function(H,U,B){return T.H.useReducer(H,U,B)},ut.useRef=function(H){return T.H.useRef(H)},ut.useState=function(H){return T.H.useState(H)},ut.useSyncExternalStore=function(H,U,B){return T.H.useSyncExternalStore(H,U,B)},ut.useTransition=function(){return T.H.useTransition()},ut.version="19.2.4",ut}var oD;function Td(){return oD||(oD=1,hS.exports=PW()),hS.exports}var y=Td();const Ce=Hi(y),ck=AW({__proto__:null,default:Ce},[y]);var mS={exports:{}},Hh={},pS={exports:{}},gS={};/**
 * @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 sD;function MW(){return sD||(sD=1,(function(e){function t(z,q){var X=z.length;z.push(q);e:for(;0<X;){var K=X-1>>>1,R=z[K];if(0<i(R,q))z[K]=q,z[X]=R,X=K;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var q=z[0],X=z.pop();if(X!==q){z[0]=X;e:for(var K=0,R=z.length,H=R>>>1;K<H;){var U=2*(K+1)-1,B=z[U],Q=U+1,Z=z[Q];if(0>i(B,X))Q<R&&0>i(Z,B)?(z[K]=Z,z[Q]=X,K=Q):(z[K]=B,z[U]=X,K=U);else if(Q<R&&0>i(Z,X))z[K]=Z,z[Q]=X,K=Q;else break e}}return q}function i(z,q){var X=z.sortIndex-q.sortIndex;return X!==0?X:z.id-q.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=[],f=[],h=1,d=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 N(z){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=z)r(f),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(f)}}function O(z){if(w=!1,N(z),!b)if(n(c)!==null)b=!0,A||(A=!0,$());else{var q=n(f);q!==null&&V(O,q.startTime-z)}}var A=!1,T=-1,P=5,L=-1;function I(){return S?!0:!(e.unstable_now()-L<P)}function F(){if(S=!1,A){var z=e.unstable_now();L=z;var q=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var X=g;try{t:{for(N(z),d=n(c);d!==null&&!(d.expirationTime>z&&I());){var K=d.callback;if(typeof K=="function"){d.callback=null,g=d.priorityLevel;var R=K(d.expirationTime<=z);if(z=e.unstable_now(),typeof R=="function"){d.callback=R,N(z),q=!0;break t}d===n(c)&&r(c),N(z)}else r(c);d=n(c)}if(d!==null)q=!0;else{var H=n(f);H!==null&&V(O,H.startTime-z),q=!1}}break e}finally{d=null,g=X,v=!1}q=void 0}}finally{q?$():A=!1}}}var $;if(typeof _=="function")$=function(){_(F)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,D=G.port2;G.port1.onmessage=F,$=function(){D.postMessage(null)}}else $=function(){j(F,0)};function V(z,q){T=j(function(){z(e.unstable_now())},q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var X=g;g=q;try{return z()}finally{g=X}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var X=g;g=z;try{return q()}finally{g=X}},e.unstable_scheduleCallback=function(z,q,X){var K=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?K+X:K):X=K,z){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=X+R,z={id:h++,callback:q,priorityLevel:z,startTime:X,expirationTime:R,sortIndex:-1},X>K?(z.sortIndex=X,t(f,z),n(c)===null&&z===n(f)&&(w?(C(T),T=-1):w=!0,V(O,X-K))):(z.sortIndex=R,t(c,z),b||v||(b=!0,A||(A=!0,$()))),z},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(z){var q=g;return function(){var X=g;g=q;try{return z.apply(this,arguments)}finally{g=X}}}})(gS)),gS}var lD;function DW(){return lD||(lD=1,pS.exports=MW()),pS.exports}var vS={exports:{}},Rr={};/**
 * @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 uD;function RW(){if(uD)return Rr;uD=1;var e=Td();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+f+" 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,f,h){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:c,containerInfo:f,implementation:h}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rr.createPortal=function(c,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(c,f,null,h)},Rr.flushSync=function(c){var f=o.T,h=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=f,r.p=h,r.d.f()}},Rr.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Rr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Rr.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var h=f.as,d=l(h,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:v}):h==="script"&&r.d.X(c,{crossOrigin:d,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Rr.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=l(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Rr.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,d=l(h,f.crossOrigin);r.d.L(c,h,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Rr.preloadModule=function(c,f){if(typeof c=="string")if(f){var h=l(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Rr.requestFormReset=function(c){r.d.r(c)},Rr.unstable_batchedUpdates=function(c,f){return c(f)},Rr.useFormState=function(c,f,h){return o.H.useFormState(c,f,h)},Rr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Rr.version="19.2.4",Rr}var cD;function A$(){if(cD)return vS.exports;cD=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(),vS.exports=RW(),vS.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 fD;function IW(){if(fD)return Hh;fD=1;var e=DW(),t=Td(),n=A$();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 f(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 k=E.alternate;if(k===null){if(x=E.return,x!==null){p=x;continue}break}if(E.child===k.child){for(k=E.child;k;){if(k===p)return c(E),s;if(k===x)return c(E),u;k=k.sibling}throw Error(r(188))}if(p.return!==x.return)p=E,x=k;else{for(var M=!1,Y=E.child;Y;){if(Y===p){M=!0,p=E,x=k;break}if(Y===x){M=!0,x=E,p=k;break}Y=Y.sibling}if(!M){for(Y=k.child;Y;){if(Y===p){M=!0,p=k,x=E;break}if(Y===x){M=!0,x=k,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 h(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=h(s),u!==null)return u;s=s.sibling}return null}var d=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"),N=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"),L=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function D(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case j:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case L: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 N: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:D(s.type)||"Memo";case P:u=s._payload,s=s._init;try{return D(s(u))}catch{}}return null}var V=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},K=[],R=-1;function H(s){return{current:s}}function U(s){0>R||(s.current=K[R],K[R]=null,R--)}function B(s,u){R++,K[R]=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)?_M(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=_M(u),s=CM(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=CM(u,s.type);u!==p&&(B(Z,s),B(Q,p))}function pe(s){Z.current===s&&(U(Q),U(Z)),ae.current===s&&(U(ae),zh._currentValue=X)}var ie,we;function Ee(s){if(ie===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ie=u&&u[1]||"",we=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+we}var Be=!1;function Ne(s,u){if(!s||Be)return"";Be=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(he){var fe=he}Reflect.construct(s,[],be)}else{try{be.call()}catch(he){fe=he}s.call(be.prototype)}}else{try{throw Error()}catch(he){fe=he}(be=s())&&typeof be.catch=="function"&&be.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 k=x.DetermineComponentFrameRoot(),M=k[0],Y=k[1];if(M&&Y){var J=M.split(`
`),ce=Y.split(`
`);for(E=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;E<ce.length&&!ce[E].includes("DetermineComponentFrameRoot");)E++;if(x===J.length||E===ce.length)for(x=J.length-1,E=ce.length-1;1<=x&&0<=E&&J[x]!==ce[E];)E--;for(;1<=x&&0<=E;x--,E--)if(J[x]!==ce[E]){if(x!==1||E!==1)do if(x--,E--,0>E||J[x]!==ce[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{Be=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function it(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 Ne(s.type,!1);case 11:return Ne(s.type.render,!1);case 1:return Ne(s.type,!0);case 31:return Ee("Activity");default:return""}}function Qe(s){try{var u="",p=null;do u+=it(s,p),p=s,s=s.return;while(s);return u}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var Xe=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,ft=e.unstable_cancelCallback,St=e.unstable_shouldYield,Kt=e.unstable_requestPaint,Dt=e.unstable_now,cn=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,Je=e.unstable_IdlePriority,Gt=e.log,nn=e.unstable_setDisableYieldValue,je=null,ot=null;function yt(s){if(typeof Gt=="function"&&nn(s),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(je,s)}catch{}}var lt=Math.clz32?Math.clz32:dr,$n=Math.log,rn=Math.LN2;function dr(s){return s>>>=0,s===0?32:31-($n(s)/rn|0)|0}var Xr=256,Dr=262144,ai=4194304;function Sr(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 Ge(s,u,p){var x=s.pendingLanes;if(x===0)return 0;var E=0,k=s.suspendedLanes,M=s.pingedLanes;s=s.warmLanes;var Y=x&134217727;return Y!==0?(x=Y&~k,x!==0?E=Sr(x):(M&=Y,M!==0?E=Sr(M):p||(p=Y&~s,p!==0&&(E=Sr(p))))):(Y=x&~k,Y!==0?E=Sr(Y):M!==0?E=Sr(M):p||(p=x&~s,p!==0&&(E=Sr(p)))),E===0?0:u!==0&&u!==E&&(u&k)===0&&(k=E&-E,p=u&-u,k>=p||k===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 We(){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 jt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Tn(s,u,p,x,E,k){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,ce=s.hiddenUpdates;for(p=M&~p;0<p;){var ve=31-lt(p),be=1<<ve;Y[ve]=0,J[ve]=-1;var fe=ce[ve];if(fe!==null)for(ce[ve]=null,ve=0;ve<fe.length;ve++){var he=fe[ve];he!==null&&(he.lane&=-536870913)}p&=~be}x!==0&&Gr(s,x,0),k!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=k&~(M&~u))}function Gr(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var x=31-lt(u);s.entangledLanes|=u,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function hr(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var x=31-lt(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:Wa(p),(p&(s.suspendedLanes|u))!==0?0:p}function Wa(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 Is(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:GM(s.type))}function ge(s,u){var p=q.p;try{return q.p=s,u()}finally{q.p=p}}var dt=Math.random().toString(36).slice(2),Rt="__reactFiber$"+dt,on="__reactProps$"+dt,Sa="__reactContainer$"+dt,Qa="__reactEvents$"+dt,hg="__reactListeners$"+dt,tw="__reactHandles$"+dt,mg="__reactResources$"+dt,iu="__reactMarker$"+dt;function Zd(s){delete s[Rt],delete s[on],delete s[Qa],delete s[hg],delete s[tw]}function Ls(s){var u=s[Rt];if(u)return u;for(var p=s.parentNode;p;){if(u=p[Sa]||p[Rt]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=MM(s);s!==null;){if(p=s[Rt])return p;s=MM(s)}return u}s=p,p=s.parentNode}return null}function zs(s){if(s=s[Rt]||s[Sa]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function $s(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Bs(s){var u=s[mg];return u||(u=s[mg]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Hn(s){s[iu]=!0}var pg=new Set,gg={};function Do(s,u){Fs(s,u),Fs(s+"Capture",u)}function Fs(s,u){for(gg[s]=u,s=0;s<u.length;s++)pg.add(u[s])}var nw=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]*$"),Jd={},vg={};function rw(s){return Xe.call(vg,s)?!0:Xe.call(Jd,s)?!1:nw.test(s)?vg[s]=!0:(Jd[s]=!0,!1)}function Ic(s,u,p){if(rw(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 Lc(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 ja(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 yg(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function iw(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,k=x.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(M){p=""+M,k.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 Us(s){if(!s._valueTracker){var u=yg(s)?"checked":"value";s._valueTracker=iw(s,u,""+s[u])}}function xg(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),x="";return s&&(x=yg(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 aw=/[\n"\\]/g;function si(s){return s.replace(aw,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function ou(s,u,p,x,E,k,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?eh(s,M,oi(u)):p!=null?eh(s,M,oi(p)):x!=null&&s.removeAttribute("value"),E==null&&k!=null&&(s.defaultChecked=!!k),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 bg(s,u,p,x,E,k,M,Y){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.type=k),u!=null||p!=null){if(!(k!=="submit"&&k!=="reset"||u!=null)){Us(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),Us(s)}function eh(s,u,p){u==="number"&&au(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function Ro(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 bT(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 wT(s,u,p,x){if(u==null){if(x!=null){if(p!=null)throw Error(r(92));if(V(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),Us(s)}function zc(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var SX=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 ST(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||SX.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function jT(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&&ST(s,E,x)}else for(var k in u)u.hasOwnProperty(k)&&ST(s,k,u[k])}function ow(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 jX=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"]]),EX=/^[\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 wg(s){return EX.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Io(){}var sw=null;function lw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var $c=null,Bc=null;function ET(s){var u=zs(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&&xg(x)}break e;case"textarea":bT(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&Ro(s,!!p.multiple,u,!1)}}}var uw=!1;function _T(s,u,p){if(uw)return s(u,p);uw=!0;try{var x=s(u);return x}finally{if(uw=!1,($c!==null||Bc!==null)&&(lv(),$c&&(u=$c,s=Bc,Bc=$c=null,ET(u),s)))for(u=0;u<s.length;u++)ET(s[u])}}function th(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"),cw=!1;if(Lo)try{var nh={};Object.defineProperty(nh,"passive",{get:function(){cw=!0}}),window.addEventListener("test",nh,nh),window.removeEventListener("test",nh,nh)}catch{cw=!1}var Hs=null,fw=null,Sg=null;function CT(){if(Sg)return Sg;var s,u=fw,p=u.length,x,E="value"in Hs?Hs.value:Hs.textContent,k=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[k-x];x++);return Sg=E.slice(s,1<x?1-x:void 0)}function jg(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 Eg(){return!0}function kT(){return!1}function li(s){function u(p,x,E,k,M){this._reactName=p,this._targetInst=E,this.type=x,this.nativeEvent=k,this.target=M,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(p=s[Y],this[Y]=p?p(k):k[Y]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Eg:kT,this.isPropagationStopped=kT,this}return d(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=Eg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Eg)},persist:function(){},isPersistent:Eg}),u}var su={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_g=li(su),rh=d({},su,{view:0,detail:0}),_X=li(rh),dw,hw,ih,Cg=d({},rh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pw,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!==ih&&(ih&&s.type==="mousemove"?(dw=s.screenX-ih.screenX,hw=s.screenY-ih.screenY):hw=dw=0,ih=s),dw)},movementY:function(s){return"movementY"in s?s.movementY:hw}}),NT=li(Cg),CX=d({},Cg,{dataTransfer:0}),kX=li(CX),NX=d({},rh,{relatedTarget:0}),mw=li(NX),AX=d({},su,{animationName:0,elapsedTime:0,pseudoElement:0}),OX=li(AX),TX=d({},su,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),PX=li(TX),MX=d({},su,{data:0}),AT=li(MX),DX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},RX={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"},IX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LX(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=IX[s])?!!u[s]:!1}function pw(){return LX}var zX=d({},rh,{key:function(s){if(s.key){var u=DX[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=jg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?RX[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pw,charCode:function(s){return s.type==="keypress"?jg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?jg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),$X=li(zX),BX=d({},Cg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),OT=li(BX),FX=d({},rh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pw}),UX=li(FX),HX=d({},su,{propertyName:0,elapsedTime:0,pseudoElement:0}),qX=li(HX),VX=d({},Cg,{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}),KX=li(VX),YX=d({},su,{newState:0,oldState:0}),XX=li(YX),GX=[9,13,27,32],gw=Lo&&"CompositionEvent"in window,ah=null;Lo&&"documentMode"in document&&(ah=document.documentMode);var WX=Lo&&"TextEvent"in window&&!ah,TT=Lo&&(!gw||ah&&8<ah&&11>=ah),PT=" ",MT=!1;function DT(s,u){switch(s){case"keyup":return GX.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Fc=!1;function QX(s,u){switch(s){case"compositionend":return RT(u);case"keypress":return u.which!==32?null:(MT=!0,PT);case"textInput":return s=u.data,s===PT&&MT?null:s;default:return null}}function ZX(s,u){if(Fc)return s==="compositionend"||!gw&&DT(s,u)?(s=CT(),Sg=fw=Hs=null,Fc=!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 TT&&u.locale!=="ko"?null:u.data;default:return null}}var JX={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 IT(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!JX[s.type]:u==="textarea"}function LT(s,u,p,x){$c?Bc?Bc.push(x):Bc=[x]:$c=x,u=pv(u,"onChange"),0<u.length&&(p=new _g("onChange","change",null,p,x),s.push({event:p,listeners:u}))}var oh=null,sh=null;function eG(s){xM(s,0)}function kg(s){var u=$s(s);if(xg(u))return s}function zT(s,u){if(s==="change")return u}var $T=!1;if(Lo){var vw;if(Lo){var yw="oninput"in document;if(!yw){var BT=document.createElement("div");BT.setAttribute("oninput","return;"),yw=typeof BT.oninput=="function"}vw=yw}else vw=!1;$T=vw&&(!document.documentMode||9<document.documentMode)}function FT(){oh&&(oh.detachEvent("onpropertychange",UT),sh=oh=null)}function UT(s){if(s.propertyName==="value"&&kg(sh)){var u=[];LT(u,sh,s,lw(s)),_T(eG,u)}}function tG(s,u,p){s==="focusin"?(FT(),oh=u,sh=p,oh.attachEvent("onpropertychange",UT)):s==="focusout"&&FT()}function nG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return kg(sh)}function rG(s,u){if(s==="click")return kg(u)}function iG(s,u){if(s==="input"||s==="change")return kg(u)}function aG(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Si=typeof Object.is=="function"?Object.is:aG;function lh(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(!Xe.call(u,E)||!Si(s[E],u[E]))return!1}return!0}function HT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function qT(s,u){var p=HT(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=HT(p)}}function VT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?VT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function KT(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 xw(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 oG=Lo&&"documentMode"in document&&11>=document.documentMode,Uc=null,bw=null,uh=null,ww=!1;function YT(s,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;ww||Uc==null||Uc!==au(x)||(x=Uc,"selectionStart"in x&&xw(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}),uh&&lh(uh,x)||(uh=x,x=pv(bw,"onSelect"),0<x.length&&(u=new _g("onSelect","select",null,u,p),s.push({event:u,listeners:x}),u.target=Uc)))}function lu(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var Hc={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")},Sw={},XT={};Lo&&(XT=document.createElement("div").style,"AnimationEvent"in window||(delete Hc.animationend.animation,delete Hc.animationiteration.animation,delete Hc.animationstart.animation),"TransitionEvent"in window||delete Hc.transitionend.transition);function uu(s){if(Sw[s])return Sw[s];if(!Hc[s])return s;var u=Hc[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in XT)return Sw[s]=u[p];return s}var GT=uu("animationend"),WT=uu("animationiteration"),QT=uu("animationstart"),sG=uu("transitionrun"),lG=uu("transitionstart"),uG=uu("transitioncancel"),ZT=uu("transitionend"),JT=new Map,jw="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(" ");jw.push("scrollEnd");function Ea(s,u){JT.set(s,u),Do(u,[s])}var Ng=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=[],qc=0,Ew=0;function Ag(){for(var s=qc,u=Ew=qc=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 k=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}k!==0&&e2(p,E,k)}}function Og(s,u,p,x){Vi[qc++]=s,Vi[qc++]=u,Vi[qc++]=p,Vi[qc++]=x,Ew|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function _w(s,u,p,x){return Og(s,u,p,x),Tg(s)}function cu(s,u){return Og(s,null,null,u),Tg(s)}function e2(s,u,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var E=!1,k=s.return;k!==null;)k.childLanes|=p,x=k.alternate,x!==null&&(x.childLanes|=p),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(E=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,E&&u!==null&&(E=31-lt(p),s=k.hiddenUpdates,x=s[E],x===null?s[E]=[u]:x.push(u),u.lane=p|536870912),k):null}function Tg(s){if(50<Th)throw Th=0,D1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Vc={};function cG(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 cG(s,u,p,x)}function Cw(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 t2(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 Pg(s,u,p,x,E,k){var M=0;if(x=s,typeof s=="function")Cw(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 L:return s=ji(31,p,u,E),s.elementType=L,s.lanes=k,s;case w:return fu(p.children,E,k,u);case S:M=8,E|=24;break;case j:return s=ji(12,p,u,E|2),s.elementType=j,s.lanes=k,s;case O:return s=ji(13,p,u,E),s.elementType=O,s.lanes=k,s;case A:return s=ji(19,p,u,E),s.elementType=A,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:M=10;break e;case C:M=9;break e;case N: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=k,u}function fu(s,u,p,x){return s=ji(7,s,x,u),s.lanes=p,s}function kw(s,u,p){return s=ji(6,s,null,u),s.lanes=p,s}function n2(s){var u=ji(18,null,null,0);return u.stateNode=s,u}function Nw(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 r2=new WeakMap;function Ki(s,u){if(typeof s=="object"&&s!==null){var p=r2.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Qe(u)},r2.set(s,u),u)}return{value:s,source:u,stack:Qe(u)}}var Kc=[],Yc=0,Mg=null,ch=0,Yi=[],Xi=0,qs=null,Za=1,Ja="";function $o(s,u){Kc[Yc++]=ch,Kc[Yc++]=Mg,Mg=s,ch=u}function i2(s,u,p){Yi[Xi++]=Za,Yi[Xi++]=Ja,Yi[Xi++]=qs,qs=s;var x=Za;s=Ja;var E=32-lt(x)-1;x&=~(1<<E),p+=1;var k=32-lt(u)+E;if(30<k){var M=E-E%5;k=(x&(1<<M)-1).toString(32),x>>=M,E-=M,Za=1<<32-lt(u)+E|p<<E|x,Ja=k+s}else Za=1<<k|p<<E|x,Ja=s}function Aw(s){s.return!==null&&($o(s,1),i2(s,1,0))}function Ow(s){for(;s===Mg;)Mg=Kc[--Yc],Kc[Yc]=null,ch=Kc[--Yc],Kc[Yc]=null;for(;s===qs;)qs=Yi[--Xi],Yi[Xi]=null,Ja=Yi[--Xi],Yi[Xi]=null,Za=Yi[--Xi],Yi[Xi]=null}function a2(s,u){Yi[Xi++]=Za,Yi[Xi++]=Ja,Yi[Xi++]=qs,Za=u.id,Ja=u.overflow,qs=s}var jr=null,mn=null,kt=!1,Vs=null,Gi=!1,Tw=Error(r(519));function Ks(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fh(Ki(u,s)),Tw}function o2(s){var u=s.stateNode,p=s.type,x=s.memoizedProps;switch(u[Rt]=s,u[on]=x,p){case"dialog":bt("cancel",u),bt("close",u);break;case"iframe":case"object":case"embed":bt("load",u);break;case"video":case"audio":for(p=0;p<Mh.length;p++)bt(Mh[p],u);break;case"source":bt("error",u);break;case"img":case"image":case"link":bt("error",u),bt("load",u);break;case"details":bt("toggle",u);break;case"input":bt("invalid",u),bg(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":bt("invalid",u);break;case"textarea":bt("invalid",u),wT(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||jM(u.textContent,p)?(x.popover!=null&&(bt("beforetoggle",u),bt("toggle",u)),x.onScroll!=null&&bt("scroll",u),x.onScrollEnd!=null&&bt("scrollend",u),x.onClick!=null&&(u.onclick=Io),u=!0):u=!1,u||Ks(s,!0)}function s2(s){for(jr=s.return;jr;)switch(jr.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:jr=jr.return}}function Xc(s){if(s!==jr)return!1;if(!kt)return s2(s),kt=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||G1(s.type,s.memoizedProps)),p=!p),p&&mn&&Ks(s),s2(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=PM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=PM(s)}else u===27?(u=mn,ol(s.type)?(s=eS,eS=null,mn=s):mn=u):mn=jr?Qi(s.stateNode.nextSibling):null;return!0}function du(){mn=jr=null,kt=!1}function Pw(){var s=Vs;return s!==null&&(di===null?di=s:di.push.apply(di,s),Vs=null),s}function fh(s){Vs===null?Vs=[s]:Vs.push(s)}var Mw=H(null),hu=null,Bo=null;function Ys(s,u,p){B(Mw,u._currentValue),u._currentValue=p}function Fo(s){s._currentValue=Mw.current,U(Mw)}function Dw(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 Rw(s,u,p,x){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var k=E.dependencies;if(k!==null){var M=E.child;k=k.firstContext;e:for(;k!==null;){var Y=k;k=E;for(var J=0;J<u.length;J++)if(Y.context===u[J]){k.lanes|=p,Y=k.alternate,Y!==null&&(Y.lanes|=p),Dw(k.return,p,s),x||(M=null);break e}k=Y.next}}else if(E.tag===18){if(M=E.return,M===null)throw Error(r(341));M.lanes|=p,k=M.alternate,k!==null&&(k.lanes|=p),Dw(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 Gc(s,u,p,x){s=null;for(var E=u,k=!1;E!==null;){if(!k){if((E.flags&524288)!==0)k=!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(zh):s=[zh])}E=E.return}s!==null&&Rw(u,s,p,x),u.flags|=262144}function Dg(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 Er(s){return l2(hu,s)}function Rg(s,u){return hu===null&&mu(s),l2(s,u)}function l2(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 fG=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()})}},dG=e.unstable_scheduleCallback,hG=e.unstable_NormalPriority,qn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Iw(){return{controller:new fG,data:new Map,refCount:0}}function dh(s){s.refCount--,s.refCount===0&&dG(hG,function(){s.controller.abort()})}var hh=null,Lw=0,Wc=0,Qc=null;function mG(s,u){if(hh===null){var p=hh=[];Lw=0,Wc=B1(),Qc={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Lw++,u.then(u2,u2),u}function u2(){if(--Lw===0&&hh!==null){Qc!==null&&(Qc.status="fulfilled");var s=hh;hh=null,Wc=0,Qc=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 c2=z.S;z.S=function(s,u){YP=Dt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&mG(s,u),c2!==null&&c2(s,u)};var pu=H(null);function zw(){var s=pu.current;return s!==null?s:sn.pooledCache}function Ig(s,u){u===null?B(pu,pu.current):B(pu,u.pool)}function f2(){var s=zw();return s===null?null:{parent:qn._currentValue,pool:s}}var Zc=Error(r(460)),$w=Error(r(474)),Lg=Error(r(542)),zg={then:function(){}};function d2(s){return s=s.status,s==="fulfilled"||s==="rejected"}function h2(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,p2(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,p2(s),s}throw vu=u,Zc}}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,Zc):p}}var vu=null;function m2(){if(vu===null)throw Error(r(459));var s=vu;return vu=null,s}function p2(s){if(s===Zc||s===Lg)throw Error(r(483))}var Jc=null,mh=0;function $g(s){var u=mh;return mh+=1,Jc===null&&(Jc=[]),h2(Jc,s,u)}function ph(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Bg(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 g2(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 k(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=kw(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),ph(ne,ue),ne.return=oe,ne):(ne=Pg(ue.type,ue.key,ue.props,null,oe.mode,ye),ph(ne,ue),ne.return=oe,ne)}function ce(oe,ne,ue,ye){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=Nw(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=fu(ue,oe.mode,ye,Ye),ne.return=oe,ne):(ne=E(ne,ue),ne.return=oe,ne)}function be(oe,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=kw(""+ne,oe.mode,ue),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ue=Pg(ne.type,ne.key,ne.props,null,oe.mode,ue),ph(ue,ne),ue.return=oe,ue;case b:return ne=Nw(ne,oe.mode,ue),ne.return=oe,ne;case P:return ne=gu(ne),be(oe,ne,ue)}if(V(ne)||$(ne))return ne=fu(ne,oe.mode,ue,null),ne.return=oe,ne;if(typeof ne.then=="function")return be(oe,$g(ne),ue);if(ne.$$typeof===_)return be(oe,Rg(oe,ne),ue);Bg(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?ce(oe,ne,ue,ye):null;case P:return ue=gu(ue),fe(oe,ne,ue,ye)}if(V(ue)||$(ue))return Ye!==null?null:ve(oe,ne,ue,ye,null);if(typeof ue.then=="function")return fe(oe,ne,$g(ue),ye);if(ue.$$typeof===_)return fe(oe,ne,Rg(oe,ue),ye);Bg(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,ce(ne,oe,ye,Ye);case P:return ye=gu(ye),he(oe,ne,ue,ye,Ye)}if(V(ye)||$(ye))return oe=oe.get(ue)||null,ve(ne,oe,ye,Ye,null);if(typeof ye.then=="function")return he(oe,ne,ue,$g(ye),Ye);if(ye.$$typeof===_)return he(oe,ne,ue,Rg(ne,ye),Ye);Bg(ne,ye)}return null}function Re(oe,ne,ue,ye){for(var Ye=null,Lt=null,Ue=ne,ht=ne=0,_t=null;Ue!==null&&ht<ue.length;ht++){Ue.index>ht?(_t=Ue,Ue=null):_t=Ue.sibling;var zt=fe(oe,Ue,ue[ht],ye);if(zt===null){Ue===null&&(Ue=_t);break}s&&Ue&&zt.alternate===null&&u(oe,Ue),ne=k(zt,ne,ht),Lt===null?Ye=zt:Lt.sibling=zt,Lt=zt,Ue=_t}if(ht===ue.length)return p(oe,Ue),kt&&$o(oe,ht),Ye;if(Ue===null){for(;ht<ue.length;ht++)Ue=be(oe,ue[ht],ye),Ue!==null&&(ne=k(Ue,ne,ht),Lt===null?Ye=Ue:Lt.sibling=Ue,Lt=Ue);return kt&&$o(oe,ht),Ye}for(Ue=x(Ue);ht<ue.length;ht++)_t=he(Ue,oe,ht,ue[ht],ye),_t!==null&&(s&&_t.alternate!==null&&Ue.delete(_t.key===null?ht:_t.key),ne=k(_t,ne,ht),Lt===null?Ye=_t:Lt.sibling=_t,Lt=_t);return s&&Ue.forEach(function(fl){return u(oe,fl)}),kt&&$o(oe,ht),Ye}function rt(oe,ne,ue,ye){if(ue==null)throw Error(r(151));for(var Ye=null,Lt=null,Ue=ne,ht=ne=0,_t=null,zt=ue.next();Ue!==null&&!zt.done;ht++,zt=ue.next()){Ue.index>ht?(_t=Ue,Ue=null):_t=Ue.sibling;var fl=fe(oe,Ue,zt.value,ye);if(fl===null){Ue===null&&(Ue=_t);break}s&&Ue&&fl.alternate===null&&u(oe,Ue),ne=k(fl,ne,ht),Lt===null?Ye=fl:Lt.sibling=fl,Lt=fl,Ue=_t}if(zt.done)return p(oe,Ue),kt&&$o(oe,ht),Ye;if(Ue===null){for(;!zt.done;ht++,zt=ue.next())zt=be(oe,zt.value,ye),zt!==null&&(ne=k(zt,ne,ht),Lt===null?Ye=zt:Lt.sibling=zt,Lt=zt);return kt&&$o(oe,ht),Ye}for(Ue=x(Ue);!zt.done;ht++,zt=ue.next())zt=he(Ue,oe,ht,zt.value,ye),zt!==null&&(s&&zt.alternate!==null&&Ue.delete(zt.key===null?ht:zt.key),ne=k(zt,ne,ht),Lt===null?Ye=zt:Lt.sibling=zt,Lt=zt);return s&&Ue.forEach(function(CW){return u(oe,CW)}),kt&&$o(oe,ht),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),ph(ye,ue),ye.return=oe,oe=ye;break e}p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ue.type===w?(ye=fu(ue.props.children,oe.mode,ye,ue.key),ye.return=oe,oe=ye):(ye=Pg(ue.type,ue.key,ue.props,null,oe.mode,ye),ph(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=Nw(ue,oe.mode,ye),ye.return=oe,oe=ye}return M(oe);case P:return ue=gu(ue),Zt(oe,ne,ue,ye)}if(V(ue))return Re(oe,ne,ue,ye);if($(ue)){if(Ye=$(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,$g(ue),ye);if(ue.$$typeof===_)return Zt(oe,ne,Rg(oe,ue),ye);Bg(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=kw(ue,oe.mode,ye),ye.return=oe,oe=ye),M(oe)):p(oe,ne)}return function(oe,ne,ue,ye){try{mh=0;var Ye=Zt(oe,ne,ue,ye);return Jc=null,Ye}catch(Ue){if(Ue===Zc||Ue===Lg)throw Ue;var Lt=ji(29,Ue,null,oe.mode);return Lt.lanes=ye,Lt.return=oe,Lt}finally{}}}var yu=g2(!0),v2=g2(!1),Xs=!1;function Bw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fw(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 Gs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ws(s,u,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Ut&2)!==0){var E=x.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),x.pending=u,u=Tg(s),e2(s,null,p),u}return Og(s,x,u,p),Tg(s)}function gh(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,hr(s,p)}}function Uw(s,u){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var E=null,k=null;if(p=p.firstBaseUpdate,p!==null){do{var M={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};k===null?E=k=M:k=k.next=M,p=p.next}while(p!==null);k===null?E=k=u:k=k.next=u}else E=k=u;p={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:k,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 Hw=!1;function vh(){if(Hw){var s=Qc;if(s!==null)throw s}}function yh(s,u,p,x){Hw=!1;var E=s.updateQueue;Xs=!1;var k=E.firstBaseUpdate,M=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var J=Y,ce=J.next;J.next=null,M===null?k=ce:M.next=ce,M=J;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,Y=ve.lastBaseUpdate,Y!==M&&(Y===null?ve.firstBaseUpdate=ce:Y.next=ce,ve.lastBaseUpdate=J))}if(k!==null){var be=E.baseState;M=0,ve=ce=J=null,Y=k;do{var fe=Y.lane&-536870913,he=fe!==Y.lane;if(he?(Et&fe)===fe:(x&fe)===fe){fe!==0&&fe===Wc&&(Hw=!0),ve!==null&&(ve=ve.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Re=s,rt=Y;fe=u;var Zt=p;switch(rt.tag){case 1:if(Re=rt.payload,typeof Re=="function"){be=Re.call(Zt,be,fe);break e}be=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=rt.payload,fe=typeof Re=="function"?Re.call(Zt,be,fe):Re,fe==null)break e;be=d({},be,fe);break e;case 2:Xs=!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?(ce=ve=he,J=be):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=be),E.baseState=J,E.firstBaseUpdate=ce,E.lastBaseUpdate=ve,k===null&&(E.shared.lanes=0),tl|=M,s.lanes=M,s.memoizedState=be}}function y2(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function x2(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)y2(p[s],u)}var ef=H(null),Fg=H(0);function b2(s,u){s=Wo,B(Fg,s),B(ef,u),Wo=s|u.baseLanes}function qw(){B(Fg,Wo),B(ef,ef.current)}function Vw(){Wo=Fg.current,U(ef),U(Fg)}var Ei=H(null),Wi=null;function Qs(s){var u=s.alternate;B(Bn,Bn.current&1),B(Ei,s),Wi===null&&(u===null||ef.current!==null||u.memoizedState!==null)&&(Wi=s)}function Kw(s){B(Bn,Bn.current),B(Ei,s),Wi===null&&(Wi=s)}function w2(s){s.tag===22?(B(Bn,Bn.current),B(Ei,s),Wi===null&&(Wi=s)):Zs()}function Zs(){B(Bn,Bn.current),B(Ei,Ei.current)}function _i(s){U(Ei),Wi===s&&(Wi=null),U(Bn)}var Bn=H(0);function Ug(s){for(var u=s;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||Z1(p)||J1(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,ct=null,Wt=null,Vn=null,Hg=!1,tf=!1,xu=!1,qg=0,xh=0,nf=null,gG=0;function Pn(){throw Error(r(321))}function Yw(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 Xw(s,u,p,x,E,k){return Uo=k,ct=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=s===null||s.memoizedState===null?iP:u1,xu=!1,k=p(x,E),xu=!1,tf&&(k=j2(u,p,x,E)),S2(s),k}function S2(s){z.H=Sh;var u=Wt!==null&&Wt.next!==null;if(Uo=0,Vn=Wt=ct=null,Hg=!1,xh=0,nf=null,u)throw Error(r(300));s===null||Kn||(s=s.dependencies,s!==null&&Dg(s)&&(Kn=!0))}function j2(s,u,p,x){ct=s;var E=0;do{if(tf&&(nf=null),xh=0,tf=!1,25<=E)throw Error(r(301));if(E+=1,Vn=Wt=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}z.H=aP,k=u(p,x)}while(tf);return k}function vG(){var s=z.H,u=s.useState()[0];return u=typeof u.then=="function"?bh(u):u,s=s.useState()[0],(Wt!==null?Wt.memoizedState:null)!==s&&(ct.flags|=1024),u}function Gw(){var s=qg!==0;return qg=0,s}function Ww(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function Qw(s){if(Hg){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Hg=!1}Uo=0,Vn=Wt=ct=null,tf=!1,xh=qg=0,nf=null}function Qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?ct.memoizedState=Vn=s:Vn=Vn.next=s,Vn}function Fn(){if(Wt===null){var s=ct.alternate;s=s!==null?s.memoizedState:null}else s=Wt.next;var u=Vn===null?ct.memoizedState:Vn.next;if(u!==null)Vn=u,Wt=s;else{if(s===null)throw ct.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?ct.memoizedState=Vn=s:Vn=Vn.next=s}return Vn}function Vg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bh(s){var u=xh;return xh+=1,nf===null&&(nf=[]),s=h2(nf,s,u),u=ct,(Vn===null?u.memoizedState:Vn.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?iP:u1),s}function Kg(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return bh(s);if(s.$$typeof===_)return Er(s)}throw Error(r(438,String(s)))}function Zw(s){var u=null,p=ct.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var x=ct.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=Vg(),ct.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]=I;return u.index++,p}function Ho(s,u){return typeof u=="function"?u(s):u}function Yg(s){var u=Fn();return Jw(u,Wt,s)}function Jw(s,u,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var E=s.baseQueue,k=x.pending;if(k!==null){if(E!==null){var M=E.next;E.next=k.next,k.next=M}u.baseQueue=E=k,x.pending=null}if(k=s.baseState,E===null)s.memoizedState=k;else{u=E.next;var Y=M=null,J=null,ce=u,ve=!1;do{var be=ce.lane&-536870913;if(be!==ce.lane?(Et&be)===be:(Uo&be)===be){var fe=ce.revertLane;if(fe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),be===Wc&&(ve=!0);else if((Uo&fe)===fe){ce=ce.next,fe===Wc&&(ve=!0);continue}else be={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(Y=J=be,M=k):J=J.next=be,ct.lanes|=fe,tl|=fe;be=ce.action,xu&&p(k,be),k=ce.hasEagerState?ce.eagerState:p(k,be)}else fe={lane:be,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(Y=J=fe,M=k):J=J.next=fe,ct.lanes|=be,tl|=be;ce=ce.next}while(ce!==null&&ce!==u);if(J===null?M=k:J.next=Y,!Si(k,s.memoizedState)&&(Kn=!0,ve&&(p=Qc,p!==null)))throw p;s.memoizedState=k,s.baseState=M,s.baseQueue=J,x.lastRenderedState=k}return E===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function e1(s){var u=Fn(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,E=p.pending,k=u.memoizedState;if(E!==null){p.pending=null;var M=E=E.next;do k=s(k,M.action),M=M.next;while(M!==E);Si(k,u.memoizedState)||(Kn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),p.lastRenderedState=k}return[k,x]}function E2(s,u,p){var x=ct,E=Fn(),k=kt;if(k){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,r1(k2.bind(null,x,E,s),[s]),E.getSnapshot!==u||M||Vn!==null&&Vn.memoizedState.tag&1){if(x.flags|=2048,rf(9,{destroy:void 0},C2.bind(null,x,E,p,u),null),sn===null)throw Error(r(349));k||(Uo&127)!==0||_2(x,u,p)}return p}function _2(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=ct.updateQueue,u===null?(u=Vg(),ct.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function C2(s,u,p,x){u.value=p,u.getSnapshot=x,N2(u)&&A2(s)}function k2(s,u,p){return p(function(){N2(u)&&A2(s)})}function N2(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!Si(s,p)}catch{return!0}}function A2(s){var u=cu(s,2);u!==null&&hi(u,s,2)}function t1(s){var u=Qr();if(typeof s=="function"){var p=s;if(s=p(),xu){yt(!0);try{p()}finally{yt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:s},u}function O2(s,u,p,x){return s.baseState=p,Jw(s,Wt,typeof x=="function"?x:Ho)}function yG(s,u,p,x,E){if(Wg(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){k.listeners.push(M)}};z.T!==null?p(!0):k.isTransition=!1,x(k),p=u.pending,p===null?(k.next=u.pending=k,T2(u,k)):(k.next=p.next,u.pending=p.next=k)}}function T2(s,u){var p=u.action,x=u.payload,E=s.state;if(u.isTransition){var k=z.T,M={};z.T=M;try{var Y=p(E,x),J=z.S;J!==null&&J(M,Y),P2(s,u,Y)}catch(ce){n1(s,u,ce)}finally{k!==null&&M.types!==null&&(k.types=M.types),z.T=k}}else try{k=p(E,x),P2(s,u,k)}catch(ce){n1(s,u,ce)}}function P2(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){M2(s,u,x)},function(x){return n1(s,u,x)}):M2(s,u,p)}function M2(s,u,p){u.status="fulfilled",u.value=p,D2(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,T2(s,p)))}function n1(s,u,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=p,D2(u),u=u.next;while(u!==x)}s.action=null}function D2(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function R2(s,u){return u}function I2(s,u){if(kt){var p=sn.formState;if(p!==null){e:{var x=ct;if(kt){if(mn){t:{for(var E=mn,k=Gi;E.nodeType!==8;){if(!k){E=null;break t}if(E=Qi(E.nextSibling),E===null){E=null;break t}}k=E.data,E=k==="F!"||k==="F"?E:null}if(E){mn=Qi(E.nextSibling),x=E.data==="F!";break e}}Ks(x)}x=!1}x&&(u=p[0])}}return p=Qr(),p.memoizedState=p.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:R2,lastRenderedState:u},p.queue=x,p=tP.bind(null,ct,x),x.dispatch=p,x=t1(!1),k=l1.bind(null,ct,!1,x.queue),x=Qr(),E={state:u,dispatch:null,action:s,pending:null},x.queue=E,p=yG.bind(null,ct,E,k,p),E.dispatch=p,x.memoizedState=s,[u,p,!1]}function L2(s){var u=Fn();return z2(u,Wt,s)}function z2(s,u,p){if(u=Jw(s,u,R2)[0],s=Yg(Ho)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=bh(u)}catch(M){throw M===Zc?Lg:M}else x=u;u=Fn();var E=u.queue,k=E.dispatch;return p!==u.memoizedState&&(ct.flags|=2048,rf(9,{destroy:void 0},xG.bind(null,E,p),null)),[x,k,s]}function xG(s,u){s.action=u}function $2(s){var u=Fn(),p=Wt;if(p!==null)return z2(u,p,s);Fn(),u=u.memoizedState,p=Fn();var x=p.queue.dispatch;return p.memoizedState=s,[u,x,!1]}function rf(s,u,p,x){return s={tag:s,create:p,deps:x,inst:u,next:null},u=ct.updateQueue,u===null&&(u=Vg(),ct.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 B2(){return Fn().memoizedState}function Xg(s,u,p,x){var E=Qr();ct.flags|=s,E.memoizedState=rf(1|u,{destroy:void 0},p,x===void 0?null:x)}function Gg(s,u,p,x){var E=Fn();x=x===void 0?null:x;var k=E.memoizedState.inst;Wt!==null&&x!==null&&Yw(x,Wt.memoizedState.deps)?E.memoizedState=rf(u,k,p,x):(ct.flags|=s,E.memoizedState=rf(1|u,k,p,x))}function F2(s,u){Xg(8390656,8,s,u)}function r1(s,u){Gg(2048,8,s,u)}function bG(s){ct.flags|=4;var u=ct.updateQueue;if(u===null)u=Vg(),ct.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function U2(s){var u=Fn().memoizedState;return bG({ref:u,nextImpl:s}),function(){if((Ut&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function H2(s,u){return Gg(4,2,s,u)}function q2(s,u){return Gg(4,4,s,u)}function V2(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 K2(s,u,p){p=p!=null?p.concat([s]):null,Gg(4,4,V2.bind(null,u,s),p)}function i1(){}function Y2(s,u){var p=Fn();u=u===void 0?null:u;var x=p.memoizedState;return u!==null&&Yw(u,x[1])?x[0]:(p.memoizedState=[s,u],s)}function X2(s,u){var p=Fn();u=u===void 0?null:u;var x=p.memoizedState;if(u!==null&&Yw(u,x[1]))return x[0];if(x=s(),xu){yt(!0);try{s()}finally{yt(!1)}}return p.memoizedState=[x,u],x}function a1(s,u,p){return p===void 0||(Uo&1073741824)!==0&&(Et&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=GP(),ct.lanes|=s,tl|=s,p)}function G2(s,u,p,x){return Si(p,u)?p:ef.current!==null?(s=a1(s,p,x),Si(s,u)||(Kn=!0),s):(Uo&42)===0||(Uo&1073741824)!==0&&(Et&261930)===0?(Kn=!0,s.memoizedState=p):(s=GP(),ct.lanes|=s,tl|=s,u)}function W2(s,u,p,x,E){var k=q.p;q.p=k!==0&&8>k?k:8;var M=z.T,Y={};z.T=Y,l1(s,!1,u,p);try{var J=E(),ce=z.S;if(ce!==null&&ce(Y,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=pG(J,x);wh(s,u,ve,Ni(s))}else wh(s,u,x,Ni(s))}catch(be){wh(s,u,{then:function(){},status:"rejected",reason:be},Ni())}finally{q.p=k,M!==null&&Y.types!==null&&(M.types=Y.types),z.T=M}}function wG(){}function o1(s,u,p,x){if(s.tag!==5)throw Error(r(476));var E=Q2(s).queue;W2(s,E,u,X,p===null?wG:function(){return Z2(s),p(x)})}function Q2(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:X},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 Z2(s){var u=Q2(s);u.next===null&&(u=s.alternate.memoizedState),wh(s,u.next.queue,{},Ni())}function s1(){return Er(zh)}function J2(){return Fn().memoizedState}function eP(){return Fn().memoizedState}function SG(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=Ni();s=Gs(p);var x=Ws(u,s,p);x!==null&&(hi(x,u,p),gh(x,u,p)),u={cache:Iw()},s.payload=u;return}u=u.return}}function jG(s,u,p){var x=Ni();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Wg(s)?nP(u,p):(p=_w(s,u,p,x),p!==null&&(hi(p,s,x),rP(p,u,x)))}function tP(s,u,p){var x=Ni();wh(s,u,p,x)}function wh(s,u,p,x){var E={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Wg(s))nP(u,E);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var M=u.lastRenderedState,Y=k(M,p);if(E.hasEagerState=!0,E.eagerState=Y,Si(Y,M))return Og(s,u,E,0),sn===null&&Ag(),!1}catch{}finally{}if(p=_w(s,u,E,x),p!==null)return hi(p,s,x),rP(p,u,x),!0}return!1}function l1(s,u,p,x){if(x={lane:2,revertLane:B1(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Wg(s)){if(u)throw Error(r(479))}else u=_w(s,p,x,2),u!==null&&hi(u,s,2)}function Wg(s){var u=s.alternate;return s===ct||u!==null&&u===ct}function nP(s,u){tf=Hg=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function rP(s,u,p){if((p&4194048)!==0){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,hr(s,p)}}var Sh={readContext:Er,use:Kg,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useInsertionEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useSyncExternalStore:Pn,useId:Pn,useHostTransitionStatus:Pn,useFormState:Pn,useActionState:Pn,useOptimistic:Pn,useMemoCache:Pn,useCacheRefresh:Pn};Sh.useEffectEvent=Pn;var iP={readContext:Er,use:Kg,useCallback:function(s,u){return Qr().memoizedState=[s,u===void 0?null:u],s},useContext:Er,useEffect:F2,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,Xg(4194308,4,V2.bind(null,u,s),p)},useLayoutEffect:function(s,u){return Xg(4194308,4,s,u)},useInsertionEffect:function(s,u){Xg(4,2,s,u)},useMemo:function(s,u){var p=Qr();u=u===void 0?null:u;var x=s();if(xu){yt(!0);try{s()}finally{yt(!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){yt(!0);try{p(u)}finally{yt(!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=jG.bind(null,ct,s),[x.memoizedState,s]},useRef:function(s){var u=Qr();return s={current:s},u.memoizedState=s},useState:function(s){s=t1(s);var u=s.queue,p=tP.bind(null,ct,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:i1,useDeferredValue:function(s,u){var p=Qr();return a1(p,s,u)},useTransition:function(){var s=t1(!1);return s=W2.bind(null,ct,s.queue,!0,!1),Qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var x=ct,E=Qr();if(kt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),sn===null)throw Error(r(349));(Et&127)!==0||_2(x,u,p)}E.memoizedState=p;var k={value:p,getSnapshot:u};return E.queue=k,F2(k2.bind(null,x,k,s),[s]),x.flags|=2048,rf(9,{destroy:void 0},C2.bind(null,x,k,p,u),null),p},useId:function(){var s=Qr(),u=sn.identifierPrefix;if(kt){var p=Ja,x=Za;p=(x&~(1<<32-lt(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=qg++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=gG++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:s1,useFormState:I2,useActionState:I2,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=l1.bind(null,ct,!0,p),p.dispatch=u,[s,u]},useMemoCache:Zw,useCacheRefresh:function(){return Qr().memoizedState=SG.bind(null,ct)},useEffectEvent:function(s){var u=Qr(),p={impl:s};return u.memoizedState=p,function(){if((Ut&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},u1={readContext:Er,use:Kg,useCallback:Y2,useContext:Er,useEffect:r1,useImperativeHandle:K2,useInsertionEffect:H2,useLayoutEffect:q2,useMemo:X2,useReducer:Yg,useRef:B2,useState:function(){return Yg(Ho)},useDebugValue:i1,useDeferredValue:function(s,u){var p=Fn();return G2(p,Wt.memoizedState,s,u)},useTransition:function(){var s=Yg(Ho)[0],u=Fn().memoizedState;return[typeof s=="boolean"?s:bh(s),u]},useSyncExternalStore:E2,useId:J2,useHostTransitionStatus:s1,useFormState:L2,useActionState:L2,useOptimistic:function(s,u){var p=Fn();return O2(p,Wt,s,u)},useMemoCache:Zw,useCacheRefresh:eP};u1.useEffectEvent=U2;var aP={readContext:Er,use:Kg,useCallback:Y2,useContext:Er,useEffect:r1,useImperativeHandle:K2,useInsertionEffect:H2,useLayoutEffect:q2,useMemo:X2,useReducer:e1,useRef:B2,useState:function(){return e1(Ho)},useDebugValue:i1,useDeferredValue:function(s,u){var p=Fn();return Wt===null?a1(p,s,u):G2(p,Wt.memoizedState,s,u)},useTransition:function(){var s=e1(Ho)[0],u=Fn().memoizedState;return[typeof s=="boolean"?s:bh(s),u]},useSyncExternalStore:E2,useId:J2,useHostTransitionStatus:s1,useFormState:$2,useActionState:$2,useOptimistic:function(s,u){var p=Fn();return Wt!==null?O2(p,Wt,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:Zw,useCacheRefresh:eP};aP.useEffectEvent=U2;function c1(s,u,p,x){u=s.memoizedState,p=p(x,u),p=p==null?u:d({},u,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var f1={enqueueSetState:function(s,u,p){s=s._reactInternals;var x=Ni(),E=Gs(x);E.payload=u,p!=null&&(E.callback=p),u=Ws(s,E,x),u!==null&&(hi(u,s,x),gh(u,s,x))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var x=Ni(),E=Gs(x);E.tag=1,E.payload=u,p!=null&&(E.callback=p),u=Ws(s,E,x),u!==null&&(hi(u,s,x),gh(u,s,x))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=Ni(),x=Gs(p);x.tag=2,u!=null&&(x.callback=u),u=Ws(s,x,p),u!==null&&(hi(u,s,p),gh(u,s,p))}};function oP(s,u,p,x,E,k,M){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,k,M):u.prototype&&u.prototype.isPureReactComponent?!lh(p,x)||!lh(E,k):!0}function sP(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&&f1.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=d({},p));for(var E in s)p[E]===void 0&&(p[E]=s[E])}return p}function lP(s){Ng(s)}function uP(s){console.error(s)}function cP(s){Ng(s)}function Qg(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function fP(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 d1(s,u,p){return p=Gs(p),p.tag=3,p.payload={element:null},p.callback=function(){Qg(s,u)},p}function dP(s){return s=Gs(s),s.tag=3,s}function hP(s,u,p,x){var E=p.type.getDerivedStateFromError;if(typeof E=="function"){var k=x.value;s.payload=function(){return E(k)},s.callback=function(){fP(u,p,x)}}var M=p.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(s.callback=function(){fP(u,p,x),typeof E!="function"&&(nl===null?nl=new Set([this]):nl.add(this));var Y=x.stack;this.componentDidCatch(x.value,{componentStack:Y!==null?Y:""})})}function EG(s,u,p,x,E){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=p.alternate,u!==null&&Gc(u,p,E,!0),p=Ei.current,p!==null){switch(p.tag){case 31:case 13:return Wi===null?uv():p.alternate===null&&Mn===0&&(Mn=3),p.flags&=-257,p.flags|=65536,p.lanes=E,x===zg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([x]):u.add(x),L1(s,x,E)),!1;case 22:return p.flags|=65536,x===zg?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)),L1(s,x,E)),!1}throw Error(r(435,p.tag))}return L1(s,x,E),uv(),!1}if(kt)return u=Ei.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,x!==Tw&&(s=Error(r(422),{cause:x}),fh(Ki(s,p)))):(x!==Tw&&(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=d1(s.stateNode,x,E),Uw(s,E),Mn!==4&&(Mn=2)),!1;var k=Error(r(520),{cause:x});if(k=Ki(k,p),Oh===null?Oh=[k]:Oh.push(k),Mn!==4&&(Mn=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=d1(p.stateNode,x,s),Uw(p,s),!1;case 1:if(u=p.type,k=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(nl===null||!nl.has(k))))return p.flags|=65536,E&=-E,p.lanes|=E,E=dP(E),hP(E,s,p,x),Uw(p,E),!1}p=p.return}while(p!==null);return!1}var h1=Error(r(461)),Kn=!1;function _r(s,u,p,x){u.child=s===null?v2(u,null,p,x):yu(u,s.child,p,x)}function mP(s,u,p,x,E){p=p.render;var k=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=Xw(s,u,p,M,k,E),Y=Gw(),s!==null&&!Kn?(Ww(s,u,E),qo(s,u,E)):(kt&&Y&&Aw(u),u.flags|=1,_r(s,u,x,E),u.child)}function pP(s,u,p,x,E){if(s===null){var k=p.type;return typeof k=="function"&&!Cw(k)&&k.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=k,gP(s,u,k,x,E)):(s=Pg(p.type,null,x,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!w1(s,E)){var M=k.memoizedProps;if(p=p.compare,p=p!==null?p:lh,p(M,x)&&s.ref===u.ref)return qo(s,u,E)}return u.flags|=1,s=zo(k,x),s.ref=u.ref,s.return=u,u.child=s}function gP(s,u,p,x,E){if(s!==null){var k=s.memoizedProps;if(lh(k,x)&&s.ref===u.ref)if(Kn=!1,u.pendingProps=x=k,w1(s,E))(s.flags&131072)!==0&&(Kn=!0);else return u.lanes=s.lanes,qo(s,u,E)}return m1(s,u,p,x,E)}function vP(s,u,p,x){var E=x.children,k=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(k=k!==null?k.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&~k}else x=0,u.child=null;return yP(s,u,k,p,x)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Ig(u,k!==null?k.cachePool:null),k!==null?b2(u,k):qw(),w2(u);else return x=u.lanes=536870912,yP(s,u,k!==null?k.baseLanes|p:p,p,x)}else k!==null?(Ig(u,k.cachePool),b2(u,k),Zs(),u.memoizedState=null):(s!==null&&Ig(u,null),qw(),Zs());return _r(s,u,E,p),u.child}function jh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function yP(s,u,p,x,E){var k=zw();return k=k===null?null:{parent:qn._currentValue,pool:k},u.memoizedState={baseLanes:p,cachePool:k},s!==null&&Ig(u,null),qw(),w2(u),s!==null&&Gc(s,u,x,!0),u.childLanes=E,null}function Zg(s,u){return u=ev({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function xP(s,u,p){return yu(u,s.child,null,p),s=Zg(u,u.pendingProps),s.flags|=2,_i(u),u.memoizedState=null,s}function _G(s,u,p){var x=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(kt){if(x.mode==="hidden")return s=Zg(u,x),u.lanes=536870912,jh(null,s);if(Kw(u),(s=mn)?(s=TM(s,Gi),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:qs!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},p=n2(s),p.return=u,u.child=p,jr=u,mn=null)):s=null,s===null)throw Ks(u);return u.lanes=536870912,null}return Zg(u,x)}var k=s.memoizedState;if(k!==null){var M=k.dehydrated;if(Kw(u),E)if(u.flags&256)u.flags&=-257,u=xP(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||Gc(s,u,p,!1),E=(p&s.childLanes)!==0,Kn||E){if(x=sn,x!==null&&(M=er(x,p),M!==0&&M!==k.retryLane))throw k.retryLane=M,cu(s,M),hi(x,s,M),h1;uv(),u=xP(s,u,p)}else s=k.treeContext,mn=Qi(M.nextSibling),jr=u,kt=!0,Vs=null,Gi=!1,s!==null&&a2(u,s),u=Zg(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 Jg(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 m1(s,u,p,x,E){return mu(u),p=Xw(s,u,p,x,void 0,E),x=Gw(),s!==null&&!Kn?(Ww(s,u,E),qo(s,u,E)):(kt&&x&&Aw(u),u.flags|=1,_r(s,u,p,E),u.child)}function bP(s,u,p,x,E,k){return mu(u),u.updateQueue=null,p=j2(u,x,p,E),S2(s),x=Gw(),s!==null&&!Kn?(Ww(s,u,k),qo(s,u,k)):(kt&&x&&Aw(u),u.flags|=1,_r(s,u,p,k),u.child)}function wP(s,u,p,x,E){if(mu(u),u.stateNode===null){var k=Vc,M=p.contextType;typeof M=="object"&&M!==null&&(k=Er(M)),k=new p(x,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=f1,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=x,k.state=u.memoizedState,k.refs={},Bw(u),M=p.contextType,k.context=typeof M=="object"&&M!==null?Er(M):Vc,k.state=u.memoizedState,M=p.getDerivedStateFromProps,typeof M=="function"&&(c1(u,p,M,x),k.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(M=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),M!==k.state&&f1.enqueueReplaceState(k,k.state,null),yh(u,x,k,E),vh(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(s===null){k=u.stateNode;var Y=u.memoizedProps,J=bu(p,Y);k.props=J;var ce=k.context,ve=p.contextType;M=Vc,typeof ve=="object"&&ve!==null&&(M=Er(ve));var be=p.getDerivedStateFromProps;ve=typeof be=="function"||typeof k.getSnapshotBeforeUpdate=="function",Y=u.pendingProps!==Y,ve||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(Y||ce!==M)&&sP(u,k,x,M),Xs=!1;var fe=u.memoizedState;k.state=fe,yh(u,x,k,E),vh(),ce=u.memoizedState,Y||fe!==ce||Xs?(typeof be=="function"&&(c1(u,p,be,x),ce=u.memoizedState),(J=Xs||oP(u,p,J,x,fe,ce,M))?(ve||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(u.flags|=4194308)):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=ce),k.props=x,k.state=ce,k.context=M,x=J):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{k=u.stateNode,Fw(s,u),M=u.memoizedProps,ve=bu(p,M),k.props=ve,be=u.pendingProps,fe=k.context,ce=p.contextType,J=Vc,typeof ce=="object"&&ce!==null&&(J=Er(ce)),Y=p.getDerivedStateFromProps,(ce=typeof Y=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(M!==be||fe!==J)&&sP(u,k,x,J),Xs=!1,fe=u.memoizedState,k.state=fe,yh(u,x,k,E),vh();var he=u.memoizedState;M!==be||fe!==he||Xs||s!==null&&s.dependencies!==null&&Dg(s.dependencies)?(typeof Y=="function"&&(c1(u,p,Y,x),he=u.memoizedState),(ve=Xs||oP(u,p,ve,x,fe,he,J)||s!==null&&s.dependencies!==null&&Dg(s.dependencies))?(ce||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(x,he,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(x,he,J)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=he),k.props=x,k.state=he,k.context=J,x=ve):(typeof k.componentDidUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),x=!1)}return k=x,Jg(s,u),x=(u.flags&128)!==0,k||x?(k=u.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&x?(u.child=yu(u,s.child,null,E),u.child=yu(u,null,p,E)):_r(s,u,p,E),u.memoizedState=k.state,s=u.child):s=qo(s,u,E),s}function SP(s,u,p,x){return du(),u.flags|=256,_r(s,u,p,x),u.child}var p1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function g1(s){return{baseLanes:s,cachePool:f2()}}function v1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=ki),s}function jP(s,u,p){var x=u.pendingProps,E=!1,k=(u.flags&128)!==0,M;if((M=k)||(M=s!==null&&s.memoizedState===null?!1:(Bn.current&2)!==0),M&&(E=!0,u.flags&=-129),M=(u.flags&32)!==0,u.flags&=-33,s===null){if(kt){if(E?Qs(u):Zs(),(s=mn)?(s=TM(s,Gi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:qs!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},p=n2(s),p.return=u,u.child=p,jr=u,mn=null)):s=null,s===null)throw Ks(u);return J1(s)?u.lanes=32:u.lanes=536870912,null}var Y=x.children;return x=x.fallback,E?(Zs(),E=u.mode,Y=ev({mode:"hidden",children:Y},E),x=fu(x,E,p,null),Y.return=u,x.return=u,Y.sibling=x,u.child=Y,x=u.child,x.memoizedState=g1(p),x.childLanes=v1(s,M,p),u.memoizedState=p1,jh(null,x)):(Qs(u),y1(u,Y))}var J=s.memoizedState;if(J!==null&&(Y=J.dehydrated,Y!==null)){if(k)u.flags&256?(Qs(u),u.flags&=-257,u=x1(s,u,p)):u.memoizedState!==null?(Zs(),u.child=s.child,u.flags|=128,u=null):(Zs(),Y=x.fallback,E=u.mode,x=ev({mode:"visible",children:x.children},E),Y=fu(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=g1(p),x.childLanes=v1(s,M,p),u.memoizedState=p1,u=jh(null,x));else if(Qs(u),J1(Y)){if(M=Y.nextSibling&&Y.nextSibling.dataset,M)var ce=M.dgst;M=ce,x=Error(r(419)),x.stack="",x.digest=M,fh({value:x,source:null,stack:null}),u=x1(s,u,p)}else if(Kn||Gc(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),h1;Z1(Y)||uv(),u=x1(s,u,p)}else Z1(Y)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,mn=Qi(Y.nextSibling),jr=u,kt=!0,Vs=null,Gi=!1,s!==null&&a2(u,s),u=y1(u,x.children),u.flags|=4096);return u}return E?(Zs(),Y=x.fallback,E=u.mode,J=s.child,ce=J.sibling,x=zo(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,ce!==null?Y=zo(ce,Y):(Y=fu(Y,E,p,null),Y.flags|=2),Y.return=u,x.return=u,x.sibling=Y,u.child=x,jh(null,x),x=u.child,Y=s.child.memoizedState,Y===null?Y=g1(p):(E=Y.cachePool,E!==null?(J=qn._currentValue,E=E.parent!==J?{parent:J,pool:J}:E):E=f2(),Y={baseLanes:Y.baseLanes|p,cachePool:E}),x.memoizedState=Y,x.childLanes=v1(s,M,p),u.memoizedState=p1,jh(s.child,x)):(Qs(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 y1(s,u){return u=ev({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function ev(s,u){return s=ji(22,s,null,u),s.lanes=0,s}function x1(s,u,p){return yu(u,s.child,null,p),s=y1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function EP(s,u,p){s.lanes|=u;var x=s.alternate;x!==null&&(x.lanes|=u),Dw(s.return,u,p)}function b1(s,u,p,x,E,k){var M=s.memoizedState;M===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:E,treeForkCount:k}:(M.isBackwards=u,M.rendering=null,M.renderingStartTime=0,M.last=x,M.tail=p,M.tailMode=E,M.treeForkCount=k)}function _P(s,u,p){var x=u.pendingProps,E=x.revealOrder,k=x.tail;x=x.children;var M=Bn.current,Y=(M&2)!==0;if(Y?(M=M&1|2,u.flags|=128):M&=1,B(Bn,M),_r(s,u,x,p),x=kt?ch:0,!Y&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&EP(s,p,u);else if(s.tag===19)EP(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&&Ug(s)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),b1(u,!1,E,p,k,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&&Ug(s)===null){u.child=E;break}s=E.sibling,E.sibling=p,p=E,E=s}b1(u,!0,p,null,k,x);break;case"together":b1(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),tl|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(Gc(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 w1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Dg(s)))}function CG(s,u,p){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),Ys(u,qn,s.memoizedState.cache),du();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:Ys(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Kw(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(Qs(u),u.flags|=128,null):(p&u.child.childLanes)!==0?jP(s,u,p):(Qs(u),s=qo(s,u,p),s!==null?s.sibling:null);Qs(u);break;case 19:var E=(s.flags&128)!==0;if(x=(p&u.childLanes)!==0,x||(Gc(s,u,p,!1),x=(p&u.childLanes)!==0),E){if(x)return _P(s,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(Bn,Bn.current),x)break;return null;case 22:return u.lanes=0,vP(s,u,p,u.pendingProps);case 24:Ys(u,qn,s.memoizedState.cache)}return qo(s,u,p)}function CP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)Kn=!0;else{if(!w1(s,p)&&(u.flags&128)===0)return Kn=!1,CG(s,u,p);Kn=(s.flags&131072)!==0}else Kn=!1,kt&&(u.flags&1048576)!==0&&i2(u,ch,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")Cw(s)?(x=bu(s,x),u.tag=1,u=wP(null,u,s,x,p)):(u.tag=0,u=m1(null,u,s,x,p));else{if(s!=null){var E=s.$$typeof;if(E===N){u.tag=11,u=mP(null,u,s,x,p);break e}else if(E===T){u.tag=14,u=pP(null,u,s,x,p);break e}}throw u=D(s)||s,Error(r(306,u,""))}}return u;case 0:return m1(s,u,u.type,u.pendingProps,p);case 1:return x=u.type,E=bu(x,u.pendingProps),wP(s,u,x,E,p);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));x=u.pendingProps;var k=u.memoizedState;E=k.element,Fw(s,u),yh(u,x,null,p);var M=u.memoizedState;if(x=M.cache,Ys(u,qn,x),x!==k.cache&&Rw(u,[qn],p,!0),vh(),x=M.element,k.isDehydrated)if(k={element:x,isDehydrated:!1,cache:M.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=SP(s,u,x,p);break e}else if(x!==E){E=Ki(Error(r(424)),u),fh(E),u=SP(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),jr=u,kt=!0,Vs=null,Gi=!0,p=v2(u,null,x,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(du(),x===E){u=qo(s,u,p);break e}_r(s,u,x,p)}u=u.child}return u;case 26:return Jg(s,u),s===null?(p=LM(u.type,null,u.pendingProps,null))?u.memoizedState=p:kt||(p=u.type,s=u.pendingProps,x=gv(te.current).createElement(p),x[Rt]=u,x[on]=s,Cr(x,p,s),Hn(x),u.stateNode=x):u.memoizedState=LM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&kt&&(x=u.stateNode=DM(u.type,u.pendingProps,te.current),jr=u,Gi=!0,E=mn,ol(u.type)?(eS=E,mn=Qi(x.firstChild)):mn=E),_r(s,u,u.pendingProps.children,p),Jg(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&kt&&((E=x=mn)&&(x=nW(x,u.type,u.pendingProps,Gi),x!==null?(u.stateNode=x,jr=u,mn=Qi(x.firstChild),Gi=!1,E=!0):E=!1),E||Ks(u)),se(u),E=u.type,k=u.pendingProps,M=s!==null?s.memoizedProps:null,x=k.children,G1(E,k)?x=null:M!==null&&G1(E,M)&&(u.flags|=32),u.memoizedState!==null&&(E=Xw(s,u,vG,null,null,p),zh._currentValue=E),Jg(s,u),_r(s,u,x,p),u.child;case 6:return s===null&&kt&&((s=p=mn)&&(p=rW(p,u.pendingProps,Gi),p!==null?(u.stateNode=p,jr=u,mn=null,s=!0):s=!1),s||Ks(u)),null;case 13:return jP(s,u,p);case 4:return re(u,u.stateNode.containerInfo),x=u.pendingProps,s===null?u.child=yu(u,null,x,p):_r(s,u,x,p),u.child;case 11:return mP(s,u,u.type,u.pendingProps,p);case 7:return _r(s,u,u.pendingProps,p),u.child;case 8:return _r(s,u,u.pendingProps.children,p),u.child;case 12:return _r(s,u,u.pendingProps.children,p),u.child;case 10:return x=u.pendingProps,Ys(u,u.type,x.value),_r(s,u,x.children,p),u.child;case 9:return E=u.type._context,x=u.pendingProps.children,mu(u),E=Er(E),x=x(E),u.flags|=1,_r(s,u,x,p),u.child;case 14:return pP(s,u,u.type,u.pendingProps,p);case 15:return gP(s,u,u.type,u.pendingProps,p);case 19:return _P(s,u,p);case 31:return _G(s,u,p);case 22:return vP(s,u,p,u.pendingProps);case 24:return mu(u),x=Er(qn),s===null?(E=zw(),E===null&&(E=sn,k=Iw(),E.pooledCache=k,k.refCount++,k!==null&&(E.pooledCacheLanes|=p),E=k),u.memoizedState={parent:x,cache:E},Bw(u),Ys(u,qn,E)):((s.lanes&p)!==0&&(Fw(s,u),yh(u,null,null,p),vh()),E=s.memoizedState,k=u.memoizedState,E.parent!==x?(E={parent:x,cache:x},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Ys(u,qn,x)):(x=k.cache,Ys(u,qn,x),x!==E.cache&&Rw(u,[qn],p,!0))),_r(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 S1(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(JP())s.flags|=8192;else throw vu=zg,$w}else s.flags&=-16777217}function kP(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!UM(u))if(JP())s.flags|=8192;else throw vu=zg,$w}function tv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?We():536870912,s.lanes|=u,lf|=u)}function Eh(s,u){if(!kt)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 kG(s,u,p){var x=u.pendingProps;switch(Ow(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)&&(Xc(u)?Vo(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Pw())),pn(u),null;case 26:var E=u.type,k=u.memoizedState;return s===null?(Vo(u),k!==null?(pn(u),kP(u,k)):(pn(u),S1(u,E,null,x,p))):k?k!==s.memoizedState?(Vo(u),pn(u),kP(u,k)):(pn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==x&&Vo(u),pn(u),S1(u,E,s,x,p)),null;case 27:if(pe(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,Xc(u)?o2(u):(s=DM(E,x,p),u.stateNode=s,Vo(u))}return pn(u),null;case 5:if(pe(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(k=Q.current,Xc(u))o2(u);else{var M=gv(te.current);switch(k){case 1:k=M.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:k=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":k=M.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":k=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":k=M.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof x.is=="string"?M.createElement("select",{is:x.is}):M.createElement("select"),x.multiple?k.multiple=!0:x.size&&(k.size=x.size);break;default:k=typeof x.is=="string"?M.createElement(E,{is:x.is}):M.createElement(E)}}k[Rt]=u,k[on]=x;e:for(M=u.child;M!==null;){if(M.tag===5||M.tag===6)k.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=k;e:switch(Cr(k,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),S1(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,Xc(u)){if(s=u.stateNode,p=u.memoizedProps,x=null,E=jr,E!==null)switch(E.tag){case 27:case 5:x=E.memoizedProps}s[Rt]=u,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||jM(s.nodeValue,p)),s||Ks(u,!0)}else s=gv(s).createTextNode(x),s[Rt]=u,u.stateNode=s}return pn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(x=Xc(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[Rt]=u}else du(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),s=!1}else p=Pw(),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=Xc(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[Rt]=u}else du(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),E=!1}else E=Pw(),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),k=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(k=x.memoizedState.cachePool.pool),k!==E&&(x.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),tv(u,u.updateQueue),pn(u),null);case 4:return ee(),s===null&&q1(u.stateNode.containerInfo),pn(u),null;case 10:return Fo(u.type),pn(u),null;case 19:if(U(Bn),x=u.memoizedState,x===null)return pn(u),null;if(E=(u.flags&128)!==0,k=x.rendering,k===null)if(E)Eh(x,!1);else{if(Mn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Ug(s),k!==null){for(u.flags|=128,Eh(x,!1),s=k.updateQueue,u.updateQueue=s,tv(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)t2(p,s),p=p.sibling;return B(Bn,Bn.current&1|2),kt&&$o(u,x.treeForkCount),u.child}s=s.sibling}x.tail!==null&&Dt()>ov&&(u.flags|=128,E=!0,Eh(x,!1),u.lanes=4194304)}else{if(!E)if(s=Ug(k),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,tv(u,s),Eh(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!kt)return pn(u),null}else 2*Dt()-x.renderingStartTime>ov&&p!==536870912&&(u.flags|=128,E=!0,Eh(x,!1),u.lanes=4194304);x.isBackwards?(k.sibling=u.child,u.child=k):(s=x.last,s!==null?s.sibling=k:u.child=k,x.last=k)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Dt(),s.sibling=null,p=Bn.current,B(Bn,E?p&1|2:p&1),kt&&$o(u,x.treeForkCount),s):(pn(u),null);case 22:case 23:return _i(u),Vw(),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&&tv(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 NG(s,u){switch(Ow(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 pe(u),null;case 31:if(u.memoizedState!==null){if(_i(u),u.alternate===null)throw Error(r(340));du()}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));du()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(Bn),null;case 4:return ee(),null;case 10:return Fo(u.type),null;case 22:case 23:return _i(u),Vw(),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 NP(s,u){switch(Ow(u),u.tag){case 3:Fo(qn),ee();break;case 26:case 27:case 5:pe(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&_i(u);break;case 13:_i(u);break;case 19:U(Bn);break;case 10:Fo(u.type);break;case 22:case 23:_i(u),Vw(),s!==null&&U(pu);break;case 24:Fo(qn)}}function _h(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 k=p.create,M=p.inst;x=k(),M.destroy=x}p=p.next}while(p!==E)}}catch(Y){Xt(u,u.return,Y)}}function Js(s,u,p){try{var x=u.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var k=E.next;x=k;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,ce=Y;try{ce()}catch(ve){Xt(E,J,ve)}}}x=x.next}while(x!==k)}}catch(ve){Xt(u,u.return,ve)}}function AP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{x2(u,p)}catch(x){Xt(s,s.return,x)}}}function OP(s,u,p){p.props=bu(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Xt(s,u,x)}}function Ch(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 eo(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 TP(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 j1(s,u,p){try{var x=s.stateNode;WG(x,s.type,p,u),x[on]=u}catch(E){Xt(s,s.return,E)}}function PP(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ol(s.type)||s.tag===4}function E1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||PP(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&&ol(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function _1(s,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&&ol(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(_1(s,u,p),s=s.sibling;s!==null;)_1(s,u,p),s=s.sibling}function nv(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&&ol(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(nv(s,u,p),s=s.sibling;s!==null;)nv(s,u,p),s=s.sibling}function MP(s){var u=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);Cr(u,x,p),u[Rt]=s,u[on]=p}catch(k){Xt(s,s.return,k)}}var Ko=!1,Yn=!1,C1=!1,DP=typeof WeakSet=="function"?WeakSet:Set,mr=null;function AG(s,u){if(s=s.containerInfo,Y1=jv,s=KT(s),xw(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,k=x.focusNode;x=x.focusOffset;try{p.nodeType,k.nodeType}catch{p=null;break e}var M=0,Y=-1,J=-1,ce=0,ve=0,be=s,fe=null;t:for(;;){for(var he;be!==p||E!==0&&be.nodeType!==3||(Y=M+E),be!==k||x!==0&&be.nodeType!==3||(J=M+x),be.nodeType===3&&(M+=be.nodeValue.length),(he=be.firstChild)!==null;)fe=be,be=he;for(;;){if(be===s)break t;if(fe===p&&++ce===E&&(Y=M),fe===k&&++ve===x&&(J=M),(he=be.nextSibling)!==null)break;be=fe,fe=be.parentNode}be=he}p=Y===-1||J===-1?null:{start:Y,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(X1={focusedElem:s,selectionRange:p},jv=!1,mr=u;mr!==null;)if(u=mr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,mr=s;else for(;mr!==null;){switch(u=mr,k=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&&k!==null){s=void 0,p=u,E=k.memoizedProps,k=k.memoizedState,x=p.stateNode;try{var Re=bu(p.type,E);s=x.getSnapshotBeforeUpdate(Re,k),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)Q1(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Q1(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,mr=s;break}mr=u.return}}function RP(s,u,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Xo(s,p),x&4&&_h(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&&AP(p),x&512&&Ch(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{x2(s,u)}catch(M){Xt(p,p.return,M)}}break;case 27:u===null&&x&4&&MP(p);case 26:case 5:Xo(s,p),u===null&&x&4&&TP(p),x&512&&Ch(p,p.return);break;case 12:Xo(s,p);break;case 31:Xo(s,p),x&4&&zP(s,p);break;case 13:Xo(s,p),x&4&&$P(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=zG.bind(null,p),iW(s,p))));break;case 22:if(x=p.memoizedState!==null||Ko,!x){u=u!==null&&u.memoizedState!==null||Yn,E=Ko;var k=Yn;Ko=x,(Yn=u)&&!k?Go(s,p,(p.subtreeFlags&8772)!==0):Xo(s,p),Ko=E,Yn=k}break;case 30:break;default:Xo(s,p)}}function IP(s){var u=s.alternate;u!==null&&(s.alternate=null,IP(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Zd(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 xn=null,ui=!1;function Yo(s,u,p){for(p=p.child;p!==null;)LP(s,u,p),p=p.sibling}function LP(s,u,p){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Yn||eo(p,u),Yo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Yn||eo(p,u);var x=xn,E=ui;ol(p.type)&&(xn=p.stateNode,ui=!1),Yo(s,u,p),Rh(p.stateNode),xn=x,ui=E;break;case 5:Yn||eo(p,u);case 6:if(x=xn,E=ui,xn=null,Yo(s,u,p),xn=x,ui=E,xn!==null)if(ui)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(p.stateNode)}catch(k){Xt(p,u,k)}else try{xn.removeChild(p.stateNode)}catch(k){Xt(p,u,k)}break;case 18:xn!==null&&(ui?(s=xn,AM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),gf(s)):AM(xn,p.stateNode));break;case 4:x=xn,E=ui,xn=p.stateNode.containerInfo,ui=!0,Yo(s,u,p),xn=x,ui=E;break;case 0:case 11:case 14:case 15:Js(2,p,u),Yn||Js(4,p,u),Yo(s,u,p);break;case 1:Yn||(eo(p,u),x=p.stateNode,typeof x.componentWillUnmount=="function"&&OP(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 zP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{gf(s)}catch(p){Xt(u,u.return,p)}}}function $P(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{gf(s)}catch(p){Xt(u,u.return,p)}}function OG(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new DP),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new DP),u;default:throw Error(r(435,s.tag))}}function rv(s,u){var p=OG(s);u.forEach(function(x){if(!p.has(x)){p.add(x);var E=$G.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],k=s,M=u,Y=M;e:for(;Y!==null;){switch(Y.tag){case 27:if(ol(Y.type)){xn=Y.stateNode,ui=!1;break e}break;case 5:xn=Y.stateNode,ui=!1;break e;case 3:case 4:xn=Y.stateNode.containerInfo,ui=!0;break e}Y=Y.return}if(xn===null)throw Error(r(160));LP(k,M,E),xn=null,ui=!1,k=E.alternate,k!==null&&(k.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)BP(u,s),u=u.sibling}var _a=null;function BP(s,u){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ci(u,s),fi(s),x&4&&(Js(3,s,s.return),_h(3,s),Js(5,s,s.return));break;case 1:ci(u,s),fi(s),x&512&&(Yn||p===null||eo(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=_a;if(ci(u,s),fi(s),x&512&&(Yn||p===null||eo(p,p.return)),x&4){var k=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":k=E.getElementsByTagName("title")[0],(!k||k[iu]||k[Rt]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=E.createElement(x),E.head.insertBefore(k,E.querySelector("head > title"))),Cr(k,x,p),k[Rt]=s,Hn(k),x=k;break e;case"link":var M=BM("link","href",E).get(x+(p.href||""));if(M){for(var Y=0;Y<M.length;Y++)if(k=M[Y],k.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&k.getAttribute("rel")===(p.rel==null?null:p.rel)&&k.getAttribute("title")===(p.title==null?null:p.title)&&k.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){M.splice(Y,1);break t}}k=E.createElement(x),Cr(k,x,p),E.head.appendChild(k);break;case"meta":if(M=BM("meta","content",E).get(x+(p.content||""))){for(Y=0;Y<M.length;Y++)if(k=M[Y],k.getAttribute("content")===(p.content==null?null:""+p.content)&&k.getAttribute("name")===(p.name==null?null:p.name)&&k.getAttribute("property")===(p.property==null?null:p.property)&&k.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&k.getAttribute("charset")===(p.charSet==null?null:p.charSet)){M.splice(Y,1);break t}}k=E.createElement(x),Cr(k,x,p),E.head.appendChild(k);break;default:throw Error(r(468,x))}k[Rt]=s,Hn(k),x=k}s.stateNode=x}else FM(E,s.type,s.stateNode);else s.stateNode=$M(E,x,s.memoizedProps);else k!==x?(k===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):k.count--,x===null?FM(E,s.type,s.stateNode):$M(E,x,s.memoizedProps)):x===null&&s.stateNode!==null&&j1(s,s.memoizedProps,p.memoizedProps)}break;case 27:ci(u,s),fi(s),x&512&&(Yn||p===null||eo(p,p.return)),p!==null&&x&4&&j1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ci(u,s),fi(s),x&512&&(Yn||p===null||eo(p,p.return)),s.flags&32){E=s.stateNode;try{zc(E,"")}catch(Re){Xt(s,s.return,Re)}}x&4&&s.stateNode!=null&&(E=s.memoizedProps,j1(s,E,p!==null?p.memoizedProps:E)),x&1024&&(C1=!0);break;case 6:if(ci(u,s),fi(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch(Re){Xt(s,s.return,Re)}}break;case 3:if(xv=null,E=_a,_a=vv(u.containerInfo),ci(u,s),_a=E,fi(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{gf(u.containerInfo)}catch(Re){Xt(s,s.return,Re)}C1&&(C1=!1,FP(s));break;case 4:x=_a,_a=vv(s.stateNode.containerInfo),ci(u,s),fi(s),_a=x;break;case 12:ci(u,s),fi(s);break;case 31:ci(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,rv(s,x)));break;case 13:ci(u,s),fi(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(av=Dt()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,rv(s,x)));break;case 22:E=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,ce=Ko,ve=Yn;if(Ko=ce||E,Yn=ve||J,ci(u,s),Yn=ve,Ko=ce,fi(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(k=J.stateNode,E)M=k.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{Y=J.stateNode;var be=J.memoizedProps.style,fe=be!=null&&be.hasOwnProperty("display")?be.display:null;Y.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Re){Xt(J,J.return,Re)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=E?"":J.memoizedProps}catch(Re){Xt(J,J.return,Re)}}}else if(u.tag===18){if(p===null){J=u;try{var he=J.stateNode;E?OM(he,!0):OM(J.stateNode,!1)}catch(Re){Xt(J,J.return,Re)}}}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,rv(s,p))));break;case 19:ci(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,rv(s,x)));break;case 30:break;case 21:break;default:ci(u,s),fi(s)}}function fi(s){var u=s.flags;if(u&2){try{for(var p,x=s.return;x!==null;){if(PP(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var E=p.stateNode,k=E1(s);nv(s,k,E);break;case 5:var M=p.stateNode;p.flags&32&&(zc(M,""),p.flags&=-33);var Y=E1(s);nv(s,Y,M);break;case 3:case 4:var J=p.stateNode.containerInfo,ce=E1(s);_1(s,ce,J);break;default:throw Error(r(161))}}catch(ve){Xt(s,s.return,ve)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function FP(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;FP(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;)RP(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:Js(4,u,u.return),wu(u);break;case 1:eo(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&OP(u,u.return,p),wu(u);break;case 27:Rh(u.stateNode);case 26:case 5:eo(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,k=u,M=k.flags;switch(k.tag){case 0:case 11:case 15:Go(E,k,p),_h(4,k);break;case 1:if(Go(E,k,p),x=k,E=x.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(ce){Xt(x,x.return,ce)}if(x=k,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++)y2(J[E],Y)}catch(ce){Xt(x,x.return,ce)}}p&&M&64&&AP(k),Ch(k,k.return);break;case 27:MP(k);case 26:case 5:Go(E,k,p),p&&x===null&&M&4&&TP(k),Ch(k,k.return);break;case 12:Go(E,k,p);break;case 31:Go(E,k,p),p&&M&4&&zP(E,k);break;case 13:Go(E,k,p),p&&M&4&&$P(E,k);break;case 22:k.memoizedState===null&&Go(E,k,p),Ch(k,k.return);break;case 30:break;default:Go(E,k,p)}u=u.sibling}}function k1(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&&dh(p))}function N1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&dh(s))}function Ca(s,u,p,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)UP(s,u,p,x),u=u.sibling}function UP(s,u,p,x){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Ca(s,u,p,x),E&2048&&_h(9,u);break;case 1:Ca(s,u,p,x);break;case 3:Ca(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&&dh(s)));break;case 12:if(E&2048){Ca(s,u,p,x),s=u.stateNode;try{var k=u.memoizedProps,M=k.id,Y=k.onPostCommit;typeof Y=="function"&&Y(M,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Xt(u,u.return,J)}}else Ca(s,u,p,x);break;case 31:Ca(s,u,p,x);break;case 13:Ca(s,u,p,x);break;case 23:break;case 22:k=u.stateNode,M=u.alternate,u.memoizedState!==null?k._visibility&2?Ca(s,u,p,x):kh(s,u):k._visibility&2?Ca(s,u,p,x):(k._visibility|=2,af(s,u,p,x,(u.subtreeFlags&10256)!==0||!1)),E&2048&&k1(M,u);break;case 24:Ca(s,u,p,x),E&2048&&N1(u.alternate,u);break;default:Ca(s,u,p,x)}}function af(s,u,p,x,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,M=u,Y=p,J=x,ce=M.flags;switch(M.tag){case 0:case 11:case 15:af(k,M,Y,J,E),_h(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?af(k,M,Y,J,E):kh(k,M):(ve._visibility|=2,af(k,M,Y,J,E)),E&&ce&2048&&k1(M.alternate,M);break;case 24:af(k,M,Y,J,E),E&&ce&2048&&N1(M.alternate,M);break;default:af(k,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&&k1(x.alternate,x);break;case 24:kh(p,x),E&2048&&N1(x.alternate,x);break;default:kh(p,x)}u=u.sibling}}var Nh=8192;function of(s,u,p){if(s.subtreeFlags&Nh)for(s=s.child;s!==null;)HP(s,u,p),s=s.sibling}function HP(s,u,p){switch(s.tag){case 26:of(s,u,p),s.flags&Nh&&s.memoizedState!==null&&gW(p,_a,s.memoizedState,s.memoizedProps);break;case 5:of(s,u,p);break;case 3:case 4:var x=_a;_a=vv(s.stateNode.containerInfo),of(s,u,p),_a=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Nh,Nh=16777216,of(s,u,p),Nh=x):of(s,u,p));break;default:of(s,u,p)}}function qP(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 Ah(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];mr=x,KP(x,s)}qP(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)VP(s),s=s.sibling}function VP(s){switch(s.tag){case 0:case 11:case 15:Ah(s),s.flags&2048&&Js(9,s,s.return);break;case 3:Ah(s);break;case 12:Ah(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,iv(s)):Ah(s);break;default:Ah(s)}}function iv(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];mr=x,KP(x,s)}qP(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Js(8,u,u.return),iv(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,iv(u));break;default:iv(u)}s=s.sibling}}function KP(s,u){for(;mr!==null;){var p=mr;switch(p.tag){case 0:case 11:case 15:Js(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:dh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,mr=x;else e:for(p=s;mr!==null;){x=mr;var E=x.sibling,k=x.return;if(IP(x),x===p){mr=null;break e}if(E!==null){E.return=k,mr=E;break e}mr=k}}}var TG={getCacheForType:function(s){var u=Er(qn),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return Er(qn).controller.signal}},PG=typeof WeakMap=="function"?WeakMap:Map,Ut=0,sn=null,xt=null,Et=0,Yt=0,Ci=null,el=!1,sf=!1,A1=!1,Wo=0,Mn=0,tl=0,Su=0,O1=0,ki=0,lf=0,Oh=null,di=null,T1=!1,av=0,YP=0,ov=1/0,sv=null,nl=null,tr=0,rl=null,uf=null,Qo=0,P1=0,M1=null,XP=null,Th=0,D1=null;function Ni(){return(Ut&2)!==0&&Et!==0?Et&-Et:z.T!==null?B1():Is()}function GP(){if(ki===0)if((Et&536870912)===0||kt){var s=Dr;Dr<<=1,(Dr&3932160)===0&&(Dr=262144),ki=s}else ki=536870912;return s=Ei.current,s!==null&&(s.flags|=32),ki}function hi(s,u,p){(s===sn&&(Yt===2||Yt===9)||s.cancelPendingCommit!==null)&&(cf(s,0),il(s,Et,ki,!1)),jt(s,p),((Ut&2)===0||s!==sn)&&(s===sn&&((Ut&2)===0&&(Su|=p),Mn===4&&il(s,Et,ki,!1)),to(s))}function WP(s,u,p){if((Ut&6)!==0)throw Error(r(327));var x=!p&&(u&127)===0&&(u&s.expiredLanes)===0||qt(s,u),E=x?RG(s,u):I1(s,u,!0),k=x;do{if(E===0){sf&&!x&&il(s,u,0,!1);break}else{if(p=s.current.alternate,k&&!MG(p)){E=I1(s,u,!1),k=!1;continue}if(E===2){if(k=u,s.errorRecoveryDisabledLanes&k)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=Oh;var J=Y.current.memoizedState.isDehydrated;if(J&&(cf(Y,M).flags|=256),M=I1(Y,M,!1),M!==2){if(A1&&!J){Y.errorRecoveryDisabledLanes|=k,Su|=k,E=4;break e}k=di,di=E,k!==null&&(di===null?di=k:di.push.apply(di,k))}E=M}if(k=!1,E!==2)continue}}if(E===1){cf(s,0),il(s,u,0,!0);break}e:{switch(x=s,k=E,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:il(x,u,ki,!el);break e;case 2:di=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=av+300-Dt(),10<E)){if(il(x,u,ki,!el),Ge(x,0,!0)!==0)break e;Qo=u,x.timeoutHandle=kM(QP.bind(null,x,p,di,sv,T1,u,ki,Su,lf,el,k,"Throttled",-0,0),E);break e}QP(x,p,di,sv,T1,u,ki,Su,lf,el,k,null,-0,0)}}break}while(!0);to(s)}function QP(s,u,p,x,E,k,M,Y,J,ce,ve,be,fe,he){if(s.timeoutHandle=-1,be=u.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Io},HP(u,k,be);var Re=(k&62914560)===k?av-Dt():(k&4194048)===k?YP-Dt():0;if(Re=vW(be,Re),Re!==null){Qo=k,s.cancelPendingCommit=Re(aM.bind(null,s,u,k,p,x,E,M,Y,J,ve,be,null,fe,he)),il(s,k,M,!ce);return}}aM(s,u,k,p,x,E,M,Y,J)}function MG(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],k=E.getSnapshot;E=E.value;try{if(!Si(k(),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 il(s,u,p,x){u&=~O1,u&=~Su,s.suspendedLanes|=u,s.pingedLanes&=~u,x&&(s.warmLanes|=u),x=s.expirationTimes;for(var E=u;0<E;){var k=31-lt(E),M=1<<k;x[k]=-1,E&=~M}p!==0&&Gr(s,p,u)}function lv(){return(Ut&6)===0?(Ph(0),!1):!0}function R1(){if(xt!==null){if(Yt===0)var s=xt.return;else s=xt,Bo=hu=null,Qw(s),Jc=null,mh=0,s=xt;for(;s!==null;)NP(s.alternate,s),s=s.return;xt=null}}function cf(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,JG(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Qo=0,R1(),sn=s,xt=p=zo(s.current,null),Et=u,Yt=0,Ci=null,el=!1,sf=qt(s,u),A1=!1,lf=ki=O1=Su=tl=Mn=0,di=Oh=null,T1=!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-lt(x),k=1<<E;u|=s[E],x&=~k}return Wo=u,Ag(),p}function ZP(s,u){ct=null,z.H=Sh,u===Zc||u===Lg?(u=m2(),Yt=3):u===$w?(u=m2(),Yt=4):Yt=u===h1?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Ci=u,xt===null&&(Mn=1,Qg(s,Ki(u,s.current)))}function JP(){var s=Ei.current;return s===null?!0:(Et&4194048)===Et?Wi===null:(Et&62914560)===Et||(Et&536870912)!==0?s===Wi:!1}function eM(){var s=z.H;return z.H=Sh,s===null?Sh:s}function tM(){var s=z.A;return z.A=TG,s}function uv(){Mn=4,el||(Et&4194048)!==Et&&Ei.current!==null||(sf=!0),(tl&134217727)===0&&(Su&134217727)===0||sn===null||il(sn,Et,ki,!1)}function I1(s,u,p){var x=Ut;Ut|=2;var E=eM(),k=tM();(sn!==s||Et!==u)&&(sv=null,cf(s,u)),u=!1;var M=Mn;e:do try{if(Yt!==0&&xt!==null){var Y=xt,J=Ci;switch(Yt){case 8:R1(),M=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(u=!0);var ce=Yt;if(Yt=0,Ci=null,ff(s,Y,J,ce),p&&sf){M=0;break e}break;default:ce=Yt,Yt=0,Ci=null,ff(s,Y,J,ce)}}DG(),M=Mn;break}catch(ve){ZP(s,ve)}while(!0);return u&&s.shellSuspendCounter++,Bo=hu=null,Ut=x,z.H=E,z.A=k,xt===null&&(sn=null,Et=0,Ag()),M}function DG(){for(;xt!==null;)nM(xt)}function RG(s,u){var p=Ut;Ut|=2;var x=eM(),E=tM();sn!==s||Et!==u?(sv=null,ov=Dt()+500,cf(s,u)):sf=qt(s,u);e:do try{if(Yt!==0&&xt!==null){u=xt;var k=Ci;t:switch(Yt){case 1:Yt=0,Ci=null,ff(s,u,k,1);break;case 2:case 9:if(d2(k)){Yt=0,Ci=null,rM(u);break}u=function(){Yt!==2&&Yt!==9||sn!==s||(Yt=7),to(s)},k.then(u,u);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:d2(k)?(Yt=0,Ci=null,rM(u)):(Yt=0,Ci=null,ff(s,u,k,7));break;case 5:var M=null;switch(xt.tag){case 26:M=xt.memoizedState;case 5:case 27:var Y=xt;if(M?UM(M):Y.stateNode.complete){Yt=0,Ci=null;var J=Y.sibling;if(J!==null)xt=J;else{var ce=Y.return;ce!==null?(xt=ce,cv(ce)):xt=null}break t}}Yt=0,Ci=null,ff(s,u,k,5);break;case 6:Yt=0,Ci=null,ff(s,u,k,6);break;case 8:R1(),Mn=6;break e;default:throw Error(r(462))}}IG();break}catch(ve){ZP(s,ve)}while(!0);return Bo=hu=null,z.H=x,z.A=E,Ut=p,xt!==null?0:(sn=null,Et=0,Ag(),Mn)}function IG(){for(;xt!==null&&!St();)nM(xt)}function nM(s){var u=CP(s.alternate,s,Wo);s.memoizedProps=s.pendingProps,u===null?cv(s):xt=u}function rM(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=bP(p,u,u.pendingProps,u.type,void 0,Et);break;case 11:u=bP(p,u,u.pendingProps,u.type.render,u.ref,Et);break;case 5:Qw(u);default:NP(p,u),u=xt=t2(u,Wo),u=CP(p,u,Wo)}s.memoizedProps=s.pendingProps,u===null?cv(s):xt=u}function ff(s,u,p,x){Bo=hu=null,Qw(u),Jc=null,mh=0;var E=u.return;try{if(EG(s,E,u,p,Et)){Mn=1,Qg(s,Ki(p,s.current)),xt=null;return}}catch(k){if(E!==null)throw xt=E,k;Mn=1,Qg(s,Ki(p,s.current)),xt=null;return}u.flags&32768?(kt||x===1?s=!0:sf||(Et&536870912)!==0?s=!1:(el=s=!0,(x===2||x===9||x===3||x===6)&&(x=Ei.current,x!==null&&x.tag===13&&(x.flags|=16384))),iM(u,s)):cv(u)}function cv(s){var u=s;do{if((u.flags&32768)!==0){iM(u,el);return}s=u.return;var p=kG(u.alternate,u,Wo);if(p!==null){xt=p;return}if(u=u.sibling,u!==null){xt=u;return}xt=u=s}while(u!==null);Mn===0&&(Mn=5)}function iM(s,u){do{var p=NG(s.alternate,s);if(p!==null){p.flags&=32767,xt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){xt=s;return}xt=s=p}while(s!==null);Mn=6,xt=null}function aM(s,u,p,x,E,k,M,Y,J){s.cancelPendingCommit=null;do fv();while(tr!==0);if((Ut&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=Ew,Tn(s,p,k,M,Y,J),s===sn&&(xt=sn=null,Et=0),uf=u,rl=s,Qo=p,P1=k,M1=E,XP=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,BG(Te,function(){return cM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=z.T,z.T=null,E=q.p,q.p=2,M=Ut,Ut|=4;try{AG(s,u,p)}finally{Ut=M,q.p=E,z.T=x}}tr=1,oM(),sM(),lM()}}function oM(){if(tr===1){tr=0;var s=rl,u=uf,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=z.T,z.T=null;var x=q.p;q.p=2;var E=Ut;Ut|=4;try{BP(u,s);var k=X1,M=KT(s.containerInfo),Y=k.focusedElem,J=k.selectionRange;if(M!==Y&&Y&&Y.ownerDocument&&VT(Y.ownerDocument.documentElement,Y)){if(J!==null&&xw(Y)){var ce=J.start,ve=J.end;if(ve===void 0&&(ve=ce),"selectionStart"in Y)Y.selectionStart=ce,Y.selectionEnd=Math.min(ve,Y.value.length);else{var be=Y.ownerDocument||document,fe=be&&be.defaultView||window;if(fe.getSelection){var he=fe.getSelection(),Re=Y.textContent.length,rt=Math.min(J.start,Re),Zt=J.end===void 0?rt:Math.min(J.end,Re);!he.extend&&rt>Zt&&(M=Zt,Zt=rt,rt=M);var oe=qT(Y,rt),ne=qT(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=be.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(be=[],he=Y;he=he.parentNode;)he.nodeType===1&&be.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<be.length;Y++){var ye=be[Y];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}jv=!!Y1,X1=Y1=null}finally{Ut=E,q.p=x,z.T=p}}s.current=u,tr=2}}function sM(){if(tr===2){tr=0;var s=rl,u=uf,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=z.T,z.T=null;var x=q.p;q.p=2;var E=Ut;Ut|=4;try{RP(s,u.alternate,u)}finally{Ut=E,q.p=x,z.T=p}}tr=3}}function lM(){if(tr===4||tr===3){tr=0,Kt();var s=rl,u=uf,p=Qo,x=XP;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?tr=5:(tr=0,uf=rl=null,uM(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(nl=null),Wr(p),u=u.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(je,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=z.T,E=q.p,q.p=2,z.T=null;try{for(var k=s.onRecoverableError,M=0;M<x.length;M++){var Y=x[M];k(Y.value,{componentStack:Y.stack})}}finally{z.T=u,q.p=E}}(Qo&3)!==0&&fv(),to(s),E=s.pendingLanes,(p&261930)!==0&&(E&42)!==0?s===D1?Th++:(Th=0,D1=s):Th=0,Ph(0)}}function uM(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,dh(u)))}function fv(){return oM(),sM(),lM(),cM()}function cM(){if(tr!==5)return!1;var s=rl,u=P1;P1=0;var p=Wr(Qo),x=z.T,E=q.p;try{q.p=32>p?32:p,z.T=null,p=M1,M1=null;var k=rl,M=Qo;if(tr=0,uf=rl=null,Qo=0,(Ut&6)!==0)throw Error(r(331));var Y=Ut;if(Ut|=4,VP(k.current),UP(k,k.current,M,p),Ut=Y,Ph(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(je,k)}catch{}return!0}finally{q.p=E,z.T=x,uM(s,u)}}function fM(s,u,p){u=Ki(p,u),u=d1(s.stateNode,u,2),s=Ws(s,u,2),s!==null&&(jt(s,2),to(s))}function Xt(s,u,p){if(s.tag===3)fM(s,s,p);else for(;u!==null;){if(u.tag===3){fM(u,s,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(nl===null||!nl.has(x))){s=Ki(p,s),p=dP(2),x=Ws(u,p,2),x!==null&&(hP(p,x,u,s),jt(x,2),to(x));break}}u=u.return}}function L1(s,u,p){var x=s.pingCache;if(x===null){x=s.pingCache=new PG;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)||(A1=!0,E.add(p),s=LG.bind(null,s,u,p),u.then(s,s))}function LG(s,u,p){var x=s.pingCache;x!==null&&x.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,sn===s&&(Et&p)===p&&(Mn===4||Mn===3&&(Et&62914560)===Et&&300>Dt()-av?(Ut&2)===0&&cf(s,0):O1|=p,lf===Et&&(lf=0)),to(s)}function dM(s,u){u===0&&(u=We()),s=cu(s,u),s!==null&&(jt(s,u),to(s))}function zG(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),dM(s,p)}function $G(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),dM(s,p)}function BG(s,u){return It(s,u)}var dv=null,df=null,z1=!1,hv=!1,$1=!1,al=0;function to(s){s!==df&&s.next===null&&(df===null?dv=df=s:df=df.next=s),hv=!0,z1||(z1=!0,UG())}function Ph(s,u){if(!$1&&hv){$1=!0;do for(var p=!1,x=dv;x!==null;){if(s!==0){var E=x.pendingLanes;if(E===0)var k=0;else{var M=x.suspendedLanes,Y=x.pingedLanes;k=(1<<31-lt(42|s)+1)-1,k&=E&~(M&~Y),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(p=!0,gM(x,k))}else k=Et,k=Ge(x,x===sn?k:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(k&3)===0||qt(x,k)||(p=!0,gM(x,k));x=x.next}while(p);$1=!1}}function FG(){hM()}function hM(){hv=z1=!1;var s=0;al!==0&&ZG()&&(s=al);for(var u=Dt(),p=null,x=dv;x!==null;){var E=x.next,k=mM(x,u);k===0?(x.next=null,p===null?dv=E:p.next=E,E===null&&(df=p)):(p=x,(s!==0||(k&3)!==0)&&(hv=!0)),x=E}tr!==0&&tr!==5||Ph(s),al!==0&&(al=0)}function mM(s,u){for(var p=s.suspendedLanes,x=s.pingedLanes,E=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var M=31-lt(k),Y=1<<M,J=E[M];J===-1?((Y&p)===0||(Y&x)!==0)&&(E[M]=me(Y,u)):J<=u&&(s.expiredLanes|=Y),k&=~Y}if(u=sn,p=Et,p=Ge(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&&ft(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&&ft(x),Wr(p)){case 2:case 8:p=xe;break;case 32:p=Te;break;case 268435456:p=Je;break;default:p=Te}return x=pM.bind(null,s),p=It(p,x),s.callbackPriority=u,s.callbackNode=p,u}return x!==null&&x!==null&&ft(x),s.callbackPriority=2,s.callbackNode=null,2}function pM(s,u){if(tr!==0&&tr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(fv()&&s.callbackNode!==p)return null;var x=Et;return x=Ge(s,s===sn?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(WP(s,x,u),mM(s,Dt()),s.callbackNode!=null&&s.callbackNode===p?pM.bind(null,s):null)}function gM(s,u){if(fv())return null;WP(s,u,!0)}function UG(){eW(function(){(Ut&6)!==0?It(de,FG):hM()})}function B1(){if(al===0){var s=Wc;s===0&&(s=Xr,Xr<<=1,(Xr&261888)===0&&(Xr=256)),al=s}return al}function vM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:wg(""+s)}function yM(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 HG(s,u,p,x,E){if(u==="submit"&&p&&p.stateNode===E){var k=vM((E[on]||null).action),M=x.submitter;M&&(u=(u=M[on]||null)?vM(u.formAction):M.getAttribute("formAction"),u!==null&&(k=u,M=null));var Y=new _g("action","action",null,x,E);s.push({event:Y,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(al!==0){var J=M?yM(E,M):new FormData(E);o1(p,{pending:!0,data:J,method:E.method,action:k},null,J)}}else typeof k=="function"&&(Y.preventDefault(),J=M?yM(E,M):new FormData(E),o1(p,{pending:!0,data:J,method:E.method,action:k},k,J))},currentTarget:E}]})}}for(var F1=0;F1<jw.length;F1++){var U1=jw[F1],qG=U1.toLowerCase(),VG=U1[0].toUpperCase()+U1.slice(1);Ea(qG,"on"+VG)}Ea(GT,"onAnimationEnd"),Ea(WT,"onAnimationIteration"),Ea(QT,"onAnimationStart"),Ea("dblclick","onDoubleClick"),Ea("focusin","onFocus"),Ea("focusout","onBlur"),Ea(sG,"onTransitionRun"),Ea(lG,"onTransitionStart"),Ea(uG,"onTransitionCancel"),Ea(ZT,"onTransitionEnd"),Fs("onMouseEnter",["mouseout","mouseover"]),Fs("onMouseLeave",["mouseout","mouseover"]),Fs("onPointerEnter",["pointerout","pointerover"]),Fs("onPointerLeave",["pointerout","pointerover"]),Do("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Do("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Do("onBeforeInput",["compositionend","keypress","textInput","paste"]),Do("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mh="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(" "),KG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mh));function xM(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 k=void 0;if(u)for(var M=x.length-1;0<=M;M--){var Y=x[M],J=Y.instance,ce=Y.currentTarget;if(Y=Y.listener,J!==k&&E.isPropagationStopped())break e;k=Y,E.currentTarget=ce;try{k(E)}catch(ve){Ng(ve)}E.currentTarget=null,k=J}else for(M=0;M<x.length;M++){if(Y=x[M],J=Y.instance,ce=Y.currentTarget,Y=Y.listener,J!==k&&E.isPropagationStopped())break e;k=Y,E.currentTarget=ce;try{k(E)}catch(ve){Ng(ve)}E.currentTarget=null,k=J}}}}function bt(s,u){var p=u[Qa];p===void 0&&(p=u[Qa]=new Set);var x=s+"__bubble";p.has(x)||(bM(u,s,2,!1),p.add(x))}function H1(s,u,p){var x=0;u&&(x|=4),bM(p,s,x,u)}var mv="_reactListening"+Math.random().toString(36).slice(2);function q1(s){if(!s[mv]){s[mv]=!0,pg.forEach(function(p){p!=="selectionchange"&&(KG.has(p)||H1(p,!1,s),H1(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[mv]||(u[mv]=!0,H1("selectionchange",!1,u))}}function bM(s,u,p,x){switch(GM(u)){case 2:var E=bW;break;case 8:E=wW;break;default:E=aS}p=E.bind(null,u,p,s),E=void 0,!cw||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 V1(s,u,p,x,E){var k=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=Ls(Y),M===null)return;if(J=M.tag,J===5||J===6||J===26||J===27){x=k=M;continue e}Y=Y.parentNode}}x=x.return}_T(function(){var ce=k,ve=lw(p),be=[];e:{var fe=JT.get(s);if(fe!==void 0){var he=_g,Re=s;switch(s){case"keypress":if(jg(p)===0)break e;case"keydown":case"keyup":he=$X;break;case"focusin":Re="focus",he=mw;break;case"focusout":Re="blur",he=mw;break;case"beforeblur":case"afterblur":he=mw;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=NT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=kX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=UX;break;case GT:case WT:case QT:he=OX;break;case ZT:he=qX;break;case"scroll":case"scrollend":he=_X;break;case"wheel":he=KX;break;case"copy":case"cut":case"paste":he=PX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=OT;break;case"toggle":case"beforetoggle":he=XX}var rt=(u&4)!==0,Zt=!rt&&(s==="scroll"||s==="scrollend"),oe=rt?fe!==null?fe+"Capture":null:fe;rt=[];for(var ne=ce,ue;ne!==null;){var ye=ne;if(ue=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ue===null||oe===null||(ye=th(ne,oe),ye!=null&&rt.push(Dh(ne,ye,ue))),Zt)break;ne=ne.return}0<rt.length&&(fe=new he(fe,Re,null,p,ve),be.push({event:fe,listeners:rt}))}}if((u&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",fe&&p!==sw&&(Re=p.relatedTarget||p.fromElement)&&(Ls(Re)||Re[Sa]))break e;if((he||fe)&&(fe=ve.window===ve?ve:(fe=ve.ownerDocument)?fe.defaultView||fe.parentWindow:window,he?(Re=p.relatedTarget||p.toElement,he=ce,Re=Re?Ls(Re):null,Re!==null&&(Zt=a(Re),rt=Re.tag,Re!==Zt||rt!==5&&rt!==27&&rt!==6)&&(Re=null)):(he=null,Re=ce),he!==Re)){if(rt=NT,ye="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(rt=OT,ye="onPointerLeave",oe="onPointerEnter",ne="pointer"),Zt=he==null?fe:$s(he),ue=Re==null?fe:$s(Re),fe=new rt(ye,ne+"leave",he,p,ve),fe.target=Zt,fe.relatedTarget=ue,ye=null,Ls(ve)===ce&&(rt=new rt(oe,ne+"enter",Re,p,ve),rt.target=ue,rt.relatedTarget=Zt,ye=rt),Zt=ye,he&&Re)t:{for(rt=YG,oe=he,ne=Re,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&&wM(be,fe,he,rt,!1),Re!==null&&Zt!==null&&wM(be,Zt,Re,rt,!0)}}e:{if(fe=ce?$s(ce):window,he=fe.nodeName&&fe.nodeName.toLowerCase(),he==="select"||he==="input"&&fe.type==="file")var Lt=zT;else if(IT(fe))if($T)Lt=iG;else{Lt=nG;var Ue=tG}else he=fe.nodeName,!he||he.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&ow(ce.elementType)&&(Lt=zT):Lt=rG;if(Lt&&(Lt=Lt(s,ce))){LT(be,Lt,p,ve);break e}Ue&&Ue(s,fe,ce),s==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&eh(fe,"number",fe.value)}switch(Ue=ce?$s(ce):window,s){case"focusin":(IT(Ue)||Ue.contentEditable==="true")&&(Uc=Ue,bw=ce,uh=null);break;case"focusout":uh=bw=Uc=null;break;case"mousedown":ww=!0;break;case"contextmenu":case"mouseup":case"dragend":ww=!1,YT(be,p,ve);break;case"selectionchange":if(oG)break;case"keydown":case"keyup":YT(be,p,ve)}var ht;if(gw)e:{switch(s){case"compositionstart":var _t="onCompositionStart";break e;case"compositionend":_t="onCompositionEnd";break e;case"compositionupdate":_t="onCompositionUpdate";break e}_t=void 0}else Fc?DT(s,p)&&(_t="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(_t="onCompositionStart");_t&&(TT&&p.locale!=="ko"&&(Fc||_t!=="onCompositionStart"?_t==="onCompositionEnd"&&Fc&&(ht=CT()):(Hs=ve,fw="value"in Hs?Hs.value:Hs.textContent,Fc=!0)),Ue=pv(ce,_t),0<Ue.length&&(_t=new AT(_t,s,null,p,ve),be.push({event:_t,listeners:Ue}),ht?_t.data=ht:(ht=RT(p),ht!==null&&(_t.data=ht)))),(ht=WX?QX(s,p):ZX(s,p))&&(_t=pv(ce,"onBeforeInput"),0<_t.length&&(Ue=new AT("onBeforeInput","beforeinput",null,p,ve),be.push({event:Ue,listeners:_t}),Ue.data=ht)),HG(be,s,ce,p,ve)}xM(be,u)})}function Dh(s,u,p){return{instance:s,listener:u,currentTarget:p}}function pv(s,u){for(var p=u+"Capture",x=[];s!==null;){var E=s,k=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||k===null||(E=th(s,p),E!=null&&x.unshift(Dh(s,E,k)),E=th(s,u),E!=null&&x.push(Dh(s,E,k))),s.tag===3)return x;s=s.return}return[]}function YG(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function wM(s,u,p,x,E){for(var k=u._reactName,M=[];p!==null&&p!==x;){var Y=p,J=Y.alternate,ce=Y.stateNode;if(Y=Y.tag,J!==null&&J===x)break;Y!==5&&Y!==26&&Y!==27||ce===null||(J=ce,E?(ce=th(p,k),ce!=null&&M.unshift(Dh(p,ce,J))):E||(ce=th(p,k),ce!=null&&M.push(Dh(p,ce,J)))),p=p.return}M.length!==0&&s.push({event:u,listeners:M})}var XG=/\r\n?/g,GG=/\u0000|\uFFFD/g;function SM(s){return(typeof s=="string"?s:""+s).replace(XG,`
`).replace(GG,"")}function jM(s,u){return u=SM(u),SM(s)===u}function Qt(s,u,p,x,E,k){switch(p){case"children":typeof x=="string"?u==="body"||u==="textarea"&&x===""||zc(s,x):(typeof x=="number"||typeof x=="bigint")&&u!=="body"&&zc(s,""+x);break;case"className":Lc(s,"class",x);break;case"tabIndex":Lc(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":Lc(s,p,x);break;case"style":jT(s,x,k);break;case"data":if(u!=="object"){Lc(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=wg(""+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 k=="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=wg(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=Io);break;case"onScroll":x!=null&&bt("scroll",s);break;case"onScrollEnd":x!=null&&bt("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=wg(""+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":bt("beforetoggle",s),bt("toggle",s),Ic(s,"popover",x);break;case"xlinkActuate":ja(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":ja(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":ja(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":ja(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":ja(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":ja(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":ja(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":ja(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":ja(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Ic(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=jX.get(p)||p,Ic(s,p,x))}}function K1(s,u,p,x,E,k){switch(p){case"style":jT(s,x,k);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"?zc(s,x):(typeof x=="number"||typeof x=="bigint")&&zc(s,""+x);break;case"onScroll":x!=null&&bt("scroll",s);break;case"onScrollEnd":x!=null&&bt("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(!gg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(E=p.endsWith("Capture"),u=p.slice(2,E?p.length-7:void 0),k=s[on]||null,k=k!=null?k[p]:null,typeof k=="function"&&s.removeEventListener(u,k,E),typeof x=="function")){typeof k!="function"&&k!==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,""):Ic(s,p,x)}}}function Cr(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":bt("error",s),bt("load",s);var x=!1,E=!1,k;for(k in p)if(p.hasOwnProperty(k)){var M=p[k];if(M!=null)switch(k){case"src":x=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,k,M,p,null)}}E&&Qt(s,u,"srcSet",p.srcSet,p,null),x&&Qt(s,u,"src",p.src,p,null);return;case"input":bt("invalid",s);var Y=k=M=E=null,J=null,ce=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":ce=ve;break;case"value":k=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)}}bg(s,k,Y,J,ce,M,E,!1);return;case"select":bt("invalid",s),x=M=k=null;for(E in p)if(p.hasOwnProperty(E)&&(Y=p[E],Y!=null))switch(E){case"value":k=Y;break;case"defaultValue":M=Y;break;case"multiple":x=Y;default:Qt(s,u,E,Y,p,null)}u=k,p=M,s.multiple=!!x,u!=null?Ro(s,!!x,u,!1):p!=null&&Ro(s,!!x,p,!0);return;case"textarea":bt("invalid",s),k=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":k=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:Qt(s,u,M,Y,p,null)}wT(s,x,E,k);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":bt("beforetoggle",s),bt("toggle",s),bt("cancel",s),bt("close",s);break;case"iframe":case"object":bt("load",s);break;case"video":case"audio":for(x=0;x<Mh.length;x++)bt(Mh[x],s);break;case"image":bt("error",s),bt("load",s);break;case"details":bt("toggle",s);break;case"embed":case"source":case"link":bt("error",s),bt("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(ce in p)if(p.hasOwnProperty(ce)&&(x=p[ce],x!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,ce,x,p,null)}return;default:if(ow(u)){for(ve in p)p.hasOwnProperty(ve)&&(x=p[ve],x!==void 0&&K1(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 WG(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,k=null,M=null,Y=null,J=null,ce=null,ve=null;for(he in p){var be=p[he];if(p.hasOwnProperty(he)&&be!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=be;default:x.hasOwnProperty(he)||Qt(s,u,he,null,x,be)}}for(var fe in x){var he=x[fe];if(be=p[fe],x.hasOwnProperty(fe)&&(he!=null||be!=null))switch(fe){case"type":k=he;break;case"name":E=he;break;case"checked":ce=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!==be&&Qt(s,u,fe,he,x,be)}}ou(s,M,Y,J,ce,ve,k,E);return;case"select":he=M=Y=fe=null;for(k in p)if(J=p[k],p.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":he=J;default:x.hasOwnProperty(k)||Qt(s,u,k,null,x,J)}for(E in x)if(k=x[E],J=p[E],x.hasOwnProperty(E)&&(k!=null||J!=null))switch(E){case"value":fe=k;break;case"defaultValue":Y=k;break;case"multiple":M=k;default:k!==J&&Qt(s,u,E,k,x,J)}u=Y,p=M,x=he,fe!=null?Ro(s,!!p,fe,!1):!!x!=!!p&&(u!=null?Ro(s,!!p,u,!0):Ro(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],k=p[M],x.hasOwnProperty(M)&&(E!=null||k!=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!==k&&Qt(s,u,M,E,x,k)}bT(s,fe,he);return;case"option":for(var Re in p)if(fe=p[Re],p.hasOwnProperty(Re)&&fe!=null&&!x.hasOwnProperty(Re))switch(Re){case"selected":s.selected=!1;break;default:Qt(s,u,Re,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(ce in x)if(fe=x[ce],he=p[ce],x.hasOwnProperty(ce)&&fe!==he&&(fe!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:Qt(s,u,ce,fe,x,he)}return;default:if(ow(u)){for(var Zt in p)fe=p[Zt],p.hasOwnProperty(Zt)&&fe!==void 0&&!x.hasOwnProperty(Zt)&&K1(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||K1(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(be in x)fe=x[be],he=p[be],!x.hasOwnProperty(be)||fe===he||fe==null&&he==null||Qt(s,u,be,fe,x,he)}function EM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QG(){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],k=E.transferSize,M=E.initiatorType,Y=E.duration;if(k&&Y&&EM(M)){for(M=0,Y=E.responseEnd,x+=1;x<p.length;x++){var J=p[x],ce=J.startTime;if(ce>Y)break;var ve=J.transferSize,be=J.initiatorType;ve&&EM(be)&&(J=J.responseEnd,M+=ve*(J<Y?1:(Y-ce)/(J-ce)))}if(--x,u+=8*(k+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 Y1=null,X1=null;function gv(s){return s.nodeType===9?s:s.ownerDocument}function _M(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 CM(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 G1(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 W1=null;function ZG(){var s=window.event;return s&&s.type==="popstate"?s===W1?!1:(W1=s,!0):(W1=null,!1)}var kM=typeof setTimeout=="function"?setTimeout:void 0,JG=typeof clearTimeout=="function"?clearTimeout:void 0,NM=typeof Promise=="function"?Promise:void 0,eW=typeof queueMicrotask=="function"?queueMicrotask:typeof NM<"u"?function(s){return NM.resolve(null).then(s).catch(tW)}:kM;function tW(s){setTimeout(function(){throw s})}function ol(s){return s==="head"}function AM(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),gf(u);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")Rh(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Rh(p);for(var k=p.firstChild;k;){var M=k.nextSibling,Y=k.nodeName;k[iu]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&k.rel.toLowerCase()==="stylesheet"||p.removeChild(k),k=M}}else p==="body"&&Rh(s.ownerDocument.body);p=E}while(p);gf(u)}function OM(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 Q1(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":Q1(p),Zd(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function nW(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(k=s.getAttribute("rel"),k==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(k!==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(k=s.getAttribute("src"),(k!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Qi(s.nextSibling),s===null)break}return null}function rW(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 TM(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 Z1(s){return s.data==="$?"||s.data==="$~"}function J1(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function iW(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 eS=null;function PM(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 MM(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 DM(s,u,p){switch(u=gv(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 Rh(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Zd(s)}var Zi=new Map,RM=new Set;function vv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Zo=q.d;q.d={f:aW,r:oW,D:sW,C:lW,L:uW,m:cW,X:dW,S:fW,M:hW};function aW(){var s=Zo.f(),u=lv();return s||u}function oW(s){var u=zs(s);u!==null&&u.tag===5&&u.type==="form"?Z2(u):Zo.r(s)}var hf=typeof document>"u"?null:document;function IM(s,u,p){var x=hf;if(x&&typeof u=="string"&&u){var E=si(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),RM.has(E)||(RM.add(E),s={rel:s,crossOrigin:p,href:u},x.querySelector(E)===null&&(u=x.createElement("link"),Cr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function sW(s){Zo.D(s),IM("dns-prefetch",s,null)}function lW(s,u){Zo.C(s,u),IM("preconnect",s,u)}function uW(s,u,p){Zo.L(s,u,p);var x=hf;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 k=E;switch(u){case"style":k=mf(s);break;case"script":k=pf(s)}Zi.has(k)||(s=d({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),Zi.set(k,s),x.querySelector(E)!==null||u==="style"&&x.querySelector(Ih(k))||u==="script"&&x.querySelector(Lh(k))||(u=x.createElement("link"),Cr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function cW(s,u){Zo.m(s,u);var p=hf;if(p&&s){var x=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+si(x)+'"][href="'+si(s)+'"]',k=E;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=pf(s)}if(!Zi.has(k)&&(s=d({rel:"modulepreload",href:s},u),Zi.set(k,s),p.querySelector(E)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Lh(k)))return}x=p.createElement("link"),Cr(x,"link",s),Hn(x),p.head.appendChild(x)}}}function fW(s,u,p){Zo.S(s,u,p);var x=hf;if(x&&s){var E=Bs(x).hoistableStyles,k=mf(s);u=u||"default";var M=E.get(k);if(!M){var Y={loading:0,preload:null};if(M=x.querySelector(Ih(k)))Y.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":u},p),(p=Zi.get(k))&&tS(s,p);var J=M=x.createElement("link");Hn(J),Cr(J,"link",s),J._p=new Promise(function(ce,ve){J.onload=ce,J.onerror=ve}),J.addEventListener("load",function(){Y.loading|=1}),J.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,yv(M,u,x)}M={type:"stylesheet",instance:M,count:1,state:Y},E.set(k,M)}}}function dW(s,u){Zo.X(s,u);var p=hf;if(p&&s){var x=Bs(p).hoistableScripts,E=pf(s),k=x.get(E);k||(k=p.querySelector(Lh(E)),k||(s=d({src:s,async:!0},u),(u=Zi.get(E))&&nS(s,u),k=p.createElement("script"),Hn(k),Cr(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(E,k))}}function hW(s,u){Zo.M(s,u);var p=hf;if(p&&s){var x=Bs(p).hoistableScripts,E=pf(s),k=x.get(E);k||(k=p.querySelector(Lh(E)),k||(s=d({src:s,async:!0,type:"module"},u),(u=Zi.get(E))&&nS(s,u),k=p.createElement("script"),Hn(k),Cr(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},x.set(E,k))}}function LM(s,u,p,x){var E=(E=te.current)?vv(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=mf(p.href),p=Bs(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=mf(p.href);var k=Bs(E).hoistableStyles,M=k.get(s);if(M||(E=E.ownerDocument||E,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,M),(k=E.querySelector(Ih(s)))&&!k._p&&(M.instance=k,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),k||mW(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=pf(p),p=Bs(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 mf(s){return'href="'+si(s)+'"'}function Ih(s){return'link[rel="stylesheet"]['+s+"]"}function zM(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function mW(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}),Cr(u,"link",p),Hn(u),s.head.appendChild(u))}function pf(s){return'[src="'+si(s)+'"]'}function Lh(s){return"script[async]"+s}function $M(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=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),Hn(x),Cr(x,"style",E),yv(x,p.precedence,s),u.instance=x;case"stylesheet":E=mf(p.href);var k=s.querySelector(Ih(E));if(k)return u.state.loading|=4,u.instance=k,Hn(k),k;x=zM(p),(E=Zi.get(E))&&tS(x,E),k=(s.ownerDocument||s).createElement("link"),Hn(k);var M=k;return M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),Cr(k,"link",x),u.state.loading|=4,yv(k,p.precedence,s),u.instance=k;case"script":return k=pf(p.src),(E=s.querySelector(Lh(k)))?(u.instance=E,Hn(E),E):(x=p,(E=Zi.get(k))&&(x=d({},p),nS(x,E)),s=s.ownerDocument||s,E=s.createElement("script"),Hn(E),Cr(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,yv(x,p.precedence,s));return u.instance}function yv(s,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=x.length?x[x.length-1]:null,k=E,M=0;M<x.length;M++){var Y=x[M];if(Y.dataset.precedence===u)k=Y;else if(k!==E)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function tS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function nS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var xv=null;function BM(s,u,p){if(xv===null){var x=new Map,E=xv=new Map;E.set(p,x)}else E=xv,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 k=p[E];if(!(k[iu]||k[Rt]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var M=k.getAttribute(u)||"";M=s+M;var Y=x.get(M);Y?Y.push(k):x.set(M,[k])}}return x}function FM(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 UM(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function gW(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=mf(x.href),k=u.querySelector(Ih(E));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=bv.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=k,Hn(k);return}k=u.ownerDocument||u,x=zM(x),(E=Zi.get(E))&&tS(x,E),k=k.createElement("link"),Hn(k);var M=k;M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),Cr(k,"link",x),p.instance=k}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=bv.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var rS=0;function vW(s,u){return s.stylesheets&&s.count===0&&Sv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&Sv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&rS===0&&(rS=62500*QG());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Sv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>rS?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(E)}}:null}function bv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var wv=null;function Sv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,wv=new Map,u.forEach(yW,s),wv=null,bv.call(s))}function yW(s,u){if(!(u.state.loading&4)){var p=wv.get(s);if(p)var x=p.get(null);else{p=new Map,wv.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<E.length;k++){var M=E[k];(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"),k=p.get(M)||x,k===x&&p.set(null,E),p.set(M,E),this.count++,x=bv.bind(this),E.addEventListener("load",x),E.addEventListener("error",x),k?k.parentNode.insertBefore(E,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var zh={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function xW(s,u,p,x,E,k,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=k,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function HM(s,u,p,x,E,k,M,Y,J,ce,ve,be){return s=new xW(s,u,p,M,J,ce,ve,be,Y),u=1,k===!0&&(u|=24),k=ji(3,null,null,u),s.current=k,k.stateNode=s,u=Iw(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:x,isDehydrated:p,cache:u},Bw(k),s}function qM(s){return s?(s=Vc,s):Vc}function VM(s,u,p,x,E,k){E=qM(E),x.context===null?x.context=E:x.pendingContext=E,x=Gs(u),x.payload={element:p},k=k===void 0?null:k,k!==null&&(x.callback=k),p=Ws(s,x,u),p!==null&&(hi(p,s,u),gh(p,s,u))}function KM(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function iS(s,u){KM(s,u),(s=s.alternate)&&KM(s,u)}function YM(s){if(s.tag===13||s.tag===31){var u=cu(s,67108864);u!==null&&hi(u,s,67108864),iS(s,67108864)}}function XM(s){if(s.tag===13||s.tag===31){var u=Ni();u=Wa(u);var p=cu(s,u);p!==null&&hi(p,s,u),iS(s,u)}}var jv=!0;function bW(s,u,p,x){var E=z.T;z.T=null;var k=q.p;try{q.p=2,aS(s,u,p,x)}finally{q.p=k,z.T=E}}function wW(s,u,p,x){var E=z.T;z.T=null;var k=q.p;try{q.p=8,aS(s,u,p,x)}finally{q.p=k,z.T=E}}function aS(s,u,p,x){if(jv){var E=oS(x);if(E===null)V1(s,u,x,Ev,p),WM(s,x);else if(jW(E,s,u,p,x))x.stopPropagation();else if(WM(s,x),u&4&&-1<SW.indexOf(s)){for(;E!==null;){var k=zs(E);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var M=Sr(k.pendingLanes);if(M!==0){var Y=k;for(Y.pendingLanes|=2,Y.entangledLanes|=2;M;){var J=1<<31-lt(M);Y.entanglements[1]|=J,M&=~J}to(k),(Ut&6)===0&&(ov=Dt()+500,Ph(0))}}break;case 31:case 13:Y=cu(k,2),Y!==null&&hi(Y,k,2),lv(),iS(k,2)}if(k=oS(x),k===null&&V1(s,u,x,Ev,p),k===E)break;E=k}E!==null&&x.stopPropagation()}else V1(s,u,x,null,p)}}function oS(s){return s=lw(s),sS(s)}var Ev=null;function sS(s){if(Ev=null,s=Ls(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 Ev=s,null}function GM(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(cn()){case de:return 2;case xe:return 8;case Te:case Ze:return 32;case Je:return 268435456;default:return 32}default:return 32}}var lS=!1,sl=null,ll=null,ul=null,$h=new Map,Bh=new Map,cl=[],SW="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 WM(s,u){switch(s){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":ll=null;break;case"mouseover":case"mouseout":ul=null;break;case"pointerover":case"pointerout":$h.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bh.delete(u.pointerId)}}function Fh(s,u,p,x,E,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:p,eventSystemFlags:x,nativeEvent:k,targetContainers:[E]},u!==null&&(u=zs(u),u!==null&&YM(u)),s):(s.eventSystemFlags|=x,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function jW(s,u,p,x,E){switch(u){case"focusin":return sl=Fh(sl,s,u,p,x,E),!0;case"dragenter":return ll=Fh(ll,s,u,p,x,E),!0;case"mouseover":return ul=Fh(ul,s,u,p,x,E),!0;case"pointerover":var k=E.pointerId;return $h.set(k,Fh($h.get(k)||null,s,u,p,x,E)),!0;case"gotpointercapture":return k=E.pointerId,Bh.set(k,Fh(Bh.get(k)||null,s,u,p,x,E)),!0}return!1}function QM(s){var u=Ls(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,ge(s.priority,function(){XM(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,ge(s.priority,function(){XM(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 _v(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=oS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);sw=x,p.target.dispatchEvent(x),sw=null}else return u=zs(p),u!==null&&YM(u),s.blockedOn=p,!1;u.shift()}return!0}function ZM(s,u,p){_v(s)&&p.delete(u)}function EW(){lS=!1,sl!==null&&_v(sl)&&(sl=null),ll!==null&&_v(ll)&&(ll=null),ul!==null&&_v(ul)&&(ul=null),$h.forEach(ZM),Bh.forEach(ZM)}function Cv(s,u){s.blockedOn===u&&(s.blockedOn=null,lS||(lS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,EW)))}var kv=null;function JM(s){kv!==s&&(kv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kv===s&&(kv=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(sS(x||p)===null)continue;break}var k=zs(p);k!==null&&(s.splice(u,3),u-=3,o1(k,{pending:!0,data:E,method:p.method,action:x},x,E))}}))}function gf(s){function u(J){return Cv(J,s)}sl!==null&&Cv(sl,s),ll!==null&&Cv(ll,s),ul!==null&&Cv(ul,s),$h.forEach(u),Bh.forEach(u);for(var p=0;p<cl.length;p++){var x=cl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<cl.length&&(p=cl[0],p.blockedOn===null);)QM(p),p.blockedOn===null&&cl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var E=p[x],k=p[x+1],M=E[on]||null;if(typeof k=="function")M||JM(p);else if(M){var Y=null;if(k&&k.hasAttribute("formAction")){if(E=k,M=k[on]||null)Y=M.formAction;else if(sS(E)!==null)continue}else Y=M.action;typeof Y=="function"?p[x+1]=Y:(p.splice(x,3),x-=3),JM(p)}}}function eD(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.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 k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.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 uS(s){this._internalRoot=s}Nv.prototype.render=uS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,x=Ni();VM(p,x,s,u,null,null)},Nv.prototype.unmount=uS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;VM(s.current,2,null,s,null,null),lv(),u[Sa]=null}};function Nv(s){this._internalRoot=s}Nv.prototype.unstable_scheduleHydration=function(s){if(s){var u=Is();s={blockedOn:null,target:s,priority:u};for(var p=0;p<cl.length&&u!==0&&u<cl[p].priority;p++);cl.splice(p,0,s),p===0&&QM(s)}};var tD=t.version;if(tD!=="19.2.4")throw Error(r(527,tD,"19.2.4"));q.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=f(u),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var _W={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Av=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Av.isDisabled&&Av.supportsFiber)try{je=Av.inject(_W),ot=Av}catch{}}return Hh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,x="",E=lP,k=uP,M=cP;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&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError)),u=HM(s,1,!1,null,null,p,x,null,E,k,M,eD),s[Sa]=u.current,q1(s),new uS(u)},Hh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var x=!1,E="",k=lP,M=uP,Y=cP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onUncaughtError!==void 0&&(k=p.onUncaughtError),p.onCaughtError!==void 0&&(M=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=HM(s,1,!0,u,p??null,x,E,J,k,M,Y,eD),u.context=qM(null),p=u.current,x=Ni(),x=Wa(x),E=Gs(x),E.callback=null,Ws(p,E,x),p=x,u.current.lanes=p,jt(u,p),to(u),s[Sa]=u.current,q1(s),new Nv(u)},Hh.version="19.2.4",Hh}var dD;function LW(){if(dD)return mS.exports;dD=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(),mS.exports=IW(),mS.exports}var zW=LW();/**
 * 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 hD="popstate";function mD(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function $W(e={}){function t(r,i){var f;let a=(f=i.state)==null?void 0:f.masked,{pathname:o,search:l,hash:c}=a||r.location;return GE("",{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:Nm(i)}return FW(t,n,null,e)}function yn(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 BW(){return Math.random().toString(36).substring(2,10)}function pD(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 GE(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Pd(t):t,state:n,key:t&&t.key||r||BW(),unstable_mask:i}}function Nm({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 Pd(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 FW(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",c=null,f=h();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function h(){return(o.state||{idx:null}).idx}function d(){l="POP";let S=h(),j=S==null?null:S-f;f=S,c&&c({action:l,location:w.location,delta:j})}function g(S,j){l="PUSH";let C=mD(S)?S:GE(w.location,S,j);f=h()+1;let _=pD(C,f),N=w.createHref(C.unstable_mask||C);try{o.pushState(_,"",N)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(N)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=mD(S)?S:GE(w.location,S,j);f=h();let _=pD(C,f),N=w.createHref(C.unstable_mask||C);o.replaceState(_,"",N),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return UW(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(hD,d),c=S,()=>{i.removeEventListener(hD,d),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 UW(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Nm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function O$(e,t,n="/"){return HW(e,t,n,!1)}function HW(e,t,n,r){let i=typeof t=="string"?Pd(t):t,a=ps(i.pathname||"/",n);if(a==null)return null;let o=T$(e);qW(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let f=M$(a);l=JW(o[c],f,r)}return l}function T$(e,t=[],n=[],r="",i=!1){let a=(o,l,c=i,f)=>{let h={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&c)return;yn(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let d=go([r,h.relativePath]),g=n.concat(h);o.children&&o.children.length>0&&(yn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),T$(o.children,t,g,d,c)),!(o.path==null&&!o.index)&&t.push({path:d,score:QW(d,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 f of P$(o.path))a(o,l,!0,f)}),t}function P$(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=P$(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 qW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ZW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var VW=/^:[\w-]+$/,KW=3,YW=2,XW=1,GW=10,WW=-2,gD=e=>e==="*";function QW(e,t){let n=e.split("/"),r=n.length;return n.some(gD)&&(r+=WW),t&&(r+=YW),n.filter(i=>!gD(i)).reduce((i,a)=>i+(VW.test(a)?KW:a===""?XW:GW),r)}function ZW(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 JW(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],f=l===r.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=Am({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},h),g=c.route;if(!d&&f&&n&&!r[r.length-1].route.index&&(d=Am({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:go([a,d.pathname]),pathnameBase:iQ(go([a,d.pathnameBase])),route:g}),d.pathnameBase!=="/"&&(a=go([a,d.pathnameBase]))}return o}function Am(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=eQ(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((f,{paramName:h,isOptional:d},g)=>{if(h==="*"){let b=l[g]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[g];return d&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:o,pattern:e}}function eQ(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,f,h)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let d=h.charAt(f+o.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 M$(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 tQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function nQ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pd(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=vD(n.substring(1),"/"):a=vD(n,t)):a=t,{pathname:a,search:aQ(r),hash:oQ(i)}}function vD(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 yS(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 rQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fk(e){let t=rQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function l0(e,t,n,r=!1){let i;typeof e=="string"?i=Pd(e):(i={...e},yn(!i.pathname||!i.pathname.includes("?"),yS("?","pathname","search",i)),yn(!i.pathname||!i.pathname.includes("#"),yS("#","pathname","hash",i)),yn(!i.search||!i.search.includes("#"),yS("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),d-=1;i.pathname=g.join("/")}l=d>=0?t[d]:"/"}let c=nQ(i,l),f=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||h)&&(c.pathname+="/"),c}var go=e=>e.join("/").replace(/\/\/+/g,"/"),iQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,sQ=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 lQ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function uQ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var D$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function R$(e,t){let n=e;if(typeof n!="string"||!tQ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(D$)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 I$=["POST","PUT","PATCH","DELETE"];new Set(I$);var cQ=["GET",...I$];new Set(cQ);var Md=y.createContext(null);Md.displayName="DataRouter";var u0=y.createContext(null);u0.displayName="DataRouterState";var fQ=y.createContext(!1),L$=y.createContext({isTransitioning:!1});L$.displayName="ViewTransition";var dQ=y.createContext(new Map);dQ.displayName="Fetchers";var hQ=y.createContext(null);hQ.displayName="Await";var qi=y.createContext(null);qi.displayName="Navigation";var pp=y.createContext(null);pp.displayName="Location";var va=y.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var dk=y.createContext(null);dk.displayName="RouteError";var z$="REACT_ROUTER_ERROR",mQ="REDIRECT",pQ="ROUTE_ERROR_RESPONSE";function gQ(e){if(e.startsWith(`${z$}:${mQ}:{`))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 vQ(e){if(e.startsWith(`${z$}:${pQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new sQ(t.status,t.statusText,t.data)}catch{}}function yQ(e,{relative:t}={}){yn(Ec(),"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}=vp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:go([n,a])),r.createHref({pathname:l,search:o,hash:i})}function Ec(){return y.useContext(pp)!=null}function ya(){return yn(Ec(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(pp).location}function xS(e){yn(Ec(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=ya();return y.useMemo(()=>Am(e,M$(t)),[t,e])}var $$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function B$(e){y.useContext(qi).static||y.useLayoutEffect(e)}function xa(){let{isDataRoute:e}=y.useContext(va);return e?MQ():xQ()}function xQ(){yn(Ec(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Md),{basename:t,navigator:n}=y.useContext(qi),{matches:r}=y.useContext(va),{pathname:i}=ya(),a=JSON.stringify(fk(r)),o=y.useRef(!1);return B$(()=>{o.current=!0}),y.useCallback((c,f={})=>{if(ca(o.current,$$),!o.current)return;if(typeof c=="number"){n.go(c);return}let h=l0(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:go([t,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[t,n,a,i,e])}var bQ=y.createContext(null);function wQ(e){let t=y.useContext(va).outlet;return y.useMemo(()=>t&&y.createElement(bQ.Provider,{value:e},t),[t,e])}function gp(){let{matches:e}=y.useContext(va),t=e[e.length-1];return t?t.params:{}}function vp(e,{relative:t}={}){let{matches:n}=y.useContext(va),{pathname:r}=ya(),i=JSON.stringify(fk(n));return y.useMemo(()=>l0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function SQ(e,t){return F$(e,t)}function F$(e,t,n){var S;yn(Ec(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(qi),{matches:i}=y.useContext(va),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let j=f&&f.path||"";H$(l,!f||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 h=ya(),d;if(t){let j=typeof t=="string"?Pd(t):t;yn(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.`),d=j}else d=h;let g=d.pathname||"/",v=g;if(c!=="/"){let j=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=O$(e,{pathname:v});ca(f||b!=null,`No routes matched location "${d.pathname}${d.search}${d.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 "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=kQ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:go([c,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:go([c,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(pp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},w):w}function jQ(){let e=PQ(),t=lQ(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 EQ=y.createElement(jQ,null),U$=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=vQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(va.Provider,{value:this.props.routeContext},y.createElement(dk.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(_Q,{error:e},t):t}};U$.contextType=fQ;var bS=new WeakMap;function _Q({children:e,error:t}){let{basename:n}=y.useContext(qi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=gQ(t.digest);if(r){let i=bS.get(t);if(i)throw i;let a=R$(r.location,n);if(D$&&!bS.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 bS.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function CQ({routeContext:e,match:t,children:n}){let r=y.useContext(Md);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(va.Provider,{value:e},n)}function kQ(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 h=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);yn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let h=0;h<i.length;h++){let d=i[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=h),d.route.id){let{loaderData:g,errors:v}=r,b=d.route.loader&&!g.hasOwnProperty(d.route.id)&&(!v||v[d.route.id]===void 0);if(d.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,f=r&&c?(h,d)=>{var g,v;c(h,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:uQ(r.matches),errorInfo:d})}:void 0;return i.reduceRight((h,d,g)=>{let v,b=!1,w=null,S=null;r&&(v=a&&d.route.id?a[d.route.id]:void 0,w=d.route.errorElement||EQ,o&&(l<0&&g===0?(H$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===g&&(b=!0,S=d.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,g+1)),C=()=>{let _;return v?_=w:b?_=S:d.route.Component?_=y.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=h,y.createElement(CQ,{match:d,routeContext:{outlet:h,matches:j,isDataRoute:r!=null},children:_})};return r&&(d.route.ErrorBoundary||d.route.errorElement||g===0)?y.createElement(U$,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:f}):C()},null)}function hk(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function NQ(e){let t=y.useContext(Md);return yn(t,hk(e)),t}function AQ(e){let t=y.useContext(u0);return yn(t,hk(e)),t}function OQ(e){let t=y.useContext(va);return yn(t,hk(e)),t}function mk(e){let t=OQ(e),n=t.matches[t.matches.length-1];return yn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function TQ(){return mk("useRouteId")}function PQ(){var r;let e=y.useContext(dk),t=AQ("useRouteError"),n=mk("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function MQ(){let{router:e}=NQ("useNavigate"),t=mk("useNavigate"),n=y.useRef(!1);return B$(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{ca(n.current,$$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var yD={};function H$(e,t,n){!t&&!yD[e]&&(yD[e]=!0,ca(!1,n))}y.memo(DQ);function DQ({routes:e,future:t,state:n,isStatic:r,onError:i}){return F$(e,void 0,{state:n,isStatic:r,onError:i})}function xD({to:e,replace:t,state:n,relative:r}){yn(Ec(),"<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(va),{pathname:o}=ya(),l=xa(),c=l0(e,fk(a),o,r==="path"),f=JSON.stringify(c);return y.useEffect(()=>{l(JSON.parse(f),{replace:t,state:n,relative:r})},[l,f,r,t,n]),null}function RQ(e){return wQ(e.context)}function kr(e){yn(!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 IQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){yn(!Ec(),"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=Pd(n));let{pathname:f="/",search:h="",hash:d="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ps(f,l);return S==null?null:{location:{pathname:S,search:h,hash:d,state:g,key:v,unstable_mask:b},navigationType:r}},[l,f,h,d,g,v,r,b]);return ca(w!=null,`<Router basename="${l}"> is not able to match the URL "${f}${h}${d}" 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(pp.Provider,{children:t,value:w}))}function LQ({children:e,location:t}){return SQ(WE(e),t)}function WE(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,WE(r.props.children,a));return}yn(r.type===kr,`[${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>`),yn(!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=WE(r.props.children,a)),n.push(o)}),n}var gy="get",vy="application/x-www-form-urlencoded";function c0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function zQ(e){return c0(e)&&e.tagName.toLowerCase()==="button"}function $Q(e){return c0(e)&&e.tagName.toLowerCase()==="form"}function BQ(e){return c0(e)&&e.tagName.toLowerCase()==="input"}function FQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function UQ(e,t){return e.button===0&&(!t||t==="_self")&&!FQ(e)}function QE(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 HQ(e,t){let n=QE(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Tv=null;function qQ(){if(Tv===null)try{new FormData(document.createElement("form"),0),Tv=!1}catch{Tv=!0}return Tv}var VQ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wS(e){return e!=null&&!VQ.has(e)?(ca(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vy}"`),null):e}function KQ(e,t){let n,r,i,a,o;if($Q(e)){let l=e.getAttribute("action");r=l?ps(l,t):null,n=e.getAttribute("method")||gy,i=wS(e.getAttribute("enctype"))||vy,a=new FormData(e)}else if(zQ(e)||BQ(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")||gy,i=wS(e.getAttribute("formenctype"))||wS(l.getAttribute("enctype"))||vy,a=new FormData(l,e),!qQ()){let{name:f,type:h,value:d}=e;if(h==="image"){let g=f?`${f}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else f&&a.append(f,d)}}else{if(c0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=gy,r=null,i=vy,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 pk(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function YQ(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 XQ(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 GQ(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 WQ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await XQ(a,n);return o.links?o.links():[]}return[]}));return eZ(r.flat(1).filter(GQ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function bD(e,t,n,r,i,a){let o=(c,f)=>n[f]?c.route.id!==n[f].route.id:!0,l=(c,f)=>{var h;return n[f].pathname!==c.pathname||((h=n[f].route.path)==null?void 0:h.endsWith("*"))&&n[f].params["*"]!==c.params["*"]};return a==="assets"?t.filter((c,f)=>o(c,f)||l(c,f)):a==="data"?t.filter((c,f)=>{var d;let h=r.routes[c.route.id];if(!h||!h.hasLoader)return!1;if(o(c,f)||l(c,f))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function QQ(e,t,{includeHydrateFallback:n}={}){return ZQ(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 ZQ(e){return[...new Set(e)]}function JQ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function eZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(JQ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function q$(){let e=y.useContext(Md);return pk(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tZ(){let e=y.useContext(u0);return pk(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var gk=y.createContext(void 0);gk.displayName="FrameworkContext";function V$(){let e=y.useContext(gk);return pk(e,"You must render this element inside a <HydratedRouter> element"),e}function nZ(e,t){let n=y.useContext(gk),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:f,onMouseLeave:h,onTouchStart:d}=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:qh(l,v),onBlur:qh(c,b),onMouseEnter:qh(f,v),onMouseLeave:qh(h,b),onTouchStart:qh(d,v)}]:[!1,g,{}]}function qh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rZ({page:e,...t}){let{router:n}=q$(),r=y.useMemo(()=>O$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(aZ,{page:e,matches:r,...t}):null}function iZ(e){let{manifest:t,routeModules:n}=V$(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return WQ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function aZ({page:e,matches:t,...n}){let r=ya(),{future:i,manifest:a,routeModules:o}=V$(),{basename:l}=q$(),{loaderData:c,matches:f}=tZ(),h=y.useMemo(()=>bD(e,t,f,a,r,"data"),[e,t,f,a,r]),d=y.useMemo(()=>bD(e,t,f,a,r,"assets"),[e,t,f,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 N;let _=a.routes[C.route.id];!_||!_.hasLoader||(!h.some(O=>O.route.id===C.route.id)&&C.route.id in c&&((N=o[C.route.id])!=null&&N.shouldRevalidate)||_.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=YQ(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,h,t,e,o]),v=y.useMemo(()=>QQ(d,a),[d,a]),b=iZ(d);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 oZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var sZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sZ&&(window.__reactRouterVersion="7.13.1")}catch{}function lZ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=$W({window:r,v5Compat:!0}));let a=i.current,[o,l]=y.useState({action:a.action,location:a.location}),c=y.useCallback(f=>{n===!1?l(f):y.startTransition(()=>l(f))},[n]);return y.useLayoutEffect(()=>a.listen(c),[a,c]),y.createElement(IQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var K$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:c,target:f,to:h,preventScrollReset:d,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:j,unstable_useTransitions:C}=y.useContext(qi),_=typeof h=="string"&&K$.test(h),N=R$(h,S);h=N.to;let O=yQ(h,{relative:i}),A=ya(),T=null;if(l){let V=l0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:go([S,V.pathname])),T=j.createHref(V)}let[P,L,I]=nZ(r,b),F=fZ(h,{replace:o,unstable_mask:l,state:c,target:f,preventScrollReset:d,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function $(V){t&&t(V),V.defaultPrevented||F(V)}let G=!(N.isExternal||a),D=y.createElement("a",{...b,...I,href:(G?T:void 0)||N.absoluteURL||O,onClick:G?$:t,ref:oZ(w,L),target:f,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?y.createElement(y.Fragment,null,D,y.createElement(rZ,{page:O})):D});Pr.displayName="Link";var yy=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:c,...f},h){let d=vp(o,{relative:f.relative}),g=ya(),v=y.useContext(u0),{navigator:b,basename:w}=y.useContext(qi),S=v!=null&&vZ(d)&&l===!0,j=b.encodeLocation?b.encodeLocation(d).pathname:d.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 N=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(N)==="/",A=_!=null&&(_===j||!i&&_.startsWith(j)&&_.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},P=O?t:void 0,L;typeof r=="function"?L=r(T):L=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let I=typeof a=="function"?a(T):a;return y.createElement(Pr,{...f,"aria-current":P,className:L,ref:h,style:I,to:o,viewTransition:l},typeof c=="function"?c(T):c)});yy.displayName="NavLink";var uZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=gy,action:l,onSubmit:c,relative:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(qi),S=pZ(),j=gZ(l,{relative:f}),C=o.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&K$.test(l),N=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:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>P()):P()};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?c:N,...v,"data-discover":!_&&e==="render"?"true":void 0})});uZ.displayName="Form";function cZ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y$(e){let t=y.useContext(Md);return yn(t,cZ(e)),t}function fZ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let h=xa(),d=ya(),g=vp(e,{relative:o});return y.useCallback(v=>{if(UQ(v,t)){v.preventDefault();let b=n!==void 0?n:Nm(d)===Nm(g),w=()=>h(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?y.startTransition(()=>w()):w()}},[d,h,g,n,r,i,t,e,a,o,l,c,f])}function dZ(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(QE(e)),n=y.useRef(!1),r=ya(),i=y.useMemo(()=>HQ(r.search,n.current?null:t.current),[r.search]),a=xa(),o=y.useCallback((l,c)=>{const f=QE(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+f,c)},[a,i]);return[i,o]}var hZ=0,mZ=()=>`__${String(++hZ)}__`;function pZ(){let{router:e}=Y$("useSubmit"),{basename:t}=y.useContext(qi),n=TQ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:c,encType:f,formData:h,body:d}=KQ(a,t);if(o.navigate===!1){let g=o.fetcherKey||mZ();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function gZ(e,{relative:t}={}){let{basename:n}=y.useContext(qi),r=y.useContext(va);yn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...vp(e||".",{relative:t})},o=ya();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(h=>h==="")){l.delete("index"),c.filter(d=>d).forEach(d=>l.append("index",d));let h=l.toString();a.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:go([n,a.pathname])),Nm(a)}function vZ(e,{relative:t}={}){let n=y.useContext(L$);yn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Y$("useViewTransitionState"),i=vp(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 Am(i.pathname,o)!=null||Am(i.pathname,a)!=null}var Gl=A$();const X$=Hi(Gl);var _c=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(){}},yZ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_l,uk,v$,xZ=(v$=class{constructor(){Pe(this,_l,yZ);Pe(this,uk,!1)}setTimeoutProvider(e){ke(this,_l,e)}setTimeout(e,t){return W(this,_l).setTimeout(e,t)}clearTimeout(e){W(this,_l).clearTimeout(e)}setInterval(e,t){return W(this,_l).setInterval(e,t)}clearInterval(e){W(this,_l).clearInterval(e)}},_l=new WeakMap,uk=new WeakMap,v$),Ru=new xZ;function bZ(e){setTimeout(e,0)}var ec=typeof window>"u"||"Deno"in globalThis;function Br(){}function wZ(e,t){return typeof e=="function"?e(t):e}function ZE(e){return typeof e=="number"&&e>=0&&e!==1/0}function G$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Il(e,t){return typeof e=="function"?e(t):e}function aa(e,t){return typeof e=="function"?e(t):e}function wD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==vk(o,t.options))return!1}else if(!Om(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 SD(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(tc(t.options.mutationKey)!==tc(a))return!1}else if(!Om(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vk(e,t){return((t==null?void 0:t.queryKeyHashFn)||tc)(e)}function tc(e){return JSON.stringify(e,(t,n)=>JE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Om(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Om(e[n],t[n])):!1}var SZ=Object.prototype.hasOwnProperty;function yk(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=jD(e)&&jD(t);if(!r&&!(JE(e)&&JE(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 f=0;for(let h=0;h<l;h++){const d=r?h:o[h],g=e[d],v=t[d];if(g===v){c[d]=g,(r?h<a:SZ.call(e,d))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[d]=v;continue}const b=yk(g,v,n+1);c[d]=b,b===g&&f++}return a===l&&f===a?e:c}function Tm(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 jD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function JE(e){if(!ED(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!ED(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ED(e){return Object.prototype.toString.call(e)==="[object Object]"}function jZ(e){return new Promise(t=>{Ru.setTimeout(t,e)})}function e_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?yk(e,t):t}function EZ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _Z(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xk=Symbol();function W$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function bk(e,t){return typeof e=="function"?e(...t):!!e}function CZ(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 Bu,Cl,Kf,y$,kZ=(y$=class extends _c{constructor(){super();Pe(this,Bu);Pe(this,Cl);Pe(this,Kf);ke(this,Kf,t=>{if(!ec&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Cl)||this.setEventListener(W(this,Kf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Cl))==null||t.call(this),ke(this,Cl,void 0))}setEventListener(t){var n;ke(this,Kf,t),(n=W(this,Cl))==null||n.call(this),ke(this,Cl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Bu)!==t&&(ke(this,Bu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Bu)=="boolean"?W(this,Bu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Bu=new WeakMap,Cl=new WeakMap,Kf=new WeakMap,y$),wk=new kZ;function t_(){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 NZ=bZ;function AZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=NZ;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 Ln=AZ(),Yf,kl,Xf,x$,OZ=(x$=class extends _c{constructor(){super();Pe(this,Yf,!0);Pe(this,kl);Pe(this,Xf);ke(this,Xf,t=>{if(!ec&&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,Xf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,kl))==null||t.call(this),ke(this,kl,void 0))}setEventListener(t){var n;ke(this,Xf,t),(n=W(this,kl))==null||n.call(this),ke(this,kl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Yf)!==t&&(ke(this,Yf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Yf)}},Yf=new WeakMap,kl=new WeakMap,Xf=new WeakMap,x$),Ly=new OZ;function TZ(e){return Math.min(1e3*2**e,3e4)}function Q$(e){return(e??"online")==="online"?Ly.isOnline():!0}var n_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Z$(e){let t=!1,n=0,r;const i=t_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new n_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},c=()=>{t=!1},f=()=>wk.isFocused()&&(e.networkMode==="always"||Ly.isOnline())&&e.canRun(),h=()=>Q$(e.networkMode)&&e.canRun(),d=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()||f())&&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(d).catch(j=>{var A;if(a())return;const C=e.retry??(ec?0:3),_=e.retryDelay??TZ,N=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),jZ(N).then(()=>f()?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:h,start:()=>(h()?b():v().then(b),i)}}var Fu,b$,J$=(b$=class{constructor(){Pe(this,Fu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ZE(this.gcTime)&&ke(this,Fu,Ru.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ec?1/0:300*1e3))}clearGcTimeout(){W(this,Fu)&&(Ru.clearTimeout(W(this,Fu)),ke(this,Fu,void 0))}},Fu=new WeakMap,b$),Uu,Gf,ra,Hu,pr,op,qu,Aa,ts,w$,PZ=(w$=class extends J${constructor(t){super();Pe(this,Aa);Pe(this,Uu);Pe(this,Gf);Pe(this,ra);Pe(this,Hu);Pe(this,pr);Pe(this,op);Pe(this,qu);ke(this,qu,!1),ke(this,op,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,Hu,t.client),ke(this,ra,W(this,Hu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,Uu,CD(this.options)),this.state=t.state??W(this,Uu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,pr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,op),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=CD(this.options);n.data!==void 0&&(this.setState(_D(n.data,n.dataUpdatedAt)),ke(this,Uu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ra).remove(this)}setData(t,n){const r=e_(this.state.data,t,this.options);return at(this,Aa,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){at(this,Aa,ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,pr))==null?void 0:r.promise;return(i=W(this,pr))==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,Uu))}isActive(){return this.observers.some(t=>aa(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Il(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:!G$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,pr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,pr))==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,pr)&&(W(this,qu)?W(this,pr).cancel({revert:!0}):W(this,pr).cancelRetry()),this.scheduleGc()),W(this,ra).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,Aa,ts).call(this,{type:"invalidate"})}async fetch(t,n){var c,f,h,d,g,v,b,w,S,j,C,_;if(this.state.fetchStatus!=="idle"&&((c=W(this,pr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,pr))return W(this,pr).continueRetry(),W(this,pr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(O=>O.options.queryFn);N&&this.setOptions(N.options)}const r=new AbortController,i=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(ke(this,qu,!0),r.signal)})},a=()=>{const N=W$(this.options,n),A=(()=>{const T={client:W(this,Hu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return ke(this,qu,!1),this.options.persister?this.options.persister(N,A,this):N(A)},l=(()=>{const N={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Hu),state:this.state,fetchFn:a};return i(N),N})();(f=this.options.behavior)==null||f.onFetch(l,this),ke(this,Gf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&at(this,Aa,ts).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),ke(this,pr,Z$({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:N=>{N instanceof n_&&N.revert&&this.setState({...W(this,Gf),fetchStatus:"idle"}),r.abort()},onFail:(N,O)=>{at(this,Aa,ts).call(this,{type:"failed",failureCount:N,error:O})},onPause:()=>{at(this,Aa,ts).call(this,{type:"pause"})},onContinue:()=>{at(this,Aa,ts).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const N=await W(this,pr).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(v=(g=W(this,ra).config).onSuccess)==null||v.call(g,N,this),(w=(b=W(this,ra).config).onSettled)==null||w.call(b,N,this.state.error,this),N}catch(N){if(N instanceof n_){if(N.silent)return W(this,pr).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw at(this,Aa,ts).call(this,{type:"error",error:N}),(j=(S=W(this,ra).config).onError)==null||j.call(S,N,this),(_=(C=W(this,ra).config).onSettled)==null||_.call(C,this.state.data,N,this),N}finally{this.scheduleGc()}}},Uu=new WeakMap,Gf=new WeakMap,ra=new WeakMap,Hu=new WeakMap,pr=new WeakMap,op=new WeakMap,qu=new WeakMap,Aa=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,...eB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,..._D(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Gf,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),Ln.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ra).notify({query:this,type:"updated",action:t})})},w$);function eB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Q$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _D(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function CD(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,Nt,sp,Zr,Vu,Wf,rs,Nl,lp,Qf,Zf,Ku,Yu,Al,Jf,Vt,mm,r_,i_,a_,o_,s_,l_,u_,tB,S$,f0=(S$=class extends _c{constructor(t,n){super();Pe(this,Vt);Pe(this,pi);Pe(this,Nt);Pe(this,sp);Pe(this,Zr);Pe(this,Vu);Pe(this,Wf);Pe(this,rs);Pe(this,Nl);Pe(this,lp);Pe(this,Qf);Pe(this,Zf);Pe(this,Ku);Pe(this,Yu);Pe(this,Al);Pe(this,Jf,new Set);this.options=n,ke(this,pi,t),ke(this,Nl,null),ke(this,rs,t_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Nt).addObserver(this),kD(W(this,Nt),this.options)?at(this,Vt,mm).call(this):this.updateResult(),at(this,Vt,o_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c_(W(this,Nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c_(W(this,Nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Vt,s_).call(this),at(this,Vt,l_).call(this),W(this,Nt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Nt);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,Nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Vt,u_).call(this),W(this,Nt).setOptions(this.options),n._defaulted&&!Tm(this.options,n)&&W(this,pi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Nt),observer:this});const i=this.hasListeners();i&&ND(W(this,Nt),r,this.options,n)&&at(this,Vt,mm).call(this),this.updateResult(),i&&(W(this,Nt)!==r||aa(this.options.enabled,W(this,Nt))!==aa(n.enabled,W(this,Nt))||Il(this.options.staleTime,W(this,Nt))!==Il(n.staleTime,W(this,Nt)))&&at(this,Vt,r_).call(this);const a=at(this,Vt,i_).call(this);i&&(W(this,Nt)!==r||aa(this.options.enabled,W(this,Nt))!==aa(n.enabled,W(this,Nt))||a!==W(this,Al))&&at(this,Vt,a_).call(this,a)}getOptimisticResult(t){const n=W(this,pi).getQueryCache().build(W(this,pi),t),r=this.createResult(n,t);return DZ(this,r)&&(ke(this,Zr,r),ke(this,Wf,this.options),ke(this,Vu,W(this,Nt).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,Jf).add(t)}getCurrentQuery(){return W(this,Nt)}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 at(this,Vt,mm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Zr)))}createResult(t,n){var L;const r=W(this,Nt),i=this.options,a=W(this,Zr),o=W(this,Vu),l=W(this,Wf),f=t!==r?t.state:W(this,sp),{state:h}=t;let d={...h},g=!1,v;if(n._optimisticResults){const I=this.hasListeners(),F=!I&&kD(t,n),$=I&&ND(t,r,n,i);(F||$)&&(d={...d,...eB(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=d;v=d.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let I;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=a.data,j=!0):I=typeof n.placeholderData=="function"?n.placeholderData((L=W(this,Zf))==null?void 0:L.state.data,W(this,Zf)):n.placeholderData,I!==void 0&&(S="success",v=e_(a==null?void 0:a.data,I,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,lp))v=W(this,Qf);else try{ke(this,lp,n.select),v=n.select(v),v=e_(a==null?void 0:a.data,v,n),ke(this,Qf,v),ke(this,Nl,null)}catch(I){ke(this,Nl,I)}W(this,Nl)&&(b=W(this,Nl),v=W(this,Qf),w=Date.now(),S="error");const C=d.fetchStatus==="fetching",_=S==="pending",N=S==="error",O=_&&C,A=v!==void 0,P={status:S,fetchStatus:d.fetchStatus,isPending:_,isSuccess:S==="success",isError:N,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!_,isLoadingError:N&&!A,isPaused:d.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:N&&A,isStale:Sk(t,n),refetch:this.refetch,promise:W(this,rs),isEnabled:aa(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=P.data!==void 0,F=P.status==="error"&&!I,$=V=>{F?V.reject(P.error):I&&V.resolve(P.data)},G=()=>{const V=ke(this,rs,P.promise=t_());$(V)},D=W(this,rs);switch(D.status){case"pending":t.queryHash===r.queryHash&&$(D);break;case"fulfilled":(F||P.data!==D.value)&&G();break;case"rejected":(!F||P.error!==D.reason)&&G();break}}return P}updateResult(){const t=W(this,Zr),n=this.createResult(W(this,Nt),this.options);if(ke(this,Vu,W(this,Nt).state),ke(this,Wf,this.options),W(this,Vu).data!==void 0&&ke(this,Zf,W(this,Nt)),Tm(n,t))return;ke(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,Jf).size)return!0;const o=new Set(a??W(this,Jf));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)})};at(this,Vt,tB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Vt,o_).call(this)}},pi=new WeakMap,Nt=new WeakMap,sp=new WeakMap,Zr=new WeakMap,Vu=new WeakMap,Wf=new WeakMap,rs=new WeakMap,Nl=new WeakMap,lp=new WeakMap,Qf=new WeakMap,Zf=new WeakMap,Ku=new WeakMap,Yu=new WeakMap,Al=new WeakMap,Jf=new WeakMap,Vt=new WeakSet,mm=function(t){at(this,Vt,u_).call(this);let n=W(this,Nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},r_=function(){at(this,Vt,s_).call(this);const t=Il(this.options.staleTime,W(this,Nt));if(ec||W(this,Zr).isStale||!ZE(t))return;const r=G$(W(this,Zr).dataUpdatedAt,t)+1;ke(this,Ku,Ru.setTimeout(()=>{W(this,Zr).isStale||this.updateResult()},r))},i_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Nt)):this.options.refetchInterval)??!1},a_=function(t){at(this,Vt,l_).call(this),ke(this,Al,t),!(ec||aa(this.options.enabled,W(this,Nt))===!1||!ZE(W(this,Al))||W(this,Al)===0)&&ke(this,Yu,Ru.setInterval(()=>{(this.options.refetchIntervalInBackground||wk.isFocused())&&at(this,Vt,mm).call(this)},W(this,Al)))},o_=function(){at(this,Vt,r_).call(this),at(this,Vt,a_).call(this,at(this,Vt,i_).call(this))},s_=function(){W(this,Ku)&&(Ru.clearTimeout(W(this,Ku)),ke(this,Ku,void 0))},l_=function(){W(this,Yu)&&(Ru.clearInterval(W(this,Yu)),ke(this,Yu,void 0))},u_=function(){const t=W(this,pi).getQueryCache().build(W(this,pi),this.options);if(t===W(this,Nt))return;const n=W(this,Nt);ke(this,Nt,t),ke(this,sp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},tB=function(t){Ln.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Zr))}),W(this,pi).getQueryCache().notify({query:W(this,Nt),type:"observerResultsUpdated"})})},S$);function MZ(e,t){return aa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function kD(e,t){return MZ(e,t)||e.state.data!==void 0&&c_(e,t,t.refetchOnMount)}function c_(e,t,n){if(aa(t.enabled,e)!==!1&&Il(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sk(e,t)}return!1}function ND(e,t,n,r){return(e!==t||aa(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Sk(e,n)}function Sk(e,t){return aa(t.enabled,e)!==!1&&e.isStaleByTime(Il(t.staleTime,e))}function DZ(e,t){return!Tm(e.getCurrentResult(),t)}function zy(e){return{onFetch:(t,n)=>{var h,d,g,v,b;const r=t.options,i=(g=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.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 f=async()=>{let w=!1;const S=_=>{CZ(_,()=>t.signal,()=>w=!0)},j=W$(t.options,t.fetchOptions),C=async(_,N,O)=>{if(w)return Promise.reject();if(N==null&&_.pages.length)return Promise.resolve(_);const T=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:N,direction:O?"backward":"forward",meta:t.options.meta};return S(F),F})(),P=await j(T),{maxPages:L}=t.options,I=O?_Z:EZ;return{pages:I(_.pages,P,L),pageParams:I(_.pageParams,N,L)}};if(i&&a.length){const _=i==="backward",N=_?nB:f_,O={pages:a,pageParams:o},A=N(r,O);l=await C(O,A,_)}else{const _=e??a.length;do{const N=c===0?o[0]??r.initialPageParam:f_(r,l);if(c>0&&N==null)break;l=await C(l,N),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,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function f_(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 nB(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 RZ(e,t){return t?f_(e,t)!=null:!1}function IZ(e,t){return!t||!e.getPreviousPageParam?!1:nB(e,t)!=null}var LZ=class extends f0{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:zy()})}getOptimisticResult(e){return e.behavior=zy(),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,f=o&&c==="forward",h=i&&c==="forward",d=o&&c==="backward",g=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:RZ(t,n.data),hasPreviousPage:IZ(t,n.data),isFetchNextPageError:f,isFetchingNextPage:h,isFetchPreviousPageError:d,isFetchingPreviousPage:g,isRefetchError:l&&!f&&!d,isRefetching:a&&!h&&!g}}},up,so,zr,Xu,lo,yl,j$,zZ=(j$=class extends J${constructor(t){super();Pe(this,lo);Pe(this,up);Pe(this,so);Pe(this,zr);Pe(this,Xu);ke(this,up,t.client),this.mutationId=t.mutationId,ke(this,zr,t.mutationCache),ke(this,so,[]),this.state=t.state||rB(),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,so).includes(t)||(W(this,so).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,so,W(this,so).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,so).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Xu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,f,h,d,g,v,b,w,S,j,C,_,N,O,A,T;const n=()=>{at(this,lo,yl).call(this,{type:"continue"})},r={client:W(this,up),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,Xu,Z$({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,L)=>{at(this,lo,yl).call(this,{type:"failed",failureCount:P,error:L})},onPause:()=>{at(this,lo,yl).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,Xu).canStart();try{if(i)n();else{at(this,lo,yl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const L=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));L!==this.state.context&&at(this,lo,yl).call(this,{type:"pending",context:L,variables:t,isPaused:a})}const P=await W(this,Xu).start();return await((f=(c=W(this,zr).config).onSuccess)==null?void 0:f.call(c,P,t,this.state.context,this,r)),await((d=(h=this.options).onSuccess)==null?void 0:d.call(h,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)),at(this,lo,yl).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(L){Promise.reject(L)}try{await((_=(C=this.options).onError)==null?void 0:_.call(C,P,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((O=(N=W(this,zr).config).onSettled)==null?void 0:O.call(N,void 0,P,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,P,t,this.state.context,r))}catch(L){Promise.reject(L)}throw at(this,lo,yl).call(this,{type:"error",error:P}),P}finally{W(this,zr).runNext(this)}}},up=new WeakMap,so=new WeakMap,zr=new WeakMap,Xu=new WeakMap,lo=new WeakSet,yl=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),Ln.batch(()=>{W(this,so).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},j$);function rB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var is,Oa,cp,E$,$Z=(E$=class extends _c{constructor(t={}){super();Pe(this,is);Pe(this,Oa);Pe(this,cp);this.config=t,ke(this,is,new Set),ke(this,Oa,new Map),ke(this,cp,0)}build(t,n,r){const i=new zZ({client:t,mutationCache:this,mutationId:++Ov(this,cp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,is).add(t);const n=Pv(t);if(typeof n=="string"){const r=W(this,Oa).get(n);r?r.push(t):W(this,Oa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,is).delete(t)){const n=Pv(t);if(typeof n=="string"){const r=W(this,Oa).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,Oa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Pv(t);if(typeof n=="string"){const r=W(this,Oa).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=Pv(t);if(typeof n=="string"){const i=(r=W(this,Oa).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(){Ln.batch(()=>{W(this,is).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,is).clear(),W(this,Oa).clear()})}getAll(){return Array.from(W(this,is))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>SD(n,r))}findAll(t={}){return this.getAll().filter(n=>SD(t,n))}notify(t){Ln.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ln.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},is=new WeakMap,Oa=new WeakMap,cp=new WeakMap,E$);function Pv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var as,Ol,gi,os,ms,xy,d_,_$,BZ=(_$=class extends _c{constructor(n,r){super();Pe(this,ms);Pe(this,as);Pe(this,Ol);Pe(this,gi);Pe(this,os);ke(this,as,n),this.setOptions(r),this.bindMethods(),at(this,ms,xy).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),Tm(this.options,r)||W(this,as).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,gi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&tc(r.mutationKey)!==tc(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){at(this,ms,xy).call(this),at(this,ms,d_).call(this,n)}getCurrentResult(){return W(this,Ol)}reset(){var n;(n=W(this,gi))==null||n.removeObserver(this),ke(this,gi,void 0),at(this,ms,xy).call(this),at(this,ms,d_).call(this)}mutate(n,r){var i;return ke(this,os,r),(i=W(this,gi))==null||i.removeObserver(this),ke(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,Ol=new WeakMap,gi=new WeakMap,os=new WeakMap,ms=new WeakSet,xy=function(){var r;const n=((r=W(this,gi))==null?void 0:r.state)??rB();ke(this,Ol,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},d_=function(n){Ln.batch(()=>{var r,i,a,o,l,c,f,h;if(W(this,os)&&this.hasListeners()){const d=W(this,Ol).variables,g=W(this,Ol).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,d,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,os)).onSettled)==null||o.call(a,n.data,null,d,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,d,g,v)}catch(b){Promise.reject(b)}try{(h=(f=W(this,os)).onSettled)==null||h.call(f,void 0,n.error,d,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(W(this,Ol))})})},_$);function AD(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function FZ(e,t,n){const r=e.slice(0);return r[t]=n,r}var ed,Oi,td,nd,ia,Tl,fp,dp,hp,mp,Mr,h_,m_,p_,g_,v_,C$,UZ=(C$=class extends _c{constructor(t,n,r){super();Pe(this,Mr);Pe(this,ed);Pe(this,Oi);Pe(this,td);Pe(this,nd);Pe(this,ia);Pe(this,Tl);Pe(this,fp);Pe(this,dp);Pe(this,hp);Pe(this,mp,[]);ke(this,ed,t),ke(this,nd,r),ke(this,td,[]),ke(this,ia,[]),ke(this,Oi,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ia).forEach(t=>{t.subscribe(n=>{at(this,Mr,g_).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){ke(this,td,t),ke(this,nd,n),Ln.batch(()=>{const r=W(this,ia),i=at(this,Mr,p_).call(this,W(this,td));i.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const a=i.map(d=>d.observer),o=a.map(d=>d.getCurrentResult()),l=r.length!==a.length,c=a.some((d,g)=>d!==r[g]),f=l||c,h=f?!0:o.some((d,g)=>{const v=W(this,Oi)[g];return!v||!Tm(d,v)});!f&&!h||(f&&(ke(this,mp,i),ke(this,ia,a)),ke(this,Oi,o),this.hasListeners()&&(f&&(AD(r,a).forEach(d=>{d.destroy()}),AD(a,r).forEach(d=>{d.subscribe(g=>{at(this,Mr,g_).call(this,d,g)})})),at(this,Mr,v_).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=at(this,Mr,p_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>at(this,Mr,m_).call(this,o??i,n,a),()=>at(this,Mr,h_).call(this,i,r)]}},ed=new WeakMap,Oi=new WeakMap,td=new WeakMap,nd=new WeakMap,ia=new WeakMap,Tl=new WeakMap,fp=new WeakMap,dp=new WeakMap,hp=new WeakMap,mp=new WeakMap,Mr=new WeakSet,h_=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)})})})},m_=function(t,n,r){if(n){const i=W(this,hp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Tl)||W(this,Oi)!==W(this,dp)||a||n!==W(this,fp))&&(ke(this,fp,n),ke(this,dp,W(this,Oi)),r!==void 0&&ke(this,hp,r),ke(this,Tl,yk(W(this,Tl),n(t)))),W(this,Tl)}return t},p_=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,ed).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new f0(W(this,ed),a);r.push({defaultedQueryOptions:a,observer:l})}),r},g_=function(t,n){const r=W(this,ia).indexOf(t);r!==-1&&(ke(this,Oi,FZ(W(this,Oi),r,n)),at(this,Mr,v_).call(this))},v_=function(){var t;if(this.hasListeners()){const n=W(this,Tl),r=at(this,Mr,h_).call(this,W(this,Oi),W(this,mp)),i=at(this,Mr,m_).call(this,r,(t=W(this,nd))==null?void 0:t.combine);n!==i&&Ln.batch(()=>{this.listeners.forEach(a=>{a(W(this,Oi))})})}},C$),uo,k$,HZ=(k$=class extends _c{constructor(t={}){super();Pe(this,uo);this.config=t,ke(this,uo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??vk(i,n);let o=this.get(a);return o||(o=new PZ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,uo).has(t.queryHash)||(W(this,uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,uo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ln.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,uo).get(t)}getAll(){return[...W(this,uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>wD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>wD(t,r)):n}notify(t){Ln.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},uo=new WeakMap,k$),Dn,Pl,Ml,rd,id,Dl,ad,od,N$,qZ=(N$=class{constructor(e={}){Pe(this,Dn);Pe(this,Pl);Pe(this,Ml);Pe(this,rd);Pe(this,id);Pe(this,Dl);Pe(this,ad);Pe(this,od);ke(this,Dn,e.queryCache||new HZ),ke(this,Pl,e.mutationCache||new $Z),ke(this,Ml,e.defaultOptions||{}),ke(this,rd,new Map),ke(this,id,new Map),ke(this,Dl,0)}mount(){Ov(this,Dl)._++,W(this,Dl)===1&&(ke(this,ad,wk.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Dn).onFocus())})),ke(this,od,Ly.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Dn).onOnline())})))}unmount(){var e,t;Ov(this,Dl)._--,W(this,Dl)===0&&((e=W(this,ad))==null||e.call(this),ke(this,ad,void 0),(t=W(this,od))==null||t.call(this),ke(this,od,void 0))}isFetching(e){return W(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Pl).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(Il(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=wZ(t,a);if(o!==void 0)return W(this,Dn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Ln.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);Ln.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Dn);return Ln.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ln.batch(()=>W(this,Dn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return Ln.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=Ln.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(Il(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=zy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=zy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ly.isOnline()?W(this,Pl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Dn)}getMutationCache(){return W(this,Pl)}getDefaultOptions(){return W(this,Ml)}setDefaultOptions(e){ke(this,Ml,e)}setQueryDefaults(e,t){W(this,rd).set(tc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,rd).values()],n={};return t.forEach(r=>{Om(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,id).set(tc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,id).values()],n={};return t.forEach(r=>{Om(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Ml).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vk(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===xk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Ml).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Dn).clear(),W(this,Pl).clear()}},Dn=new WeakMap,Pl=new WeakMap,Ml=new WeakMap,rd=new WeakMap,id=new WeakMap,Dl=new WeakMap,ad=new WeakMap,od=new WeakMap,N$),iB=y.createContext(void 0),gt=e=>{const t=y.useContext(iB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},VZ=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(iB.Provider,{value:e,children:t})),aB=y.createContext(!1),oB=()=>y.useContext(aB);aB.Provider;function KZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var YZ=y.createContext(KZ()),sB=()=>y.useContext(YZ),lB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?bk(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},uB=e=>{y.useEffect(()=>{e.clearReset()},[e])},cB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||bk(n,[e.error,r])),fB=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))}},XZ=(e,t)=>e.isLoading&&e.isFetching&&!t,y_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,x_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function GZ({queries:e,...t},n){const r=gt(),i=oB(),a=sB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{fB(w);const S=r.getQueryCache().get(w.queryHash);lB(w,a,S)}),uB(a);const[l]=y.useState(()=>new UZ(r,o,t)),[c,f,h]=l.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>d?l.subscribe(Ln.batchCalls(w)):Br,[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>y_(o[S],w))?c.flatMap((w,S)=>{const j=o[S];if(j&&y_(j,w)){const C=new f0(r,j);return x_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const j=o[S];return j&&cB({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 f(h())}function dB(e,t,n){var g,v,b,w;const r=oB(),i=sB(),a=gt(),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",fB(o),lB(o,i,l),uB(i);const c=!a.getQueryCache().get(o.queryHash),[f]=y.useState(()=>new t(a,o)),h=f.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const j=d?f.subscribe(Ln.batchCalls(S)):Br;return f.updateResult(),j},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(o)},[o,f]),y_(o,h))throw x_(o,f,i);if(cB({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw h.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,o,h),o.experimental_prefetchInRender&&!ec&&XZ(h,r)){const S=c?x_(o,f,i):l==null?void 0:l.promise;S==null||S.catch(Br).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?h:f.trackResult(h)}function Un(e,t){return dB(e,f0)}function Bt(e,t){const n=gt(),[r]=y.useState(()=>new BZ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(Ln.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&bk(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function WZ(e,t){return dB(e,LZ)}var QZ=(e,t,n,r,i,a,o,l)=>{let c=document.documentElement,f=["light","dark"];function h(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)}),d(v)}function d(v){l&&f.includes(v)&&(c.style.colorScheme=v)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)h(r);else try{let v=localStorage.getItem(t)||n,b=o&&v==="system"?g():v;h(b)}catch{}},OD=["light","dark"],hB="(prefers-color-scheme: dark)",ZZ=typeof window>"u",jk=y.createContext(void 0),JZ={setTheme:e=>{},themes:[]},Ek=()=>{var e;return(e=y.useContext(jk))!=null?e:JZ},eJ=e=>y.useContext(jk)?y.createElement(y.Fragment,null,e.children):y.createElement(nJ,{...e}),tJ=["light","dark"],nJ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=tJ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:f,nonce:h,scriptProps:d})=>{let[g,v]=y.useState(()=>iJ(i,o)),[b,w]=y.useState(()=>g==="system"?SS():g),S=c?Object.values(c):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=SS());let T=c?c[A]:A,P=t?aJ(h):null,L=document.documentElement,I=F=>{F==="class"?(L.classList.remove(...S),T&&L.classList.add(T)):F.startsWith("data-")&&(T?L.setAttribute(F,T):L.removeAttribute(F))};if(Array.isArray(l)?l.forEach(I):I(l),r){let F=OD.includes(o)?o:null,$=OD.includes(A)?A:F;L.style.colorScheme=$}P==null||P()},[h]),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=SS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(hB);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 N=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(jk.Provider,{value:N},y.createElement(rJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:h,scriptProps:d}),f)},rJ=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:c,scriptProps:f})=>{let h=JSON.stringify([n,t,a,e,l,o,r,i]).slice(1,-1);return y.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${QZ.toString()})(${h})`}})}),iJ=(e,t)=>{if(ZZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},aJ=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)}},SS=e=>(e||(e=window.matchMedia(hB)),e.matches?"dark":"light");function TD(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=TD(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():TD(e[i],null)}}}}function Ct(...e){return y.useCallback(gs(...e),e)}function nc(e){const t=oJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),c=l.find(lJ);if(c){const f=c.props.children,h=l.map(d=>d===c?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:d);return m.jsx(t,{...o,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,h):null})}return m.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var _k=nc("Slot");function oJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=cJ(i),l=uJ(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 mB=Symbol("radix.slottable");function sJ(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=mB,t}function lJ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mB}function uJ(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 cJ(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 fJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=fJ.reduce((e,t)=>{const n=nc(`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),m.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function pB(e,t){e&&Gl.flushSync(()=>e.dispatchEvent(t))}var gB=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"}),dJ="VisuallyHidden",vB=y.forwardRef((e,t)=>m.jsx(Ve.span,{...e,ref:t,style:{...gB,...e.style}}));vB.displayName=dJ;var hJ=vB;function mJ(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return m.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 Va(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const f=d=>{var j;const{scope:g,children:v,...b}=d,w=((j=g==null?void 0:g[e])==null?void 0:j[c])||l,S=y.useMemo(()=>b,Object.values(b));return m.jsx(w.Provider,{value:S,children:v})};f.displayName=a+"Provider";function h(d,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(`\`${d}\` must be used within \`${a}\``)}return[f,h]}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:f})=>{const d=c(a)[`__scope${f}`];return{...l,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ck(e){const t=e+"CollectionProvider",[n,r]=Va(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 m.jsx(i,{scope:S,itemMap:_,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",c=nc(l),f=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,_=a(l,j),N=Ct(S,_.collectionRef);return m.jsx(c,{ref:N,children:C})});f.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",g=nc(h),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,..._}=w,N=Ce.useRef(null),O=Ct(S,N),A=a(h,j);return Ce.useEffect(()=>(A.itemMap.set(N,{ref:N,..._}),()=>void A.itemMap.delete(N))),m.jsx(g,{[d]:"",ref:O,children:C})});v.displayName=h;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(`[${d}]`));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:f,ItemSlot:v},b,r]}function Ae(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 xr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},gJ=ck[" useInsertionEffect ".trim().toString()]||xr;function Bl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=vJ({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const h=y.useRef(e!==void 0);y.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${r} is changing from ${d?"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.`),h.current=l},[l,r])}const f=y.useCallback(h=>{var d;if(l){const g=yJ(h)?h(e):h;g!==e&&((d=o.current)==null||d.call(o,g))}else a(h)},[l,e,a,o]);return[c,f]}function vJ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return gJ(()=>{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 yJ(e){return typeof e=="function"}function xJ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=bJ(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Ct(r.ref,wJ(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function bJ(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=xJ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Mv(r.current);a.current=l==="mounted"?f:"none"},[l]),xr(()=>{const f=r.current,h=i.current;if(h!==e){const g=a.current,v=Mv(f);e?c("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(h&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),xr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,d=v=>{const w=Mv(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",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Mv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Mv(e){return(e==null?void 0:e.animationName)||"none"}function wJ(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 SJ=ck[" useId ".trim().toString()]||(()=>{}),jJ=0;function yr(e){const[t,n]=y.useState(SJ());return xr(()=>{n(r=>r??String(jJ++))},[e]),e||(t?`radix-${t}`:"")}var d0="Collapsible",[EJ]=Va(d0),[_J,kk]=EJ(d0),yB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,f]=Bl({prop:r,defaultProp:i??!1,onChange:o,caller:d0});return m.jsx(_J,{scope:n,disabled:a,contentId:yr(),open:c,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),children:m.jsx(Ve.div,{"data-state":Ak(c),"data-disabled":a?"":void 0,...l,ref:t})})});yB.displayName=d0;var xB="CollapsibleTrigger",bB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=kk(xB,n);return m.jsx(Ve.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ak(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ae(e.onClick,i.onOpenToggle)})});bB.displayName=xB;var Nk="CollapsibleContent",wB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=kk(Nk,e.__scopeCollapsible);return m.jsx(qr,{present:n||i.open,children:({present:a})=>m.jsx(CJ,{...r,ref:t,present:a})})});wB.displayName=Nk;var CJ=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=kk(Nk,n),[l,c]=y.useState(r),f=y.useRef(null),h=Ct(t,f),d=y.useRef(0),g=d.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)},[]),xr(()=>{const C=f.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();d.current=_.height,v.current=_.width,S.current||(C.style.transitionDuration=j.current.transitionDuration,C.style.animationName=j.current.animationName),c(r)}},[o.open,r]),m.jsx(Ve.div,{"data-state":Ak(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...a,ref:h,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 Ak(e){return e?"open":"closed"}var kJ=yB,NJ=y.createContext(void 0);function yp(e){const t=y.useContext(NJ);return e||t||"ltr"}function Or(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 AJ(e,t=globalThis==null?void 0:globalThis.document){const n=Or(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 OJ="DismissableLayer",b_="dismissableLayer.update",TJ="dismissableLayer.pointerDownOutside",PJ="dismissableLayer.focusOutside",PD,SB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,f=y.useContext(SB),[h,d]=y.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=Ct(t,T=>d(T)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=h?w.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,N=C>=j,O=RJ(T=>{const P=T.target,L=[...f.branches].some(I=>I.contains(P));!N||L||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=IJ(T=>{const P=T.target;[...f.branches].some(I=>I.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return AJ(T=>{C===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),y.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(PD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),MD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=PD)}},[h,g,n,f]),y.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),MD())},[h,f]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(b_,T),()=>document.removeEventListener(b_,T)},[]),m.jsx(Ve.div,{...c,ref:b,style:{pointerEvents:_?N?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,O.onPointerDownCapture)})});xp.displayName=OJ;var MJ="DismissableLayerBranch",DJ=y.forwardRef((e,t)=>{const n=y.useContext(SB),r=y.useRef(null),i=Ct(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(Ve.div,{...e,ref:i})});DJ.displayName=MJ;function RJ(e,t=globalThis==null?void 0:globalThis.document){const n=Or(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){jB(TJ,n,f,{discrete:!0})};const f={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 IJ(e,t=globalThis==null?void 0:globalThis.document){const n=Or(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&jB(PJ,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 MD(){const e=new CustomEvent(b_);document.dispatchEvent(e)}function jB(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?pB(i,a):i.dispatchEvent(a)}var jS="focusScope.autoFocusOnMount",ES="focusScope.autoFocusOnUnmount",DD={bubbles:!1,cancelable:!0},LJ="FocusScope",h0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),f=Or(i),h=Or(a),d=y.useRef(null),g=Ct(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 N=_.target;l.contains(N)?d.current=N:xl(d.current,{select:!0})},S=function(_){if(v.paused||!l)return;const N=_.relatedTarget;N!==null&&(l.contains(N)||xl(d.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&xl(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){ID.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(jS,DD);l.addEventListener(jS,f),l.dispatchEvent(j),j.defaultPrevented||(zJ(HJ(EB(l)),{select:!0}),document.activeElement===w&&xl(l))}return()=>{l.removeEventListener(jS,f),setTimeout(()=>{const j=new CustomEvent(ES,DD);l.addEventListener(ES,h),l.dispatchEvent(j),j.defaultPrevented||xl(w??document.body,{select:!0}),l.removeEventListener(ES,h),ID.remove(v)},0)}}},[l,f,h,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,[_,N]=$J(C);_&&N?!w.shiftKey&&j===N?(w.preventDefault(),n&&xl(_,{select:!0})):w.shiftKey&&j===_&&(w.preventDefault(),n&&xl(N,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Ve.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});h0.displayName=LJ;function zJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xl(r,{select:t}),document.activeElement!==n)return}function $J(e){const t=EB(e),n=RD(t,e),r=RD(t.reverse(),e);return[n,r]}function EB(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 RD(e,t){for(const n of e)if(!BJ(n,{upTo:t}))return n}function BJ(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 FJ(e){return e instanceof HTMLInputElement&&"select"in e}function xl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&FJ(e)&&t&&e.select()}}var ID=UJ();function UJ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=LD(e,t),e.unshift(t)},remove(t){var n;e=LD(e,t),(n=e[0])==null||n.resume()}}}function LD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function HJ(e){return e.filter(t=>t.tagName!=="A")}var qJ="Portal",bp=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);xr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?X$.createPortal(m.jsx(Ve.div,{...r,ref:t}),o):null});bp.displayName=qJ;var _S=0;function Ok(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zD()),document.body.insertAdjacentElement("beforeend",e[1]??zD()),_S++,()=>{_S===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_S--}},[])}function zD(){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 fo=function(){return fo=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},fo.apply(this,arguments)};function _B(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 VJ(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 by="right-scroll-bar-position",wy="width-before-scroll-bar",KJ="with-scroll-bars-hidden",YJ="--removed-body-scroll-bar-size";function CS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XJ(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 GJ=typeof window<"u"?y.useLayoutEffect:y.useEffect,$D=new WeakMap;function WJ(e,t){var n=XJ(null,function(r){return e.forEach(function(i){return CS(i,r)})});return GJ(function(){var r=$D.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||CS(l,null)}),a.forEach(function(l){i.has(l)||CS(l,o)})}$D.set(n,e)},[e]),n}function QJ(e){return e}function ZJ(e,t){t===void 0&&(t=QJ);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 h=o;o=[],h.forEach(a)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return i}function JJ(e){e===void 0&&(e={});var t=ZJ(null);return t.options=fo({async:!0,ssr:!1},e),t}var CB=function(e){var t=e.sideCar,n=_B(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,fo({},n))};CB.isSideCarExport=!0;function eee(e,t){return e.useMedium(t),CB}var kB=JJ(),kS=function(){},m0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:kS,onWheelCapture:kS,onTouchMoveCapture:kS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,f=e.removeScrollBar,h=e.enabled,d=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,N=_B(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=WJ([n,t]),T=fo(fo({},N),i);return y.createElement(y.Fragment,null,h&&y.createElement(O,{sideCar:kB,removeScrollBar:f,shards:d,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:_}),o?y.cloneElement(y.Children.only(l),fo(fo({},T),{ref:A})):y.createElement(C,fo({},T,{className:c,ref:A}),l))});m0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};m0.classNames={fullWidth:wy,zeroRight:by};var tee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tee();return t&&e.setAttribute("nonce",t),e}function ree(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nee())&&(ree(t,n),iee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oee=function(){var e=aee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},NB=function(){var e=oee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},see={left:0,top:0,right:0,gap:0},NS=function(e){return parseInt(e||"",10)||0},lee=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[NS(n),NS(r),NS(i)]},uee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return see;var t=lee(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])}},cee=NB(),$f="data-scroll-locked",fee=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(KJ,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat($f,`] {
    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(by,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(wy,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(by," .").concat(by,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(wy," .").concat(wy,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat($f,`] {
    `).concat(YJ,": ").concat(l,`px;
  }
`)},BD=function(){var e=parseInt(document.body.getAttribute($f)||"0",10);return isFinite(e)?e:0},dee=function(){y.useEffect(function(){return document.body.setAttribute($f,(BD()+1).toString()),function(){var e=BD()-1;e<=0?document.body.removeAttribute($f):document.body.setAttribute($f,e.toString())}},[])},hee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;dee();var a=y.useMemo(function(){return uee(i)},[i]);return y.createElement(cee,{styles:fee(a,!t,i,n?"":"!important")})},w_=!1;if(typeof window<"u")try{var Dv=Object.defineProperty({},"passive",{get:function(){return w_=!0,!0}});window.addEventListener("test",Dv,Dv),window.removeEventListener("test",Dv,Dv)}catch{w_=!1}var vf=w_?{passive:!1}:!1,mee=function(e){return e.tagName==="TEXTAREA"},AB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!mee(e)&&n[t]==="visible")},pee=function(e){return AB(e,"overflowY")},gee=function(e){return AB(e,"overflowX")},FD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=OB(e,r);if(i){var a=TB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},yee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},OB=function(e,t){return e==="v"?pee(t):gee(t)},TB=function(e,t){return e==="v"?vee(t):yee(t)},xee=function(e,t){return e==="h"&&t==="rtl"?-1:1},bee=function(e,t,n,r,i){var a=xee(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),f=!1,h=o>0,d=0,g=0;do{if(!l)break;var v=TB(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&OB(e,l)&&(d+=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(h&&Math.abs(d)<1||!h&&Math.abs(g)<1)&&(f=!0),f},Rv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},UD=function(e){return[e.deltaX,e.deltaY]},HD=function(e){return e&&"current"in e?e.current:e},wee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},See=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},jee=0,yf=[];function Eee(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(jee++)[0],a=y.useState(NB)[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=VJ([e.lockRef.current],(e.shards||[]).map(HD),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var j=Rv(w),C=n.current,_="deltaX"in w?w.deltaX:C[0]-j[0],N="deltaY"in w?w.deltaY:C[1]-j[1],O,A=w.target,T=Math.abs(_)>Math.abs(N)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var P=window.getSelection(),L=P&&P.anchorNode,I=L?L===A||L.contains(A):!1;if(I)return!1;var F=FD(T,A);if(!F)return!0;if(F?O=T:(O=T==="v"?"h":"v",F=FD(T,A)),!F)return!1;if(!r.current&&"changedTouches"in w&&(_||N)&&(r.current=O),!O)return!0;var $=r.current||O;return bee($,S,w,$==="h"?_:N)},[]),c=y.useCallback(function(w){var S=w;if(!(!yf.length||yf[yf.length-1]!==a)){var j="deltaY"in S?UD(S):Rv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&wee(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var _=(o.current.shards||[]).map(HD).filter(Boolean).filter(function(O){return O.contains(S.target)}),N=_.length>0?l(S,_[0]):!o.current.noIsolation;N&&S.cancelable&&S.preventDefault()}}},[]),f=y.useCallback(function(w,S,j,C){var _={name:w,delta:S,target:j,should:C,shadowParent:_ee(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(N){return N!==_})},1)},[]),h=y.useCallback(function(w){n.current=Rv(w),r.current=void 0},[]),d=y.useCallback(function(w){f(w.type,UD(w),w.target,l(w,e.lockRef.current))},[]),g=y.useCallback(function(w){f(w.type,Rv(w),w.target,l(w,e.lockRef.current))},[]);y.useEffect(function(){return yf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",c,vf),document.addEventListener("touchmove",c,vf),document.addEventListener("touchstart",h,vf),function(){yf=yf.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,vf),document.removeEventListener("touchmove",c,vf),document.removeEventListener("touchstart",h,vf)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:See(i)}):null,v?y.createElement(hee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _ee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cee=eee(kB,Eee);var p0=y.forwardRef(function(e,t){return y.createElement(m0,fo({},e,{ref:t,sideCar:Cee}))});p0.classNames=m0.classNames;var kee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xf=new WeakMap,Iv=new WeakMap,Lv={},AS=0,PB=function(e){return e&&(e.host||PB(e.parentNode))},Nee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=PB(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})},Aee=function(e,t,n,r){var i=Nee(t,Array.isArray(e)?e:[e]);Lv[n]||(Lv[n]=new WeakMap);var a=Lv[n],o=[],l=new Set,c=new Set(i),f=function(d){!d||l.has(d)||(l.add(d),f(d.parentNode))};i.forEach(f);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(g){if(l.has(g))h(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(xf.get(g)||0)+1,S=(a.get(g)||0)+1;xf.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Iv.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 h(t),l.clear(),AS++,function(){o.forEach(function(d){var g=xf.get(d)-1,v=a.get(d)-1;xf.set(d,g),a.set(d,v),g||(Iv.has(d)||d.removeAttribute(r),Iv.delete(d)),v||d.removeAttribute(n)}),AS--,AS||(xf=new WeakMap,xf=new WeakMap,Iv=new WeakMap,Lv={})}},Tk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=kee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Aee(r,i,n,"aria-hidden")):function(){return null}},g0="Dialog",[MB]=Va(g0),[Oee,Ka]=MB(g0),DB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[f,h]=Bl({prop:r,defaultProp:i??!1,onChange:a,caller:g0});return m.jsx(Oee,{scope:t,triggerRef:l,contentRef:c,contentId:yr(),titleId:yr(),descriptionId:yr(),open:f,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};DB.displayName=g0;var RB="DialogTrigger",Tee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ka(RB,n),a=Ct(t,i.triggerRef);return m.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Dk(i.open),...r,ref:a,onClick:Ae(e.onClick,i.onOpenToggle)})});Tee.displayName=RB;var Pk="DialogPortal",[Pee,IB]=MB(Pk,{forceMount:void 0}),LB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ka(Pk,t);return m.jsx(Pee,{scope:t,forceMount:n,children:y.Children.map(r,o=>m.jsx(qr,{present:n||a.open,children:m.jsx(bp,{asChild:!0,container:i,children:o})}))})};LB.displayName=Pk;var $y="DialogOverlay",zB=y.forwardRef((e,t)=>{const n=IB($y,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka($y,e.__scopeDialog);return a.modal?m.jsx(qr,{present:r||a.open,children:m.jsx(Dee,{...i,ref:t})}):null});zB.displayName=$y;var Mee=nc("DialogOverlay.RemoveScroll"),Dee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ka($y,n);return m.jsx(p0,{as:Mee,allowPinchZoom:!0,shards:[i.contentRef],children:m.jsx(Ve.div,{"data-state":Dk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),rc="DialogContent",$B=y.forwardRef((e,t)=>{const n=IB(rc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ka(rc,e.__scopeDialog);return m.jsx(qr,{present:r||a.open,children:a.modal?m.jsx(Ree,{...i,ref:t}):m.jsx(Iee,{...i,ref:t})})});$B.displayName=rc;var Ree=y.forwardRef((e,t)=>{const n=Ka(rc,e.__scopeDialog),r=y.useRef(null),i=Ct(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return Tk(a)},[]),m.jsx(BB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault())})}),Iee=y.forwardRef((e,t)=>{const n=Ka(rc,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return m.jsx(BB,{...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,f;(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;((f=n.triggerRef.current)==null?void 0:f.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),BB=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Ka(rc,n),c=y.useRef(null),f=Ct(t,c);return Ok(),m.jsxs(m.Fragment,{children:[m.jsx(h0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(xp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Dk(l.open),...o,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Lee,{titleId:l.titleId}),m.jsx($ee,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Mk="DialogTitle",FB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ka(Mk,n);return m.jsx(Ve.h2,{id:i.titleId,...r,ref:t})});FB.displayName=Mk;var UB="DialogDescription",HB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ka(UB,n);return m.jsx(Ve.p,{id:i.descriptionId,...r,ref:t})});HB.displayName=UB;var qB="DialogClose",VB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ka(qB,n);return m.jsx(Ve.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>i.onOpenChange(!1))})});VB.displayName=qB;function Dk(e){return e?"open":"closed"}var KB="DialogTitleWarning",[C5e,YB]=mJ(KB,{contentName:rc,titleName:Mk,docsSlug:"dialog"}),Lee=({titleId:e})=>{const t=YB(KB),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},zee="DialogDescriptionWarning",$ee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YB(zee).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},Rk=DB,Ik=LB,Lk=zB,zk=$B,XB=FB,GB=HB,$k=VB,OS={exports:{}},TS={};/**
 * @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 qD;function Bee(){if(qD)return TS;qD=1;var e=Td();function t(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&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(d,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})},[d,v,g]),i(function(){return c(w)&&S({inst:w}),d(function(){c(w)&&S({inst:w})})},[d]),o(v),v}function c(d){var g=d.getSnapshot;d=d.value;try{var v=g();return!n(d,v)}catch{return!0}}function f(d,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return TS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,TS}var VD;function Fee(){return VD||(VD=1,OS.exports=Bee()),OS.exports}function Uee(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 Hee(e){const[t,n]=y.useState(void 0);return xr(()=>{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,f=Array.isArray(c)?c[0]:c;o=f.inlineSize,l=f.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 qee=["top","right","bottom","left"],Fl=Math.min,Ti=Math.max,By=Math.round,zv=Math.floor,vo=e=>({x:e,y:e}),Vee={left:"right",right:"left",bottom:"top",top:"bottom"};function S_(e,t,n){return Ti(e,Fl(t,n))}function vs(e,t){return typeof e=="function"?e(t):e}function ys(e){return e.split("-")[0]}function Dd(e){return e.split("-")[1]}function Bk(e){return e==="x"?"y":"x"}function Fk(e){return e==="y"?"height":"width"}function ho(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Uk(e){return Bk(ho(e))}function Kee(e,t,n){n===void 0&&(n=!1);const r=Dd(e),i=Uk(e),a=Fk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Fy(o)),[o,Fy(o)]}function Yee(e){const t=Fy(e);return[j_(e),t,j_(t)]}function j_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const KD=["left","right"],YD=["right","left"],Xee=["top","bottom"],Gee=["bottom","top"];function Wee(e,t,n){switch(e){case"top":case"bottom":return n?t?YD:KD:t?KD:YD;case"left":case"right":return t?Xee:Gee;default:return[]}}function Qee(e,t,n,r){const i=Dd(e);let a=Wee(ys(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(j_)))),a}function Fy(e){const t=ys(e);return Vee[t]+e.slice(t.length)}function Zee(e){return{top:0,right:0,bottom:0,left:0,...e}}function WB(e){return typeof e!="number"?Zee(e):{top:e,right:e,bottom:e,left:e}}function Uy(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 XD(e,t,n){let{reference:r,floating:i}=e;const a=ho(t),o=Uk(t),l=Fk(o),c=ys(t),f=a==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,g=r[l]/2-i[l]/2;let v;switch(c){case"top":v={x:h,y:r.y-i.height};break;case"bottom":v={x:h,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Dd(t)){case"start":v[o]-=g*(n&&f?-1:1);break;case"end":v[o]+=g*(n&&f?-1:1);break}return v}async function Jee(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:g=!1,padding:v=0}=vs(t,e),b=WB(v),S=l[g?d==="floating"?"reference":"floating":d],j=Uy(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:f,rootBoundary:h,strategy:c})),C=d==="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)),N=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=Uy(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:_,strategy:c}):C);return{top:(j.top-O.top+b.top)/N.y,bottom:(O.bottom-j.bottom+b.bottom)/N.y,left:(j.left-O.left+b.left)/N.x,right:(O.right-j.right+b.right)/N.x}}const ete=50,tte=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Jee},c=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=XD(f,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:N,data:O,reset:A}=await C({x:h,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:f,platform:l,elements:{reference:e,floating:t}});h=_??h,d=N??d,b[j]={...b[j],...O},A&&v<ete&&(v++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(f=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:h,y:d}=XD(f,g,c)),w=-1)}return{x:h,y:d,placement:g,strategy:i,middlewareData:b}},nte=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:f,padding:h=0}=vs(e,t)||{};if(f==null)return{};const d=WB(h),g={x:n,y:r},v=Uk(i),b=Fk(v),w=await o.getDimensions(f),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",_=S?"clientHeight":"clientWidth",N=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(f));let T=A?A[_]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[_]||a.floating[b]);const P=N/2-O/2,L=T/2-w[b]/2-1,I=Fl(d[j],L),F=Fl(d[C],L),$=I,G=T-w[b]-F,D=T/2-w[b]/2+P,V=S_($,D,G),z=!c.arrow&&Dd(i)!=null&&D!==V&&a.reference[b]/2-(D<$?I:F)-w[b]/2<0,q=z?D<$?D-$:D-G:0;return{[v]:g[v]+q,data:{[v]:V,centerOffset:D-V-q,...z&&{alignmentOffset:q}},reset:z}}}),rte=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:f}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=vs(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=ys(i),C=ho(l),_=ys(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(f.floating)),O=g||(_||!w?[Fy(l)]:Yee(l)),A=b!=="none";!g&&A&&O.push(...Qee(l,w,b,N));const T=[l,...O],P=await c.detectOverflow(t,S),L=[];let I=((r=a.flip)==null?void 0:r.overflows)||[];if(h&&L.push(P[j]),d){const D=Kee(i,o,N);L.push(P[D[0]],P[D[1]])}if(I=[...I,{placement:i,overflows:L}],!L.every(D=>D<=0)){var F,$;const D=(((F=a.flip)==null?void 0:F.index)||0)+1,V=T[D];if(V&&(!(d==="alignment"?C!==ho(V):!1)||I.every(X=>ho(X.placement)===C?X.overflows[0]>0:!0)))return{data:{index:D,overflows:I},reset:{placement:V}};let z=($=I.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:$.placement;if(!z)switch(v){case"bestFit":{var G;const q=(G=I.filter(X=>{if(A){const K=ho(X.placement);return K===C||K==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(K=>K>0).reduce((K,R)=>K+R,0)]).sort((X,K)=>X[1]-K[1])[0])==null?void 0:G[0];q&&(z=q);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function GD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WD(e){return qee.some(t=>e[t]>=0)}const ite=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=vs(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=GD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:WD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=GD(o,n.floating);return{data:{escapedOffsets:l,escaped:WD(l)}}}default:return{}}}}},QB=new Set(["left","top"]);async function ate(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ys(n),l=Dd(n),c=ho(n)==="y",f=QB.has(o)?-1:1,h=a&&c?-1:1,d=vs(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{x:v*h,y:g*f}:{x:g*f,y:v*h}}const ote=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 ate(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:_}}},...f}=vs(e,t),h={x:n,y:r},d=await a.detectOverflow(t,f),g=ho(ys(i)),v=Bk(g);let b=h[v],w=h[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=b+d[j],N=b-d[C];b=S_(_,b,N)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=w+d[j],N=w-d[C];w=S_(_,w,N)}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}}}}}},lte=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:f=!0}=vs(e,t),h={x:n,y:r},d=ho(i),g=Bk(d);let v=h[g],b=h[d];const w=vs(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const _=g==="y"?"height":"width",N=a.reference[g]-a.floating[_]+S.mainAxis,O=a.reference[g]+a.reference[_]-S.mainAxis;v<N?v=N:v>O&&(v=O)}if(f){var j,C;const _=g==="y"?"width":"height",N=QB.has(ys(i)),O=a.reference[d]-a.floating[_]+(N&&((j=o.offset)==null?void 0:j[d])||0)+(N?0:S.crossAxis),A=a.reference[d]+a.reference[_]+(N?0:((C=o.offset)==null?void 0:C[d])||0)-(N?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[d]:b}}}},ute=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=()=>{},...f}=vs(e,t),h=await o.detectOverflow(t,f),d=ys(i),g=Dd(i),v=ho(i)==="y",{width:b,height:w}=a.floating;let S,j;d==="top"||d==="bottom"?(S=d,j=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=d,S=g==="end"?"top":"bottom");const C=w-h.top-h.bottom,_=b-h.left-h.right,N=Fl(w-h[S],C),O=Fl(b-h[j],_),A=!t.middlewareData.shift;let T=N,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 I=Ti(h.left,0),F=Ti(h.right,0),$=Ti(h.top,0),G=Ti(h.bottom,0);v?P=b-2*(I!==0||F!==0?I+F:Ti(h.left,h.right)):T=w-2*($!==0||G!==0?$+G:Ti(h.top,h.bottom))}await c({...t,availableWidth:P,availableHeight:T});const L=await o.getDimensions(l.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function v0(){return typeof window<"u"}function Rd(e){return ZB(e)?(e.nodeName||"").toLowerCase():"#document"}function Ri(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(ZB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZB(e){return v0()?e instanceof Node||e instanceof Ri(e).Node:!1}function $a(e){return v0()?e instanceof Element||e instanceof Ri(e).Element:!1}function _s(e){return v0()?e instanceof HTMLElement||e instanceof Ri(e).HTMLElement:!1}function QD(e){return!v0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ri(e).ShadowRoot}function wp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function cte(e){return/^(table|td|th)$/.test(Rd(e))}function y0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fte=/transform|translate|scale|rotate|perspective|filter/,dte=/paint|layout|strict|content/,ju=e=>!!e&&e!=="none";let PS;function Hk(e){const t=$a(e)?Ba(e):e;return ju(t.transform)||ju(t.translate)||ju(t.scale)||ju(t.rotate)||ju(t.perspective)||!qk()&&(ju(t.backdropFilter)||ju(t.filter))||fte.test(t.willChange||"")||dte.test(t.contain||"")}function hte(e){let t=Ul(e);for(;_s(t)&&!sd(t);){if(Hk(t))return t;if(y0(t))return null;t=Ul(t)}return null}function qk(){return PS==null&&(PS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),PS}function sd(e){return/^(html|body|#document)$/.test(Rd(e))}function Ba(e){return Ri(e).getComputedStyle(e)}function x0(e){return $a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ul(e){if(Rd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||QD(e)&&e.host||Co(e);return QD(t)?t.host:t}function JB(e){const t=Ul(e);return sd(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&wp(t)?t:JB(t)}function Pm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=JB(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Ri(i);if(a){const l=E_(o);return t.concat(o,o.visualViewport||[],wp(i)?i:[],l&&n?Pm(l):[])}else return t.concat(i,Pm(i,[],n))}function E_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function e6(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=_s(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=By(n)!==a||By(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Vk(e){return $a(e)?e:e.contextElement}function Bf(e){const t=Vk(e);if(!_s(t))return vo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=e6(t);let o=(a?By(n.width):n.width)/r,l=(a?By(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const mte=vo(0);function t6(e){const t=Ri(e);return!qk()||!t.visualViewport?mte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pte(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ri(e)?!1:t}function ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Vk(e);let o=vo(1);t&&(r?$a(r)&&(o=Bf(r)):o=Bf(e));const l=pte(a,n,r)?t6(a):vo(0);let c=(i.left+l.x)/o.x,f=(i.top+l.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(a){const g=Ri(a),v=r&&$a(r)?Ri(r):r;let b=g,w=E_(b);for(;w&&r&&v!==b;){const S=Bf(w),j=w.getBoundingClientRect(),C=Ba(w),_=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,N=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,f*=S.y,h*=S.x,d*=S.y,c+=_,f+=N,b=Ri(w),w=E_(b)}}return Uy({width:h,height:d,x:c,y:f})}function b0(e,t){const n=x0(e).scrollLeft;return t?t.left+n:ic(Co(e)).left+n}function n6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-b0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function gte(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Co(r),l=t?y0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},f=vo(1);const h=vo(0),d=_s(r);if((d||!d&&!a)&&((Rd(r)!=="body"||wp(o))&&(c=x0(r)),d)){const v=ic(r);f=Bf(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const g=o&&!d&&!a?n6(o,c):vo(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-c.scrollTop*f.y+h.y+g.y}}function vte(e){return Array.from(e.getClientRects())}function yte(e){const t=Co(e),n=x0(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+b0(e);const l=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=Ti(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const ZD=25;function xte(e,t){const n=Ri(e),r=Co(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const h=qk();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const f=b0(r);if(f<=0){const h=r.ownerDocument,d=h.body,g=getComputedStyle(d),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-v);b<=ZD&&(a-=b)}else f<=ZD&&(a+=f);return{width:a,height:o,x:l,y:c}}function bte(e,t){const n=ic(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_s(e)?Bf(e):vo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,f=r*a.y;return{width:o,height:l,x:c,y:f}}function JD(e,t,n){let r;if(t==="viewport")r=xte(e,n);else if(t==="document")r=yte(Co(e));else if($a(t))r=bte(t,n);else{const i=t6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Uy(r)}function r6(e,t){const n=Ul(e);return n===t||!$a(n)||sd(n)?!1:Ba(n).position==="fixed"||r6(n,t)}function wte(e,t){const n=t.get(e);if(n)return n;let r=Pm(e,[],!1).filter(l=>$a(l)&&Rd(l)!=="body"),i=null;const a=Ba(e).position==="fixed";let o=a?Ul(e):e;for(;$a(o)&&!sd(o);){const l=Ba(o),c=Hk(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||wp(o)&&!c&&r6(e,o))?r=r.filter(h=>h!==o):i=l,o=Ul(o)}return t.set(e,r),r}function Ste(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?y0(t)?[]:wte(t,this._c):[].concat(n),r],l=JD(t,o[0],i);let c=l.top,f=l.right,h=l.bottom,d=l.left;for(let g=1;g<o.length;g++){const v=JD(t,o[g],i);c=Ti(v.top,c),f=Fl(v.right,f),h=Fl(v.bottom,h),d=Ti(v.left,d)}return{width:f-d,height:h-c,x:d,y:c}}function jte(e){const{width:t,height:n}=e6(e);return{width:t,height:n}}function Ete(e,t,n){const r=_s(t),i=Co(t),a=n==="fixed",o=ic(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=vo(0);function f(){c.x=b0(i)}if(r||!r&&!a)if((Rd(t)!=="body"||wp(i))&&(l=x0(t)),r){const v=ic(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else i&&f();a&&!r&&i&&f();const h=i&&!r&&!a?n6(i,l):vo(0),d=o.left+l.scrollLeft-c.x-h.x,g=o.top+l.scrollTop-c.y-h.y;return{x:d,y:g,width:o.width,height:o.height}}function MS(e){return Ba(e).position==="static"}function eR(e,t){if(!_s(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Co(e)===n&&(n=n.ownerDocument.body),n}function i6(e,t){const n=Ri(e);if(y0(e))return n;if(!_s(e)){let i=Ul(e);for(;i&&!sd(i);){if($a(i)&&!MS(i))return i;i=Ul(i)}return n}let r=eR(e,t);for(;r&&cte(r)&&MS(r);)r=eR(r,t);return r&&sd(r)&&MS(r)&&!Hk(r)?n:r||hte(e)||n}const _te=async function(e){const t=this.getOffsetParent||i6,n=this.getDimensions,r=await n(e.floating);return{reference:Ete(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cte(e){return Ba(e).direction==="rtl"}const kte={convertOffsetParentRelativeRectToViewportRelativeRect:gte,getDocumentElement:Co,getClippingRect:Ste,getOffsetParent:i6,getElementRects:_te,getClientRects:vte,getDimensions:jte,getScale:Bf,isElement:$a,isRTL:Cte};function a6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nte(e,t){let n=null,r;const i=Co(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 f=e.getBoundingClientRect(),{left:h,top:d,width:g,height:v}=f;if(l||t(),!g||!v)return;const b=zv(d),w=zv(i.clientWidth-(h+g)),S=zv(i.clientHeight-(d+v)),j=zv(h),_={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ti(0,Fl(1,c))||1};let N=!0;function O(A){const T=A[0].intersectionRatio;if(T!==c){if(!N)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!a6(f,e.getBoundingClientRect())&&o(),N=!1}try{n=new IntersectionObserver(O,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return o(!0),a}function Ate(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,f=Vk(e),h=i||a?[...f?Pm(f):[],...t?Pm(t):[]]:[];h.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),a&&j.addEventListener("resize",n)});const d=f&&l?Nte(f,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(j=>{let[C]=j;C&&C.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),f&&!c&&v.observe(f),t&&v.observe(t));let b,w=c?ic(e):null;c&&S();function S(){const j=ic(e);w&&!a6(w,j)&&n(),w=j,b=requestAnimationFrame(S)}return n(),()=>{var j;h.forEach(C=>{i&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),d==null||d(),(j=v)==null||j.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const Ote=ote,Tte=ste,Pte=rte,Mte=ute,Dte=ite,tR=nte,Rte=lte,Ite=(e,t,n)=>{const r=new Map,i={platform:kte,...n},a={...i.platform,_c:r};return tte(e,t,{...i,platform:a})};var Lte=typeof document<"u",zte=function(){},Sy=Lte?y.useLayoutEffect:zte;function Hy(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(!Hy(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)&&!Hy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function o6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nR(e,t){const n=o6(e);return Math.round(t*n)/n}function DS(e){const t=y.useRef(e);return Sy(()=>{t.current=e}),t}function $te(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:f}=e,[h,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=y.useState(r);Hy(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(X=>{X!==A.current&&(A.current=X,w(X))},[]),_=y.useCallback(X=>{X!==T.current&&(T.current=X,j(X))},[]),N=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),P=y.useRef(h),L=c!=null,I=DS(c),F=DS(i),$=DS(f),G=y.useCallback(()=>{if(!A.current||!T.current)return;const X={placement:t,strategy:n,middleware:g};F.current&&(X.platform=F.current),Ite(A.current,T.current,X).then(K=>{const R={...K,isPositioned:$.current!==!1};D.current&&!Hy(P.current,R)&&(P.current=R,Gl.flushSync(()=>{d(R)}))})},[g,t,n,F,$]);Sy(()=>{f===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(X=>({...X,isPositioned:!1})))},[f]);const D=y.useRef(!1);Sy(()=>(D.current=!0,()=>{D.current=!1}),[]),Sy(()=>{if(N&&(A.current=N),O&&(T.current=O),N&&O){if(I.current)return I.current(N,O,G);G()}},[N,O,G,I,L]);const V=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:_}),[C,_]),z=y.useMemo(()=>({reference:N,floating:O}),[N,O]),q=y.useMemo(()=>{const X={position:n,left:0,top:0};if(!z.floating)return X;const K=nR(z.floating,h.x),R=nR(z.floating,h.y);return l?{...X,transform:"translate("+K+"px, "+R+"px)",...o6(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:R}},[n,l,z.floating,h.x,h.y]);return y.useMemo(()=>({...h,update:G,refs:V,elements:z,floatingStyles:q}),[h,G,V,z,q])}const Bte=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?tR({element:r.current,padding:i}).fn(n):{}:r?tR({element:r,padding:i}).fn(n):{}}}},Fte=(e,t)=>{const n=Ote(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ute=(e,t)=>{const n=Tte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hte=(e,t)=>({fn:Rte(e).fn,options:[e,t]}),qte=(e,t)=>{const n=Pte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vte=(e,t)=>{const n=Mte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kte=(e,t)=>{const n=Dte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yte=(e,t)=>{const n=Bte(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Xte="Arrow",s6=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return m.jsx(Ve.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});s6.displayName=Xte;var Gte=s6,Kk="Popper",[l6,Id]=Va(Kk),[Wte,u6]=l6(Kk),c6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return m.jsx(Wte,{scope:t,anchor:r,onAnchorChange:i,children:n})};c6.displayName=Kk;var f6="PopperAnchor",d6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=u6(f6,n),o=y.useRef(null),l=Ct(t,o),c=y.useRef(null);return y.useEffect(()=>{const f=c.current;c.current=(r==null?void 0:r.current)||o.current,f!==c.current&&a.onAnchorChange(c.current)}),r?null:m.jsx(Ve.div,{...i,ref:l})});d6.displayName=f6;var Yk="PopperContent",[Qte,Zte]=l6(Yk),h6=y.forwardRef((e,t)=>{var ae,re,ee,se,pe,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=u6(Yk,n),[j,C]=y.useState(null),_=Ct(t,we=>C(we)),[N,O]=y.useState(null),A=Hee(N),T=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,L=r+(a!=="center"?"-"+a:""),I=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(f)?f:[f],$=F.length>0,G={padding:I,boundary:F.filter(ene),altBoundary:$},{refs:D,floatingStyles:V,placement:z,isPositioned:q,middlewareData:X}=$te({strategy:"fixed",placement:L,whileElementsMounted:(...we)=>Ate(...we,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[Fte({mainAxis:i+P,alignmentAxis:o}),c&&Ute({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Hte():void 0,...G}),c&&qte({...G}),Vte({...G,apply:({elements:we,rects:Ee,availableWidth:Be,availableHeight:Ne})=>{const{width:it,height:Qe}=Ee.reference,Xe=we.floating.style;Xe.setProperty("--radix-popper-available-width",`${Be}px`),Xe.setProperty("--radix-popper-available-height",`${Ne}px`),Xe.setProperty("--radix-popper-anchor-width",`${it}px`),Xe.setProperty("--radix-popper-anchor-height",`${Qe}px`)}}),N&&Yte({element:N,padding:l}),tne({arrowWidth:T,arrowHeight:P}),g&&Kte({strategy:"referenceHidden",...G})]}),[K,R]=g6(z),H=Or(b);xr(()=>{q&&(H==null||H())},[q,H]);const U=(ae=X.arrow)==null?void 0:ae.x,B=(re=X.arrow)==null?void 0:re.y,Q=((ee=X.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return xr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),m.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=X.transformOrigin)==null?void 0:se.x,(pe=X.transformOrigin)==null?void 0:pe.y].join(" "),...((ie=X.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Qte,{scope:n,placedSide:K,onArrowChange:O,arrowX:U,arrowY:B,shouldHideArrow:Q,children:m.jsx(Ve.div,{"data-side":K,"data-align":R,...w,ref:_,style:{...w.style,animation:q?void 0:"none"}})})})});h6.displayName=Yk;var m6="PopperArrow",Jte={top:"bottom",right:"left",bottom:"top",left:"right"},p6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=Zte(m6,r),o=Jte[a.placedSide];return m.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:m.jsx(Gte,{...i,ref:n,style:{...i.style,display:"block"}})})});p6.displayName=m6;function ene(e){return e!==null}var tne=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,[f,h]=g6(n),d={start:"0%",center:"50%",end:"100%"}[h],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 f==="bottom"?(b=o?d:`${g}px`,w=`${-c}px`):f==="top"?(b=o?d:`${g}px`,w=`${r.floating.height+c}px`):f==="right"?(b=`${-c}px`,w=o?d:`${v}px`):f==="left"&&(b=`${r.floating.width+c}px`,w=o?d:`${v}px`),{data:{x:b,y:w}}}});function g6(e){const[t,n="center"]=e.split("-");return[t,n]}var Xk=c6,Gk=d6,Wk=h6,Qk=p6,RS="rovingFocusGroup.onEntryFocus",nne={bubbles:!1,cancelable:!0},Sp="RovingFocusGroup",[__,v6,rne]=Ck(Sp),[ine,w0]=Va(Sp,[rne]),[ane,one]=ine(Sp),y6=y.forwardRef((e,t)=>m.jsx(__.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(__.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(sne,{...e,ref:t})})}));y6.displayName=Sp;var sne=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...d}=e,g=y.useRef(null),v=Ct(t,g),b=yp(a),[w,S]=Bl({prop:o,defaultProp:l??null,onChange:c,caller:Sp}),[j,C]=y.useState(!1),_=Or(f),N=v6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(RS,_),()=>P.removeEventListener(RS,_)},[_]),m.jsx(ane,{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:m.jsx(Ve.div,{tabIndex:j||A===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{O.current=!0}),onFocus:Ae(e.onFocus,P=>{const L=!O.current;if(P.target===P.currentTarget&&L&&!j){const I=new CustomEvent(RS,nne);if(P.currentTarget.dispatchEvent(I),!I.defaultPrevented){const F=N().filter(z=>z.focusable),$=F.find(z=>z.active),G=F.find(z=>z.id===w),V=[$,G,...F].filter(Boolean).map(z=>z.ref.current);w6(V,h)}}O.current=!1}),onBlur:Ae(e.onBlur,()=>C(!1))})})}),x6="RovingFocusGroupItem",b6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=yr(),f=a||c,h=one(x6,n),d=h.currentTabStopId===f,g=v6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=h;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),m.jsx(__.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:m.jsx(Ve.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:Ae(e.onMouseDown,S=>{r?h.onItemFocus(f):S.preventDefault()}),onFocus:Ae(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ae(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=cne(S,h.orientation,h.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let _=g().filter(N=>N.focusable).map(N=>N.ref.current);if(j==="last")_.reverse();else if(j==="prev"||j==="next"){j==="prev"&&_.reverse();const N=_.indexOf(S.currentTarget);_=h.loop?fne(_,N+1):_.slice(N+1)}setTimeout(()=>w6(_))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:w!=null}):o})})});b6.displayName=x6;var lne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function une(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cne(e,t,n){const r=une(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lne[r]}function w6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S6=y6,j6=b6,C_=["Enter"," "],dne=["ArrowDown","PageUp","Home"],E6=["ArrowUp","PageDown","End"],hne=[...dne,...E6],mne={ltr:[...C_,"ArrowRight"],rtl:[...C_,"ArrowLeft"]},pne={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jp="Menu",[Mm,gne,vne]=Ck(jp),[Cc,_6]=Va(jp,[vne,Id,w0]),S0=Id(),C6=w0(),[yne,kc]=Cc(jp),[xne,Ep]=Cc(jp),k6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=S0(t),[c,f]=y.useState(null),h=y.useRef(!1),d=Or(a),g=yp(i);return y.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.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})}},[]),m.jsx(Xk,{...l,children:m.jsx(yne,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:f,children:m.jsx(xne,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:g,modal:o,children:r})})})};k6.displayName=jp;var bne="MenuAnchor",Zk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return m.jsx(Gk,{...i,...r,ref:t})});Zk.displayName=bne;var Jk="MenuPortal",[wne,N6]=Cc(Jk,{forceMount:void 0}),A6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=kc(Jk,t);return m.jsx(wne,{scope:t,forceMount:n,children:m.jsx(qr,{present:n||a.open,children:m.jsx(bp,{asChild:!0,container:i,children:r})})})};A6.displayName=Jk;var ua="MenuContent",[Sne,eN]=Cc(ua),O6=y.forwardRef((e,t)=>{const n=N6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=Ep(ua,e.__scopeMenu);return m.jsx(Mm.Provider,{scope:e.__scopeMenu,children:m.jsx(qr,{present:r||a.open,children:m.jsx(Mm.Slot,{scope:e.__scopeMenu,children:o.modal?m.jsx(jne,{...i,ref:t}):m.jsx(Ene,{...i,ref:t})})})})}),jne=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu),r=y.useRef(null),i=Ct(t,r);return y.useEffect(()=>{const a=r.current;if(a)return Tk(a)},[]),m.jsx(tN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ene=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu);return m.jsx(tN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_ne=nc("MenuContent.ScrollLock"),tN=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,S=kc(ua,n),j=Ep(ua,n),C=S0(n),_=C6(n),N=gne(n),[O,A]=y.useState(null),T=y.useRef(null),P=Ct(t,T,S.onContentChange),L=y.useRef(0),I=y.useRef(""),F=y.useRef(0),$=y.useRef(null),G=y.useRef("right"),D=y.useRef(0),V=b?p0:y.Fragment,z=b?{as:_ne,allowPinchZoom:!0}:void 0,q=K=>{var ae,re;const R=I.current+K,H=N().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=Lne(Q,R,B),te=(re=H.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){I.current=se,window.clearTimeout(L.current),se!==""&&(L.current=window.setTimeout(()=>ee(""),1e3))})(R),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(L.current),[]),Ok();const X=y.useCallback(K=>{var H,U;return G.current===((H=$.current)==null?void 0:H.side)&&$ne(K,(U=$.current)==null?void 0:U.area)},[]);return m.jsx(Sne,{scope:n,searchRef:I,onItemEnter:y.useCallback(K=>{X(K)&&K.preventDefault()},[X]),onItemLeave:y.useCallback(K=>{var R;X(K)||((R=T.current)==null||R.focus(),A(null))},[X]),onTriggerLeave:y.useCallback(K=>{X(K)&&K.preventDefault()},[X]),pointerGraceTimerRef:F,onPointerGraceIntentChange:y.useCallback(K=>{$.current=K},[]),children:m.jsx(V,{...z,children:m.jsx(h0,{asChild:!0,trapped:i,onMountAutoFocus:Ae(a,K=>{var R;K.preventDefault(),(R=T.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:m.jsx(xp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,onDismiss:v,children:m.jsx(S6,{asChild:!0,..._,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Ae(c,K=>{j.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Wk,{role:"menu","aria-orientation":"vertical","data-state":K6(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:P,style:{outline:"none",...w.style},onKeyDown:Ae(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&&q(K.key));const Q=T.current;if(K.target!==Q||!hne.includes(K.key))return;K.preventDefault();const te=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);E6.includes(K.key)&&te.reverse(),Rne(te)}),onBlur:Ae(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(L.current),I.current="")}),onPointerMove:Ae(e.onPointerMove,Dm(K=>{const R=K.target,H=D.current!==K.clientX;if(K.currentTarget.contains(R)&&H){const U=K.clientX>D.current?"right":"left";G.current=U,D.current=K.clientX}}))})})})})})})});O6.displayName=ua;var Cne="MenuGroup",nN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Ve.div,{role:"group",...r,ref:t})});nN.displayName=Cne;var kne="MenuLabel",T6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Ve.div,{...r,ref:t})});T6.displayName=kne;var qy="MenuItem",rR="menu.itemSelect",j0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=Ep(qy,e.__scopeMenu),l=eN(qy,e.__scopeMenu),c=Ct(t,a),f=y.useRef(!1),h=()=>{const d=a.current;if(!n&&d){const g=new CustomEvent(rR,{bubbles:!0,cancelable:!0});d.addEventListener(rR,v=>r==null?void 0:r(v),{once:!0}),pB(d,g),g.defaultPrevented?f.current=!1:o.onClose()}};return m.jsx(P6,{...i,ref:c,disabled:n,onClick:Ae(e.onClick,h),onPointerDown:d=>{var g;(g=e.onPointerDown)==null||g.call(e,d),f.current=!0},onPointerUp:Ae(e.onPointerUp,d=>{var g;f.current||(g=d.currentTarget)==null||g.click()}),onKeyDown:Ae(e.onKeyDown,d=>{const g=l.searchRef.current!=="";n||g&&d.key===" "||C_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});j0.displayName=qy;var P6=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=eN(qy,n),l=C6(n),c=y.useRef(null),f=Ct(t,c),[h,d]=y.useState(!1),[g,v]=y.useState("");return y.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),m.jsx(Mm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:m.jsx(j6,{asChild:!0,...l,focusable:!r,children:m.jsx(Ve.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:Ae(e.onPointerMove,Dm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,Dm(b=>o.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>d(!0)),onBlur:Ae(e.onBlur,()=>d(!1))})})})}),Nne="MenuCheckboxItem",M6=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.jsx(z6,{scope:e.__scopeMenu,checked:n,children:m.jsx(j0,{role:"menuitemcheckbox","aria-checked":Vy(n)?"mixed":n,...i,ref:t,"data-state":iN(n),onSelect:Ae(i.onSelect,()=>r==null?void 0:r(Vy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});M6.displayName=Nne;var D6="MenuRadioGroup",[Ane,One]=Cc(D6,{value:void 0,onValueChange:()=>{}}),R6=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Or(r);return m.jsx(Ane,{scope:e.__scopeMenu,value:n,onValueChange:a,children:m.jsx(nN,{...i,ref:t})})});R6.displayName=D6;var I6="MenuRadioItem",L6=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=One(I6,e.__scopeMenu),a=n===i.value;return m.jsx(z6,{scope:e.__scopeMenu,checked:a,children:m.jsx(j0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":iN(a),onSelect:Ae(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});L6.displayName=I6;var rN="MenuItemIndicator",[z6,Tne]=Cc(rN,{checked:!1}),$6=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=Tne(rN,n);return m.jsx(qr,{present:r||Vy(a.checked)||a.checked===!0,children:m.jsx(Ve.span,{...i,ref:t,"data-state":iN(a.checked)})})});$6.displayName=rN;var Pne="MenuSeparator",B6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});B6.displayName=Pne;var Mne="MenuArrow",F6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return m.jsx(Qk,{...i,...r,ref:t})});F6.displayName=Mne;var Dne="MenuSub",[k5e,U6]=Cc(Dne),pm="MenuSubTrigger",H6=y.forwardRef((e,t)=>{const n=kc(pm,e.__scopeMenu),r=Ep(pm,e.__scopeMenu),i=U6(pm,e.__scopeMenu),a=eN(pm,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,f={__scopeMenu:e.__scopeMenu},h=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>h,[h]),y.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),m.jsx(Zk,{asChild:!0,...f,children:m.jsx(P6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":K6(n.open),...e,ref:gs(t,i.onTriggerChange),onClick:d=>{var g;(g=e.onClick)==null||g.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,Dm(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ae(e.onPointerLeave,Dm(d=>{var v,b;h();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:d.clientX+j,y:d.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(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,d=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&d.key===" "||mne[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});H6.displayName=pm;var q6="MenuSubContent",V6=y.forwardRef((e,t)=>{const n=N6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=Ep(ua,e.__scopeMenu),l=U6(q6,e.__scopeMenu),c=y.useRef(null),f=Ct(t,c);return m.jsx(Mm.Provider,{scope:e.__scopeMenu,children:m.jsx(qr,{present:r||a.open,children:m.jsx(Mm.Slot,{scope:e.__scopeMenu,children:m.jsx(tN,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,h=>{h.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{var v;const d=h.currentTarget.contains(h.target),g=pne[o.dir].includes(h.key);d&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),h.preventDefault())})})})})})});V6.displayName=q6;function K6(e){return e?"open":"closed"}function Vy(e){return e==="indeterminate"}function iN(e){return Vy(e)?"indeterminate":e?"checked":"unchecked"}function Rne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ine(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Lne(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Ine(e,Math.max(a,0));i.length===1&&(o=o.filter(f=>f!==n));const c=o.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function zne(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],f=l.x,h=l.y,d=c.x,g=c.y;h>r!=g>r&&n<(d-f)*(r-h)/(g-h)+f&&(i=!i)}return i}function $ne(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zne(n,t)}function Dm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Bne=k6,Fne=Zk,Une=A6,Hne=O6,qne=nN,Vne=T6,Kne=j0,Yne=M6,Xne=R6,Gne=L6,Wne=$6,Qne=B6,Zne=F6,Jne=H6,ere=V6,E0="DropdownMenu",[tre]=Va(E0,[_6]),ii=_6(),[nre,Y6]=tre(E0),X6=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ii(t),f=y.useRef(null),[h,d]=Bl({prop:i,defaultProp:a??!1,onChange:o,caller:E0});return m.jsx(nre,{scope:t,triggerId:yr(),triggerRef:f,contentId:yr(),open:h,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(g=>!g),[d]),modal:l,children:m.jsx(Bne,{...c,open:h,onOpenChange:d,dir:r,modal:l,children:n})})};X6.displayName=E0;var G6="DropdownMenuTrigger",W6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Y6(G6,n),o=ii(n);return m.jsx(Fne,{asChild:!0,...o,children:m.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:Ae(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ae(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});W6.displayName=G6;var rre="DropdownMenuPortal",Q6=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ii(t);return m.jsx(Une,{...r,...n})};Q6.displayName=rre;var Z6="DropdownMenuContent",J6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Y6(Z6,n),a=ii(n),o=y.useRef(!1);return m.jsx(Hne,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,h=c.button===2||f;(!i.modal||h)&&(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)"}})});J6.displayName=Z6;var ire="DropdownMenuGroup",are=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(qne,{...i,...r,ref:t})});are.displayName=ire;var ore="DropdownMenuLabel",sre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Vne,{...i,...r,ref:t})});sre.displayName=ore;var lre="DropdownMenuItem",e8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Kne,{...i,...r,ref:t})});e8.displayName=lre;var ure="DropdownMenuCheckboxItem",t8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Yne,{...i,...r,ref:t})});t8.displayName=ure;var cre="DropdownMenuRadioGroup",fre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Xne,{...i,...r,ref:t})});fre.displayName=cre;var dre="DropdownMenuRadioItem",hre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Gne,{...i,...r,ref:t})});hre.displayName=dre;var mre="DropdownMenuItemIndicator",n8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Wne,{...i,...r,ref:t})});n8.displayName=mre;var pre="DropdownMenuSeparator",gre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Qne,{...i,...r,ref:t})});gre.displayName=pre;var vre="DropdownMenuArrow",yre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Zne,{...i,...r,ref:t})});yre.displayName=vre;var xre="DropdownMenuSubTrigger",bre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(Jne,{...i,...r,ref:t})});bre.displayName=xre;var wre="DropdownMenuSubContent",Sre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return m.jsx(ere,{...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)"}})});Sre.displayName=wre;var jre=X6,Ere=W6,_re=Q6,Cre=J6,kre=e8,Nre=t8,Are=n8,Ore="Label",r8=y.forwardRef((e,t)=>m.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())}}));r8.displayName=Ore;var Tre=r8;function k_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Pre(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var aN="ScrollArea",[i8]=Va(aN),[Mre,ba]=i8(aN),a8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=y.useState(null),[f,h]=y.useState(null),[d,g]=y.useState(null),[v,b]=y.useState(null),[w,S]=y.useState(null),[j,C]=y.useState(0),[_,N]=y.useState(0),[O,A]=y.useState(!1),[T,P]=y.useState(!1),L=Ct(t,F=>c(F)),I=yp(i);return m.jsx(Mre,{scope:n,type:r,dir:I,scrollHideDelay:a,scrollArea:l,viewport:f,onViewportChange:h,content:d,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:C,onCornerHeightChange:N,children:m.jsx(Ve.div,{dir:I,...o,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});a8.displayName=aN;var o8="ScrollAreaViewport",s8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=ba(o8,n),l=y.useRef(null),c=Ct(t,l,o.onViewportChange);return m.jsxs(m.Fragment,{children:[m.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}),m.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:m.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});s8.displayName=o8;var ko="ScrollAreaScrollbar",l8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ba(ko,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"?m.jsx(Dre,{...r,ref:t,forceMount:n}):i.type==="scroll"?m.jsx(Rre,{...r,ref:t,forceMount:n}):i.type==="auto"?m.jsx(u8,{...r,ref:t,forceMount:n}):i.type==="always"?m.jsx(oN,{...r,ref:t}):null});l8.displayName=ko;var Dre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ba(ko,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const f=()=>{window.clearTimeout(c),o(!0)},h=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),m.jsx(qr,{present:n||a,children:m.jsx(u8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),Rre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ba(ko,e.__scopeScrollArea),a=e.orientation==="horizontal",o=C0(()=>c("SCROLL_END"),100),[l,c]=Pre("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 f=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,c]),y.useEffect(()=>{const f=i.viewport,h=a?"scrollLeft":"scrollTop";if(f){let d=f[h];const g=()=>{const v=f[h];d!==v&&(c("SCROLL"),o()),d=v};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,a,c,o]),m.jsx(qr,{present:n||l!=="hidden",children:m.jsx(oN,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),u8=y.forwardRef((e,t)=>{const n=ba(ko,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=C0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?f:h)}},10);return ld(n.viewport,c),ld(n.content,c),m.jsx(qr,{present:r||a,children:m.jsx(oN,{"data-state":a?"visible":"hidden",...i,ref:t})})}),oN=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ba(ko,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}}),f=m8(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:f>0&&f<1,onThumbChange:g=>a.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function d(g,v){return Fre(g,o.current,l,v)}return n==="horizontal"?m.jsx(Ire,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=iR(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=d(g,i.dir))}}):n==="vertical"?m.jsx(Lre,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=iR(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=d(g))}}):null}),Ire=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ba(ko,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),f=Ct(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),m.jsx(f8,{"data-orientation":"horizontal",...i,ref:f,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":_0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(a.viewport){const g=a.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),g8(g,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Yy(o.paddingLeft),paddingEnd:Yy(o.paddingRight)}})}})}),Lre=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ba(ko,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),f=Ct(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),m.jsx(f8,{"data-orientation":"vertical",...i,ref:f,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":_0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(a.viewport){const g=a.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),g8(g,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Yy(o.paddingTop),paddingEnd:Yy(o.paddingBottom)}})}})}),[zre,c8]=i8(ko),f8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:f,onWheelScroll:h,onResize:d,...g}=e,v=ba(ko,n),[b,w]=y.useState(null),S=Ct(t,L=>w(L)),j=y.useRef(null),C=y.useRef(""),_=v.viewport,N=r.content-r.viewport,O=Or(h),A=Or(c),T=C0(d,10);function P(L){if(j.current){const I=L.clientX-j.current.left,F=L.clientY-j.current.top;f({x:I,y:F})}}return y.useEffect(()=>{const L=I=>{const F=I.target;(b==null?void 0:b.contains(F))&&O(I,N)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[_,b,N,O]),y.useEffect(A,[r,A]),ld(b,T),ld(v.content,T),m.jsx(zre,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Or(a),onThumbPointerUp:Or(o),onThumbPositionChange:A,onThumbPointerDown:Or(l),children:m.jsx(Ve.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Ae(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(L))}),onPointerMove:Ae(e.onPointerMove,P),onPointerUp:Ae(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),Ky="ScrollAreaThumb",d8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=c8(Ky,e.__scopeScrollArea);return m.jsx(qr,{present:n||i.hasThumb,children:m.jsx($re,{ref:t,...r})})}),$re=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=ba(Ky,n),o=c8(Ky,n),{onThumbPositionChange:l}=o,c=Ct(t,d=>o.onThumbChange(d)),f=y.useRef(void 0),h=C0(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(h(),!f.current){const v=Ure(d,l);f.current=v,l()}};return l(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,h,l]),m.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:Ae(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),b=d.clientX-v.left,w=d.clientY-v.top;o.onThumbPointerDown({x:b,y:w})}),onPointerUp:Ae(e.onPointerUp,o.onThumbPointerUp)})});d8.displayName=Ky;var sN="ScrollAreaCorner",h8=y.forwardRef((e,t)=>{const n=ba(sN,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(Bre,{...e,ref:t}):null});h8.displayName=sN;var Bre=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ba(sN,n),[a,o]=y.useState(0),[l,c]=y.useState(0),f=!!(a&&l);return ld(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),c(h)}),ld(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),o(h)}),f?m.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 Yy(e){return e?parseInt(e,10):0}function m8(e,t){const n=e/t;return isNaN(n)?0:n}function _0(e){const t=m8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Fre(e,t,n,r="ltr"){const i=_0(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return p8([c,f],d)(e)}function iR(e,t,n="ltr"){const r=_0(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],f=k_(e,c);return p8([0,o],[0,l])(f)}function p8(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 g8(e,t){return e>0&&e<t}var Ure=(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 C0(e,t){const n=Or(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 ld(e,t){const n=Or(t);xr(()=>{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 Hre=a8,qre=s8,Vre=h8,Kre=[" ","Enter","ArrowUp","ArrowDown"],Yre=[" ","Enter"],ac="Select",[k0,N0,Xre]=Ck(ac),[Ld]=Va(ac,[Xre,Id]),A0=Id(),[Gre,Wl]=Ld(ac),[Wre,Qre]=Ld(ac),v8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:f,name:h,autoComplete:d,disabled:g,required:v,form:b}=e,w=A0(t),[S,j]=y.useState(null),[C,_]=y.useState(null),[N,O]=y.useState(!1),A=yp(f),[T,P]=Bl({prop:r,defaultProp:i??!1,onChange:a,caller:ac}),[L,I]=Bl({prop:o,defaultProp:l,onChange:c,caller:ac}),F=y.useRef(null),$=S?b||!!S.closest("form"):!0,[G,D]=y.useState(new Set),V=Array.from(G).map(z=>z.props.value).join(";");return m.jsx(Xk,{...w,children:m.jsxs(Gre,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:_,valueNodeHasChildren:N,onValueNodeHasChildrenChange:O,contentId:yr(),value:L,onValueChange:I,open:T,onOpenChange:P,dir:A,triggerPointerDownPosRef:F,disabled:g,children:[m.jsx(k0.Provider,{scope:t,children:m.jsx(Wre,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(z=>{D(q=>new Set(q).add(z))},[]),onNativeOptionRemove:y.useCallback(z=>{D(q=>{const X=new Set(q);return X.delete(z),X})},[]),children:n})}),$?m.jsxs($8,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:d,value:L,onChange:z=>I(z.target.value),disabled:g,form:b,children:[L===void 0?m.jsx("option",{value:""}):null,Array.from(G)]},V):null]})})};v8.displayName=ac;var y8="SelectTrigger",x8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=A0(n),o=Wl(y8,n),l=o.disabled||r,c=Ct(t,o.onTriggerChange),f=N0(n),h=y.useRef("touch"),[d,g,v]=F8(w=>{const S=f().filter(_=>!_.disabled),j=S.find(_=>_.value===o.value),C=U8(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 m.jsx(Gk,{asChild:!0,...a,children:m.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":B8(o.value)?"":void 0,...i,ref:c,onClick:Ae(i.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&b(w)}),onPointerDown:Ae(i.onPointerDown,w=>{h.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:Ae(i.onKeyDown,w=>{const S=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&Kre.includes(w.key)&&(b(),w.preventDefault())})})})});x8.displayName=y8;var b8="SelectValue",w8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Wl(b8,n),{onValueNodeHasChildrenChange:f}=c,h=a!==void 0,d=Ct(t,c.onValueNodeChange);return xr(()=>{f(h)},[f,h]),m.jsx(Ve.span,{...l,ref:d,style:{pointerEvents:"none"},children:B8(c.value)?m.jsx(m.Fragment,{children:o}):a})});w8.displayName=b8;var Zre="SelectIcon",S8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.jsx(Ve.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});S8.displayName=Zre;var Jre="SelectPortal",j8=e=>m.jsx(bp,{asChild:!0,...e});j8.displayName=Jre;var oc="SelectContent",E8=y.forwardRef((e,t)=>{const n=Wl(oc,e.__scopeSelect),[r,i]=y.useState();if(xr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Gl.createPortal(m.jsx(_8,{scope:e.__scopeSelect,children:m.jsx(k0.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),a):null}return m.jsx(C8,{...e,ref:t})});E8.displayName=oc;var Na=10,[_8,Ql]=Ld(oc),eie="SelectContentImpl",tie=nc("SelectContent.RemoveScroll"),C8=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...j}=e,C=Wl(oc,n),[_,N]=y.useState(null),[O,A]=y.useState(null),T=Ct(t,ae=>N(ae)),[P,L]=y.useState(null),[I,F]=y.useState(null),$=N0(n),[G,D]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(_)return Tk(_)},[_]),Ok();const z=y.useCallback(ae=>{const[re,...ee]=$().map(ie=>ie.ref.current),[se]=ee.slice(-1),pe=document.activeElement;for(const ie of ae)if(ie===pe||(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!==pe))return},[$,O]),q=y.useCallback(()=>z([P,_]),[z,P,_]);y.useEffect(()=>{G&&q()},[G,q]);const{onOpenChange:X,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(_){let ae={x:0,y:0};const re=se=>{var pe,ie;ae={x:Math.abs(Math.round(se.pageX)-(((pe=K.current)==null?void 0:pe.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)||X(!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})}}},[_,X,K]),y.useEffect(()=>{const ae=()=>X(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[X]);const[R,H]=F8(ae=>{const re=$().filter(pe=>!pe.disabled),ee=re.find(pe=>pe.ref.current===document.activeElement),se=U8(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),U=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&(L(ae),se&&(V.current=!0))},[C.value]),B=y.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&F(ae)},[C.value]),Z=r==="popper"?N_:k8,te=Z===N_?{side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return m.jsx(_8,{scope:n,content:_,viewport:O,onViewportChange:A,itemRefCallback:U,selectedItem:P,onItemLeave:B,itemTextRefCallback:Q,focusSelectedItem:q,selectedItemText:I,position:r,isPositioned:G,searchRef:R,children:m.jsx(p0,{as:tie,allowPinchZoom:!0,children:m.jsx(h0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ae(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:m.jsx(xp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:m.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...j,...te,onPlaced:()=>D(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(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=$().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const pe=ae.target,ie=se.indexOf(pe);se=se.slice(ie+1)}setTimeout(()=>z(se)),ae.preventDefault()}})})})})})})});C8.displayName=eie;var nie="SelectItemAlignedPosition",k8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Wl(oc,n),o=Ql(oc,n),[l,c]=y.useState(null),[f,h]=y.useState(null),d=Ct(t,T=>h(T)),g=N0(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&&f&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),P=f.getBoundingClientRect(),L=a.valueNode.getBoundingClientRect(),I=j.getBoundingClientRect();if(a.dir!=="rtl"){const pe=I.left-P.left,ie=L.left-pe,we=T.left-ie,Ee=T.width+we,Be=Math.max(Ee,P.width),Ne=window.innerWidth-Na,it=k_(ie,[Na,Math.max(Na,Ne-Be)]);l.style.minWidth=Ee+"px",l.style.left=it+"px"}else{const pe=P.right-I.right,ie=window.innerWidth-L.right-pe,we=window.innerWidth-T.right-ie,Ee=T.width+we,Be=Math.max(Ee,P.width),Ne=window.innerWidth-Na,it=k_(ie,[Na,Math.max(Na,Ne-Be)]);l.style.minWidth=Ee+"px",l.style.right=it+"px"}const F=g(),$=window.innerHeight-Na*2,G=w.scrollHeight,D=window.getComputedStyle(f),V=parseInt(D.borderTopWidth,10),z=parseInt(D.paddingTop,10),q=parseInt(D.borderBottomWidth,10),X=parseInt(D.paddingBottom,10),K=V+z+G+X+q,R=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-Na,Z=$-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=V+z+ae,ee=K-re;if(re<=Q){const pe=F.length>0&&S===F[F.length-1].ref.current;l.style.bottom="0px";const ie=f.clientHeight-w.offsetTop-w.offsetHeight,we=Math.max(Z,te+(pe?B:0)+ie+q),Ee=re+we;l.style.height=Ee+"px"}else{const pe=F.length>0&&S===F[0].ref.current;l.style.top="0px";const we=Math.max(Q,V+w.offsetTop+(pe?U:0)+te)+ee;l.style.height=we+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Na}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,f,w,S,j,a.dir,r]);xr(()=>_(),[_]);const[N,O]=y.useState();xr(()=>{f&&O(window.getComputedStyle(f).zIndex)},[f]);const A=y.useCallback(T=>{T&&b.current===!0&&(_(),C==null||C(),b.current=!1)},[_,C]);return m.jsx(iie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:m.jsx(Ve.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});k8.displayName=nie;var rie="SelectPopperPosition",N_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Na,...a}=e,o=A0(n);return m.jsx(Wk,{...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)"}})});N_.displayName=rie;var[iie,lN]=Ld(oc,{}),A_="SelectViewport",N8=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Ql(A_,n),o=lN(A_,n),l=Ct(t,a.onViewportChange),c=y.useRef(0);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(k0.Slot,{scope:n,children:m.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ae(i.onScroll,f=>{const h=f.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&d){const v=Math.abs(c.current-h.scrollTop);if(v>0){const b=window.innerHeight-Na*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),j=Math.max(w,S);if(j<b){const C=j+v,_=Math.min(b,C),N=C-_;d.style.height=_+"px",d.style.bottom==="0px"&&(h.scrollTop=N>0?N:0,d.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});N8.displayName=A_;var A8="SelectGroup",[aie,oie]=Ld(A8),sie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yr();return m.jsx(aie,{scope:n,id:i,children:m.jsx(Ve.div,{role:"group","aria-labelledby":i,...r,ref:t})})});sie.displayName=A8;var O8="SelectLabel",lie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=oie(O8,n);return m.jsx(Ve.div,{id:i.id,...r,ref:t})});lie.displayName=O8;var Xy="SelectItem",[uie,T8]=Ld(Xy),P8=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Wl(Xy,n),c=Ql(Xy,n),f=l.value===r,[h,d]=y.useState(a??""),[g,v]=y.useState(!1),b=Ct(t,C=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,C,r,i)}),w=yr(),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 m.jsx(uie,{scope:n,value:r,disabled:i,textId:w,isSelected:f,onItemTextChange:y.useCallback(C=>{d(_=>_||((C==null?void 0:C.textContent)??"").trim())},[]),children:m.jsx(k0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:m.jsx(Ve.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:Ae(o.onFocus,()=>v(!0)),onBlur:Ae(o.onBlur,()=>v(!1)),onClick:Ae(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Ae(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Ae(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ae(o.onPointerMove,C=>{var _;S.current=C.pointerType,i?(_=c.onItemLeave)==null||_.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,C=>{var _;C.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:Ae(o.onKeyDown,C=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&C.key===" "||(Yre.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});P8.displayName=Xy;var gm="SelectItemText",M8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Wl(gm,n),l=Ql(gm,n),c=T8(gm,n),f=Qre(gm,n),[h,d]=y.useState(null),g=Ct(t,j=>d(j),c.onItemTextChange,j=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,j,c.value,c.disabled)}),v=h==null?void 0:h.textContent,b=y.useMemo(()=>m.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=f;return xr(()=>(w(b),()=>S(b)),[w,S,b]),m.jsxs(m.Fragment,{children:[m.jsx(Ve.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gl.createPortal(a.children,o.valueNode):null]})});M8.displayName=gm;var D8="SelectItemIndicator",R8=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return T8(D8,n).isSelected?m.jsx(Ve.span,{"aria-hidden":!0,...r,ref:t}):null});R8.displayName=D8;var O_="SelectScrollUpButton",I8=y.forwardRef((e,t)=>{const n=Ql(O_,e.__scopeSelect),r=lN(O_,e.__scopeSelect),[i,a]=y.useState(!1),o=Ct(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollTop>0;a(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.jsx(z8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});I8.displayName=O_;var T_="SelectScrollDownButton",L8=y.forwardRef((e,t)=>{const n=Ql(T_,e.__scopeSelect),r=lN(T_,e.__scopeSelect),[i,a]=y.useState(!1),o=Ct(t,r.onScrollButtonChange);return xr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<f;a(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.jsx(z8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});L8.displayName=T_;var z8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ql("SelectScrollButton",n),o=y.useRef(null),l=N0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),xr(()=>{var h;const f=l().find(d=>d.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),m.jsx(Ve.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ae(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(i.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(i.onPointerLeave,()=>{c()})})}),cie="SelectSeparator",fie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(Ve.div,{"aria-hidden":!0,...r,ref:t})});fie.displayName=cie;var P_="SelectArrow",die=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=A0(n),a=Wl(P_,n),o=Ql(P_,n);return a.open&&o.position==="popper"?m.jsx(Qk,{...i,...r,ref:t}):null});die.displayName=P_;var hie="SelectBubbleInput",$8=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=Ct(r,i),o=Uee(t);return y.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const d=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[o,t]),m.jsx(Ve.select,{...n,style:{...gB,...n.style},ref:a,defaultValue:t})});$8.displayName=hie;function B8(e){return e===""||e===void 0}function F8(e){const t=Or(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const l=n.current+o;t(l),(function c(f){n.current=f,window.clearTimeout(r.current),f!==""&&(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 U8(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=mie(e,Math.max(a,0));i.length===1&&(o=o.filter(f=>f!==n));const c=o.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function mie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pie=v8,gie=x8,vie=w8,yie=S8,xie=j8,bie=E8,wie=N8,Sie=P8,jie=M8,Eie=R8,_ie=I8,Cie=L8,kie="Separator",aR="horizontal",Nie=["horizontal","vertical"],H8=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=aR,...i}=e,a=Aie(r)?r:aR,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return m.jsx(Ve.div,{"data-orientation":a,...l,...i,ref:t})});H8.displayName=kie;function Aie(e){return Nie.includes(e)}var Oie=H8,O0="Tabs",[Tie]=Va(O0,[w0]),q8=w0(),[Pie,uN]=Tie(O0),V8=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...f}=e,h=yp(l),[d,g]=Bl({prop:r,onChange:i,defaultProp:a??"",caller:O0});return m.jsx(Pie,{scope:n,baseId:yr(),value:d,onValueChange:g,orientation:o,dir:h,activationMode:c,children:m.jsx(Ve.div,{dir:h,"data-orientation":o,...f,ref:t})})});V8.displayName=O0;var K8="TabsList",Y8=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=uN(K8,n),o=q8(n);return m.jsx(S6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:m.jsx(Ve.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});Y8.displayName=K8;var X8="TabsTrigger",G8=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=uN(X8,n),l=q8(n),c=Z8(o.baseId,r),f=J8(o.baseId,r),h=r===o.value;return m.jsx(j6,{asChild:!0,...l,focusable:!i,active:h,children:m.jsx(Ve.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Ae(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?o.onValueChange(r):d.preventDefault()}),onKeyDown:Ae(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const d=o.activationMode!=="manual";!h&&!i&&d&&o.onValueChange(r)})})})});G8.displayName=X8;var W8="TabsContent",Q8=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=uN(W8,n),c=Z8(l.baseId,r),f=J8(l.baseId,r),h=r===l.value,d=y.useRef(h);return y.useEffect(()=>{const g=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(g)},[]),m.jsx(qr,{present:i||h,children:({present:g})=>m.jsx(Ve.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:g&&a})})});Q8.displayName=W8;function Z8(e,t){return`${e}-trigger-${t}`}function J8(e,t){return`${e}-content-${t}`}var Mie=V8,Die=Y8,Rie=G8,Iie=Q8,[T0]=Va("Tooltip",[Id]),P0=Id(),eF="TooltipProvider",Lie=700,M_="tooltip.open",[zie,cN]=T0(eF),tF=e=>{const{__scopeTooltip:t,delayDuration:n=Lie,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 f=c.current;return()=>window.clearTimeout(f)},[]),m.jsx(zie,{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(f=>{l.current=f},[]),disableHoverableContent:i,children:a})};tF.displayName=eF;var Rm="Tooltip",[$ie,_p]=T0(Rm),nF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=cN(Rm,e.__scopeTooltip),f=P0(t),[h,d]=y.useState(null),g=yr(),v=y.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=y.useRef(!1),[j,C]=Bl({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(M_))):c.onClose(),a==null||a(T)},caller:Rm}),_=y.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),N=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)},[]),m.jsx(Xk,{...f,children:m.jsx($ie,{scope:t,contentId:g,open:j,stateAttribute:_,trigger:h,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?A():N()},[c.isOpenDelayedRef,A,N]),onTriggerLeave:y.useCallback(()=>{b?O():(window.clearTimeout(v.current),v.current=0)},[O,b]),onOpen:N,onClose:O,disableHoverableContent:b,children:n})})};nF.displayName=Rm;var D_="TooltipTrigger",rF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_p(D_,n),a=cN(D_,n),o=P0(n),l=y.useRef(null),c=Ct(t,l,i.onTriggerChange),f=y.useRef(!1),h=y.useRef(!1),d=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(Gk,{asChild:!0,...o,children:m.jsx(Ve.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ae(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Ae(e.onBlur,i.onClose),onClick:Ae(e.onClick,i.onClose)})})});rF.displayName=D_;var fN="TooltipPortal",[Bie,Fie]=T0(fN,{forceMount:void 0}),iF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=_p(fN,t);return m.jsx(Bie,{scope:t,forceMount:n,children:m.jsx(qr,{present:n||a.open,children:m.jsx(bp,{asChild:!0,container:i,children:r})})})};iF.displayName=fN;var ud="TooltipContent",aF=y.forwardRef((e,t)=>{const n=Fie(ud,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=_p(ud,e.__scopeTooltip);return m.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?m.jsx(oF,{side:i,...a,ref:t}):m.jsx(Uie,{side:i,...a,ref:t})})}),Uie=y.forwardRef((e,t)=>{const n=_p(ud,e.__scopeTooltip),r=cN(ud,e.__scopeTooltip),i=y.useRef(null),a=Ct(t,i),[o,l]=y.useState(null),{trigger:c,onClose:f}=n,h=i.current,{onPointerInTransitChange:d}=r,g=y.useCallback(()=>{l(null),d(!1)},[d]),v=y.useCallback((b,w)=>{const S=b.currentTarget,j={x:b.clientX,y:b.clientY},C=Kie(j,S.getBoundingClientRect()),_=Yie(j,C),N=Xie(w.getBoundingClientRect()),O=Wie([..._,...N]);l(O),d(!0)},[d]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(c&&h){const b=S=>v(S,h),w=S=>v(S,c);return c.addEventListener("pointerleave",b),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",w)}}},[c,h,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))||(h==null?void 0:h.contains(S)),_=!Gie(j,o);C?g():_&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,h,o,f,g]),m.jsx(oF,{...e,ref:a})}),[Hie,qie]=T0(Rm,{isInside:!1}),Vie=sJ("TooltipContent"),oF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=_p(ud,n),f=P0(n),{onClose:h}=c;return y.useEffect(()=>(document.addEventListener(M_,h),()=>document.removeEventListener(M_,h)),[h]),y.useEffect(()=>{if(c.trigger){const d=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),m.jsx(xp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:m.jsxs(Wk,{"data-state":c.stateAttribute,...f,...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:[m.jsx(Vie,{children:r}),m.jsx(Hie,{scope:n,isInside:!0,children:m.jsx(hJ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});aF.displayName=ud;var sF="TooltipArrow",lF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=P0(n);return qie(sF,n).isInside?null:m.jsx(Qk,{...i,...r,ref:t})});lF.displayName=sF;function Kie(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 Yie(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 Xie(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 Gie(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],f=l.x,h=l.y,d=c.x,g=c.y;h>r!=g>r&&n<(d-f)*(r-h)/(g-h)+f&&(i=!i)}return i}function Wie(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),Qie(t)}function Qie(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 Zie=tF,Jie=nF,eae=rF,tae=iF,nae=aF,rae=lF;function uF(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=uF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=uF(e))&&(r&&(r+=" "),r+=t);return r}const iae=(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},aae=(e,t)=>({classGroupId:e,validator:t}),cF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Gy="-",oR=[],oae="arbitrary..",sae=e=>{const t=uae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lae(o);const l=o.split(Gy),c=l[0]===""&&l.length>1?1:0;return fF(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],f=n[o];return c?f?iae(f,c):c:f||oR}return n[o]||oR}}},fF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=fF(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const l=t===0?e.join(Gy):e.slice(t).join(Gy),c=o.length;for(let f=0;f<c;f++){const h=o[f];if(h.validator(l))return h.classGroupId}},lae=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?oae+r:void 0})(),uae=e=>{const{theme:t,classGroups:n}=e;return cae(n,t)},cae=(e,t)=>{const n=cF();for(const r in e){const i=e[r];dN(i,n,r,t)}return n},dN=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];fae(o,t,n,r)}},fae=(e,t,n,r)=>{if(typeof e=="string"){dae(e,t,n);return}if(typeof e=="function"){hae(e,t,n,r);return}mae(e,t,n,r)},dae=(e,t,n)=>{const r=e===""?t:dF(t,e);r.classGroupId=n},hae=(e,t,n,r)=>{if(pae(e)){dN(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(aae(n,e))},mae=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];dN(c,dF(t,l),n,r)}},dF=(e,t)=>{let n=e;const r=t.split(Gy),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=cF(),n.nextPart.set(o,l)),n=l}return n},pae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gae=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)}}},R_="!",sR=":",vae=[],lR=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),yae=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,c=0,f;const h=i.length;for(let w=0;w<h;w++){const S=i[w];if(o===0&&l===0){if(S===sR){a.push(i.slice(c,w)),c=w+1;continue}if(S==="/"){f=w;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const d=a.length===0?i:i.slice(c);let g=d,v=!1;d.endsWith(R_)?(g=d.slice(0,-1),v=!0):d.startsWith(R_)&&(g=d.slice(1),v=!0);const b=f&&f>c?f-c:void 0;return lR(a,v,g,b)};if(t){const i=t+sR,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):lR(vae,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},xae=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}},bae=e=>({cache:gae(e.cacheSize),parseClassName:yae(e),sortModifiers:xae(e),...sae(e)}),wae=/\s+/,Sae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(wae);let c="";for(let f=l.length-1;f>=0;f-=1){const h=l[f],{isExternal:d,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(h);if(d){c=h+(c.length>0?" "+c:c);continue}let S=!!w,j=r(S?b.substring(0,w):b);if(!j){if(!S){c=h+(c.length>0?" "+c:c);continue}if(j=r(b),!j){c=h+(c.length>0?" "+c:c);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),_=v?C+R_:C,N=_+j;if(o.indexOf(N)>-1)continue;o.push(N);const O=i(j,S);for(let A=0;A<O.length;++A){const T=O[A];o.push(_+T)}c=h+(c.length>0?" "+c:c)}return c},jae=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=hF(n))&&(i&&(i+=" "),i+=r);return i},hF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hF(e[r]))&&(n&&(n+=" "),n+=t);return n},Eae=(e,...t)=>{let n,r,i,a;const o=c=>{const f=t.reduce((h,d)=>d(h),e());return n=bae(f),r=n.cache.get,i=n.cache.set,a=l,l(c)},l=c=>{const f=r(c);if(f)return f;const h=Sae(c,n);return i(c,h),h};return a=o,(...c)=>a(jae(...c))},_ae=[],nr=e=>{const t=n=>n[e]||_ae;return t.isThemeGetter=!0,t},mF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Cae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nae=/\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$/,Aae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Oae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=e=>Cae.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),hl=e=>!!e&&Number.isInteger(Number(e)),IS=e=>e.endsWith("%")&&vt(e.slice(0,-1)),Jo=e=>kae.test(e),gF=()=>!0,Pae=e=>Nae.test(e)&&!Aae.test(e),hN=()=>!1,Mae=e=>Oae.test(e),Dae=e=>Tae.test(e),Rae=e=>!Le(e)&&!ze(e),Iae=e=>Zl(e,xF,hN),Le=e=>mF.test(e),Eu=e=>Zl(e,bF,Pae),uR=e=>Zl(e,qae,vt),Lae=e=>Zl(e,SF,gF),zae=e=>Zl(e,wF,hN),cR=e=>Zl(e,vF,hN),$ae=e=>Zl(e,yF,Dae),$v=e=>Zl(e,jF,Mae),ze=e=>pF.test(e),Vh=e=>Nc(e,bF),Bae=e=>Nc(e,wF),fR=e=>Nc(e,vF),Fae=e=>Nc(e,xF),Uae=e=>Nc(e,yF),Bv=e=>Nc(e,jF,!0),Hae=e=>Nc(e,SF,!0),Zl=(e,t,n)=>{const r=mF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Nc=(e,t,n=!1)=>{const r=pF.exec(e);return r?r[1]?t(r[1]):n:!1},vF=e=>e==="position"||e==="percentage",yF=e=>e==="image"||e==="url",xF=e=>e==="length"||e==="size"||e==="bg-size",bF=e=>e==="length",qae=e=>e==="number",wF=e=>e==="family-name",SF=e=>e==="number"||e==="weight",jF=e=>e==="shadow",Vae=()=>{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"),f=nr("radius"),h=nr("shadow"),d=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"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...N(),ze,Le],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[ze,Le,c],L=()=>[dl,"full","auto",...P()],I=()=>[hl,"none","subgrid",ze,Le],F=()=>["auto",{span:["full",hl,ze,Le]},hl,ze,Le],$=()=>[hl,"auto",ze,Le],G=()=>["auto","min","max","fr",ze,Le],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...P()],q=()=>[dl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],X=()=>[dl,"screen","full","dvw","lvw","svw","min","max","fit",...P()],K=()=>[dl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],R=()=>[e,ze,Le],H=()=>[...N(),fR,cR,{position:[ze,Le]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",Fae,Iae,{size:[ze,Le]}],Q=()=>[IS,Vh,Eu],Z=()=>["","none","full",f,ze,Le],te=()=>["",vt,Vh,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=()=>[vt,IS,fR,cR],se=()=>["","none",b,ze,Le],pe=()=>["none",vt,ze,Le],ie=()=>["none",vt,ze,Le],we=()=>[vt,ze,Le],Ee=()=>[dl,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[gF],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[Rae],"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",vt],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dl,Le,ze,S]}],container:["container"],columns:[{columns:[vt,Le,ze,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:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[hl,"auto",ze,Le]}],basis:[{basis:[dl,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,dl,"auto","initial","none",Le]}],grow:[{grow:["",vt,ze,Le]}],shrink:[{shrink:["",vt,ze,Le]}],order:[{order:[hl,"first","last","none",ze,Le]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],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:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...q()]}],"min-w":[{"min-w":[l,"screen","none",...q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Vh,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Hae,Lae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",IS,Le]}],"font-family":[{font:[Bae,zae,t]}],"font-features":[{"font-features":[Le]}],"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,ze,Le]}],"line-clamp":[{"line-clamp":[vt,"none",ze,uR]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",ze,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",ze,Eu]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[vt,"auto",ze,Le]}],"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",ze,Le]}],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",ze,Le]}],"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"]},hl,ze,Le],radial:["",ze,Le],conic:[hl,ze,Le]},Uae,$ae]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],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:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,ze,Le]}],"outline-w":[{outline:["",vt,Vh,Eu]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",h,Bv,$v]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Bv,$v]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[vt,Eu]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",g,Bv,$v]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[vt,ze,Le]}],"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":[vt]}],"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":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"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":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"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":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"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":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"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":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"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":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"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":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ze,Le]}],"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":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"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":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"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",ze,Le]}],filter:[{filter:["","none",ze,Le]}],blur:[{blur:se()}],brightness:[{brightness:[vt,ze,Le]}],contrast:[{contrast:[vt,ze,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Bv,$v]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",vt,ze,Le]}],"hue-rotate":[{"hue-rotate":[vt,ze,Le]}],invert:[{invert:["",vt,ze,Le]}],saturate:[{saturate:[vt,ze,Le]}],sepia:[{sepia:["",vt,ze,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Le]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[vt,ze,Le]}],"backdrop-contrast":[{"backdrop-contrast":[vt,ze,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,ze,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,ze,Le]}],"backdrop-invert":[{"backdrop-invert":["",vt,ze,Le]}],"backdrop-opacity":[{"backdrop-opacity":[vt,ze,Le]}],"backdrop-saturate":[{"backdrop-saturate":[vt,ze,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,ze,Le]}],"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",ze,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",ze,Le]}],ease:[{ease:["linear","initial",j,ze,Le]}],delay:[{delay:[vt,ze,Le]}],animate:[{animate:["none",C,ze,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ze,Le]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[ze,Le,"","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:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",ze,Le]}],"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",ze,Le]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[vt,Vh,Eu,uR]}],stroke:[{stroke:["none",...R()]}],"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"]}},Kae=Eae(Vae);function Oe(...e){return Kae(Mt(e))}function mN({delayDuration:e=0,...t}){return m.jsx(Zie,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function EF({...e}){return m.jsx(Jie,{"data-slot":"tooltip",...e})}function _F({...e}){return m.jsx(eae,{"data-slot":"tooltip-trigger",...e})}function CF({className:e,sideOffset:t=0,children:n,...r}){return m.jsx(tae,{children:m.jsxs(nae,{"data-slot":"tooltip-content",sideOffset:t,className:Oe("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,m.jsx(rae,{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 kF=(...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 Yae=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 Xae=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 dR=e=>{const t=Xae(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 Gae={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 Wae=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 Qae=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,...Gae,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kF("lucide",i),...!a&&!Wae(l)&&{"aria-hidden":"true"},...l},[...o.map(([f,h])=>y.createElement(f,h)),...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 nt=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(Qae,{ref:a,iconNode:t,className:kF(`lucide-${Yae(dR(e))}`,`lucide-${e}`,r),...i}));return n.displayName=dR(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 Zae=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Jae=nt("arrow-down",Zae);/**
 * @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 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],M0=nt("arrow-left",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 toe=[["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"}]],D0=nt("bot-message-square",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 noe=[["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"}]],NF=nt("bot",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 roe=[["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"}]],AF=nt("brain",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=[["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"}]],aoe=nt("calendar-clock",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 ooe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pN=nt("check",ooe);/**
 * @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:"m6 9 6 6 6-6",key:"qrunsl"}]],cd=nt("chevron-down",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 loe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],uoe=nt("chevron-left",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 coe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cp=nt("chevron-right",coe);/**
 * @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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],doe=nt("chevron-up",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:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],moe=nt("chevrons-up-down",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 poe=[["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"}]],fa=nt("circle-alert",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 goe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],R0=nt("circle-check",goe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const voe=[["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"}]],gN=nt("circle-x",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 yoe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],xoe=nt("clock",yoe);/**
 * @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:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Wy=nt("corner-down-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:"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"}]],I0=nt("download",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:"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"}]],vN=nt("external-link",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:"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"}]],Eoe=nt("eye-off",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 _oe=[["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"}]],Coe=nt("eye",_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 koe=[["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"}]],I_=nt("folder-kanban",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 Noe=[["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"}]],Aoe=nt("folder-up",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 Ooe=[["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"}]],Toe=nt("folder",Ooe);/**
 * @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:"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"}]],Moe=nt("history",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 Doe=[["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"}]],Roe=nt("house",Doe);/**
 * @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"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Loe=nt("info",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 zoe=[["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"}]],$oe=nt("key-round",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 Boe=[["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"}]],OF=nt("layout-dashboard",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 Foe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Tr=nt("loader-circle",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 Uoe=[["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"}]],kp=nt("message-square",Uoe);/**
 * @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=[["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"}]],qoe=nt("monitor",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 Voe=[["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"}]],TF=nt("moon",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:"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"}]],PF=nt("octagon-x",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 Yoe=[["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"}]],yN=nt("paperclip",Yoe);/**
 * @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=[["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"}]],MF=nt("pause",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 Goe=[["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"}]],Np=nt("pencil",Goe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Woe=[["path",{d:"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"}]],L0=nt("play",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:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sc=nt("plus",Qoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zoe=[["path",{d:"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"}]],DF=nt("save",Zoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Joe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],RF=nt("search",Joe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ese=[["path",{d:"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"}]],tse=nt("send",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 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"}]],z0=nt("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 rse=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],IF=nt("square",rse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ise=[["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"}]],LF=nt("sun",ise);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ase=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ose=nt("terminal",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:"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"}]],Ya=nt("trash-2",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 lse=[["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"}]],use=nt("triangle-alert",lse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cse=[["path",{d:"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"}]],$0=nt("upload",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 fse=[["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"}]],zF=nt("users",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 dse=[["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"}]],$F=nt("wrench",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 hse=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lc=nt("x",hse);function mse(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 pse=e=>{switch(e){case"success":return yse;case"info":return bse;case"warning":return xse;case"error":return wse;default:return null}},gse=Array(12).fill(0),vse=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},gse.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),yse=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"})),xse=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"})),bse=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"})),wse=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"})),Sse=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"})),jse=()=>{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 L_=1;class Ese{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:L_++,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 f=>{if(o=["resolve",f],Ce.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(Cse(f)&&!f.ok){a=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:g,...b})}else if(f instanceof Error){a=!1;const d=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){a=!1;const d=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:g,...b})}}).catch(async f=>{if(o=["reject",f],n.error!==void 0){a=!1;const h=typeof n.error=="function"?await n.error(f):n.error,d=typeof n.description=="function"?await n.description(f):n.description,v=typeof h=="object"&&!Ce.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:d,...v})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((f,h)=>l.then(()=>o[0]==="reject"?h(o[1]):f(o[1])).catch(h));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)||L_++;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 Ese,_se=(e,t)=>{const n=(t==null?void 0:t.id)||L_++;return vi.addToast({title:e,...t,id:n}),n},Cse=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",kse=_se,Nse=()=>vi.toasts,Ase=()=>vi.getActiveToasts(),Ht=Object.assign(kse,{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:Nse,getToasts:Ase});mse("[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 Fv(e){return e.label!==void 0}const Ose=3,Tse="24px",Pse="16px",hR=4e3,Mse=356,Dse=14,Rse=45,Ise=200;function no(...e){return e.filter(Boolean).join(" ")}function Lse(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const zse=e=>{var t,n,r,i,a,o,l,c,f;const{invert:h,toast:d,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:j,toasts:C,expanded:_,removeToast:N,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:P,actionButtonStyle:L,className:I="",descriptionClassName:F="",duration:$,position:G,gap:D,expandByDefault:V,classNames:z,icons:q,closeButtonAriaLabel:X="Close toast"}=e,[K,R]=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),[pe,ie]=Ce.useState(!1),[we,Ee]=Ce.useState(0),[Be,Ne]=Ce.useState(0),it=Ce.useRef(d.duration||$||hR),Qe=Ce.useRef(null),Xe=Ce.useRef(null),It=j===0,ft=j+1<=w,St=d.type,Kt=d.dismissible!==!1,Dt=d.className||"",cn=d.descriptionClassName||"",de=Ce.useMemo(()=>S.findIndex(Ge=>Ge.toastId===d.id)||0,[S,d.id]),xe=Ce.useMemo(()=>{var Ge;return(Ge=d.closeButton)!=null?Ge:A},[d.closeButton,A]),Te=Ce.useMemo(()=>d.duration||$||hR,[d.duration,$]),Ze=Ce.useRef(0),Je=Ce.useRef(0),Gt=Ce.useRef(0),nn=Ce.useRef(null),[je,ot]=G.split("-"),yt=Ce.useMemo(()=>S.reduce((Ge,qt,me)=>me>=de?Ge:Ge+qt.height,0),[S,de]),lt=jse(),$n=d.invert||h,rn=St==="loading";Je.current=Ce.useMemo(()=>de*D+yt,[de,yt]),Ce.useEffect(()=>{it.current=Te},[Te]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const Ge=Xe.current;if(Ge){const qt=Ge.getBoundingClientRect().height;return Ne(qt),b(me=>[{toastId:d.id,height:qt,position:d.position},...me]),()=>b(me=>me.filter(We=>We.toastId!==d.id))}},[b,d.id]),Ce.useLayoutEffect(()=>{if(!B)return;const Ge=Xe.current,qt=Ge.style.height;Ge.style.height="auto";const me=Ge.getBoundingClientRect().height;Ge.style.height=qt,Ne(me),b(We=>We.find(jt=>jt.toastId===d.id)?We.map(jt=>jt.toastId===d.id?{...jt,height:me}:jt):[{toastId:d.id,height:me,position:d.position},...We])},[B,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const dr=Ce.useCallback(()=>{te(!0),Ee(Je.current),b(Ge=>Ge.filter(qt=>qt.toastId!==d.id)),setTimeout(()=>{N(d)},Ise)},[d,N,b,Je]);Ce.useEffect(()=>{if(d.promise&&St==="loading"||d.duration===1/0||d.type==="loading")return;let Ge;return _||v||lt?(()=>{if(Gt.current<Ze.current){const We=new Date().getTime()-Ze.current;it.current=it.current-We}Gt.current=new Date().getTime()})():(()=>{it.current!==1/0&&(Ze.current=new Date().getTime(),Ge=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),dr()},it.current))})(),()=>clearTimeout(Ge)},[_,v,d,St,lt,dr]),Ce.useEffect(()=>{d.delete&&(dr(),d.onDismiss==null||d.onDismiss.call(d,d))},[dr,d.delete]);function Xr(){var Ge;if(q!=null&&q.loading){var qt;return Ce.createElement("div",{className:no(z==null?void 0:z.loader,d==null||(qt=d.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":St==="loading"},q.loading)}return Ce.createElement(vse,{className:no(z==null?void 0:z.loader,d==null||(Ge=d.classNames)==null?void 0:Ge.loader),visible:St==="loading"})}const Dr=d.icon||(q==null?void 0:q[St])||pse(St);var ai,Sr;return Ce.createElement("li",{tabIndex:0,ref:Xe,className:no(I,Dt,z==null?void 0:z.toast,d==null||(t=d.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[St],d==null||(n=d.classNames)==null?void 0:n[St]),"data-sonner-toast":"","data-rich-colors":(ai=d.richColors)!=null?ai:O,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":B,"data-promise":!!d.promise,"data-swiped":pe,"data-removed":Z,"data-visible":ft,"data-y-position":je,"data-x-position":ot,"data-index":j,"data-front":It,"data-swiping":ae,"data-dismissible":Kt,"data-type":St,"data-invert":$n,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(_||V&&B),"data-testid":d.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?we:Je.current}px`,"--initial-height":V?"auto":`${Be}px`,...T,...d.style},onDragEnd:()=>{re(!1),R(null),nn.current=null},onPointerDown:Ge=>{Ge.button!==2&&(rn||!Kt||(Qe.current=new Date,Ee(Je.current),Ge.target.setPointerCapture(Ge.pointerId),Ge.target.tagName!=="BUTTON"&&(re(!0),nn.current={x:Ge.clientX,y:Ge.clientY})))},onPointerUp:()=>{var Ge,qt,me;if(ee||!Kt)return;nn.current=null;const We=Number(((Ge=Xe.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),an=Number(((qt=Xe.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),jt=new Date().getTime()-((me=Qe.current)==null?void 0:me.getTime()),Tn=K==="x"?We:an,Gr=Math.abs(Tn)/jt;if(Math.abs(Tn)>=Rse||Gr>.11){Ee(Je.current),d.onDismiss==null||d.onDismiss.call(d,d),U(K==="x"?We>0?"right":"left":an>0?"down":"up"),dr(),se(!0);return}else{var hr,er;(hr=Xe.current)==null||hr.style.setProperty("--swipe-amount-x","0px"),(er=Xe.current)==null||er.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),R(null)},onPointerMove:Ge=>{var qt,me,We;if(!nn.current||!Kt||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const jt=Ge.clientY-nn.current.y,Tn=Ge.clientX-nn.current.x;var Gr;const hr=(Gr=e.swipeDirections)!=null?Gr:Lse(G);!K&&(Math.abs(Tn)>1||Math.abs(jt)>1)&&R(Math.abs(Tn)>Math.abs(jt)?"x":"y");let er={x:0,y:0};const Wa=Wr=>1/(1.5+Math.abs(Wr)/20);if(K==="y"){if(hr.includes("top")||hr.includes("bottom"))if(hr.includes("top")&&jt<0||hr.includes("bottom")&&jt>0)er.y=jt;else{const Wr=jt*Wa(jt);er.y=Math.abs(Wr)<Math.abs(jt)?Wr:jt}}else if(K==="x"&&(hr.includes("left")||hr.includes("right")))if(hr.includes("left")&&Tn<0||hr.includes("right")&&Tn>0)er.x=Tn;else{const Wr=Tn*Wa(Tn);er.x=Math.abs(Wr)<Math.abs(Tn)?Wr:Tn}(Math.abs(er.x)>0||Math.abs(er.y)>0)&&ie(!0),(me=Xe.current)==null||me.style.setProperty("--swipe-amount-x",`${er.x}px`),(We=Xe.current)==null||We.style.setProperty("--swipe-amount-y",`${er.y}px`)}},xe&&!d.jsx&&St!=="loading"?Ce.createElement("button",{"aria-label":X,"data-disabled":rn,"data-close-button":!0,onClick:rn||!Kt?()=>{}:()=>{dr(),d.onDismiss==null||d.onDismiss.call(d,d)},className:no(z==null?void 0:z.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Sr=q==null?void 0:q.close)!=null?Sr:Sse):null,(St||d.icon||d.promise)&&d.icon!==null&&((q==null?void 0:q[St])!==null||d.icon)?Ce.createElement("div",{"data-icon":"",className:no(z==null?void 0:z.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Xr():null,d.type!=="loading"?Dr:null):null,Ce.createElement("div",{"data-content":"",className:no(z==null?void 0:z.content,d==null||(a=d.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:no(z==null?void 0:z.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ce.createElement("div",{"data-description":"",className:no(F,cn,z==null?void 0:z.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),Ce.isValidElement(d.cancel)?d.cancel:d.cancel&&Fv(d.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||P,onClick:Ge=>{Fv(d.cancel)&&Kt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ge),dr())},className:no(z==null?void 0:z.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,Ce.isValidElement(d.action)?d.action:d.action&&Fv(d.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:Ge=>{Fv(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ge),!Ge.defaultPrevented&&dr())},className:no(z==null?void 0:z.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function mR(){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 $se(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?Pse:Tse;function c(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=l:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(l)}),n}const Bse=Ce.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:h,mobileOffset:d,theme:g="light",richColors:v,duration:b,style:w,visibleToasts:S=Ose,toastOptions:j,dir:C=mR(),gap:_=Dse,icons:N,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]),L=Ce.useMemo(()=>Array.from(new Set([a].concat(P.filter(B=>B.position).map(B=>B.position)))),[P,a]),[I,F]=Ce.useState([]),[$,G]=Ce.useState(!1),[D,V]=Ce.useState(!1),[z,q]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Ce.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=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(()=>{X$.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"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{q(Z?"dark":"light")}catch(te){console.error(te)}})}},[g]),Ce.useEffect(()=>{A.length<=1&&G(!1)},[A]),Ce.useEffect(()=>{const B=Q=>{var Z;if(o.every(re=>Q[re]||Q.code===re)){var ae;G(!0),(ae=X.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===X.current||(Z=X.current)!=null&&Z.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),Ce.useEffect(()=>{if(X.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,H.current=!1)}},[X.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((B,Q)=>{var Z;const[te,ae]=B.split("-");return P.length?Ce.createElement("ol",{key:B,dir:C==="auto"?mR():C,tabIndex:-1,ref:X,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=I[0])==null?void 0:Z.height)||0}px`,"--width":`${Mse}px`,"--gap":`${_}px`,...w,...$se(h,d)},onBlur:re=>{H.current&&!re.currentTarget.contains(re.relatedTarget)&&(H.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H.current||(H.current=!0,R.current=re.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{D||G(!1)},onDragEnd:()=>G(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},P.filter(re=>!re.position&&Q===0||re.position===B).map((re,ee)=>{var se,pe;return Ce.createElement(zse,{key:re.id,icons:N,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:(pe=j==null?void 0:j.closeButton)!=null?pe:c,interacting:D,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:I.filter(ie=>ie.position==re.position),setHeights:F,expandByDefault:l,gap:_,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),Fse=({...e})=>{const{theme:t="system"}=Ek();return m.jsx(Bse,{theme:t,className:"toaster group",icons:{success:m.jsx(R0,{className:"size-4"}),info:m.jsx(Loe,{className:"size-4"}),warning:m.jsx(use,{className:"size-4"}),error:m.jsx(PF,{className:"size-4"}),loading:m.jsx(Tr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},Use=new qZ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),BF="/api";class FF extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Kh(e,t){const n=`${BF}${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 FF(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function Hse(e,t){const n=`${BF}${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 FF(a.status,a.statusText,o)}return a.json()}const Fe={get:e=>Kh(e),post:(e,t)=>Kh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Kh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Kh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Kh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),Hse(e,n)}},$e={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]}};function Ac(){return Un({queryKey:$e.projects.all,queryFn:()=>Fe.get("/projects")})}function xN(e,t){return Un({queryKey:$e.projects.detail(e),queryFn:()=>Fe.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function B0(e){return Un({queryKey:$e.projects.files(e),queryFn:()=>Fe.get(`/projects/${e}/files`)})}function bN(e,t){return Un({queryKey:$e.projects.config(e),queryFn:()=>Fe.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function Qy(e,t){return WZ({queryKey:$e.conversations.detail(e),queryFn:({pageParam:n})=>Fe.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 qse(e=10){return Un({queryKey:["conversations","recent",e],queryFn:()=>Fe.get(`/conversations/recent?limit=${e}`)})}function F0(){return Un({queryKey:["imu","conversations"],queryFn:()=>Fe.get("/imu/conversations")})}function wN(e,t=1,n=20){return Un({queryKey:[...$e.conversations.all(e),t,n],queryFn:()=>Fe.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function UF(){const e=gt();return Bt({mutationFn:t=>Fe.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$e.conversations.all(n.project_id)})}})}function HF(e){const t=gt();return Bt({mutationFn:n=>Fe.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData($e.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||"",f=c?`${c}

${r.task}`:r.task;return{...o,pending_task:f}});return{...i,pages:a}}),t.invalidateQueries({queryKey:$e.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function SN(e){const t=gt();return Bt({mutationFn:({conversationId:n,title:r})=>Fe.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:$e.conversations.all(e)}),t.invalidateQueries({queryKey:$e.conversations.detail(r)})}})}function qF(e){const t=gt();return Bt({mutationFn:()=>Fe.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:$e.conversations.detail(e)})}})}function VF(){const e=gt();return Bt({mutationFn:()=>Fe.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function jN(){const e=gt();return Bt({mutationFn:({conversationId:t,title:n})=>Fe.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:$e.conversations.detail(n)})}})}function KF(){const e=gt();return Bt({mutationFn:t=>Fe.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:$e.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 YF(e){const t=gt();return Bt({mutationFn:n=>Fe.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:$e.conversations.all(e)});const r=t.getQueryData($e.conversations.all(e));return t.setQueryData($e.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:$e.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData($e.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:$e.conversations.all(e)})}})}function et({className:e,type:t,...n}){return m.jsx("input",{type:t,"data-slot":"input",className:Oe("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 Vse=500;function Kse({onCommandPalette:e,onShortcutsHelp:t}){const n=xa(),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},Vse);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function XF(e){const t=e?"?"+new URLSearchParams(e).toString():"";return Un({queryKey:$e.sessions.all(e),queryFn:()=>Fe.get(`/sessions${t}`)})}function EN(){return XF({status:"running",per_page:"50"})}function Yse(){return XF({per_page:"10"})}function GF(e,t=1,n=20){return Un({queryKey:[...$e.projects.sessions(e),t,n],queryFn:()=>Fe.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function Xse(e,t,n){return Un({queryKey:$e.sessions.detail(e,t),queryFn:()=>Fe.get(`/projects/${e}/sessions/${t}`),...n})}var pR=1,Gse=.9,Wse=.8,Qse=.17,LS=.1,zS=.999,Zse=.9999,Jse=.99,ele=/[\\\/_+.#"@\[\(\{&]/,tle=/[\\\/_+.#"@\[\(\{&]/g,nle=/[\s-]/,WF=/[\s-]/g;function z_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?pR:Jse;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),f=n.indexOf(c,i),h=0,d,g,v,b;f>=0;)d=z_(e,t,n,r,f+1,a+1,o),d>h&&(f===i?d*=pR:ele.test(e.charAt(f-1))?(d*=Wse,v=e.slice(i,f-1).match(tle),v&&i>0&&(d*=Math.pow(zS,v.length))):nle.test(e.charAt(f-1))?(d*=Gse,b=e.slice(i,f-1).match(WF),b&&i>0&&(d*=Math.pow(zS,b.length))):(d*=Qse,i>0&&(d*=Math.pow(zS,f-i))),e.charAt(f)!==t.charAt(a)&&(d*=Zse)),(d<LS&&n.charAt(f-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(f-1)!==r.charAt(a))&&(g=z_(e,t,n,r,f+1,a+2,o),g*LS>d&&(d=g*LS)),d>h&&(h=d),f=n.indexOf(c,f+1);return o[l]=h,h}function gR(e){return e.toLowerCase().replace(WF," ")}function rle(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,z_(e,t,gR(e),gR(t),0,0,{})}var Yh='[cmdk-group=""]',$S='[cmdk-group-items=""]',ile='[cmdk-group-heading=""]',QF='[cmdk-item=""]',vR=`${QF}:not([aria-disabled="true"])`,$_="cmdk-item-select",Tf="data-value",ale=(e,t,n)=>rle(e,t,n),ZF=y.createContext(void 0),Ap=()=>y.useContext(ZF),JF=y.createContext(void 0),_N=()=>y.useContext(JF),eU=y.createContext(void 0),tU=y.forwardRef((e,t)=>{let n=Pf(()=>{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=Pf(()=>new Set),i=Pf(()=>new Map),a=Pf(()=>new Map),o=Pf(()=>new Set),l=nU(e),{label:c,children:f,value:h,onValueChange:d,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=yr(),_=yr(),N=yr(),O=y.useRef(null),A=gle();uc(()=>{if(h!==void 0){let U=h.trim();n.current.value=U,T.emit()}},[h]),uc(()=>{A(6,G)},[]);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")$(),I(),A(1,F);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(N);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(A(7,()=>{var ee;n.current.selectedItemId=(ee=D())==null?void 0:ee.id,T.emit()}),Q||A(5,G),((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,L(B,Q)),A(2,()=>{I(),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,()=>{$(),I(),n.current.value||F(),T.emit()}),()=>{a.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=D();A(4,()=>{$(),(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:N,labelId:_,listInnerRef:O}),[]);function L(U,B){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:ale;return U?te(U,n.current.search,B):0}function I(){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;V().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($S);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${$S} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${$S} > *`))}),B.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Yh}[${Tf}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function F(){let U=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),B=U==null?void 0:U.getAttribute(Tf);T.setState("value",B||void 0)}function $(){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=L(re,ee);n.current.filtered.items.set(ae,se),se>0&&te++}for(let[ae,re]of i.current)for(let ee of re)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=te}function G(){var U,B,Q;let Z=D();Z&&(((U=Z.parentElement)==null?void 0:U.firstChild)===Z&&((Q=(B=Z.closest(Yh))==null?void 0:B.querySelector(ile))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function D(){var U;return(U=O.current)==null?void 0:U.querySelector(`${QF}[aria-selected="true"]`)}function V(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(vR))||[])}function z(U){let B=V()[U];B&&T.setState("value",B.getAttribute(Tf))}function q(U){var B;let Q=D(),Z=V(),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(Tf))}function X(U){let B=D(),Q=B==null?void 0:B.closest(Yh),Z;for(;Q&&!Z;)Q=U>0?mle(Q,Yh):ple(Q,Yh),Z=Q==null?void 0:Q.querySelector(vR);Z?T.setState("value",Z.getAttribute(Tf)):q(U)}let K=()=>z(V().length-1),R=U=>{U.preventDefault(),U.metaKey?K():U.altKey?X(1):q(1)},H=U=>{U.preventDefault(),U.metaKey?z(0):U.altKey?X(-1):q(-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&&R(U);break}case"ArrowDown":{R(U);break}case"p":case"k":{S&&U.ctrlKey&&H(U);break}case"ArrowUp":{H(U);break}case"Home":{U.preventDefault(),z(0);break}case"End":{U.preventDefault(),K();break}case"Enter":{U.preventDefault();let Z=D();if(Z){let te=new Event($_);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:yle},c),U0(e,U=>y.createElement(JF.Provider,{value:T},y.createElement(ZF.Provider,{value:P},U))))}),ole=y.forwardRef((e,t)=>{var n,r;let i=yr(),a=y.useRef(null),o=y.useContext(eU),l=Ap(),c=nU(e),f=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;uc(()=>{if(!f)return l.item(i,o==null?void 0:o.id)},[f]);let h=rU(i,a,[e.value,e.children,a],e.keywords),d=_N(),g=Hl(A=>A.value&&A.value===h.current),v=Hl(A=>f||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($_,b),()=>A.removeEventListener($_,b)},[v,e.onSelect,e.disabled]);function b(){var A,T;w(),(T=(A=c.current).onSelect)==null||T.call(A,h.current)}function w(){d.setState("value",h.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:C,forceMount:_,keywords:N,...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)}),sle=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=yr(),l=y.useRef(null),c=y.useRef(null),f=yr(),h=Ap(),d=Hl(v=>i||h.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);uc(()=>h.group(o),[]),rU(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:d?void 0:!0},n&&y.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),U0(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(eU.Provider,{value:g},v))))}),lle=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"})}),ule=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=_N(),o=Hl(f=>f.search),l=Hl(f=>f.selectedItemId),c=Ap();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:f=>{i||a.setState("search",f.target.value),n==null||n(f.target.value)}})}),cle=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Hl(f=>f.selectedItemId),c=Ap();return y.useEffect(()=>{if(o.current&&a.current){let f=o.current,h=a.current,d,g=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let v=f.offsetHeight;h.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(d),g.unobserve(f)}}},[]),y.createElement(Ve.div,{ref:gs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},U0(e,f=>y.createElement("div",{ref:gs(o,c.listInnerRef),"cmdk-list-sizer":""},f)))}),fle=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement(Rk,{open:n,onOpenChange:r},y.createElement(Ik,{container:o},y.createElement(Lk,{"cmdk-overlay":"",className:i}),y.createElement(zk,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(tU,{ref:t,...l}))))}),dle=y.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?y.createElement(Ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),hle=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},U0(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),zd=Object.assign(tU,{List:cle,Item:ole,Input:ule,Group:sle,Separator:lle,Dialog:fle,Empty:dle,Loading:hle});function mle(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ple(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function nU(e){let t=y.useRef(e);return uc(()=>{t.current=e}),t}var uc=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Pf(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=_N(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function rU(e,t,n,r=[]){let i=y.useRef(),a=Ap();return uc(()=>{var o;let l=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():i.current}})(),c=r.map(f=>f.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(Tf,l),i.current=l}),i}var gle=()=>{let[e,t]=y.useState(),n=Pf(()=>new Map);return uc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function vle(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function U0({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(vle(t),{ref:t.ref},n(t.props.children)):n(t)}var yle={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const yR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xR=Mt,H0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const h=n==null?void 0:n[f],d=a==null?void 0:a[f];if(h===null)return null;const g=yR(h)||yR(d);return i[f][g]}),l=n&&Object.entries(n).reduce((f,h)=>{let[d,g]=h;return g===void 0||(f[d]=g),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:d,className:g,...v}=h;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...a,...l}[w]):{...a,...l}[w]===S})?[...f,d,g]:f},[]);return xR(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},xle=H0("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Se({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?_k:"button";return m.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:Oe(xle({variant:t,size:n,className:e})),...i})}function No({...e}){return m.jsx(Rk,{"data-slot":"dialog",...e})}function ble({...e}){return m.jsx(Ik,{"data-slot":"dialog-portal",...e})}function wle({className:e,...t}){return m.jsx(Lk,{"data-slot":"dialog-overlay",className:Oe("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 Ao({className:e,children:t,showCloseButton:n=!0,...r}){return m.jsxs(ble,{"data-slot":"dialog-portal",children:[m.jsx(wle,{}),m.jsxs(zk,{"data-slot":"dialog-content",className:Oe("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&&m.jsxs($k,{"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:[m.jsx(lc,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Oo({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:Oe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function iU({className:e,showCloseButton:t=!1,children:n,...r}){return m.jsxs("div",{"data-slot":"dialog-footer",className:Oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&m.jsx($k,{asChild:!0,children:m.jsx(Se,{variant:"outline",children:"Close"})})]})}function To({className:e,...t}){return m.jsx(XB,{"data-slot":"dialog-title",className:Oe("text-lg leading-none font-semibold",e),...t})}function aU({className:e,...t}){return m.jsx(GB,{"data-slot":"dialog-description",className:Oe("text-sm text-muted-foreground",e),...t})}function Sle({className:e,...t}){return m.jsx(zd,{"data-slot":"command",className:Oe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function jle({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return m.jsxs(No,{...a,children:[m.jsxs(Oo,{className:"sr-only",children:[m.jsx(To,{children:e}),m.jsx(aU,{children:t})]}),m.jsx(Ao,{className:Oe("overflow-hidden p-0",r),showCloseButton:i,children:m.jsx(Sle,{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 Ele({className:e,...t}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(RF,{className:"size-4 shrink-0 opacity-50"}),m.jsx(zd.Input,{"data-slot":"command-input",className:Oe("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 _le({className:e,...t}){return m.jsx(zd.List,{"data-slot":"command-list",className:Oe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Cle({...e}){return m.jsx(zd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Xh({className:e,...t}){return m.jsx(zd.Group,{"data-slot":"command-group",className:Oe("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 ka({className:e,...t}){return m.jsx(zd.Item,{"data-slot":"command-item",className:Oe("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 bR({className:e,...t}){return m.jsx("span",{"data-slot":"command-shortcut",className:Oe("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function kle({open:e,onOpenChange:t}){var f;const n=xa(),{setTheme:r}=Ek(),i=Ac(),a=EN(),o=i.data??[],l=((f=a.data)==null?void 0:f.items)??[],c=h=>{t(!1),n(h)};return m.jsxs(jle,{open:e,onOpenChange:t,showCloseButton:!1,children:[m.jsx(Ele,{placeholder:"Type a command or search..."}),m.jsxs(_le,{children:[m.jsx(Cle,{children:"No results found."}),m.jsxs(Xh,{heading:"Navigation",children:[m.jsxs(ka,{onSelect:()=>c("/"),children:[m.jsx(OF,{}),"Dashboard",m.jsx(bR,{children:"G D"})]}),m.jsxs(ka,{onSelect:()=>c("/projects"),children:[m.jsx(I_,{}),"Projects",m.jsx(bR,{children:"G P"})]})]}),o.length>0&&m.jsx(Xh,{heading:"Projects",children:o.map(h=>m.jsxs(ka,{onSelect:()=>c(`/projects/${h.id}`),children:[m.jsx(I_,{}),h.display_name]},h.id))}),l.length>0&&m.jsx(Xh,{heading:"Running Sessions",children:l.map(h=>m.jsxs(ka,{onSelect:()=>c(`/projects/${h.project_id}/sessions/${h.run_id}`),children:[m.jsx(L0,{}),h.role," (",h.run_id.slice(0,8),")"]},h.run_id))}),m.jsxs(Xh,{heading:"Resources",children:[m.jsxs(ka,{onSelect:()=>c("/resources/roles"),children:[m.jsx(zF,{}),"Roles"]}),m.jsxs(ka,{onSelect:()=>c("/resources/skills"),children:[m.jsx($F,{}),"Skills"]}),m.jsxs(ka,{onSelect:()=>c("/resources/agents"),children:[m.jsx(NF,{}),"Agents"]}),m.jsxs(ka,{onSelect:()=>c("/resources/memories"),children:[m.jsx(AF,{}),"Memory"]})]}),m.jsxs(Xh,{heading:"Theme",children:[m.jsxs(ka,{onSelect:()=>{r("light"),t(!1)},children:[m.jsx(LF,{}),"Light"]}),m.jsxs(ka,{onSelect:()=>{r("dark"),t(!1)},children:[m.jsx(TF,{}),"Dark"]}),m.jsxs(ka,{onSelect:()=>{r("system"),t(!1)},children:[m.jsx(qoe,{}),"System"]})]})]})]})}const Nle=[{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 Ale({open:e,onOpenChange:t}){return m.jsx(No,{open:e,onOpenChange:t,children:m.jsxs(Ao,{className:"max-w-sm",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Keyboard Shortcuts"})}),m.jsx("div",{className:"space-y-2",children:Nle.map(n=>m.jsxs("div",{className:"flex items-center justify-between text-sm",children:[m.jsx("span",{className:"text-muted-foreground",children:n.description}),m.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>m.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 Ole({...e}){return m.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Tle({className:e,...t}){return m.jsx("ol",{"data-slot":"breadcrumb-list",className:Oe("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function Ple({className:e,...t}){return m.jsx("li",{"data-slot":"breadcrumb-item",className:Oe("inline-flex items-center gap-1.5",e),...t})}function Mle({asChild:e,className:t,...n}){const r=e?_k:"a";return m.jsx(r,{"data-slot":"breadcrumb-link",className:Oe("transition-colors hover:text-foreground",t),...n})}function Dle({className:e,...t}){return m.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Oe("font-normal text-foreground",e),...t})}function Rle({children:e,className:t,...n}){return m.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Oe("[&>svg]:size-3.5",t),...n,children:e??m.jsx(Cp,{})})}function fd({...e}){return m.jsx(jre,{"data-slot":"dropdown-menu",...e})}function dd({...e}){return m.jsx(Ere,{"data-slot":"dropdown-menu-trigger",...e})}function hd({className:e,sideOffset:t=4,...n}){return m.jsx(_re,{children:m.jsx(Cre,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Oe("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 vm({className:e,inset:t,variant:n="default",...r}){return m.jsx(kre,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Oe("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 CN({className:e,children:t,checked:n,...r}){return m.jsxs(Nre,{"data-slot":"dropdown-menu-checkbox-item",className:Oe("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(Are,{children:m.jsx(pN,{className:"size-4"})})}),t]})}function Sl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return m.jsx(Oie,{"data-slot":"separator",decorative:n,orientation:t,className:Oe("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 Ile=[{to:"/imu",label:"Bot Imu",icon:D0},{to:"/dashboard",label:"Dashboard",icon:OF,end:!0},{to:"/projects",label:"Projects",icon:I_},{to:"/settings",label:"Settings",icon:z0}],Lle=[{to:"/schedules/runs",label:"Run History",icon:Moe},{to:"/schedules/recurring",label:"Recurring",icon:xoe},{to:"/schedules/one-time",label:"One-Time",icon:aoe}],zle=[{to:"/resources/roles",label:"Roles",icon:zF},{to:"/resources/skills",label:"Skills",icon:$F},{to:"/resources/agents",label:"Agents",icon:NF},{to:"/resources/memories",label:"Memory",icon:AF}];function $le({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(!1),[c,f]=y.useState(!1),[h,d]=y.useState(""),g=y.useRef(null),v=SN(t),b=YF(t),w=j=>{j.stopPropagation(),j.preventDefault(),d(e.title??""),a(!0),setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0)},S=()=>{const j=h.trim();v.mutate({conversationId:e.id,title:j||null}),a(!1)};return i?m.jsx("div",{className:"px-1",children:m.jsx(et,{ref:g,value:h,onChange:j=>d(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"})}):m.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:Oe("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:[m.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:m.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),c?m.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[m.jsx("button",{onClick:j=>{j.stopPropagation(),b.mutate(e.id),f(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),m.jsx("button",{onClick:j=>{j.stopPropagation(),f(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):m.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[m.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:m.jsx(Np,{className:"h-3 w-3"})}),!n&&m.jsx("button",{onClick:j=>{j.stopPropagation(),f(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:m.jsx(Ya,{className:"h-3 w-3"})})]})]})}function Ble({conv:e,isActive:t,navigate:n}){const[r,i]=y.useState(!1),[a,o]=y.useState(!1),[l,c]=y.useState(!1),[f,h]=y.useState(""),d=y.useRef(null),g=jN(),v=KF(),b=S=>{S.stopPropagation(),S.preventDefault(),h(e.title??""),i(!0),setTimeout(()=>{var j;return(j=d.current)==null?void 0:j.focus()},0)},w=()=>{const S=f.trim();g.mutate({conversationId:e.id,title:S||null}),i(!1)};return r?m.jsx("div",{className:"px-1",children:m.jsx(et,{ref:d,value:f,onChange:S=>h(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"})}):m.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:Oe("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:[m.jsx("button",{onClick:()=>n(`/imu/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:m.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),l?m.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[m.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"}),m.jsx("button",{onClick:S=>{S.stopPropagation(),c(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):m.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:a?1:0},children:[m.jsx("button",{onClick:b,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:m.jsx(Np,{className:"h-3 w-3"})}),!t&&m.jsx("button",{onClick:S=>{S.stopPropagation(),c(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:m.jsx(Ya,{className:"h-3 w-3"})})]})]})}function Fle({conversationId:e}){const t=xa(),n=F0(),r=VF();return m.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[m.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:m.jsx(Pr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),m.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[m.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:[m.jsx(M0,{className:"h-4 w-4 shrink-0"}),m.jsx(D0,{className:"h-4 w-4 shrink-0"}),m.jsx("span",{className:"truncate",children:"Bot Imu"})]}),m.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[m.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),m.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:m.jsx(sc,{className:"h-3.5 w-3.5"})})]}),m.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(n.data??[]).map(i=>m.jsx(Ble,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function Ule({projectId:e,conversationId:t}){var o,l;const n=xa(),r=wN(e,1,50),i=UF(),a=xN(e);return m.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[m.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:m.jsx(Pr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),m.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[m.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:[m.jsx(M0,{className:"h-4 w-4 shrink-0"}),m.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),m.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[m.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),m.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:m.jsx(sc,{className:"h-3.5 w-3.5"})})]}),m.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(c=>m.jsx($le,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function Hle(){var d,g;const t=ya().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}=xN(n,{enabled:n>0}),{data:a}=wN(n,1,50),o=((d=a==null?void 0:a.items.find(v=>v.id===r))==null?void 0:d.title)??null,l=t[0]==="imu"&&t[1]?Number(t[1]):0,{data:c}=F0(),f=((g=c==null?void 0:c.find(v=>v.id===l))==null?void 0:g.title)??null,h=[];if(t[0]==="projects"){if(n===0)h.push({label:"Bot Imu",href:"/imu"}),t[2]==="sessions"&&t[3]&&h.push({label:`Session ${t[3].slice(0,8)}…`});else if(h.push({label:"Projects",href:"/projects"}),t[1]){const v=`/projects/${t[1]}`,b=(i==null?void 0:i.display_name)??`Project #${t[1]}`;h.push({label:b,href:v,projectSwitcher:!0}),t[2]==="sessions"&&t[3]?h.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&h.push({label:o??`Conversation #${t[3]}`})}}if(t[0]==="imu"&&(h.push({label:"Bot Imu",href:"/imu"}),t[1]&&h.push({label:f??`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]?(h.push({label:"Schedules",href:"/schedules/recurring"}),h.push({label:v[b]})):h.push({label:"Schedules"})}if(t[0]==="settings"&&h.push({label:"Settings"}),t[0]==="resources"){const v={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};h.push({label:"Resources"}),t[1]&&(h[h.length-1].href=`/resources/${t[1]}`,h.push({label:v[t[1]]??t[1]}))}return h}function qle(){const e=Hle(),t=xa(),n=Ac(),{data:r}=F0(),i=(r??[]).some(S=>S.active_session_count>0),{setTheme:a}=Ek(),[o,l]=y.useState(!1),[c,f]=y.useState(!1),h=xS("/projects/:projectId/conversations/:conversationId"),d=h?Number(h.params.projectId):0,g=h?Number(h.params.conversationId):0,v=xS("/imu/:conversationId"),b=v?Number(v.params.conversationId):0,w=xS("/projects/0/sessions/:runId");return Kse({onCommandPalette:()=>l(!0),onShortcutsHelp:()=>f(!0)}),m.jsxs("div",{className:"flex h-screen",children:[h?m.jsx(Ule,{projectId:d,conversationId:g}):v?m.jsx(Fle,{conversationId:b}):m.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[m.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:m.jsx(Pr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),m.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[Ile.map(({to:S,label:j,icon:C,end:_})=>m.jsxs(yy,{to:S,end:_,className:({isActive:N})=>Oe("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(N||S==="/imu"&&!!w)&&!(S==="/projects"&&w)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[m.jsx(C,{className:"h-4 w-4"}),j,S==="/imu"&&i&&m.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},S)),m.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),Lle.map(({to:S,label:j,icon:C})=>m.jsxs(yy,{to:S,className:({isActive:_})=>Oe("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:[m.jsx(C,{className:"h-4 w-4"}),j]},S)),m.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),zle.map(({to:S,label:j,icon:C})=>m.jsxs(yy,{to:S,className:({isActive:_})=>Oe("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:[m.jsx(C,{className:"h-4 w-4"}),j]},S))]})]}),m.jsxs("div",{className:"flex flex-1 flex-col",children:[m.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[m.jsx(Ole,{children:m.jsx(Tle,{children:e.map((S,j)=>{const C=j===e.length-1;return m.jsxs(Ple,{children:[j>0&&m.jsx(Rle,{}),S.projectSwitcher?m.jsxs(fd,{children:[m.jsxs(dd,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[S.label,m.jsx(moe,{className:"h-3 w-3 text-muted-foreground"})]}),m.jsx(hd,{align:"start",children:(n.data??[]).map(_=>m.jsxs(vm,{onClick:()=>t(`/projects/${_.id}`),children:[S.href===`/projects/${_.id}`?m.jsx(pN,{className:"mr-2 h-3.5 w-3.5"}):m.jsx("span",{className:"mr-2 inline-block w-3.5"}),_.display_name]},_.id))})]}):C?m.jsx(Dle,{children:S.label}):m.jsx(Mle,{href:S.href,children:S.label})]},S.label)})})}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.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:m.jsx("kbd",{className:"font-mono",children:"⌘K"})}),m.jsxs(fd,{children:[m.jsx(dd,{asChild:!0,children:m.jsxs(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[m.jsx(LF,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),m.jsx(TF,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),m.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),m.jsxs(hd,{align:"end",children:[m.jsx(vm,{onClick:()=>a("light"),children:"Light"}),m.jsx(vm,{onClick:()=>a("dark"),children:"Dark"}),m.jsx(vm,{onClick:()=>a("system"),children:"System"})]})]})]})]}),m.jsx(Sl,{}),m.jsx("main",{className:"flex-1 overflow-auto p-6",children:m.jsx(RQ,{})})]}),m.jsx(kle,{open:o,onOpenChange:l}),m.jsx(Ale,{open:c,onOpenChange:f})]})}function Vle(){const e=gt();return Bt({mutationFn:t=>Fe.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$e.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function kN(){const e=gt();return Bt({mutationFn:t=>Fe.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function Kle(){const e=gt();return Bt({mutationFn:t=>Fe.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const Yle=H0("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 pt({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?_k:"span";return m.jsx(i,{"data-slot":"badge","data-variant":t,className:Oe(Yle({variant:t}),e),...r})}function Fa({className:e,...t}){return m.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:m.jsx("table",{"data-slot":"table",className:Oe("w-full caption-bottom text-sm",e),...t})})}function Ua({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:Oe("[&_tr]:border-b",e),...t})}function Ha({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:Oe("[&_tr:last-child]:border-0",e),...t})}function Cn({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:Oe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function qe({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:Oe("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 He({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:Oe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Zy({sessions:e,projectNames:t}){return m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Run ID"}),t&&m.jsx(qe,{children:"Project"}),m.jsx(qe,{children:"Role"}),m.jsx(qe,{children:"Status"}),m.jsx(qe,{children:"Started"}),m.jsx(qe,{children:"Duration"}),m.jsx(qe,{children:"Task"}),m.jsx(qe,{className:"w-[80px]"})]})}),m.jsx(Ha,{children:e.map(n=>m.jsxs(Cn,{children:[m.jsx(He,{children:m.jsx(Pr,{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&&m.jsx(He,{children:m.jsx(Pr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),m.jsx(He,{className:"text-sm",children:n.role}),m.jsx(He,{children:m.jsx(Xle,{status:n.status})}),m.jsx(He,{className:"text-sm text-muted-foreground",children:Jy(n.started_at)}),m.jsx(He,{className:"text-sm text-muted-foreground",children:q0(n.duration_ms)}),m.jsx(He,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),m.jsx(He,{children:m.jsx(Gle,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function Xle({status:e}){const t=oU(e);return m.jsxs(pt,{variant:"outline",className:Oe("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"&&m.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const wR=oU;function oU(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 Jy(e){try{return new Date(e).toLocaleString()}catch{return e}}function q0(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 Gle({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=Kle(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Se,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):m.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:m.jsx(Ya,{className:"h-4 w-4"})})}function kn({className:e,...t}){return m.jsx("div",{"data-slot":"card",className:Oe("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Gh({className:e,...t}){return m.jsx("div",{"data-slot":"card-header",className:Oe("@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 Wh({className:e,...t}){return m.jsx("div",{"data-slot":"card-title",className:Oe("leading-none font-semibold",e),...t})}function Nn({className:e,...t}){return m.jsx("div",{"data-slot":"card-content",className:Oe("px-6",e),...t})}const BS=1e4;function Wle(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState(!1),[l,c]=y.useState(!1),f=y.useRef(null),h=y.useRef(void 0),d=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}`);f.current=w,w.onopen=()=>{o(!0),d.current=1e3},w.addEventListener("snapshot",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&i(j.lines.slice(-BS))}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>BS?_.slice(-BS):_})}catch{}}),w.addEventListener("done",()=>{c(!0),w.close(),f.current=null}),w.onerror=()=>{w.close(),f.current=null,o(!1),h.current=setTimeout(()=>{d.current=Math.min(d.current*2,15e3),b()},d.current)}}return b(),()=>{var w;(w=f.current)==null||w.close(),f.current=null,h.current&&clearTimeout(h.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const Qle=5e3;function Zle({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=Wle(e,n,!0),c=o.slice(-4),[f,h]=y.useState("");y.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const C=Date.now()-w,_=Math.floor(C/1e3)%60,N=Math.floor(C/6e4)%60,O=Math.floor(C/36e5);h(O>0?`${O}h ${N}m`:`${N}m ${_}s`)};S();const j=setInterval(S,1e3);return()=>clearInterval(j)},[a]);const d=y.useRef(o.length),g=y.useRef(Date.now()),[v,b]=y.useState(!1);return y.useEffect(()=>{o.length!==d.current&&(d.current=o.length,g.current=Date.now(),b(!1))},[o.length]),y.useEffect(()=>{const w=setInterval(()=>{Date.now()-g.current>Qle&&b(!0)},1e3);return()=>clearInterval(w)},[]),m.jsx(kn,{className:"overflow-hidden",children:m.jsxs(Nn,{className:"space-y-2 pt-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":v?"bg-green-300":"animate-pulse bg-green-500"}`}),m.jsx("span",{className:"font-medium text-sm",children:r})]}),m.jsx(pt,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")})]}),m.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[m.jsxs("span",{children:["Session: ",e.slice(0,12)]}),m.jsx("span",{children:"·"}),m.jsx("span",{children:f})]}),m.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)=>m.jsxs("div",{className:"truncate",children:[m.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):m.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),m.jsx("div",{className:"flex justify-end",children:m.jsxs(Pr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",m.jsx(Cp,{className:"h-3 w-3"})]})})]})})}const FS=8;function Jle(){var o;const t=((o=EN().data)==null?void 0:o.items)??[],n=GZ({queries:t.slice(0,FS).map(l=>({queryKey:$e.sessions.detail(l.project_id,l.run_id),queryFn:()=>Fe.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[f,h]of Object.entries(c.agents))r.push({runId:c.run_id,projectId:c.project_id,agentId:f,role:h.role,runtime:h.runtime,startedAt:h.started_at})}if(r.length===0)return null;const i=r.slice(0,FS),a=r.length-FS;return m.jsxs("section",{className:"space-y-3",children:[m.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),m.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>m.jsx(Zle,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function hn({className:e,...t}){return m.jsx("div",{"data-slot":"skeleton",className:Oe("animate-pulse rounded-md bg-accent",e),...t})}function eue(){return m.jsxs("div",{className:"space-y-8",children:[m.jsx(hn,{className:"h-8 w-40"}),m.jsxs("div",{className:"space-y-3",children:[m.jsx(hn,{className:"h-4 w-24"}),m.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>m.jsx(hn,{className:"h-28 rounded-lg"},e))})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsx(hn,{className:"h-4 w-32"}),m.jsx(hn,{className:"h-48 rounded-lg"})]})]})}function tue(){var d,g;const e=Ac(),t=EN(),n=Yse(),r=qse(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return m.jsx(eue,{});if(a)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",a.message]})]});const o=e.data??[],l=((d=t.data)==null?void 0:d.items)??[],c=((g=n.data)==null?void 0:g.items)??[],f=new Map;for(const v of o)f.set(v.id,v.display_name);const h=new Map;for(const v of l)h.set(v.project_id,(h.get(v.project_id)??0)+1);return m.jsxs("div",{className:"space-y-8",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),m.jsx(Jle,{}),m.jsxs("section",{className:"space-y-3",children:[m.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Directory"}),m.jsx(qe,{children:"Status"})]})}),m.jsxs(Ha,{children:[o.slice(0,10).map(v=>m.jsxs(Cn,{children:[m.jsx(He,{children:m.jsx(Pr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),m.jsx(He,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),m.jsx(He,{children:m.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&m.jsx(pt,{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"}),(h.get(v.id)??0)>0&&m.jsxs(pt,{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:[m.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),h.get(v.id)," running"]})]})})]},v.id)),o.length>10&&m.jsx(Cn,{children:m.jsx(He,{colSpan:3,className:"text-center",children:m.jsxs(Pr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&m.jsxs("section",{className:"space-y-3",children:[m.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsx(Zy,{sessions:l,projectNames:f})})})]}),(r.data??[]).length>0&&m.jsxs("section",{className:"space-y-3",children:[m.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Title"}),m.jsx(qe,{children:"Project"}),m.jsx(qe,{children:"Sessions"}),m.jsx(qe,{children:"Last Activity"})]})}),m.jsx(Ha,{children:(r.data??[]).map(v=>m.jsxs(Cn,{children:[m.jsx(He,{children:m.jsx(Pr,{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}`})}),m.jsx(He,{children:m.jsx(Pr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),m.jsx(He,{className:"text-sm text-muted-foreground",children:v.session_count}),m.jsx(He,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),m.jsxs("section",{className:"space-y-3",children:[m.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsx(Zy,{sessions:c,projectNames:f})})})]})]})}function sU(){return Un({queryKey:$e.config.global,queryFn:()=>Fe.get("/config/global")})}function nue(){const e=gt();return Bt({mutationFn:t=>Fe.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:$e.projects.all})}})}function rue(){const e=gt();return Bt({mutationFn:t=>Fe.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:$e.projects.all})}})}function iue(){const e=gt();return Bt({mutationFn:({projectId:t,files:n})=>Fe.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$e.projects.files(n.projectId)})}})}function aue(){const e=gt();return Bt({mutationFn:({projectId:t,filePath:n})=>Fe.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$e.projects.files(n.projectId)})}})}function oue(){const e=gt();return Bt({mutationFn:t=>Fe.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData($e.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:$e.config.global})}})}function lU(){const e=gt();return Bt({mutationFn:({projectId:t,data:n})=>Fe.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData($e.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:$e.projects.config(n.projectId)})}})}function V0({className:e,children:t,...n}){return m.jsxs(Hre,{"data-slot":"scroll-area",className:Oe("relative",e),...n,children:[m.jsx(qre,{"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}),m.jsx(sue,{}),m.jsx(Vre,{})]})}function sue({className:e,orientation:t="vertical",...n}){return m.jsx(l8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Oe("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:m.jsx(d8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function lue({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=y.useState(null),[a,o]=y.useState(!0),[l,c]=y.useState(null),[f,h]=y.useState(null),d=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Fe.get(`/fs/browse${b}`).then(i).catch(w=>c(w.message??"Failed to browse")).finally(()=>o(!1))},g=async()=>{if(!(!r||!(f!=null&&f.trim())))try{const v=await Fe.post("/fs/mkdir",{path:r.path,name:f.trim()});h(null),d(v.path)}catch(v){c(v instanceof Error?v.message:"Failed to create folder")}};return y.useEffect(()=>{d(e||void 0)},[]),m.jsx(No,{open:!0,onOpenChange:v=>!v&&n(),children:m.jsxs(Ao,{className:"sm:max-w-[480px]",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Select Directory"})}),r&&m.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&m.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?m.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):m.jsx(V0,{className:"h-[300px]",children:m.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&m.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(r.parent),children:[m.jsx(Aoe,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>m.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(v.path),children:[m.jsx(Toe,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&m.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),m.jsx(iU,{children:f!==null?m.jsxs("div",{className:"flex w-full gap-2",children:[m.jsx(et,{value:f,onChange:v=>h(v.target.value),onKeyDown:v=>{v.key==="Enter"&&g(),v.key==="Escape"&&h(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),m.jsx(Se,{size:"sm",onClick:g,children:"Create"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:()=>h(null),children:"Cancel"})]}):m.jsxs(m.Fragment,{children:[m.jsx(Se,{variant:"outline",onClick:()=>h(""),disabled:!r,children:"New Folder"}),m.jsx("div",{className:"flex-1"}),m.jsx(Se,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),m.jsx(Se,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function st({className:e,...t}){return m.jsx(Tre,{"data-slot":"label",className:Oe("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 da({...e}){return m.jsx(pie,{"data-slot":"select",...e})}function ha({...e}){return m.jsx(vie,{"data-slot":"select-value",...e})}function ma({className:e,size:t="default",children:n,...r}){return m.jsxs(gie,{"data-slot":"select-trigger","data-size":t,className:Oe("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,m.jsx(yie,{asChild:!0,children:m.jsx(cd,{className:"size-4 opacity-50"})})]})}function pa({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return m.jsx(xie,{children:m.jsxs(bie,{"data-slot":"select-content",className:Oe("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:[m.jsx(uue,{}),m.jsx(wie,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),m.jsx(cue,{})]})})}function An({className:e,children:t,...n}){return m.jsxs(Sie,{"data-slot":"select-item",className:Oe("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:[m.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:m.jsx(Eie,{children:m.jsx(pN,{className:"size-4"})})}),m.jsx(jie,{children:t})]})}function uue({className:e,...t}){return m.jsx(_ie,{"data-slot":"select-scroll-up-button",className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(doe,{className:"size-4"})})}function cue({className:e,...t}){return m.jsx(Cie,{"data-slot":"select-scroll-down-button",className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(cd,{className:"size-4"})})}function fue(){const{data:e,isLoading:t,error:n}=Ac(),[r,i]=y.useState(!1);if(t)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-32"}),m.jsx(hn,{className:"h-64 rounded-lg"})]});if(n)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),m.jsxs(Se,{onClick:()=>i(!0),children:[m.jsx(sc,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&m.jsx(due,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Directory"}),m.jsx(qe,{children:"Created"}),m.jsx(qe,{children:"Status"}),m.jsx(qe,{className:"w-[80px]"})]})}),m.jsx(Ha,{children:a.map(o=>m.jsxs(Cn,{children:[m.jsx(He,{children:m.jsx(Pr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),m.jsx(He,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),m.jsx(He,{className:"text-sm text-muted-foreground",children:mue(o.created_at)}),m.jsx(He,{children:o.dir_exists?m.jsx(pt,{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"}):m.jsx(pt,{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"})}),m.jsx(He,{children:m.jsx(hue,{projectId:o.id})})]},o.id))})]})})})]})}function due({onDone:e,onCancel:t}){var P,L,I;const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState(""),[h,d]=y.useState(!1),[g,v]=y.useState(!1),b=nue(),w=lU(),j=(P=sU().data)==null?void 0:P.defaults,C=(j==null?void 0:j.isolation)??"none",_=((L=j==null?void 0:j.session)==null?void 0:L.merge_strategy)??"auto",N=o||C,O=async()=>{const F=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),$={},G=c||_;$.isolation=N,$.session={merge_strategy:G},await w.mutateAsync({projectId:F.id,data:$}),e()},A=async F=>{F.preventDefault();try{if(N==="worktree"&&i.trim()&&!(await Fe.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await O()}catch{}},T=async()=>{try{await Fe.post("/fs/git-init",{path:i.trim()}),v(!1),await O()}catch{}};return m.jsx(kn,{children:m.jsx(Nn,{className:"pt-6",children:m.jsxs("form",{onSubmit:A,className:"space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"display-name",children:"Display Name"}),m.jsx(et,{id:"display-name",value:n,onChange:F=>r(F.target.value),required:!0,autoFocus:!0})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"working-dir",children:"Working Directory"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(et,{id:"working-dir",value:i,onChange:F=>a(F.target.value),placeholder:"/path/to/project",required:!0}),m.jsx(Se,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!h),children:"Browse"})]})]})]}),h&&m.jsx(lue,{initialPath:i||void 0,onSelect:F=>{a(F),d(!1)},onCancel:()=>d(!1)}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"isolation",children:"Isolation"}),m.jsxs(da,{value:o||C,onValueChange:l,children:[m.jsx(ma,{id:"isolation",children:m.jsx(ha,{})}),m.jsxs(pa,{children:[m.jsx(An,{value:"none",children:"none"}),m.jsx(An,{value:"worktree",children:"worktree"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"merge-strategy",children:"Merge Strategy"}),m.jsxs(da,{value:c||_,onValueChange:f,children:[m.jsx(ma,{id:"merge-strategy",children:m.jsx(ha,{})}),m.jsxs(pa,{children:[m.jsx(An,{value:"auto",children:"auto"}),m.jsx(An,{value:"local",children:"local"}),m.jsx(An,{value:"pr",children:"pr"})]})]})]})]}),g&&m.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[m.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",m.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),m.jsxs("div",{className:"mt-2 flex gap-2",children:[m.jsx(Se,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),m.jsx(Se,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&m.jsx("p",{className:"text-sm text-destructive",children:(I=b.error||w.error)==null?void 0:I.message}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(Se,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),m.jsx(Se,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function hue({projectId:e}){const[t,n]=y.useState(!1),r=rue(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Se,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):m.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:m.jsx(Ya,{className:"h-4 w-4"})})}function mue(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function $d(e){return Un({queryKey:$e.projects.resources(e),queryFn:()=>Fe.get(`/projects/${e}/resources`)})}function pue(e,t,n,r){return Un({queryKey:$e.projects.resourceDetail(e,t,n),queryFn:()=>Fe.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function gue(e,t,n,r){return Un({queryKey:$e.projects.resourceConfig(e,t,n),queryFn:()=>Fe.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function vue(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 NN({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=vue(e,t);return m.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[m.jsx(Se,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:m.jsx(uoe,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?m.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):m.jsx(Se,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),m.jsx(Se,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:m.jsx(Cp,{className:"h-4 w-4"})})]})}function uU(e,t,n){return Un({queryKey:$e.registry.config(e,t),queryFn:()=>Fe.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function bo({className:e,...t}){return m.jsx("textarea",{"data-slot":"textarea",className:Oe("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 Op({...e}){return m.jsx(kJ,{"data-slot":"collapsible",...e})}function Tp({...e}){return m.jsx(bB,{"data-slot":"collapsible-trigger",...e})}function Pp({...e}){return m.jsx(wB,{"data-slot":"collapsible-content",...e})}function yue({projectId:e,open:t,onOpenChange:n}){var xe,Te,Ze,Je,Gt,nn;const r=xa(),i=bN(e),{data:a}=$d(e),o=B0(e),l=Vle(),c=(xe=i.data)==null?void 0:xe.merged,f="__empty__",[h,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(""),[N,O]=y.useState(""),[A,T]=y.useState(""),[P,L]=y.useState(""),[I,F]=y.useState(""),[$,G]=y.useState(!1),[D,V]=y.useState([]),[z,q]=y.useState(!1),[X,K]=y.useState(""),[R,H]=y.useState(!1),[U,B]=y.useState(!1),Q=gt(),Z=()=>{d(""),v(""),w(""),j(""),_(""),O(""),T(""),L(""),F(""),G(!1),V([]),q(!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 ot=Array.from(je.dataTransfer.files);if(ot.length){B(!0);try{const yt=await Fe.upload(`/projects/${e}/files`,ot);Q.invalidateQueries({queryKey:$e.projects.files(e)}),V(lt=>{const $n=yt.map(rn=>rn.path).filter(rn=>!lt.includes(rn));return[...lt,...$n]})}catch{}finally{B(!1)}}},se=je=>{V(ot=>ot.includes(je)?ot.filter(yt=>yt!==je):[...ot,je])},pe=async je=>{je.preventDefault();try{const ot={project_id:e,task:h.trim()};g.trim()&&(ot.role=g.trim());const yt={};b.trim()&&(yt.runtime=b.trim()),S.trim()&&(yt.memory=S.trim()),C&&(yt.cache_delegations=C==="true"),N.trim()&&(yt.cache_max_entries=Number(N.trim())),A.trim()&&(yt.cache_ttl_seconds=Number(A.trim())),P.trim()&&(yt.max_num_delegations=Number(P.trim())),Object.keys(yt).length>0&&(ot.overrides=yt),D.length>0&&(ot.context_files=D),I.trim()&&(ot.system_prompt=I.trim()),$&&(ot.interactive=!0);const lt=await l.mutateAsync(ot);Z(),n(!1),r(`/projects/${e}/sessions/${lt.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),Be=[ie,...Ee],Ne=(a??[]).filter(je=>je.type==="agents").map(je=>je.name),it=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));it.add("none");const Qe=[...it].sort(),Xe=g.trim()||ie,It=uU("roles",Xe,{enabled:!!Xe}),ft=((Ze=(Te=It.data)==null?void 0:Te.params_values)==null?void 0:Ze.default_agent)??((nn=(Gt=(Je=It.data)==null?void 0:Je.params_schema)==null?void 0:Gt.default_agent)==null?void 0:nn.default)??"",St=ft&&Ne.includes(ft)?ft:(c==null?void 0:c.runtime)??"strawpot-claude-code",Kt=g.trim()&&!Be.includes(g.trim())?"Role not found in installed roles":"",Dt=b.trim()&&Ne.length>0&&!Ne.includes(b.trim())?"Runtime not found in installed agents":"",cn=S.trim()&&!Qe.includes(S.trim())?"Memory not found in installed providers":"",de=!!Kt||!!Dt||!!cn;return m.jsx(No,{open:t,onOpenChange:n,children:m.jsxs(Ao,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Launch Session"})}),m.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"task",children:["Task ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs("div",{className:"relative",onDragOver:te,onDragEnter:ae,onDragLeave:re,onDrop:ee,children:[m.jsx(bo,{id:"task",value:h,onChange:je=>d(je.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(R||U)&&m.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?m.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(Tr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):m.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[m.jsx($0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(o.data??[]).length>0&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(fd,{children:[m.jsx(dd,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"outline",size:"sm",children:[m.jsx(yN,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),m.jsxs(hd,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[m.jsx("div",{className:"px-2 py-1.5",children:m.jsx(et,{placeholder:"Filter files...",value:X,onChange:je=>K(je.target.value),className:"h-7 text-xs",onKeyDown:je=>je.stopPropagation()})}),m.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o.data??[]).filter(je=>je.path.toLowerCase().includes(X.toLowerCase())).map(je=>m.jsx(CN,{checked:D.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:ot=>ot.preventDefault(),children:m.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),D.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.length," file(s) attached"]})]}),D.length>0&&m.jsxs("div",{className:"flex flex-wrap gap-1",children:[(z?D:D.slice(0,3)).map(je=>m.jsxs(pt,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[m.jsx("button",{type:"button",onClick:()=>se(je),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:m.jsx(lc,{className:"h-3 w-3"})}),m.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!z&&D.length>3&&m.jsxs("button",{type:"button",onClick:()=>q(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",D.length-3," more"]}),z&&D.length>3&&m.jsx("button",{type:"button",onClick:()=>q(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"role",children:"Role"}),m.jsx(et,{id:"role",list:"datalist-role",value:g,onChange:je=>v(je.target.value),placeholder:ie}),m.jsxs("datalist",{id:"datalist-role",children:[m.jsx("option",{value:ie}),Ee.map(je=>m.jsx("option",{value:je},je))]}),Kt&&m.jsx("p",{className:"text-xs text-destructive",children:Kt})]}),m.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:$,onChange:je=>G(je.target.checked),className:"rounded border-input"}),m.jsx("span",{className:"text-sm",children:"Interactive mode"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),m.jsxs(Op,{children:[m.jsx(Tp,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"ghost",size:"sm",children:[m.jsx(cd,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),m.jsxs(Pp,{className:"mt-3 space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"runtime",children:"Runtime"}),m.jsx(et,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:St}),Ne.length>0&&m.jsx("datalist",{id:"datalist-runtime",children:Ne.map(je=>m.jsx("option",{value:je},je))}),Dt&&m.jsx("p",{className:"text-xs text-destructive",children:Dt})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"memory",children:"Memory"}),m.jsx(et,{id:"memory",list:"datalist-memory",value:S,onChange:je=>j(je.target.value),placeholder:(c==null?void 0:c.memory)||"dial"}),m.jsx("datalist",{id:"datalist-memory",children:Qe.map(je=>m.jsx("option",{value:je},je))}),cn&&m.jsx("p",{className:"text-xs text-destructive",children:cn})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"system-prompt",children:"System Prompt"}),m.jsx(bo,{id:"system-prompt",value:I,onChange:je=>F(je.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Max Delegations"}),m.jsx(et,{type:"number",min:"0",value:P,onChange:je=>L(je.target.value),placeholder:c!=null&&c.max_num_delegations?String(c.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Delegations"}),m.jsxs(da,{value:C||f,onValueChange:je=>_(je===f?"":je),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{placeholder:(c==null?void 0:c.cache_delegations)!==!1?"true":"false"})}),m.jsxs(pa,{children:[m.jsxs(An,{value:f,className:"text-muted-foreground",children:["Default (",(c==null?void 0:c.cache_delegations)!==!1?"true":"false",")"]}),m.jsx(An,{value:"true",children:"true"}),m.jsx(An,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Max Entries"}),m.jsx(et,{type:"number",min:"0",value:N,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"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache TTL (seconds)"}),m.jsx(et,{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&&m.jsx("p",{className:"text-sm text-destructive",children:l.error.message}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(Se,{type:"submit",disabled:l.isPending||de,children:l.isPending?"Launching...":"Launch"}),m.jsx(Se,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function xue(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function cU({projectId:e}){const t=B0(e),n=iue(),r=aue(),i=y.useRef(null),[a,o]=y.useState(!1),[l,c]=y.useState(null),f=y.useCallback(j=>{const C=Array.from(j);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>Ht.success(`Uploaded ${C.length} file(s)`),onError:()=>Ht.error("Upload failed")})},[e,n]),h=y.useCallback(j=>{j.preventDefault(),o(!1),f(j.dataTransfer.files)},[f]),d=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&&(f(j.target.files),j.target.value="")},[f]),w=y.useCallback(j=>{r.mutate({projectId:e,filePath:j},{onSuccess:()=>{Ht.success("File deleted"),c(null)},onError:()=>{Ht.error("Failed to delete file"),c(null)}})},[e,r]),S=t.data??[];return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{onDrop:h,onDragOver:d,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:[m.jsx($0,{className:"h-8 w-8 text-muted-foreground"}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",m.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&m.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),m.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{className:"w-24",children:"Size"}),m.jsx(qe,{className:"w-44",children:"Modified"}),m.jsx(qe,{className:"w-28"})]})}),m.jsx(Ha,{children:S.map(j=>m.jsxs(Cn,{children:[m.jsx(He,{className:"font-mono text-xs",children:j.path}),m.jsx(He,{className:"text-xs text-muted-foreground",children:xue(j.size)}),m.jsx(He,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),m.jsx(He,{children:l===j.path?m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:()=>w(j.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),m.jsx("button",{type:"button",onClick:()=>c(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):m.jsx("div",{className:"flex justify-end",children:m.jsx(Se,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(j.path),disabled:r.isPending,children:m.jsx(Ya,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Mp({className:e,orientation:t="horizontal",...n}){return m.jsx(Mie,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Oe("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const bue=H0("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 Dp({className:e,variant:t="default",...n}){return m.jsx(Die,{"data-slot":"tabs-list","data-variant":t,className:Oe(bue({variant:t}),e),...n})}function or({className:e,...t}){return m.jsx(Rie,{"data-slot":"tabs-trigger",className:Oe("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 m.jsx(Iie,{"data-slot":"tabs-content",className:Oe("flex-1 outline-none",e),...t})}function wue(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Sue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eue={};function SR(e,t){return(Eue.jsx?jue:Sue).test(e)}const _ue=/[ \t\n\f\r]/g;function Cue(e){return typeof e=="object"?e.type==="text"?jR(e.value):!1:jR(e)}function jR(e){return e.replace(_ue,"")===""}class Rp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rp.prototype.normal={};Rp.prototype.property={};Rp.prototype.space=void 0;function fU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rp(n,r,t)}function B_(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 kue=0;const mt=Oc(),Xn=Oc(),F_=Oc(),_e=Oc(),fn=Oc(),Ff=Oc(),Ai=Oc();function Oc(){return 2**++kue}const U_=Object.freeze(Object.defineProperty({__proto__:null,boolean:mt,booleanish:Xn,commaOrSpaceSeparated:Ai,commaSeparated:Ff,number:_e,overloadedBoolean:F_,spaceSeparated:fn},Symbol.toStringTag,{value:"Module"})),US=Object.keys(U_);class AN extends bi{constructor(t,n,r,i){let a=-1;if(super(t,n),ER(this,"space",i),typeof r=="number")for(;++a<US.length;){const o=US[a];ER(this,US[a],(r&U_[o])===U_[o])}}}AN.prototype.defined=!0;function ER(e,t,n){n&&(e[t]=n)}function Bd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new AN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[B_(r)]=r,n[B_(a.attribute)]=r}return new Rp(t,n,e.space)}const dU=Bd({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 hU(e,t){return t in e?e[t]:t}function mU(e,t){return hU(e,t.toLowerCase())}const Nue=Bd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ff,acceptCharset:fn,accessKey:fn,action:null,allow:null,allowFullScreen:mt,allowPaymentRequest:mt,allowUserMedia:mt,alt:null,as:null,async:mt,autoCapitalize:null,autoComplete:fn,autoFocus:mt,autoPlay:mt,blocking:fn,capture:null,charSet:null,checked:mt,cite:null,className:fn,cols:_e,colSpan:null,content:null,contentEditable:Xn,controls:mt,controlsList:fn,coords:_e|Ff,crossOrigin:null,data:null,dateTime:null,decoding:null,default:mt,defer:mt,dir:null,dirName:null,disabled:mt,download:F_,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:mt,formTarget:null,headers:fn,height:_e,hidden:F_,high:_e,href:null,hrefLang:null,htmlFor:fn,httpEquiv:fn,id:null,imageSizes:null,imageSrcSet:null,inert:mt,inputMode:null,integrity:null,is:null,isMap:mt,itemId:null,itemProp:fn,itemRef:fn,itemScope:mt,itemType:fn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:mt,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:mt,muted:mt,name:null,nonce:null,noModule:mt,noValidate:mt,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:mt,optimum:_e,pattern:null,ping:fn,placeholder:null,playsInline:mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:mt,referrerPolicy:null,rel:fn,required:mt,reversed:mt,rows:_e,rowSpan:_e,sandbox:fn,scope:null,scoped:mt,seamless:mt,selected:mt,shadowRootClonable:mt,shadowRootDelegatesFocus:mt,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:mt,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:mt,declare:mt,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:mt,noHref:mt,noShade:mt,noWrap:mt,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:mt,disableRemotePlayback:mt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:mU}),Aue=Bd({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:mt,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:Ff,g2:Ff,glyphName:Ff,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:hU}),pU=Bd({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()}}),gU=Bd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mU}),vU=Bd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Oue={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"},Tue=/[A-Z]/g,_R=/-[a-z]/g,Pue=/^data[-\w.:]+$/i;function Mue(e,t){const n=B_(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"&&Pue.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(_R,Rue);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!_R.test(a)){let o=a.replace(Tue,Due);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=AN}return new i(r,t)}function Due(e){return"-"+e.toLowerCase()}function Rue(e){return e.charAt(1).toUpperCase()}const Iue=fU([dU,Nue,pU,gU,vU],"html"),ON=fU([dU,Aue,pU,gU,vU],"svg");function Lue(e){return e.join(" ").trim()}var bf={},HS,CR;function zue(){if(CR)return HS;CR=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=`
`,f="/",h="*",d="",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 N(D){var V=D.match(t);V&&(C+=V.length);var z=D.lastIndexOf(c);_=~z?D.length-z:_+D.length}function O(){var D={line:C,column:_};return function(V){return V.position=new A(D),L(),V}}function A(D){this.start=D,this.end={line:C,column:_},this.source=j.source}A.prototype.content=S;function T(D){var V=new Error(j.source+":"+C+":"+_+": "+D);if(V.reason=D,V.filename=j.source,V.line=C,V.column=_,V.source=S,!j.silent)throw V}function P(D){var V=D.exec(S);if(V){var z=V[0];return N(z),S=S.slice(z.length),V}}function L(){P(n)}function I(D){var V;for(D=D||[];V=F();)V!==!1&&D.push(V);return D}function F(){var D=O();if(!(f!=S.charAt(0)||h!=S.charAt(1))){for(var V=2;d!=S.charAt(V)&&(h!=S.charAt(V)||f!=S.charAt(V+1));)++V;if(V+=2,d===S.charAt(V-1))return T("End of comment missing");var z=S.slice(2,V-2);return _+=2,N(z),S=S.slice(V),_+=2,D({type:g,comment:z})}}function $(){var D=O(),V=P(r);if(V){if(F(),!P(i))return T("property missing ':'");var z=P(a),q=D({type:v,property:w(V[0].replace(e,d)),value:z?w(z[0].replace(e,d)):d});return P(o),q}}function G(){var D=[];I(D);for(var V;V=$();)V!==!1&&(D.push(V),I(D));return D}return L(),G()}function w(S){return S?S.replace(l,d):d}return HS=b,HS}var kR;function $ue(){if(kR)return bf;kR=1;var e=bf&&bf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bf,"__esModule",{value:!0}),bf.default=n;const t=e(zue());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:f,value:h}=c;l?i(f,h,c):h&&(a=a||{},a[f]=h)}),a}return bf}var Qh={},NR;function Bue(){if(NR)return Qh;NR=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,h){return h.toUpperCase()},l=function(f,h){return"".concat(h,"-")},c=function(f,h){return h===void 0&&(h={}),a(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(i,l):f=f.replace(r,l),f.replace(t,o))};return Qh.camelCase=c,Qh}var Zh,AR;function Fue(){if(AR)return Zh;AR=1;var e=Zh&&Zh.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e($ue()),n=Bue();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,Zh=r,Zh}var Uue=Fue();const Hue=Hi(Uue),yU=xU("end"),TN=xU("start");function xU(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 que(e){const t=TN(e),n=yU(e);if(t&&n)return{start:t,end:n}}function jm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?OR(e.position):"start"in e||"end"in e?OR(e):"line"in e||"column"in e?H_(e):""}function H_(e){return TR(e&&e.line)+":"+TR(e&&e.column)}function OR(e){return H_(e&&e.start)+"-"+H_(e&&e.end)}function TR(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=jm(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 PN={}.hasOwnProperty,Vue=new Map,Kue=/[A-Z]/g,Yue=new Set(["table","tbody","thead","tfoot","tr"]),Xue=new Set(["td","th"]),bU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gue(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=rce(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"?ON:Iue,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wU(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wU(e,t,n){if(t.type==="element")return Wue(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Que(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jue(e,t,n);if(t.type==="mdxjsEsm")return Zue(e,t);if(t.type==="root")return ece(e,t,n);if(t.type==="text")return tce(e,t)}function Wue(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ON,e.schema=i),e.ancestors.push(t);const a=jU(e,t.tagName,!1),o=ice(e,t);let l=DN(e,t);return Yue.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Cue(c):!0})),SU(e,o,a,t),MN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Que(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)}Im(e,t.position)}function Zue(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Im(e,t.position)}function Jue(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ON,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:jU(e,t.name,!0),o=ace(e,t),l=DN(e,t);return SU(e,o,a,t),MN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ece(e,t,n){const r={};return MN(r,DN(e,t)),e.create(t,e.Fragment,r,n)}function tce(e,t){return t.value}function SU(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function MN(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 f=Array.isArray(o.children)?n:t;return l?f(a,o,l):f(a,o)}}function rce(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=TN(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 ice(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&PN.call(t.properties,i)){const a=oce(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Xue.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 ace(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 Im(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 Im(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function DN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Vue;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 f=i.get(c)||0;o=c+"-"+f,i.set(c,f+1)}}const l=wU(e,a,o);l!==void 0&&n.push(l)}return n}function oce(e,t,n){const r=Mue(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?wue(n):Lue(n)),r.property==="style"){let i=typeof n=="object"?n:sce(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lce(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Oue[r.property]||r.property:r.attribute,n]}}function sce(e,t){try{return Hue(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=bU+"#cannot-parse-style-attribute",i}}function jU(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=SR(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=SR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return PN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Im(e)}function Im(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=bU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lce(e){const t={};let n;for(n in e)PN.call(e,n)&&(t[uce(n)]=e[n]);return t}function uce(e){let t=e.replace(Kue,cce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cce(e){return"-"+e.toLowerCase()}const qS={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"]},fce={};function RN(e,t){const n=fce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return EU(e,r,i)}function EU(e,t,n){if(dce(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 PR(e.children,t,n)}return Array.isArray(e)?PR(e,t,n):""}function PR(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=EU(e[i],t,n);return r.join("")}function dce(e){return!!(e&&typeof e=="object")}const MR=document.createElement("i");function IN(e){const t="&"+e+";";MR.innerHTML=t;const n=MR.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 DR={}.hasOwnProperty;function _U(e){const t={};let n=-1;for(;++n<e.length;)hce(t,e[n]);return t}function hce(e,t){let n;for(n in t){const i=(DR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){DR.call(i,o)||(i[o]=[]);const l=a[o];mce(i[o],Array.isArray(l)?l:l?[l]:[])}}}function mce(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 CU(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 za(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=Jl(/[A-Za-z]/),Ur=Jl(/[\dA-Za-z]/),pce=Jl(/[#-'*+\--9=?A-Z^-~]/);function ex(e){return e!==null&&(e<32||e===127)}const q_=Jl(/\d/),gce=Jl(/[\dA-Fa-f]/),vce=Jl(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function wt(e){return e===-2||e===-1||e===32}const K0=Jl(new RegExp("\\p{P}|\\p{S}","u")),cc=Jl(/\s/);function Jl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fd(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 Tt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return wt(c)?(e.enter(n),l(c)):t(c)}function l(c){return wt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const yce={tokenize:xce};function xce(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"),Tt(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 tt(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const bce={tokenize:wce},RR={tokenize:Sce};function wce(e){const t=this,n=[];let r=0,i,a,o;return l;function l(_){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,c,f)(_)}return f(_)}function c(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const N=t.events.length;let O=N,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=N;for(;T<t.events.length;)t.events[T][1].end={...A},T++;return Ii(t.events,O+1,0,t.events.slice(N)),t.events.length=T,f(_)}return l(_)}function f(_){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(RR,h,d)(_)}function h(_){return i&&C(),j(r),g(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(_)}function g(_){return t.containerState={},e.attempt(RR,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 tt(_)?(e.consume(_),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(_),w)}function S(_,N){const O=t.sliceStream(_);if(N&&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,L,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(L){I=t.events[P][1].end;break}L=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...I},A++;Ii(t.events,P+1,0,t.events.slice(T)),t.events.length=A}}function j(_){let N=n.length;for(;N-- >_;){const O=n[N];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 Sce(e,t,n){return Tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function md(e){if(e===null||un(e)||cc(e))return 1;if(K0(e))return 2}function Y0(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 V_={name:"attention",resolveAll:jce,tokenize:Ece};function jce(e,t){let n=-1,r,i,a,o,l,c,f,h;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 d={...e[r][1].end},g={...e[n][1].start};IR(d,-c),IR(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,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},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=oa(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=oa(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=oa(f,Y0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=oa(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=oa(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ii(e,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ece(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=md(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 f=e.exit("attentionSequence"),h=md(c),d=!h||h===2&&i||n.includes(c),g=!i||i===2&&h||n.includes(r);return f._open=!!(a===42?d:d&&(i||!g)),f._close=!!(a===42?g:g&&(h||!d)),t(c)}}function IR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _ce={name:"autolink",tokenize:Cce};function Cce(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):f(v)}function o(v){return v===43||v===45||v===46||Ur(v)?(r=1,l(v)):f(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,f(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||ex(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),h):pce(v)?(e.consume(v),f):n(v)}function h(v){return Ur(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,h):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:d;return e.consume(v),b}return n(v)}}const Ip={partial:!0,tokenize:kce};function kce(e,t,n){return r;function r(a){return wt(a)?Tt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||tt(a)?t(a):n(a)}}const kU={continuation:{tokenize:Ace},exit:Oce,name:"blockQuote",tokenize:Nce};function Nce(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 wt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Ace(e,t,n){const r=this;return i;function i(o){return wt(o)?Tt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(kU,t,n)(o)}}function Oce(e){e.exit("blockQuote")}const NU={name:"characterEscape",tokenize:Tce};function Tce(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 vce(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const AU={name:"characterReference",tokenize:Pce};function Pce(e,t,n){const r=this;let i=0,a,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Ur,h(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=gce,h):(e.enter("characterReferenceValue"),a=7,o=q_,h(d))}function h(d){if(d===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!IN(r.sliceSerialize(g))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<a?(e.consume(d),h):n(d)}}const LR={partial:!0,tokenize:Dce},zR={concrete:!0,name:"codeFenced",tokenize:Mce};function Mce(e,t,n){const r=this,i={partial:!0,tokenize:O};let a=0,o=0,l;return c;function c(A){return f(A)}function f(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"),h(A)}function h(A){return A===l?(o++,e.consume(A),h):o<3?n(A):(e.exit("codeFencedFenceSequence"),wt(A)?Tt(e,d,"whitespace")(A):d(A))}function d(A){return A===null||tt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(LR,w,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(A)):wt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Tt(e,v,"whitespace")(A)):A===96&&A===l?n(A):(e.consume(A),g)}function v(A){return A===null||tt(A)?d(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||tt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(A)):A===96&&A===l?n(A):(e.consume(A),b)}function w(A){return e.attempt(i,N,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return a>0&&wt(A)?Tt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||tt(A)?e.check(LR,w,N)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||tt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),_)}function N(A){return e.exit("codeFenced"),t(A)}function O(A,T,P){let L=0;return I;function I(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),F}function F(V){return A.enter("codeFencedFence"),wt(V)?Tt(A,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):$(V)}function $(V){return V===l?(A.enter("codeFencedFenceSequence"),G(V)):P(V)}function G(V){return V===l?(L++,A.consume(V),G):L>=o?(A.exit("codeFencedFenceSequence"),wt(V)?Tt(A,D,"whitespace")(V):D(V)):P(V)}function D(V){return V===null||tt(V)?(A.exit("codeFencedFence"),T(V)):P(V)}}}function Dce(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 VS={name:"codeIndented",tokenize:Ice},Rce={partial:!0,tokenize:Lce};function Ice(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Tt(e,a,"linePrefix",5)(f)}function a(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?c(f):tt(f)?e.attempt(Rce,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||tt(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function Lce(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Tt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):tt(o)?i(o):n(o)}}const zce={name:"codeText",previous:Bce,resolve:$ce,tokenize:Fce};function $ce(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 Bce(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Fce(e,t,n){let r=0,i,a;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),i=0,h(d)):tt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||tt(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",f(d))}}class Uce{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&&Jh(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),Jh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jh(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);Jh(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jh(this.left,n.reverse())}}}function Jh(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 OU(e){const t={};let n=-1,r,i,a,o,l,c,f;const h=new Uce(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.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,Hce(h,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=h.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.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={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return Ii(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function Hce(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=[],f={};let h,d,g=-1,v=n,b=0,w=0;const S=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(h=r.sliceStream(v),v.next||h.push(null),d&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=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;)f[b+c[g][0]]=b+c[g][1],b+=c[g][1]-c[g][0]-1;return f}const qce={resolve:Kce,tokenize:Yce},Vce={partial:!0,tokenize:Xce};function Kce(e){return OU(e),e}function Yce(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):tt(l)?e.check(Vce,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 Xce(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Tt(e,a,"linePrefix")}function a(o){if(o===null||tt(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function TU(e,t,n,r,i,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(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||ex(j)?n(j):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(j))}function g(j){return j===62?(e.enter(a),e.consume(j),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(e.exit("chunkString"),e.exit(l),g(j)):j===null||j===60||tt(j)?n(j):(e.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(e.consume(j),v):v(j)}function w(j){return!h&&(j===null||j===41||un(j))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(j)):h<f&&j===40?(e.consume(j),h++,w):j===41?(e.consume(j),h--,w):j===null||j===32||j===40||ex(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 PU(e,t,n,r,i,a){const o=this;let l=0,c;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),h}function h(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):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||tt(v)||l++>999?(e.exit("chunkString"),h(v)):(e.consume(v),c||(c=!wt(v)),v===92?g:d)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,d):d(v)}}function MU(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),f(g))}function f(g){return g===o?(e.exit(a),c(o)):g===null?n(g):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Tt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===o||g===null||tt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?d:h)}function d(g){return g===o||g===92?(e.consume(g),h):h(g)}}function Em(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):wt(i)?Tt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Gce={name:"definition",tokenize:Qce},Wce={partial:!0,tokenize:Zce};function Qce(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return PU.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=za(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 un(v)?Em(e,f)(v):f(v)}function f(v){return TU(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function h(v){return e.attempt(Wce,d,d)(v)}function d(v){return wt(v)?Tt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||tt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function Zce(e,t,n){return r;function r(l){return un(l)?Em(e,i)(l):n(l)}function i(l){return MU(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return wt(l)?Tt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||tt(l)?t(l):n(l)}}const Jce={name:"hardBreakEscape",tokenize:efe};function efe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return tt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const tfe={name:"headingAtx",resolve:nfe,tokenize:rfe};function nfe(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 rfe(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(e.consume(h),o):h===null||un(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||tt(h)?(e.exit("atxHeading"),t(h)):wt(h)?Tt(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||un(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const ife=["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"],$R=["pre","script","style","textarea"],afe={concrete:!0,name:"htmlFlow",resolveTo:lfe,tokenize:ufe},ofe={partial:!0,tokenize:ffe},sfe={partial:!0,tokenize:cfe};function lfe(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 ufe(e,t,n){const r=this;let i,a,o,l,c;return f;function f(B){return h(B)}function h(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),d}function d(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:R):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:R):n(B)}function v(B){return B===45?(e.consume(B),r.interrupt?t:R):n(B)}function b(B){const Q="CDATA[";return B===Q.charCodeAt(l++)?(e.consume(B),l===Q.length?r.interrupt?t:$: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||un(B)){const Q=B===47,Z=o.toLowerCase();return!Q&&!a&&$R.includes(Z)?(i=1,r.interrupt?t(B):$(B)):ife.includes(o.toLowerCase())?(i=6,Q?(e.consume(B),j):r.interrupt?t(B):$(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:$):n(B)}function C(B){return wt(B)?(e.consume(B),C):I(B)}function _(B){return B===47?(e.consume(B),I):B===58||B===95||ei(B)?(e.consume(B),N):wt(B)?(e.consume(B),_):I(B)}function N(B){return B===45||B===46||B===58||B===95||Ur(B)?(e.consume(B),N):O(B)}function O(B){return B===61?(e.consume(B),A):wt(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):wt(B)?(e.consume(B),A):P(B)}function T(B){return B===c?(e.consume(B),c=null,L):B===null||tt(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||un(B)?O(B):(e.consume(B),P)}function L(B){return B===47||B===62||wt(B)?_(B):n(B)}function I(B){return B===62?(e.consume(B),F):n(B)}function F(B){return B===null||tt(B)?$(B):wt(B)?(e.consume(B),F):n(B)}function $(B){return B===45&&i===2?(e.consume(B),z):B===60&&i===1?(e.consume(B),q):B===62&&i===4?(e.consume(B),H):B===63&&i===3?(e.consume(B),R):B===93&&i===5?(e.consume(B),K):tt(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ofe,U,G)(B)):B===null||tt(B)?(e.exit("htmlFlowData"),G(B)):(e.consume(B),$)}function G(B){return e.check(sfe,D,U)(B)}function D(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),V}function V(B){return B===null||tt(B)?G(B):(e.enter("htmlFlowData"),$(B))}function z(B){return B===45?(e.consume(B),R):$(B)}function q(B){return B===47?(e.consume(B),o="",X):$(B)}function X(B){if(B===62){const Q=o.toLowerCase();return $R.includes(Q)?(e.consume(B),H):$(B)}return ei(B)&&o.length<8?(e.consume(B),o+=String.fromCharCode(B),X):$(B)}function K(B){return B===93?(e.consume(B),R):$(B)}function R(B){return B===62?(e.consume(B),H):B===45&&i===2?(e.consume(B),R):$(B)}function H(B){return B===null||tt(B)?(e.exit("htmlFlowData"),U(B)):(e.consume(B),H)}function U(B){return e.exit("htmlFlow"),t(B)}}function cfe(e,t,n){const r=this;return i;function i(o){return tt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function ffe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ip,t,n)}}const dfe={name:"htmlText",tokenize:hfe};function hfe(e,t,n){const r=this;let i,a,o;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),O):R===63?(e.consume(R),_):ei(R)?(e.consume(R),P):n(R)}function f(R){return R===45?(e.consume(R),h):R===91?(e.consume(R),a=0,b):ei(R)?(e.consume(R),C):n(R)}function h(R){return R===45?(e.consume(R),v):n(R)}function d(R){return R===null?n(R):R===45?(e.consume(R),g):tt(R)?(o=d,q(R)):(e.consume(R),d)}function g(R){return R===45?(e.consume(R),v):d(R)}function v(R){return R===62?z(R):R===45?g(R):d(R)}function b(R){const H="CDATA[";return R===H.charCodeAt(a++)?(e.consume(R),a===H.length?w:b):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),S):tt(R)?(o=w,q(R)):(e.consume(R),w)}function S(R){return R===93?(e.consume(R),j):w(R)}function j(R){return R===62?z(R):R===93?(e.consume(R),j):w(R)}function C(R){return R===null||R===62?z(R):tt(R)?(o=C,q(R)):(e.consume(R),C)}function _(R){return R===null?n(R):R===63?(e.consume(R),N):tt(R)?(o=_,q(R)):(e.consume(R),_)}function N(R){return R===62?z(R):_(R)}function O(R){return ei(R)?(e.consume(R),A):n(R)}function A(R){return R===45||Ur(R)?(e.consume(R),A):T(R)}function T(R){return tt(R)?(o=T,q(R)):wt(R)?(e.consume(R),T):z(R)}function P(R){return R===45||Ur(R)?(e.consume(R),P):R===47||R===62||un(R)?L(R):n(R)}function L(R){return R===47?(e.consume(R),z):R===58||R===95||ei(R)?(e.consume(R),I):tt(R)?(o=L,q(R)):wt(R)?(e.consume(R),L):z(R)}function I(R){return R===45||R===46||R===58||R===95||Ur(R)?(e.consume(R),I):F(R)}function F(R){return R===61?(e.consume(R),$):tt(R)?(o=F,q(R)):wt(R)?(e.consume(R),F):L(R)}function $(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,G):tt(R)?(o=$,q(R)):wt(R)?(e.consume(R),$):(e.consume(R),D)}function G(R){return R===i?(e.consume(R),i=void 0,V):R===null?n(R):tt(R)?(o=G,q(R)):(e.consume(R),G)}function D(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||un(R)?L(R):(e.consume(R),D)}function V(R){return R===47||R===62||un(R)?L(R):n(R)}function z(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function q(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),X}function X(R){return wt(R)?Tt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):K(R)}function K(R){return e.enter("htmlTextData"),o(R)}}const LN={name:"labelEnd",resolveAll:vfe,resolveTo:yfe,tokenize:xfe},mfe={tokenize:bfe},pfe={tokenize:wfe},gfe={tokenize:Sfe};function vfe(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 yfe(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}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=oa(l,e.slice(a+1,a+r+3)),l=oa(l,[["enter",h,t]]),l=oa(l,Y0(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=oa(l,[["exit",h,t],e[o-2],e[o-1],["exit",f,t]]),l=oa(l,e.slice(o+1)),l=oa(l,[["exit",c,t]]),Ii(e,a,e.length,l),e}function xfe(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?d(g):(o=r.parser.defined.includes(za(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(mfe,h,o?h:d)(g):g===91?e.attempt(pfe,h,o?f:d)(g):o?h(g):d(g)}function f(g){return e.attempt(gfe,h,d)(g)}function h(g){return t(g)}function d(g){return a._balanced=!0,n(g)}}function bfe(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return un(d)?Em(e,a)(d):a(d)}function a(d){return d===41?h(d):TU(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return un(d)?Em(e,c)(d):h(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?MU(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function f(d){return un(d)?Em(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function wfe(e,t,n){const r=this;return i;function i(l){return PU.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(za(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Sfe(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 jfe={name:"labelStartImage",resolveAll:LN.resolveAll,tokenize:Efe};function Efe(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 _fe={name:"labelStartLink",resolveAll:LN.resolveAll,tokenize:Cfe};function Cfe(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 KS={name:"lineEnding",tokenize:kfe};function kfe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Tt(e,t,"linePrefix")}}const jy={name:"thematicBreak",tokenize:Nfe};function Nfe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,l(f)}function l(f){return f===i?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||tt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===i?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),wt(f)?Tt(e,l,"whitespace")(f):l(f))}}const mi={continuation:{tokenize:Pfe},exit:Dfe,name:"list",tokenize:Tfe},Afe={partial:!0,tokenize:Rfe},Ofe={partial:!0,tokenize:Mfe};function Tfe(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:q_(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(jy,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return q_(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"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Ip,r.interrupt?n:h,e.attempt(Afe,g,d))}function h(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function d(v){return wt(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 Pfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ip,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Tt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!wt(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(Ofe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Tt(e,e.attempt(mi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Mfe(e,t,n){const r=this;return Tt(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 Dfe(e){e.exit(this.containerState.type)}function Rfe(e,t,n){const r=this;return Tt(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!wt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const BR={name:"setextUnderline",resolveTo:Ife,tokenize:Lfe};function Ife(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(f){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),wt(f)?Tt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||tt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const zfe={tokenize:$fe};function $fe(e){const t=this,n=e.attempt(Ip,r,e.attempt(this.parser.constructs.flowInitial,i,Tt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qce,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 Bfe={resolveAll:RU()},Ffe=DU("string"),Ufe=DU("text");function DU(e){return{resolveAll:RU(e==="text"?Hfe: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(h){return f(h)?a(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return f(h)?(n.exit("data"),a(h)):(n.consume(h),c)}function f(h){if(h===null)return!0;const d=i[h];let g=-1;if(d)for(;++g<d.length;){const v=d[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function RU(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 Hfe(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 f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(f===-2)c=!0,l++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={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={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const qfe={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:kU},Vfe={91:Gce},Kfe={[-2]:VS,[-1]:VS,32:VS},Yfe={35:tfe,42:jy,45:[BR,jy],60:afe,61:BR,95:jy,96:zR,126:zR},Xfe={38:AU,92:NU},Gfe={[-5]:KS,[-4]:KS,[-3]:KS,33:jfe,38:AU,42:V_,60:[_ce,dfe],91:_fe,92:[Jce,NU],93:LN,95:V_,96:zce},Wfe={null:[V_,Bfe]},Qfe={null:[42,95]},Zfe={null:[]},Jfe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qfe,contentInitial:Vfe,disable:Zfe,document:qfe,flow:Yfe,flowInitial:Kfe,insideSpan:Wfe,string:Xfe,text:Gfe},Symbol.toStringTag,{value:"Module"}));function ede(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:N,interrupt:T(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:d};let h=t.tokenize.call(f,c);return t.resolveAll&&a.push(t),f;function d(F){return o=oa(o,F),S(),o[o.length-1]!==null?[]:(P(t,0),f.events=Y0(a,f.events,f),f.events)}function g(F,$){return nde(v(F),$)}function v(F){return tde(o,F)}function b(){const{_bufferIndex:F,_index:$,line:G,column:D,offset:V}=r;return{_bufferIndex:F,_index:$,line:G,column:D,offset:V}}function w(F){i[F.line]=F.column,I()}function S(){let F;for(;r._index<o.length;){const $=o[r._index];if(typeof $=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<$.length;)j($.charCodeAt(r._bufferIndex));else j($)}}function j(F){h=h(F)}function C(F){tt(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,I()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=F}function _(F,$){const G=$||{};return G.type=F,G.start=b(),f.events.push(["enter",G,f]),l.push(G),G}function N(F){const $=l.pop();return $.end=b(),f.events.push(["exit",$,f]),$}function O(F,$){P(F,$.from)}function A(F,$){$.restore()}function T(F,$){return G;function G(D,V,z){let q,X,K,R;return Array.isArray(D)?U(D):"tokenize"in D?U([D]):H(D);function H(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,pe=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return U(pe)(re)}}function U(te){return q=te,X=0,te.length===0?z:B(te[X])}function B(te){return ae;function ae(re){return R=L(),K=te,te.partial||(f.currentConstruct=te),te.name&&f.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call($?Object.assign(Object.create(f),$):f,c,Q,Z)(re)}}function Q(te){return F(K,R),V}function Z(te){return R.restore(),++X<q.length?B(q[X]):z}}}function P(F,$){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Ii(f.events,$,f.events.length-$,F.resolve(f.events.slice($),f)),F.resolveTo&&(f.events=F.resolveTo(f.events,f))}function L(){const F=b(),$=f.previous,G=f.currentConstruct,D=f.events.length,V=Array.from(l);return{from:D,restore:z};function z(){r=F,f.previous=$,f.currentConstruct=G,f.events.length=D,l=V,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tde(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 nde(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 rde(e){const r={constructs:_U([Jfe,...(e||{}).extensions||[]]),content:i(yce),defined:[],document:i(bce),flow:i(zfe),lazy:{},string:i(Ffe),text:i(Ufe)};return r;function i(a){return o;function o(l){return ede(r,a,l)}}}function ide(e){for(;!OU(e););return e}const FR=/[\0\t\n\r]/g;function ade(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let f,h,d,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(FR.lastIndex=d,f=FR.exec(a),g=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(g),!f){t=a.slice(d);break}if(v===10&&d===g&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<g&&(c.push(a.slice(d,g)),e+=g-d),v){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=g+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const ode=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sde(e){return e.replace(ode,lde)}function lde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return CU(n.slice(a?2:1),a?16:10)}return IN(n)||e}const IU={}.hasOwnProperty;function ude(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),cde(n)(ide(rde(n).document().write(ade()(e,t,!0))))}function cde(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Xe),autolinkProtocol:L,autolinkEmail:L,atxHeading:a(Be),blockQuote:a(se),characterEscape:L,characterReference:L,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(ie,o),codeTextData:L,data:L,codeFlowValue:L,definition:a(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(it,o),htmlFlowData:L,htmlText:a(it,o),htmlTextData:L,image:a(Qe),label:o,link:a(Xe),listItem:a(ft),listItemValue:g,listOrdered:a(It,d),listUnordered:a(It),paragraph:a(St),reference:B,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Be),strong:a(Kt),thematicBreak:a(cn)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:I,codeIndented:c(j),codeText:c(V),codeTextData:I,data:I,definition:c(),definitionDestinationString:N,definitionLabelString:C,definitionTitleString:_,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(G),htmlFlowData:I,htmlText:c(D),htmlTextData:I,image:c(q),label:K,labelText:X,lineEnding:F,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:R,resourceTitleString:H,resource:U,setextHeading:c(P),setextHeadingLineSequence:T,setextHeadingText:A,strong:c(),thematicBreak:c()}};LU(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let xe={type:"root",children:[]};const Te={stack:[xe],tokenStack:[],config:t,enter:l,exit:f,buffer:o,resume:h,data:n},Ze=[];let Je=-1;for(;++Je<de.length;)if(de[Je][1].type==="listOrdered"||de[Je][1].type==="listUnordered")if(de[Je][0]==="enter")Ze.push(Je);else{const Gt=Ze.pop();Je=i(de,Gt,Je)}for(Je=-1;++Je<de.length;){const Gt=t[de[Je][0]];IU.call(Gt,de[Je][1].type)&&Gt[de[Je][1].type].call(Object.assign({sliceSerialize:de[Je][2].sliceSerialize},Te),de[Je][1])}if(Te.tokenStack.length>0){const Gt=Te.tokenStack[Te.tokenStack.length-1];(Gt[1]||UR).call(Te,void 0,Gt[0])}for(xe.position={start:ml(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:ml(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)xe=t.transforms[Je](xe)||xe;return xe}function i(de,xe,Te){let Ze=xe-1,Je=-1,Gt=!1,nn,je,ot,yt;for(;++Ze<=Te;){const lt=de[Ze];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?Je++:Je--,yt=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(nn&&!yt&&!Je&&!ot&&(ot=Ze),yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yt=void 0}if(!Je&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||Je===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(nn){let $n=Ze;for(je=void 0;$n--;){const rn=de[$n];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;je&&(de[je][1].type="lineEndingBlank",Gt=!0),rn[1].type="lineEnding",je=$n}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}ot&&(!je||ot<je)&&(nn._spread=!0),nn.end=Object.assign({},je?de[je][1].start:lt[1].end),de.splice(je||Ze,0,["exit",nn,lt[2]]),Ze++,Te++}if(lt[1].type==="listItemPrefix"){const $n={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};nn=$n,de.splice(Ze,0,["enter",$n,lt[2]]),Ze++,Te++,ot=void 0,yt=!0}}}return de[xe][1]._spread=Gt,Te}function a(de,xe){return Te;function Te(Ze){l.call(this,de(Ze),Ze),xe&&xe.call(this,Ze)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(de,xe,Te){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([xe,Te||void 0]),de.position={start:ml(xe.start),end:void 0}}function c(de){return xe;function xe(Te){de&&de.call(this,Te),f.call(this,Te)}}function f(de,xe){const Te=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==de.type&&(xe?xe.call(this,de,Ze[0]):(Ze[1]||UR).call(this,de,Ze[0]));else throw new Error("Cannot close `"+de.type+"` ("+jm({start:de.start,end:de.end})+"): it’s not open");Te.position.end=ml(de.end)}function h(){return RN(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function g(de){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function v(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=de}function b(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=de}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/(\r?\n|\r)$/g,"")}function C(de){const xe=this.resume(),Te=this.stack[this.stack.length-1];Te.label=xe,Te.identifier=za(this.sliceSerialize(de)).toLowerCase()}function _(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function N(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function O(de){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Te=this.sliceSerialize(de).length;xe.depth=Te}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(de){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function L(de){const Te=this.stack[this.stack.length-1].children;let Ze=Te[Te.length-1];(!Ze||Ze.type!=="text")&&(Ze=Dt(),Ze.position={start:ml(de.start),end:void 0},Te.push(Ze)),this.stack.push(Ze)}function I(de){const xe=this.stack.pop();xe.value+=this.sliceSerialize(de),xe.position.end=ml(de.end)}function F(de){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=xe.children[xe.children.length-1];Te.position.end=ml(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(L.call(this,de),I.call(this,de))}function $(){this.data.atHardBreak=!0}function G(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function D(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function V(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function z(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function q(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function X(de){const xe=this.sliceSerialize(de),Te=this.stack[this.stack.length-2];Te.label=sde(xe),Te.identifier=za(xe).toLowerCase()}function K(){const de=this.stack[this.stack.length-1],xe=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const Ze=de.children;Te.children=Ze}else Te.alt=xe}function R(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function H(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function U(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Q(de){const xe=this.resume(),Te=this.stack[this.stack.length-1];Te.label=xe,Te.identifier=za(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function Z(de){this.data.characterReferenceType=de.type}function te(de){const xe=this.sliceSerialize(de),Te=this.data.characterReferenceType;let Ze;Te?(Ze=CU(xe,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=IN(xe);const Je=this.stack[this.stack.length-1];Je.value+=Ze}function ae(de){const xe=this.stack.pop();xe.position.end=ml(de.end)}function re(de){I.call(this,de);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(de)}function ee(de){I.call(this,de);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(de)}function se(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function it(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function Xe(){return{type:"link",title:null,url:"",children:[]}}function It(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function ft(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function St(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function cn(){return{type:"thematicBreak"}}}function ml(e){return{line:e.line,column:e.column,offset:e.offset}}function LU(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LU(e,r):fde(e,r)}}function fde(e,t){let n;for(n in t)if(IU.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 UR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+jm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+jm({start:t.start,end:t.end})+") is still open")}function dde(e){const t=this;t.parser=n;function n(r){return ude(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hde(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 mde(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function pde(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 gde(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vde(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yde(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Fd(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 f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function xde(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 bde(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zU(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 wde(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zU(e,t);const i={src:Fd(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 Sde(e,t){const n={src:Fd(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 jde(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 Ede(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zU(e,t);const i={href:Fd(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 _de(e,t){const n={href:Fd(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 Cde(e,t,n){const r=e.all(t),i=n?kde(n):$U(t),a={},o=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.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 h=r[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function kde(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=$U(n[r])}return t}function $U(e){const t=e.spread;return t??e.children.length>1}function Nde(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 Ade(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ode(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Tde(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pde(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=TN(t.children[1]),c=yU(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 Mde(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 f=[];for(;++c<l;){const d=t.children[c],g={},v=o?o[c]:void 0;v&&(g.align=v);let b={type:"element",tagName:a,properties:g,children:[]};d&&(b.children=e.all(d),e.patch(d,b),b=e.applyData(d,b)),f.push(b)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,h),e.applyData(t,h)}function Dde(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const HR=9,qR=32;function Rde(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(VR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(VR(t.slice(i),i>0,!1)),a.join("")}function VR(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===HR||a===qR;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===HR||a===qR;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ide(e,t){const n={type:"text",value:Rde(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Lde(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zde={blockquote:hde,break:mde,code:pde,delete:gde,emphasis:vde,footnoteReference:yde,heading:xde,html:bde,imageReference:wde,image:Sde,inlineCode:jde,linkReference:Ede,link:_de,listItem:Cde,list:Nde,paragraph:Ade,root:Ode,strong:Tde,table:Pde,tableCell:Dde,tableRow:Mde,text:Ide,thematicBreak:Lde,toml:Uv,yaml:Uv,definition:Uv,footnoteDefinition:Uv};function Uv(){}const BU=-1,X0=0,_m=1,tx=2,zN=3,$N=4,BN=5,FN=6,FU=7,UU=8,KR=typeof self=="object"?self:globalThis,$de=(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 X0:case BU:return n(o,i);case _m:{const l=n([],i);for(const c of o)l.push(r(c));return l}case tx:{const l=n({},i);for(const[c,f]of o)l[r(c)]=r(f);return l}case zN:return n(new Date(o),i);case $N:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case BN:{const l=n(new Map,i);for(const[c,f]of o)l.set(r(c),r(f));return l}case FN:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case FU:{const{name:l,message:c}=o;return n(new KR[l](c),i)}case UU: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 KR[a](o),i)};return r},YR=e=>$de(new Map,e)(0),wf="",{toString:Bde}={},{keys:Fde}=Object,em=e=>{const t=typeof e;if(t!=="object"||!e)return[X0,t];const n=Bde.call(e).slice(8,-1);switch(n){case"Array":return[_m,wf];case"Object":return[tx,wf];case"Date":return[zN,wf];case"RegExp":return[$N,wf];case"Map":return[BN,wf];case"Set":return[FN,wf];case"DataView":return[_m,n]}return n.includes("Array")?[_m,n]:n.includes("Error")?[FU,n]:[tx,n]},Hv=([e,t])=>e===X0&&(t==="function"||t==="symbol"),Ude=(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]=em(o);switch(l){case X0:{let h=o;switch(c){case"bigint":l=UU,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([BU],o)}return i([l,h],o)}case _m:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const h=[],d=i([l,h],o);for(const g of o)h.push(a(g));return d}case tx:{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 h=[],d=i([l,h],o);for(const g of Fde(o))(e||!Hv(em(o[g])))&&h.push([a(g),a(o[g])]);return d}case zN:return i([l,o.toISOString()],o);case $N:{const{source:h,flags:d}=o;return i([l,{source:h,flags:d}],o)}case BN:{const h=[],d=i([l,h],o);for(const[g,v]of o)(e||!(Hv(em(g))||Hv(em(v))))&&h.push([a(g),a(v)]);return d}case FN:{const h=[],d=i([l,h],o);for(const g of o)(e||!Hv(em(g)))&&h.push(a(g));return d}}const{message:f}=o;return i([l,{name:c,message:f}],o)};return a},XR=(e,{json:t,lossy:n}={})=>{const r=[];return Ude(!(t||n),!!t,new Map,r)(e),r},nx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?YR(XR(e,t)):structuredClone(e):(e,t)=>YR(XR(e,t));function Hde(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 qde(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Vde(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Hde,r=e.options.footnoteBackLabel||qde,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 f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const h=e.all(f),d=String(f.identifier).toUpperCase(),g=Fd(d.toLowerCase());let v=0;const b=[],w=e.footnoteCounts.get(d);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=h[h.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 h.push(...b);const j={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(h,!0)};e.patch(f,j),l.push(j)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...nx(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 G0=(function(e){if(e==null)return Gde;if(typeof e=="function")return W0(e);if(typeof e=="object")return Array.isArray(e)?Kde(e):Yde(e);if(typeof e=="string")return Xde(e);throw new Error("Expected function, string, or object as test")});function Kde(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=G0(e[n]);return W0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Yde(e){const t=e;return W0(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Xde(e){return W0(t);function t(n){return n&&n.type===e}}function W0(e){return t;function t(n,r,i){return!!(Wde(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Gde(){return!0}function Wde(e){return e!==null&&typeof e=="object"&&"type"in e}const HU=[],Qde=!0,K_=!1,Zde="skip";function qU(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=G0(i),o=r?-1:1;l(e,void 0,[])();function l(c,f,h){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=HU,b,w,S;if((!t||a(c,f,h[h.length-1]||void 0))&&(v=Jde(n(c,h)),v[0]===K_))return v;if("children"in c&&c.children){const j=c;if(j.children&&v[0]!==Zde)for(w=(r?j.children.length:-1)+o,S=h.concat(j);w>-1&&w<j.children.length;){const C=j.children[w];if(b=l(C,w,S)(),b[0]===K_)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function Jde(e){return Array.isArray(e)?e:typeof e=="number"?[Qde,e]:e==null?HU:[e]}function UN(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),qU(e,a,l,i);function l(c,f){const h=f[f.length-1],d=h?h.children.indexOf(c):void 0;return o(c,d,h)}}const Y_={}.hasOwnProperty,ehe={};function the(e,t){const n=t||ehe,r=new Map,i=new Map,a=new Map,o={...zde,...n.handlers},l={all:f,applyData:rhe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:nhe,wrap:ahe};return UN(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();d.has(g)||d.set(g,h)}}),l;function c(h,d){const g=h.type,v=l.handlers[g];if(Y_.call(l.handlers,g)&&v)return v(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in h){const{children:w,...S}=h,j=nx(S);return j.children=l.all(h),j}return nx(h)}return(l.options.unknownHandler||ihe)(l,h,d)}function f(h){const d=[];if("children"in h){const g=h.children;let v=-1;for(;++v<g.length;){const b=l.one(g[v],h);if(b){if(v&&g[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=GR(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=GR(w.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function nhe(e,t){e.position&&(t.position=que(e))}function rhe(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,nx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ihe(e,t){const n=t.data||{},r="value"in t&&!(Y_.call(n,"hProperties")||Y_.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 ahe(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 GR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function WR(e,t){const n=the(e,t),r=n.one(e,void 0),i=Vde(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function ohe(e,t){return e&&"run"in e?async function(n,r){const i=WR(n,{file:r,...t});await e.run(i,r)}:function(n,r){return WR(n,{file:r,...e||t})}}function QR(e){if(e)throw e}var YS,ZR;function she(){if(ZR)return YS;ZR=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!d)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},o=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},l=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(r)return r(f,h).value}else return;return f[h]};return YS=function c(){var f,h,d,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(f=arguments[S],f!=null)for(h in f)d=l(w,h),g=l(f,h),w!==g&&(C&&g&&(a(g)||(v=i(g)))?(v?(v=!1,b=d&&i(d)?d:[]):b=d&&a(d)?d:{},o(w,{name:h,newValue:c(C,b,g)})):typeof g<"u"&&o(w,{name:h,newValue:g}));return w},YS}var lhe=she();const XS=Hi(lhe);function X_(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 uhe(){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,...f){const h=e[++a];let d=-1;if(c){o(c);return}for(;++d<i.length;)(f[d]===null||f[d]===void 0)&&(f[d]=i[d]);i=f,h?che(h,l)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function che(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(f){const h=f;if(l&&n)throw h;return i(h)}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 oo={basename:fhe,dirname:dhe,extname:hhe,join:mhe,sep:"/"};function fhe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lp(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 dhe(e){if(Lp(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 hhe(e){Lp(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 mhe(...e){let t=-1,n;for(;++t<e.length;)Lp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":phe(n)}function phe(e){Lp(e);const t=e.codePointAt(0)===47;let n=ghe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ghe(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 Lp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vhe={cwd:yhe};function yhe(){return"/"}function G_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xhe(e){if(typeof e=="string")e=new URL(e);else if(!G_(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 bhe(e)}function bhe(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 GS=["history","path","basename","stem","extname","dirname"];class VU{constructor(t){let n;t?G_(t)?n={path:t}:typeof t=="string"||whe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vhe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<GS.length;){const a=GS[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)GS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?oo.basename(this.path):void 0}set basename(t){QS(t,"basename"),WS(t,"basename"),this.path=oo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?oo.dirname(this.path):void 0}set dirname(t){JR(this.basename,"dirname"),this.path=oo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?oo.extname(this.path):void 0}set extname(t){if(WS(t,"extname"),JR(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=oo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){G_(t)&&(t=xhe(t)),QS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?oo.basename(this.path,this.extname):void 0}set stem(t){QS(t,"stem"),WS(t,"stem"),this.path=oo.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 WS(e,t){if(e&&e.includes(oo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+oo.sep+"`")}function QS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function JR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function whe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const She=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),jhe={}.hasOwnProperty;class HN extends She{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=uhe()}copy(){const t=new HN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(XS(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ej("data",this.frozen),this.namespace[t]=n,this):jhe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ej("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=qv(t),r=this.parser||this.Parser;return ZS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ZS("process",this.parser||this.Parser),JS("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=qv(t),c=r.parse(l);r.run(c,l,function(h,d,g){if(h||!d||!g)return f(h);const v=d,b=r.stringify(v,g);Che(b)?g.value=b:g.result=b,f(h,g)});function f(h,d){h||!d?o(h):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),ZS("processSync",this.parser||this.Parser),JS("processSync",this.compiler||this.Compiler),this.process(t,i),tI("processSync","process",n),r;function i(a,o){n=!0,QR(a),r=o}}run(t,n,r){eI(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=qv(n);i.run(t,c,f);function f(h,d,g){const v=d||t;h?l(h):o?o(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),tI("runSync","run",r),i;function a(o,l){QR(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=qv(n),i=this.compiler||this.Compiler;return JS("stringify",i),eI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ej("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(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...d]=f;c(h,d)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))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(f.plugins),f.settings&&(i.settings=XS(!0,i.settings,f.settings))}function l(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const d=f[h];a(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,h){let d=-1,g=-1;for(;++d<r.length;)if(r[d][0]===f){g=d;break}if(g===-1)r.push([f,...h]);else if(h.length>0){let[v,...b]=h;const w=r[g][1];X_(w)&&X_(v)&&(v=XS(!0,w,v)),r[g]=[f,v,...b]}}}}const Ehe=new HN().freeze();function ZS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function JS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ej(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 eI(e){if(!X_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qv(e){return _he(e)?e:new VU(e)}function _he(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Che(e){return typeof e=="string"||khe(e)}function khe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nhe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nI=[],rI={allowDangerousHtml:!0},Ahe=/^(https?|ircs?|mailto|xmpp)$/i,Ohe=[{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 The(e){const t=Phe(e),n=Mhe(e);return Dhe(t.runSync(t.parse(n),n),e)}function Phe(e){const t=e.rehypePlugins||nI,n=e.remarkPlugins||nI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rI}:rI;return Ehe().use(dde).use(n).use(ohe,r).use(t)}function Mhe(e){const t=e.children||"",n=new VU;return typeof t=="string"&&(n.value=t),n}function Dhe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Rhe;for(const h of Ohe)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+Nhe+h.id,void 0);return UN(e,f),Gue(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(h,d,g){if(h.type==="raw"&&g&&typeof d=="number")return o?g.children.splice(d,1):g.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let v;for(v in qS)if(Object.hasOwn(qS,v)&&Object.hasOwn(h.properties,v)){const b=h.properties[v],w=qS[v];(w===null||w.includes(h.tagName))&&(h.properties[v]=c(String(b||""),v,h))}}if(h.type==="element"){let v=n?!n.includes(h.tagName):a?a.includes(h.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(h,d,g)),v&&g&&typeof d=="number")return l&&h.children?g.children.splice(d,1,...h.children):g.children.splice(d,1),d}}}function Rhe(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||Ahe.test(e.slice(0,t))?e:""}function iI(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 Ihe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Lhe(e,t,n){const i=G0((n||{}).ignore||[]),a=zhe(t);let o=-1;for(;++o<a.length;)qU(e,"text",l);function l(f,h){let d=-1,g;for(;++d<h.length;){const v=h[d],b=g?g.children:void 0;if(i(v,b?b.indexOf(v):void 0,g))return;g=v}if(g)return c(f,h)}function c(f,h){const d=h[h.length-1],g=a[o][0],v=a[o][1];let b=0;const S=d.children.indexOf(f);let j=!1,C=[];g.lastIndex=0;let _=g.exec(f.value);for(;_;){const N=_.index,O={index:_.index,input:_.input,stack:[...h,f]};let A=v(..._,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=N+1:(b!==N&&C.push({type:"text",value:f.value.slice(b,N)}),Array.isArray(A)?C.push(...A):A&&C.push(A),b=N+_[0].length,j=!0),!g.global)break;_=g.exec(f.value)}return j?(b<f.value.length&&C.push({type:"text",value:f.value.slice(b)}),d.children.splice(S,1,...C)):C=[f],S+C.length}}function zhe(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([$he(i[0]),Bhe(i[1])])}return t}function $he(e){return typeof e=="string"?new RegExp(Ihe(e),"g"):e}function Bhe(e){return typeof e=="function"?e:function(){return e}}const tj="phrasing",nj=["autolink","link","image","label"];function Fhe(){return{transforms:[Xhe],enter:{literalAutolink:Hhe,literalAutolinkEmail:rj,literalAutolinkHttp:rj,literalAutolinkWww:rj},exit:{literalAutolink:Yhe,literalAutolinkEmail:Khe,literalAutolinkHttp:qhe,literalAutolinkWww:Vhe}}}function Uhe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:tj,notInConstruct:nj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:tj,notInConstruct:nj},{character:":",before:"[ps]",after:"\\/",inConstruct:tj,notInConstruct:nj}]}}function Hhe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rj(e){this.config.enter.autolinkProtocol.call(this,e)}function qhe(e){this.config.exit.autolinkProtocol.call(this,e)}function Vhe(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 Khe(e){this.config.exit.autolinkEmail.call(this,e)}function Yhe(e){this.exit(e)}function Xhe(e){Lhe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ghe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Whe]],{ignore:["link","linkReference"]})}function Ghe(e,t,n,r,i){let a="";if(!KU(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!Qhe(n)))return!1;const o=Zhe(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 Whe(e,t,n,r){return!KU(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Qhe(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 Zhe(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=iI(e,"(");let a=iI(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 KU(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||cc(n)||K0(n))&&(!t||n!==47)}YU.peek=sme;function Jhe(){this.buffer()}function eme(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tme(){this.buffer()}function nme(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=za(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ime(e){this.exit(e)}function ame(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=za(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ome(e){this.exit(e)}function sme(){return"["}function YU(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 lme(){return{enter:{gfmFootnoteCallString:Jhe,gfmFootnoteCall:eme,gfmFootnoteDefinitionLabelString:tme,gfmFootnoteDefinition:nme},exit:{gfmFootnoteCallString:rme,gfmFootnoteCall:ime,gfmFootnoteDefinitionLabelString:ame,gfmFootnoteDefinition:ome}}}function ume(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:YU},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const f=a.enter("footnoteDefinition"),h=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?XU:cme))),f(),c}}function cme(e,t,n){return t===0?e:XU(e,t,n)}function XU(e,t,n){return(n?"":"    ")+e}const fme=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];GU.peek=gme;function dme(){return{canContainEols:["delete"],enter:{strikethrough:mme},exit:{strikethrough:pme}}}function hme(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fme}],handlers:{delete:GU}}}function mme(e){this.enter({type:"delete",children:[]},e)}function pme(e){this.exit(e)}function GU(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 gme(){return"~"}function vme(e){return e.length}function yme(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||vme,a=[],o=[],l=[],c=[];let f=0,h=-1;for(;++h<e.length;){const w=[],S=[];let j=-1;for(e[h].length>f&&(f=e[h].length);++j<e[h].length;){const C=xme(e[h][j]);if(n.alignDelimiters!==!1){const _=i(C);S[j]=_,(c[j]===void 0||_>c[j])&&(c[j]=_)}w.push(C)}o[h]=w,l[h]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)a[d]=aI(r[d]);else{const w=aI(r);for(;++d<f;)a[d]=w}d=-1;const g=[],v=[];for(;++d<f;){const w=a[d];let S="",j="";w===99?(S=":",j=":"):w===108?S=":":w===114&&(j=":");let C=n.alignDelimiters===!1?1:Math.max(1,c[d]-S.length-j.length);const _=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>c[d]&&(c[d]=C),v[d]=C),g[d]=_}o.splice(1,0,g),l.splice(1,0,v),h=-1;const b=[];for(;++h<o.length;){const w=o[h],S=l[h];d=-1;const j=[];for(;++d<f;){const C=w[d]||"";let _="",N="";if(n.alignDelimiters!==!1){const O=c[d]-(S[d]||0),A=a[d];A===114?_=" ".repeat(O):A===99?O%2?(_=" ".repeat(O/2+.5),N=" ".repeat(O/2-.5)):(_=" ".repeat(O/2),N=_):N=" ".repeat(O)}n.delimiterStart!==!1&&!d&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||d)&&j.push(" "),n.alignDelimiters!==!1&&j.push(_),j.push(C),n.alignDelimiters!==!1&&j.push(N),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
`)}function xme(e){return e==null?"":String(e)}function aI(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 bme(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()),wme);return i(),o}function wme(e,t,n){return">"+(n?"":" ")+e}function Sme(e,t){return oI(e,t.inConstruct,!0)&&!oI(e,t.notInConstruct,!1)}function oI(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 sI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&Sme(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function jme(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 Eme(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 _me(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 Cme(e,t,n,r){const i=_me(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Eme(e,n)){const d=n.enter("codeIndented"),g=n.indentLines(a,kme);return d(),g}const l=n.createTracker(r),c=i.repeat(Math.max(jme(a,i)+1,3)),f=n.enter("codeFenced");let h=l.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);h+=l.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(n.safe(e.meta,{before:h,after:`
`,encode:["`"],...l.current()})),d()}return h+=l.move(`
`),a&&(h+=l.move(a+`
`)),h+=l.move(c),f(),h}function kme(e,t,n){return(n?"":"    ")+e}function qN(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 Nme(e,t,n,r){const i=qN(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":`
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=c.move(" "+i),f+=c.move(n.safe(e.title,{before:f,after:i,...c.current()})),f+=c.move(i),l()),o(),f}function Ame(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 Lm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rx(e,t,n){const r=md(e),i=md(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}}WU.peek=Ome;function WU(e,t,n,r){const i=Ame(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 f=c.charCodeAt(0),h=rx(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=Lm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=rx(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+Lm(d));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+v}function Ome(e,t,n){return n.options.emphasis||"*"}function Tme(e,t){let n=!1;return UN(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,K_}),!!((!e.depth||e.depth<3)&&RN(e)&&(t.options.setext||n))}function Pme(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Tme(e,n)){const h=n.enter("headingSetext"),d=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return d(),h(),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 f=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(f)&&(f=Lm(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,n.options.closeAtx&&(f+=" "+o),c(),l(),f}QU.peek=Mme;function QU(e){return e.value||""}function Mme(){return"<"}ZU.peek=Dme;function ZU(e,t,n,r){const i=qN(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=c.move(" "+i),f+=c.move(n.safe(e.title,{before:f,after:i,...c.current()})),f+=c.move(i),l()),f+=c.move(")"),o(),f}function Dme(){return"!"}JU.peek=Rme;function JU(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 f=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Rme(){return"!"}eH.peek=Ime;function eH(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 f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return i+r+i}function Ime(){return"`"}function tH(e,t){const n=RN(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))}nH.peek=Lme;function nH(e,t,n,r){const i=qN(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(tH(e,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),n.stack=h,d}l=n.enter("link"),c=n.enter("label");let f=o.move("[");return f+=o.move(n.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(n.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(c=n.enter("destinationRaw"),f+=o.move(n.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=o.move(" "+i),f+=o.move(n.safe(e.title,{before:f,after:i,...o.current()})),f+=o.move(i),c()),f+=o.move(")"),l(),f}function Lme(e,t,n){return tH(e,n)?"<":"["}rH.peek=zme;function rH(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 f=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function zme(){return"["}function VN(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 $me(e){const t=VN(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 Bme(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 iH(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 Fme(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Bme(n):VN(n);const l=e.ordered?o==="."?")":".":$me(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.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),iH(n)===o&&h){let d=-1;for(;++d<e.children.length;){const g=e.children[d];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 f=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),f}function Ume(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 Hme(e,t,n,r){const i=Ume(n);let a=n.bulletCurrent||VN(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"),f=n.indentLines(n.containerFlow(e,l.current()),h);return c(),f;function h(d,g,v){return g?(v?"":" ".repeat(o))+d:(v?a:a+" ".repeat(o-a.length))+d}}function qme(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Vme=G0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Kme(e,t,n,r){return(e.children.some(function(o){return Vme(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Yme(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aH.peek=Xme;function aH(e,t,n,r){const i=Yme(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 f=c.charCodeAt(0),h=rx(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=Lm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=rx(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+Lm(d));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+v}function Xme(e,t,n){return n.options.strong||"*"}function Gme(e,t,n,r){return n.safe(e.value,r)}function Wme(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 Qme(e,t,n){const r=(iH(n)+(n.options.ruleSpaces?" ":"")).repeat(Wme(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oH={blockquote:bme,break:sI,code:Cme,definition:Nme,emphasis:WU,hardBreak:sI,heading:Pme,html:QU,image:ZU,imageReference:JU,inlineCode:eH,link:nH,linkReference:rH,list:Fme,listItem:Hme,paragraph:qme,root:Kme,strong:aH,text:Gme,thematicBreak:Qme};function Zme(){return{enter:{table:Jme,tableData:lI,tableHeader:lI,tableRow:tpe},exit:{codeText:npe,table:epe,tableData:ij,tableHeader:ij,tableRow:ij}}}function Jme(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 epe(e){this.exit(e),this.data.inTable=void 0}function tpe(e){this.enter({type:"tableRow",children:[]},e)}function ij(e){this.exit(e)}function lI(e){this.enter({type:"tableCell",children:[]},e)}function npe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rpe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rpe(e,t){return t==="|"?t:e}function ipe(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 f(h(v,w,S),v.align)}function l(v,b,w,S){const j=d(v,w,S),C=f([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 f(v,b){return yme(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function h(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("table");for(;++j<S.length;)C[j]=d(S[j],b,w);return _(),C}function d(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=oH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function ape(){return{exit:{taskListCheckValueChecked:uI,taskListCheckValueUnchecked:uI,paragraph:spe}}}function ope(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lpe}}}function uI(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function spe(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 lpe(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=oH.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(h){return h+o}}function upe(){return[Fhe(),lme(),dme(),Zme(),ape()]}function cpe(e){return{extensions:[Uhe(),ume(e),hme(),ipe(e),ope()]}}const fpe={tokenize:vpe,partial:!0},sH={tokenize:ype,partial:!0},lH={tokenize:xpe,partial:!0},uH={tokenize:bpe,partial:!0},dpe={tokenize:wpe,partial:!0},cH={name:"wwwAutolink",tokenize:ppe,previous:dH},fH={name:"protocolAutolink",tokenize:gpe,previous:hH},Cs={name:"emailAutolink",tokenize:mpe,previous:mH},Po={};function hpe(){return{text:Po}}let _u=48;for(;_u<123;)Po[_u]=Cs,_u++,_u===58?_u=65:_u===91&&(_u=97);Po[43]=Cs;Po[45]=Cs;Po[46]=Cs;Po[95]=Cs;Po[72]=[Cs,fH];Po[104]=[Cs,fH];Po[87]=[Cs,cH];Po[119]=[Cs,cH];function mpe(e,t,n){const r=this;let i,a;return o;function o(d){return!W_(d)||!mH.call(r,r.previous)||KN(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return W_(d)?(e.consume(d),l):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(dpe,h,f)(d):d===45||d===95||Ur(d)?(a=!0,e.consume(d),c):h(d)}function f(d){return e.consume(d),i=!0,c}function h(d){return a&&i&&ei(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function ppe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!dH.call(r,r.previous)||KN(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(fpe,e.attempt(sH,e.attempt(lH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function gpe(e,t,n){const r=this;let i="",a=!1;return o;function o(d){return(d===72||d===104)&&hH.call(r,r.previous)&&!KN(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(ei(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),a?f:(a=!0,c)):n(d)}function f(d){return d===null||ex(d)||un(d)||cc(d)||K0(d)?n(d):e.attempt(sH,e.attempt(lH,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function vpe(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 ype(e,t,n){let r,i,a;return o;function o(f){return f===46||f===95?e.check(uH,c,l)(f):f===null||un(f)||cc(f)||f!==45&&K0(f)?c(f):(a=!0,e.consume(f),o)}function l(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),o}function c(f){return i||r||!a?n(f):t(f)}}function xpe(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(uH,t,a)(o):o===null||un(o)||cc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function bpe(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||un(l)||cc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||un(l)||cc(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 wpe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function dH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||un(e)}function hH(e){return!ei(e)}function mH(e){return!(e===47||W_(e))}function W_(e){return e===43||e===45||e===46||e===95||Ur(e)}function KN(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 Spe={tokenize:Ope,partial:!0};function jpe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:kpe,continuation:{tokenize:Npe},exit:Ape}},text:{91:{name:"gfmFootnoteCall",tokenize:Cpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Epe,resolveTo:_pe}}}}function Epe(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 f=za(r.sliceSerialize({start:o.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function _pe(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 Cpe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(a>999||d===93&&!o||d===null||d===91||un(d))return n(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(za(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return un(d)||(o=!0),a++,e.consume(d),d===92?h:f}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function kpe(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"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(o>999||b===93&&!l||b===null||b===91||un(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=za(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return un(b)||(l=!0),o++,e.consume(b),b===92?d:h}function d(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}function g(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),Tt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Npe(e,t,n){return e.check(Ip,t,e.attempt(Spe,t,n))}function Ape(e){e.exit("gfmFootnoteDefinition")}function Ope(e,t,n){const r=this;return Tt(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 Tpe(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 f=c;for(;f--;)if(o[f][0]==="exit"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[f][1].end.offset-o[f][1].start.offset){o[c][1].type="strikethroughSequence",o[f][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[f][1].start),end:Object.assign({},o[c][1].end)},d={type:"strikethroughText",start:Object.assign({},o[f][1].end),end:Object.assign({},o[c][1].start)},g=[["enter",h,l],["enter",o[f][1],l],["exit",o[f][1],l],["enter",d,l]],v=l.parser.constructs.insideSpan.null;v&&Ii(g,g.length,0,Y0(v,o.slice(f+1,c),l)),Ii(g,g.length,0,[["exit",d,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",h,l]]),Ii(o,f-1,c-f+3,g),c=f+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 f=this.previous,h=this.events;let d=0;return g;function g(b){return f===126&&h[h.length-1][1].type!=="characterEscape"?c(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=md(f);if(b===126)return d>1?c(b):(o.consume(b),d++,v);if(d<2&&!n)return c(b);const S=o.exit("strikethroughSequenceTemporary"),j=md(b);return S._open=!j||j===2&&!!w,S._close=!w||w===2&&!!j,l(b)}}}class Ppe{constructor(){this.map=[]}add(t,n,r){Mpe(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 Mpe(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 Dpe(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 Rpe(){return{flow:{null:{name:"table",tokenize:Ipe,resolveAll:Lpe}}}}function Ipe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(I){let F=r.events.length-1;for(;F>-1;){const D=r.events[F][1].type;if(D==="lineEnding"||D==="linePrefix")F--;else break}const $=F>-1?r.events[F][1].type:null,G=$==="tableHead"||$==="tableRow"?A:c;return G===A&&r.parser.lazy[r.now().line]?n(I):G(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(o=!0,a+=1),h(I)}function h(I){return I===null?n(I):tt(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),v):n(I):wt(I)?Tt(e,h,"whitespace")(I):(a+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),d(I)))}function d(I){return I===null||I===124||un(I)?(e.exit("data"),h(I)):(e.consume(I),I===92?g:d)}function g(I){return I===92||I===124?(e.consume(I),d):d(I)}function v(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,wt(I)?Tt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):b(I))}function b(I){return I===45||I===58?S(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),w):O(I)}function w(I){return wt(I)?Tt(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),j):I===45?(a+=1,j(I)):I===null||tt(I)?N(I):O(I)}function j(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):O(I)}function C(I){return I===45?(e.consume(I),C):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return wt(I)?Tt(e,N,"whitespace")(I):N(I)}function N(I){return I===124?b(I):I===null||tt(I)?!o||i!==a?O(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):O(I)}function O(I){return n(I)}function A(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||tt(I)?(e.exit("tableRow"),t(I)):wt(I)?Tt(e,T,"whitespace")(I):(e.enter("data"),P(I))}function P(I){return I===null||I===124||un(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?L:P)}function L(I){return I===92||I===124?(e.consume(I),P):P(I)}}function Lpe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,h,d;const g=new Ppe;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(cI(g,t,c,f,h),h=void 0,c=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",h,t]])),i=b.type==="tableDelimiterRow"?2:h?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Vv(g,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Vv(g,t,a,i,void 0,d)),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],d=Vv(g,t,a,i,n,d)):o[1]!==0&&(d=Vv(g,t,o,i,n,d)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&cI(g,t,c,f,h),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=Dpe(t.events,n))}return e}function Vv(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Mf(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Mf(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 f=Mf(t.events,n[2]),h=Mf(t.events,n[3]),d={type:l,start:Object.assign({},f),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,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",d,t]])}return i!==void 0&&(a.end=Object.assign({},Mf(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function cI(e,t,n,r,i){const a=[],o=Mf(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 Mf(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const zpe={name:"tasklistCheck",tokenize:Bpe};function $pe(){return{text:{91:zpe}}}function Bpe(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 un(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 tt(c)?t(c):wt(c)?e.check({tokenize:Fpe},t,n)(c):n(c)}}function Fpe(e,t,n){return Tt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Upe(e){return _U([hpe(),jpe(),Tpe(e),Rpe(),$pe()])}const Hpe={};function qpe(e){const t=this,n=e||Hpe,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Upe(n)),a.push(upe()),o.push(cpe(n))}function Li({content:e,className:t}){return m.jsx("div",{className:t,children:m.jsx(The,{remarkPlugins:[qpe],components:{h1:({children:n})=>m.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>m.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>m.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>m.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>m.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>m.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>m.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?m.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}):m.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>m.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>m.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>m.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>m.jsx("div",{className:"mb-2 overflow-x-auto",children:m.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>m.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>m.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>m.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>m.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>m.jsx("em",{className:"italic",children:n})},children:e})})}function Q0({view:e,onChange:t}){return m.jsxs("div",{className:"mb-3 flex gap-1",children:[m.jsx("button",{className:Oe("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"}),m.jsx("button",{className:Oe("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 Vpe(){const e=gt();return Bt({mutationFn:t=>Fe.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function pH(){const e=gt();return Bt({mutationFn:({type:t,name:n})=>Fe.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Kpe(){const e=gt();return Bt({mutationFn:t=>Fe.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Ype(){const e=gt();return Bt({mutationFn:t=>Fe.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Xpe(){const e=gt();return Bt({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Fe.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$e.registry.config(n.type,n.name)})}})}function Gpe(e){const t=gt();return Bt({mutationFn:n=>Fe.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:$e.projects.resources(e)})}})}function gH(e){const t=gt();return Bt({mutationFn:({type:n,name:r})=>Fe.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:$e.projects.resources(e)})}})}function Wpe(e){const t=gt();return Bt({mutationFn:n=>Fe.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:$e.projects.resources(e)})}})}function Qpe(e){const t=gt();return Bt({mutationFn:n=>Fe.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:$e.projects.resources(e)})}})}function Zpe(e){const t=gt();return Bt({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Fe.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:$e.projects.resourceConfig(e,r.type,r.name)})}})}function Jpe({...e}){return m.jsx(Rk,{"data-slot":"sheet",...e})}function ege({...e}){return m.jsx(Ik,{"data-slot":"sheet-portal",...e})}function tge({className:e,...t}){return m.jsx(Lk,{"data-slot":"sheet-overlay",className:Oe("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 nge({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return m.jsxs(ege,{children:[m.jsx(tge,{}),m.jsxs(zk,{"data-slot":"sheet-content",className:Oe("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&&m.jsxs($k,{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:[m.jsx(lc,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function rge({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:Oe("flex flex-col gap-1.5 p-4",e),...t})}function ige({className:e,...t}){return m.jsx(XB,{"data-slot":"sheet-title",className:Oe("font-semibold text-foreground",e),...t})}function age({className:e,...t}){return m.jsx(GB,{"data-slot":"sheet-description",className:Oe("text-sm text-muted-foreground",e),...t})}function oge(e){return Un({queryKey:$e.registry.validate(e??""),queryFn:()=>Fe.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Gu(e,t){return Un({queryKey:$e.registry.list(e),queryFn:()=>Fe.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function sge(e,t,n){return Un({queryKey:$e.registry.detail(e,t),queryFn:()=>Fe.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const lge=H0("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 Ey({className:e,variant:t,...n}){return m.jsx("div",{"data-slot":"alert",role:"alert",className:Oe(lge({variant:t}),e),...n})}function _y({className:e,...t}){return m.jsx("div",{"data-slot":"alert-title",className:Oe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Cy({className:e,...t}){return m.jsx("div",{"data-slot":"alert-description",className:Oe("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function uge({agentName:e}){const{data:t}=oge(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:m.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&m.jsxs(Ey,{variant:"destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsx(_y,{children:"Missing Prerequisites"}),m.jsx(Cy,{children:t.missing_tools.map(r=>m.jsxs("div",{className:"mt-1",children:[m.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&m.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&&m.jsxs(Ey,{children:[m.jsx(ose,{className:"h-4 w-4"}),m.jsx(_y,{children:"Setup"}),m.jsxs(Cy,{children:[m.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),m.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),m.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&&m.jsxs(Ey,{children:[m.jsx($oe,{className:"h-4 w-4"}),m.jsx(_y,{children:"API Key Required"}),m.jsx(Cy,{children:m.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>m.jsxs("span",{children:[i>0&&", ",m.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function cge({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=uU(e,t,{enabled:n&&!r}),a=gue(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=Xpe(),f=Zpe(r??0),h=r?f:c,{data:d}=Gu("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 N=L=>j(I=>{const F=new Set(I);return F.has(L)?F.delete(L):F.add(L),F}),O=(d??[]).map(L=>L.name),A=String(b.default_agent??"").trim(),T=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",P=()=>{h.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:_.length>0?b:void 0},{onSuccess:()=>Ht.success("Configuration saved"),onError:()=>Ht.error("Failed to save configuration")})};return m.jsxs("div",{className:"flex flex-col gap-4",children:[C.length>0&&m.jsxs(m.Fragment,{children:[m.jsx(Sl,{}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(L=>{const I=o.env_schema[L],F=S.has(L);return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(st,{className:"text-xs font-mono",children:L}),I.required&&m.jsx(pt,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),I.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),m.jsxs("div",{className:"relative",children:[m.jsx(et,{type:F?"text":"password",value:g[L]??"",onChange:$=>v(G=>({...G,[L]:$.target.value})),placeholder:L,className:"h-8 pr-8 text-xs font-mono"}),m.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>N(L),children:F?m.jsx(Eoe,{className:"h-3.5 w-3.5"}):m.jsx(Coe,{className:"h-3.5 w-3.5"})})]})]},L)})]})]}),_.length>0&&m.jsxs(m.Fragment,{children:[m.jsx(Sl,{}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),_.map(L=>{const I=o.params_schema[L],F=b[L],$=I.default;if(I.type==="boolean")return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx(st,{className:"text-xs font-mono",children:L}),I.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),m.jsxs(da,{value:F!=null?String(F):$!=null?String($):"",onValueChange:q=>w(X=>({...X,[L]:q==="true"})),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{})}),m.jsxs(pa,{children:[m.jsx(An,{value:"true",children:"true"}),m.jsx(An,{value:"false",children:"false"})]})]})]},L);const G=I.type==="int"||I.type==="float"?"number":"text",D=I.type==="float"?"any":void 0,V=L==="default_agent"&&d?d.map(q=>q.name):void 0,z=V?`datalist-${L}`:void 0;return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx(st,{className:"text-xs font-mono",children:L}),I.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),m.jsx(et,{type:G,step:D,list:z,value:F!=null?String(F):"",onChange:q=>w(X=>({...X,[L]:G==="number"&&q.target.value!==""?Number(q.target.value):q.target.value})),placeholder:$!=null?String($):void 0,className:"h-8 text-xs font-mono"}),V&&m.jsx("datalist",{id:z,children:V.map(q=>m.jsx("option",{value:q},q))}),L==="default_agent"&&T&&m.jsx("p",{className:"text-xs text-destructive",children:T})]},L)})]})]}),m.jsxs(Se,{size:"sm",onClick:P,disabled:h.isPending||!!T,className:"self-start",children:[m.jsx(DF,{className:"mr-2 h-3.5 w-3.5"}),h.isPending?"Saving...":"Save Configuration"]})]})}function vH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var $,G;const a=gt(),o=()=>{i!=null&&a.invalidateQueries({queryKey:$e.projects.resources(i)})},l=pH(),c=Kpe(),f=Ype(),h=gH(i??0),d=Wpe(i??0),g=Qpe(i??0),v=i!=null&&(e==null?void 0:e.source)==="project",b=v?h:l,w=v?d:c,S=v?g:f,[j,C]=y.useState(!1),[_,N]=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:D=>{D.exit_code===0?(Ht.success(`Uninstalled ${e.name}`),v||o(),r(!1)):Ht.error(`Uninstall failed: ${D.stderr||D.stdout}`),C(!1)},onError:()=>{Ht.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(Ht.success(`Updated ${e.name}`),v||o()):Ht.error(`Update failed: ${D.stderr||D.stdout}`)},onError:()=>Ht.error("Update request failed")})},P=()=>{S.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(Ht.success(`Reinstalled ${e.name}`),v||o()):Ht.error(`Reinstall failed: ${D.stderr||D.stdout}`)},onError:()=>Ht.error("Reinstall request failed")})},I=(($={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:$.includes(e.name))??!1,F=(G=e.frontmatter)==null?void 0:G.metadata;return m.jsx(Jpe,{open:n,onOpenChange:D=>{r(D),C(!1),N("markdown")},children:m.jsxs(nge,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[m.jsxs(rge,{className:"shrink-0",children:[m.jsxs(ige,{className:"flex items-center gap-2",children:[e.name,e.version&&m.jsxs(pt,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),m.jsx(age,{children:e.description||"No description"})]}),m.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[m.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[m.jsxs("span",{children:["Source: ",m.jsx("strong",{children:e.source})]}),m.jsxs("span",{children:["Path: ",m.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),F&&Object.keys(F).length>0&&m.jsxs("details",{className:"text-sm",children:[m.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),m.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(F,null,2)})]})]}),m.jsx(V0,{className:"min-h-0 flex-1",children:m.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&m.jsx(uge,{agentName:e.name}),m.jsx(cge,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),m.jsx("div",{className:"mt-4",children:e.body?m.jsxs(m.Fragment,{children:[m.jsx(Q0,{view:_,onChange:N}),_==="markdown"?m.jsx(Li,{content:e.body,className:"text-sm"}):m.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e.body})]}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No content."})})]})}),m.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[m.jsx(Se,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),m.jsx(Se,{variant:"outline",size:"sm",onClick:P,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),m.jsx("div",{className:"flex-1"}),!I&&m.jsxs(m.Fragment,{children:[m.jsx(Se,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&m.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const fge=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function YN({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=y.useState(n??"roles"),[o,l]=y.useState(""),[c,f]=y.useState(null),[h,d]=y.useState(null);y.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=Vpe(),v=Gpe(r??0),b=r?v:g,w=(c==null?void 0:c.status)==="success",S=()=>{o.trim()&&(f(null),d(null),b.mutate({type:i,name:o.trim()},{onSuccess:C=>{C.exit_code===0?(Ht.success(`Installed ${o.trim()}`),f({status:"success",message:`Successfully installed ${o.trim()}`}),d(C.stdout||null)):(f({status:"error",message:"Installation failed"}),d(C.stderr||C.stdout||"Unknown error."))},onError:()=>{f({status:"error",message:"Install request failed"}),Ht.error("Install request failed")}}))},j=C=>{C||(f(null),d(null),l("")),t(C)};return m.jsx(No,{open:e,onOpenChange:j,children:m.jsxs(Ao,{className:"sm:max-w-md",children:[m.jsxs(Oo,{children:[m.jsx(To,{children:r?"Install Resource to Project":"Install Resource"}),m.jsx(aU,{children:"Install a resource from StrawHub by name."})]}),m.jsxs("div",{className:"flex flex-col gap-4",children:[c&&m.jsxs(Ey,{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"?m.jsx(R0,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):m.jsx(gN,{className:"h-4 w-4"}),m.jsx(_y,{children:c.status==="success"?"Installed":"Error"}),m.jsx(Cy,{children:c.message})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx(st,{htmlFor:"install-type",children:"Type"}),m.jsxs(da,{value:i,onValueChange:a,disabled:w,children:[m.jsx(ma,{id:"install-type",children:m.jsx(ha,{})}),m.jsx(pa,{children:fge.map(C=>m.jsx(An,{value:C.value,children:C.label},C.value))})]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx(st,{htmlFor:"install-name",children:"Package Name"}),m.jsx(et,{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()}})]}),h&&m.jsxs("details",{className:"text-sm",children:[m.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),m.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:h})]})]}),m.jsx(iU,{children:(c==null?void 0:c.status)==="success"?m.jsx(Se,{onClick:()=>j(!1),children:"Done"}):m.jsx(Se,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const fI=["roles","skills","agents","memories"],yH={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories"};function dge({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=$d(e),[a,o]=y.useState(null),[l,c]=y.useState(""),[f,h]=y.useState(!1),[d,g]=y.useState(!1),v=t??d,b=n??g,{data:w}=pue(e,l,a??"",{enabled:f&&!!a&&!!l}),S=j=>{o(j.name),c(j.type),h(!0)};return m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources available to this project"}),m.jsxs(Se,{onClick:()=>b(!0),size:"sm",children:[m.jsx(I0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?m.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((j,C)=>m.jsx(hn,{className:"h-12 w-full"},C))}):!r||r.length===0?m.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources available yet."}):m.jsxs(Mp,{defaultValue:"all",children:[m.jsxs(Dp,{children:[m.jsx(or,{value:"all",children:"All"}),fI.map(j=>{const C=r.filter(_=>_.type===j).length;return m.jsxs(or,{value:j,disabled:C===0,children:[yH[j]," (",C,")"]},j)})]}),m.jsx(sr,{value:"all",children:m.jsx(dI,{resources:r,showType:!0,projectId:e,onSelect:S})}),fI.map(j=>m.jsx(sr,{value:j,children:m.jsx(dI,{resources:r.filter(C=>C.type===j),projectId:e,onSelect:S})},j))]}),m.jsx(vH,{resource:w??null,resourceType:l,open:f,onOpenChange:h,projectId:e}),m.jsx(YN,{open:v,onOpenChange:b,projectId:e})]})}function dI({resources:e,showType:t,projectId:n,onSelect:r}){return e.length===0?m.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources in this category."}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Source"}),t&&m.jsx(qe,{children:"Type"}),m.jsx(qe,{children:"Version"}),m.jsx(qe,{children:"Description"}),m.jsx(qe,{children:"Config"}),m.jsx(qe,{className:"w-24"})]})}),m.jsx(Ha,{children:e.map(i=>m.jsxs(Cn,{className:"cursor-pointer",onClick:()=>r(i),children:[m.jsx(He,{className:"font-medium",children:i.name}),m.jsx(He,{children:m.jsx(pt,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&m.jsx(He,{children:m.jsx(pt,{variant:"outline",className:"text-xs",children:yH[i.type]??i.type})}),m.jsx(He,{className:"text-sm text-muted-foreground",children:i.version??"—"}),m.jsx(He,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),m.jsx(He,{children:i.config_count>0&&m.jsxs(pt,{variant:"secondary",className:"text-xs gap-1",children:[m.jsx(z0,{className:"h-3 w-3"}),i.config_count]})}),m.jsx(He,{children:i.source==="project"&&m.jsx(hge,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function hge({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=gH(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?Ht.success(`Uninstalled ${n}`):Ht.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{Ht.error("Uninstall request failed"),i(!1)}})};return r?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Se,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):m.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:m.jsx(Ya,{className:"h-4 w-4"})})}function mge(e,t="30d"){return Un({queryKey:$e.projects.stats(e,t),queryFn:()=>Fe.get(`/projects/${e}/stats?period=${t}`)})}var pge=["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 XN(e){if(typeof e!="string")return!1;var t=pge;return t.includes(e)}var gge=["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"],vge=new Set(gge);function xH(e){return typeof e!="string"?!1:vge.has(e)}function bH(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)&&(xH(n)||bH(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)&&(xH(n)||bH(n)||XN(n))&&(t[n]=e[n]);return t}function yge(e){return e==null?null:y.isValidElement(e)?ni(e.props):typeof e=="object"&&!Array.isArray(e)?ni(e):null}var xge=["children","width","height","viewBox","className","style","title","desc"];function Q_(){return Q_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q_.apply(null,arguments)}function bge(e,t){if(e==null)return{};var n,r,i=wge(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 wge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var GN=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:f}=e,h=bge(e,xge),d=a||{width:r,height:i,x:0,y:0},g=Mt("recharts-surface",o);return y.createElement("svg",Q_({},ni(h),{className:g,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),y.createElement("title",null,c),y.createElement("desc",null,f),n)}),Sge=["children","className"];function Z_(){return Z_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z_.apply(null,arguments)}function jge(e,t){if(e==null)return{};var n,r,i=Ege(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 Ege(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 lr=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=jge(e,Sge),a=Mt("recharts-layer",r);return y.createElement("g",Z_({className:a},ni(i),{ref:t}),n)}),wH=y.createContext(null),_ge=()=>y.useContext(wH);function dn(e){return function(){return e}}const SH=Math.cos,ix=Math.sin,Xa=Math.sqrt,ax=Math.PI,Z0=2*ax,J_=Math.PI,eC=2*J_,Tu=1e-6,Cge=eC-Tu;function jH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function kge(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return jH;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 Nge{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?jH:kge(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,f=i-n,h=o-t,d=l-n,g=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Tu)if(!(Math.abs(d*c-f*h)>Tu)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=c*c+f*f,S=v*v+b*b,j=Math.sqrt(w),C=Math.sqrt(g),_=a*Math.tan((J_-Math.acos((w+g-S)/(2*j*C)))/2),N=_/C,O=_/j;Math.abs(N-1)>Tu&&this._append`L${t+N*h},${n+N*d}`,this._append`A${a},${a},0,0,${+(d*v>h*b)},${this._x1=t+O*c},${this._y1=n+O*f}`}}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),f=t+l,h=n+c,d=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Tu||Math.abs(this._y1-h)>Tu)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%eC+eC),g>Cge?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=f},${this._y1=h}`:g>Tu&&this._append`A${r},${r},0,${+(g>=J_)},${d},${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 WN(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 Nge(t)}function QN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function EH(e){this._context=e}EH.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 J0(e){return new EH(e)}function _H(e){return e[0]}function CH(e){return e[1]}function kH(e,t){var n=dn(!0),r=null,i=J0,a=null,o=WN(l);e=typeof e=="function"?e:e===void 0?_H:dn(e),t=typeof t=="function"?t:t===void 0?CH:dn(t);function l(c){var f,h=(c=QN(c)).length,d,g=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=h;++f)!(f<h&&n(d=c[f],f,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(d,f,c),+t(d,f,c));if(v)return a=null,v+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:dn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:dn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:dn(!!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 Kv(e,t,n){var r=null,i=dn(!0),a=null,o=J0,l=null,c=WN(f);e=typeof e=="function"?e:e===void 0?_H:dn(+e),t=typeof t=="function"?t:dn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?CH:dn(+n);function f(d){var g,v,b,w=(d=QN(d)).length,S,j=!1,C,_=new Array(w),N=new Array(w);for(a==null&&(l=o(C=c())),g=0;g<=w;++g){if(!(g<w&&i(S=d[g],g,d))===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],N[b]);l.lineEnd(),l.areaEnd()}j&&(_[g]=+e(S,g,d),N[g]=+t(S,g,d),l.point(r?+r(S,g,d):_[g],n?+n(S,g,d):N[g]))}if(C)return l=null,C+""||null}function h(){return kH().defined(i).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:dn(+d),r=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:dn(+d),f):e},f.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:dn(+d),f):r},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:dn(+d),n=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:dn(+d),f):t},f.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:dn(+d),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(d){return arguments.length?(i=typeof d=="function"?d:dn(!!d),f):i},f.curve=function(d){return arguments.length?(o=d,a!=null&&(l=o(a)),f):o},f.context=function(d){return arguments.length?(d==null?a=l=null:l=o(a=d),f):a},f}class NH{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 Age(e){return new NH(e,!0)}function Oge(e){return new NH(e,!1)}const ZN={draw(e,t){const n=Xa(t/ax);e.moveTo(n,0),e.arc(0,0,n,0,Z0)}},Tge={draw(e,t){const n=Xa(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()}},AH=Xa(1/3),Pge=AH*2,Mge={draw(e,t){const n=Xa(t/Pge),r=n*AH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Dge={draw(e,t){const n=Xa(t),r=-n/2;e.rect(r,r,n,n)}},Rge=.8908130915292852,OH=ix(ax/10)/ix(7*ax/10),Ige=ix(Z0/10)*OH,Lge=-SH(Z0/10)*OH,zge={draw(e,t){const n=Xa(t*Rge),r=Ige*n,i=Lge*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Z0*a/5,l=SH(o),c=ix(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},aj=Xa(3),$ge={draw(e,t){const n=-Xa(t/(aj*3));e.moveTo(0,n*2),e.lineTo(-aj*n,-n),e.lineTo(aj*n,-n),e.closePath()}},Ji=-.5,ea=Xa(3)/2,tC=1/Xa(12),Bge=(tC/2+1)*3,Fge={draw(e,t){const n=Xa(t/Bge),r=n/2,i=n*tC,a=r,o=n*tC+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 Uge(e,t){let n=null,r=WN(i);e=typeof e=="function"?e:dn(e||ZN),t=typeof t=="function"?t:dn(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:dn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:dn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function ox(){}function sx(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function TH(e){this._context=e}TH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:sx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hge(e){return new TH(e)}function PH(e){this._context=e}PH.prototype={areaStart:ox,areaEnd:ox,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qge(e){return new PH(e)}function MH(e){this._context=e}MH.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:sx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vge(e){return new MH(e)}function DH(e){this._context=e}DH.prototype={areaStart:ox,areaEnd:ox,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 Kge(e){return new DH(e)}function hI(e){return e<0?-1:1}function mI(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(hI(a)+hI(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function pI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function oj(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 lx(e){this._context=e}lx.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:oj(this,this._t0,pI(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,oj(this,pI(this,n=mI(this,e,t)),n);break;default:oj(this,this._t0,n=mI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function RH(e){this._context=new IH(e)}(RH.prototype=Object.create(lx.prototype)).point=function(e,t){lx.prototype.point.call(this,t,e)};function IH(e){this._context=e}IH.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 Yge(e){return new lx(e)}function Xge(e){return new RH(e)}function LH(e){this._context=e}LH.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=gI(e),i=gI(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 gI(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 Gge(e){return new LH(e)}function eb(e,t){this._context=e,this._t=t}eb.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 Wge(e){return new eb(e,.5)}function Qge(e){return new eb(e,0)}function Zge(e){return new eb(e,1)}function dc(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 nC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Jge(e,t){return e[t]}function eve(e){const t=[];return t.key=e,t}function tve(){var e=dn([]),t=nC,n=dc,r=Jge;function i(a){var o=Array.from(e.apply(this,arguments),eve),l,c=o.length,f=-1,h;for(const d of a)for(l=0,++f;l<c;++l)(o[l][f]=[0,+r(d,o[l].key,f,a)]).data=d;for(l=0,h=QN(t(o));l<c;++l)o[h[l]].index=l;return n(o,h),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:dn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:dn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?nC:typeof a=="function"?a:dn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??dc,i):n},i}function nve(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}dc(e,t)}}function rve(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}dc(e,t)}}function ive(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,f=0;l<o;++l){for(var h=e[t[l]],d=h[r][1]||0,g=h[r-1][1]||0,v=(d-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+=d,f+=v*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=f/c)}i[r-1][1]+=i[r-1][0]=n,dc(e,t)}}var sj={},lj={},vI;function ave(){return vI||(vI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(lj)),lj}var uj={},yI;function zH(){return yI||(yI=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})(uj)),uj}var cj={},xI;function JN(){return xI||(xI=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})(cj)),cj}var fj={},dj={},bI;function ove(){return bI||(bI=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})(dj)),dj}var wI;function eA(){return wI||(wI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ove(),n=JN();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="",f="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<o;){const d=i[l];f?d==="\\"&&l+1<o?(l++,c+=i[l]):d===f?f="":c+=d:h?d==='"'||d==="'"?f=d:d==="]"?(h=!1,a.push(c),c=""):c+=d:d==="["?(h=!0,c&&(a.push(c),c="")):d==="."?c&&(a.push(c),c=""):c+=d,l++}return c&&a.push(c),a}e.toPath=r})(fj)),fj}var SI;function tA(){return SI||(SI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ave(),n=zH(),r=JN(),i=eA();function a(l,c,f){if(l==null)return f;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return f;const h=l[c];return h===void 0?n.isDeepKey(c)?a(l,i.toPath(c),f):f:h}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const h=l[c];return h===void 0?f:h}default:{if(Array.isArray(c))return o(l,c,f);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return f;const h=l[c];return h===void 0?f:h}}}function o(l,c,f){if(c.length===0)return f;let h=l;for(let d=0;d<c.length;d++){if(h==null||t.isUnsafeProperty(c[d]))return f;h=h[c[d]]}return h===void 0?f:h}e.get=a})(sj)),sj}var hj,jI;function sve(){return jI||(jI=1,hj=tA().get),hj}var lve=sve();const hc=Hi(lve);var uve=4;function Rl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uve,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function In(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+Rl(l)+a:i+a},"")}var vr=e=>e===0?0:e>0?1:-1,wo=e=>typeof e=="number"&&e!=+e,mc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Me=e=>(typeof e=="number"||e instanceof Number)&&!wo(e),So=e=>Me(e)||typeof e=="string",cve=0,zm=e=>{var t=++cve;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(!Me(t)&&typeof t!="string")return r;var a;if(mc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return wo(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},$H=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 bn(e,t,n){return Me(e)&&Me(t)?Rl(e+n*(t-e)):t}function BH(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):hc(r,t))===n)}var jn=e=>e===null||typeof e>"u",zp=e=>jn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function yi(e){return e!=null}function eu(){}var fve=["type","size","sizeType"];function rC(){return rC=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},rC.apply(null,arguments)}function EI(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 _I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(r){dve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dve(e,t,n){return(t=hve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hve(e){var t=mve(e,"string");return typeof t=="symbol"?t:t+""}function mve(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 pve(e,t){if(e==null)return{};var n,r,i=gve(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 gve(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 FH={symbolCircle:ZN,symbolCross:Tge,symbolDiamond:Mge,symbolSquare:Dge,symbolStar:zge,symbolTriangle:$ge,symbolWye:Fge},vve=Math.PI/180,yve=e=>{var t="symbol".concat(zp(e));return FH[t]||ZN},xve=(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*vve;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)=>{FH["symbol".concat(zp(e))]=t},nA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=pve(e,fve),a=_I(_I({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=yve(o),v=Uge().type(g).size(xve(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:f,cy:h}=a,d=ni(a);return Me(f)&&Me(h)&&Me(n)?y.createElement("path",rC({},d,{className:Mt("recharts-symbols",c),transform:"translate(".concat(f,", ").concat(h,")"),d:l()})):null};nA.registerSymbol=bve;var UH=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,rA=(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=>{XN(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},wve=(e,t,n)=>r=>(e(t,n,r),null),$p=(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];XN(i)&&typeof a=="function"&&(r||(r={}),r[i]=wve(a,t,n))}),r};function CI(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 Sve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){jve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jve(e,t,n){return(t=Eve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eve(e){var t=_ve(e,"string");return typeof t=="symbol"?t:t+""}function _ve(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=Sve({},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 ux(){return ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ux.apply(null,arguments)}function kI(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 HH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){Cve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cve(e,t,n){return(t=kve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kve(e){var t=Nve(e,"string");return typeof t=="symbol"?t:t+""}function Nve(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,Ave={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Ove(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Tve(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:Ove(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 f=HH({},t);return delete f.legendIcon,y.cloneElement(t.legendIcon,f)}return y.createElement(nA,{fill:l,cx:i,cy:i,size:na,sizeType:"diameter",type:c})}function Pve(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},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,g)=>{var v=d.formatter||i,b=Mt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=typeof l=="object"?HH({},l):{};w.color=d.inactive?a:w.color||d.color;var S=v?v(d.value,d,g):d.value;return y.createElement("li",ux({className:b,style:f,key:"legend-item-".concat(g)},$p(e,d,g)),y.createElement(GN,{width:n,height:n,viewBox:c,style:h,"aria-label":"".concat(S," legend icon")},y.createElement(Tve,{data:d,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Mve=e=>{var t=Zn(e,Ave),{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(Pve,ux({},t,{payload:n})))},mj={},pj={},NI;function Dve(){return NI||(NI=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})(pj)),pj}var gj={},AI;function Rve(){return AI||(AI=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})(gj)),gj}var vj={},OI;function qH(){return OI||(OI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(vj)),vj}var yj={},xj={},bj={},TI;function Ive(){return TI||(TI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(bj)),bj}var PI;function VH(){return PI||(PI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ive();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(xj)),xj}var wj={},MI;function Lve(){return MI||(MI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(wj)),wj}var DI;function zve(){return DI||(DI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VH(),n=Lve();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(yj)),yj}var Sj={},jj={},RI;function $ve(){return RI||(RI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(jj)),jj}var Ej={},_j={},Cj={},kj={},II;function KH(){return II||(II=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})(kj)),kj}var Nj={},LI;function YH(){return LI||(LI=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})(Nj)),Nj}var Aj={},zI;function XH(){return zI||(zI=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})(Aj)),Aj}var $I;function Bve(){return $I||($I=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KH(),n=YH(),r=XH();function i(h,d,g){return typeof g!="function"?i(h,d,()=>{}):a(h,d,function v(b,w,S,j,C,_){const N=g(b,w,S,j,C,_);return N!==void 0?!!N:a(b,w,v,_)},new Map)}function a(h,d,g,v){if(d===h)return!0;switch(typeof d){case"object":return o(h,d,g,v);case"function":return Object.keys(d).length>0?a(h,{...d},g,v):r.isEqualsSameValueZero(h,d);default:return t.isObject(h)?typeof d=="string"?d==="":!0:r.isEqualsSameValueZero(h,d)}}function o(h,d,g,v){if(d==null)return!0;if(Array.isArray(d))return c(h,d,g,v);if(d instanceof Map)return l(h,d,g,v);if(d instanceof Set)return f(h,d,g,v);const b=Object.keys(d);if(h==null||n.isPrimitive(h))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(d))return v.get(d)===h;v==null||v.set(d,h);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(h)&&!(S in h)||d[S]===void 0&&h[S]!==void 0||d[S]===null&&h[S]!==null||!g(h[S],d[S],S,h,d,v))return!1}return!0}finally{v==null||v.delete(d)}}function l(h,d,g,v){if(d.size===0)return!0;if(!(h instanceof Map))return!1;for(const[b,w]of d.entries()){const S=h.get(b);if(g(S,w,b,h,d,v)===!1)return!1}return!0}function c(h,d,g,v){if(d.length===0)return!0;if(!Array.isArray(h))return!1;const b=new Set;for(let w=0;w<d.length;w++){const S=d[w];let j=!1;for(let C=0;C<h.length;C++){if(b.has(C))continue;const _=h[C];let N=!1;if(g(_,S,w,h,d,v)&&(N=!0),N){b.add(C),j=!0;break}}if(!j)return!1}return!0}function f(h,d,g,v){return d.size===0?!0:h instanceof Set?c([...h],[...d],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Cj)),Cj}var BI;function GH(){return BI||(BI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bve();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(_j)),_j}var Oj={},Tj={},Pj={},FI;function Fve(){return FI||(FI=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})(Pj)),Pj}var Mj={},UI;function iA(){return UI||(UI=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})(Mj)),Mj}var Dj={},HI;function WH(){return HI||(HI=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]",f="[object Set]",h="[object Array]",d="[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]",N="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",P="[object BigInt64Array]",L="[object Float32Array]",I="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=h,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=N,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=L,e.float64ArrayTag=I,e.functionTag=d,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=O,e.mapTag=c,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=C,e.uint32ArrayTag=_,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})(Dj)),Dj}var Rj={},qI;function Uve(){return qI||(qI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Rj)),Rj}var VI;function QH(){return VI||(VI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fve(),n=iA(),r=WH(),i=YH(),a=Uve();function o(h,d){return l(h,void 0,h,new Map,d)}function l(h,d,g,v=new Map,b=void 0){const w=b==null?void 0:b(h,d,g,v);if(w!==void 0)return w;if(i.isPrimitive(h))return h;if(v.has(h))return v.get(h);if(Array.isArray(h)){const S=new Array(h.length);v.set(h,S);for(let j=0;j<h.length;j++)S[j]=l(h[j],j,g,v,b);return Object.hasOwn(h,"index")&&(S.index=h.index),Object.hasOwn(h,"input")&&(S.input=h.input),S}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const S=new RegExp(h.source,h.flags);return S.lastIndex=h.lastIndex,S}if(h instanceof Map){const S=new Map;v.set(h,S);for(const[j,C]of h)S.set(j,l(C,j,g,v,b));return S}if(h instanceof Set){const S=new Set;v.set(h,S);for(const j of h)S.add(l(j,void 0,g,v,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(a.isTypedArray(h)){const S=new(Object.getPrototypeOf(h)).constructor(h.length);v.set(h,S);for(let j=0;j<h.length;j++)S[j]=l(h[j],j,g,v,b);return S}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const S=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return v.set(h,S),c(S,h,g,v,b),S}if(typeof File<"u"&&h instanceof File){const S=new File([h],h.name,{type:h.type});return v.set(h,S),c(S,h,g,v,b),S}if(typeof Blob<"u"&&h instanceof Blob){const S=new Blob([h],{type:h.type});return v.set(h,S),c(S,h,g,v,b),S}if(h instanceof Error){const S=structuredClone(h);return v.set(h,S),S.message=h.message,S.name=h.name,S.stack=h.stack,S.cause=h.cause,S.constructor=h.constructor,c(S,h,g,v,b),S}if(h instanceof Boolean){const S=new Boolean(h.valueOf());return v.set(h,S),c(S,h,g,v,b),S}if(h instanceof Number){const S=new Number(h.valueOf());return v.set(h,S),c(S,h,g,v,b),S}if(h instanceof String){const S=new String(h.valueOf());return v.set(h,S),c(S,h,g,v,b),S}if(typeof h=="object"&&f(h)){const S=Object.create(Object.getPrototypeOf(h));return v.set(h,S),c(S,h,g,v,b),S}return h}function c(h,d,g=h,v,b){const w=[...Object.keys(d),...t.getSymbols(d)];for(let S=0;S<w.length;S++){const j=w[S],C=Object.getOwnPropertyDescriptor(h,j);(C==null||C.writable)&&(h[j]=l(d[j],j,g,v,b))}}function f(h){switch(n.getTag(h)){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})(Tj)),Tj}var KI;function Hve(){return KI||(KI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QH();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Oj)),Oj}var YI;function qve(){return YI||(YI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GH(),n=Hve();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Ej)),Ej}var Ij={},Lj={},zj={},XI;function Vve(){return XI||(XI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QH(),n=iA(),r=WH();function i(a,o){return t.cloneDeepWith(a,(l,c,f,h)=>{const d=o==null?void 0:o(l,c,f,h);if(d!==void 0)return d;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return h.set(a,g),t.copyProperties(g,a,f,h),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(zj)),zj}var GI;function Kve(){return GI||(GI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vve();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Lj)),Lj}var $j={},Bj={},WI;function ZH(){return WI||(WI=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})(Bj)),Bj}var Fj={},QI;function Yve(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Fj)),Fj}var ZI;function Xve(){return ZI||(ZI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zH(),n=ZH(),r=Yve(),i=eA();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 f=o;for(let h=0;h<c.length;h++){const d=c[h];if((f==null||!Object.hasOwn(f,d))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(d)&&d<f.length))return!1;f=f[d]}return!0}e.has=a})($j)),$j}var JI;function Gve(){return JI||(JI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GH(),n=JN(),r=Kve(),i=tA(),a=Xve();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(f){const h=i.get(f,l);return h===void 0?a.has(f,l):c===void 0?h===void 0:t.isMatch(h,c)}}e.matchesProperty=o})(Ij)),Ij}var eL;function Wve(){return eL||(eL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qH(),n=$ve(),r=qve(),i=Gve();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})(Sj)),Sj}var tL;function Qve(){return tL||(tL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dve(),n=Rve(),r=qH(),i=zve(),a=Wve();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(mj)),mj}var Uj,nL;function Zve(){return nL||(nL=1,Uj=Qve().uniqBy),Uj}var Jve=Zve();const rL=Hi(Jve);function JH(e,t,n){return t===!0?rL(e,n):typeof t=="function"?rL(e,t):e}var Hj={exports:{}},qj={};/**
 * @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 iL;function eye(){if(iL)return qj;iL=1;var e=Td(),t=Fee();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}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 qj.useSyncExternalStoreWithSelector=function(f,h,d,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 N=T}return N=A}if(T=N,r(_,A))return T;var P=g(A);return v!==void 0&&v(T,P)?(_=A,T):(_=A,N=P)}var C=!1,_,N,O=d===void 0?null:d;return[function(){return j(h())},O===null?void 0:function(){return j(O())}]},[h,d,g,v]);var S=i(f,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},qj}var aL;function tye(){return aL||(aL=1,Hj.exports=eye()),Hj.exports}var eq=tye();const nye=Hi(eq);var aA=y.createContext(null),rye=e=>e,tn=()=>{var e=y.useContext(aA);return e?e.store.dispatch:rye},ky=()=>{},iye=()=>ky,aye=(e,t)=>e===t;function Ie(e){var t=y.useContext(aA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:ky,[t,e]);return eq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:iye,t?t.store.getState:ky,t?t.store.getState:ky,n,aye)}function oye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function sye(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function lye(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 oL=e=>Array.isArray(e)?e:[e];function uye(e){const t=Array.isArray(e[0])?e[0]:e;return lye(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function cye(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var fye=class{constructor(e){this.value=e}deref(){return this.value}},dye=typeof WeakRef<"u"?WeakRef:fye,hye=0,sL=1;function Yv(){return{s:hye,v:void 0,o:null,p:null}}function tq(e,t={}){let n=Yv();const{resultEqualityCheck:r}=t;let i,a=0;function o(){var d;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=Yv(),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=Yv(),w.set(b,l)):l=S}}const f=l;let h;if(l.s===sL)h=l.v;else if(h=e.apply(null,arguments),a++,r){const g=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;g!=null&&r(g,h)&&(h=g,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new dye(h):h}return f.s=sL,f.v=h,h}return o.clearCache=()=>{n=Yv(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function mye(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},f=i.pop();typeof f=="object"&&(c=f,f=i.pop()),oye(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const h={...n,...c},{memoize:d,memoizeOptions:g=[],argsMemoize:v=tq,argsMemoizeOptions:b=[]}=h,w=oL(g),S=oL(b),j=uye(i),C=d(function(){return a++,f.apply(null,arguments)},...w),_=v(function(){o++;const O=cye(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(_,{resultFunc:f,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=mye(tq),pye=Object.assign((e,t=le)=>{sye(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:()=>pye}),Vj={},Kj={},Yj={},lL;function gye(){return lL||(lL=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})(Yj)),Yj}var Xj={},Gj={},uL;function nq(){return uL||(uL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Gj)),Gj}var cL;function vye(){return cL||(cL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nq(),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})(Xj)),Xj}var fL;function yye(){return fL||(fL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gye(),n=vye(),r=eA();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 f=(v,b)=>{let w=v;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},h=(v,b)=>b==null||v==null?b:typeof v=="object"&&"key"in v?Object.hasOwn(b,v.key)?b[v.key]:f(b,v.path):typeof v=="function"?v(b):Array.isArray(v)?f(b,v):typeof b=="object"?b[v]:b,d=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:d.map(b=>h(b,v))})).slice().sort((v,b)=>{for(let w=0;w<d.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})(Kj)),Kj}var Wj={},dL;function xye(){return dL||(dL=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 f=0;f<l.length;f++){const h=l[f];Array.isArray(h)&&c<a?o(h,c+1):i.push(h)}};return o(n,0),i}e.flatten=t})(Wj)),Wj}var Qj={},hL;function rq(){return hL||(hL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ZH(),n=VH(),r=KH(),i=XH();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})(Qj)),Qj}var mL;function bye(){return mL||(mL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yye(),n=xye(),r=rq();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})(Vj)),Vj}var Zj,pL;function wye(){return pL||(pL=1,Zj=bye().sortBy),Zj}var Sye=wye();const tb=Hi(Sye);var iq=e=>e.legend.settings,jye=e=>e.legend.size,Eye=e=>e.legend.payload,_ye=le([Eye,iq],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?tb(r,n):r});function Cye(){return Ie(_ye)}var Xv=1;function aq(){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)>Xv||Math.abs(o.left-t.left)>Xv||Math.abs(o.top-t.top)>Xv||Math.abs(o.width-t.width)>Xv)&&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 Nr(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 kye=typeof Symbol=="function"&&Symbol.observable||"@@observable",gL=kye,Jj=()=>Math.random().toString(36).substring(7).split("").join("."),Nye={INIT:`@@redux/INIT${Jj()}`,REPLACE:`@@redux/REPLACE${Jj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Jj()}`},cx=Nye;function oA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function oq(e,t,n){if(typeof e!="function")throw new Error(Nr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Nr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Nr(1));return n(oq)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function f(){o===a&&(o=new Map,a.forEach((S,j)=>{o.set(j,S)}))}function h(){if(c)throw new Error(Nr(3));return i}function d(S){if(typeof S!="function")throw new Error(Nr(4));if(c)throw new Error(Nr(5));let j=!0;f();const C=l++;return o.set(C,S),function(){if(j){if(c)throw new Error(Nr(6));j=!1,f(),o.delete(C),a=null}}}function g(S){if(!oA(S))throw new Error(Nr(7));if(typeof S.type>"u")throw new Error(Nr(8));if(typeof S.type!="string")throw new Error(Nr(17));if(c)throw new Error(Nr(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(Nr(10));r=S,g({type:cx.REPLACE})}function b(){const S=d;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Nr(11));function C(){const N=j;N.next&&N.next(h())}return C(),{unsubscribe:S(C)}},[gL](){return this}}}return g({type:cx.INIT}),{dispatch:g,subscribe:d,getState:h,replaceReducer:v,[gL]:b}}function Aye(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:cx.INIT})>"u")throw new Error(Nr(12));if(typeof n(void 0,{type:cx.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Nr(13))})}function sq(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{Aye(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let c=!1;const f={};for(let h=0;h<r.length;h++){const d=r[h],g=n[d],v=o[d],b=g(v,l);if(typeof b>"u")throw l&&l.type,new Error(Nr(14));f[d]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?f:o}}function fx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Oye(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Nr(15))};const o={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},l=e.map(c=>c(o));return a=fx(...l)(i.dispatch),{...i,dispatch:a}}}function lq(e){return oA(e)&&"type"in e&&typeof e.type=="string"}var uq=Symbol.for("immer-nothing"),vL=Symbol.for("immer-draftable"),ri=Symbol.for("immer-state");function Ma(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Di=Object,pd=Di.getPrototypeOf,dx="constructor",nb="prototype",iC="configurable",hx="enumerable",Ny="writable",$m="value",xs=e=>!!e&&!!e[ri];function qa(e){var t;return e?cq(e)||ib(e)||!!e[vL]||!!((t=e[dx])!=null&&t[vL])||ab(e)||ob(e):!1}var Tye=Di[nb][dx].toString(),yL=new WeakMap;function cq(e){if(!e||!sA(e))return!1;const t=pd(e);if(t===null||t===Di[nb])return!0;const n=Di.hasOwnProperty.call(t,dx)&&t[dx];if(n===Object)return!0;if(!Df(n))return!1;let r=yL.get(n);return r===void 0&&(r=Function.toString.call(n),yL.set(n,r)),r===Tye}function rb(e,t,n=!0){Bp(e)===0?(n?Reflect.ownKeys(e):Di.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Bp(e){const t=e[ri];return t?t.type_:ib(e)?1:ab(e)?2:ob(e)?3:0}var xL=(e,t,n=Bp(e))=>n===2?e.has(t):Di[nb].hasOwnProperty.call(e,t),aC=(e,t,n=Bp(e))=>n===2?e.get(t):e[t],mx=(e,t,n,r=Bp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Pye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ib=Array.isArray,ab=e=>e instanceof Map,ob=e=>e instanceof Set,sA=e=>typeof e=="object",Df=e=>typeof e=="function",eE=e=>typeof e=="boolean";function Mye(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ns=e=>e.copy_||e.base_,lA=e=>e.modified_?e.copy_:e.base_;function oC(e,t){if(ab(e))return new Map(e);if(ob(e))return new Set(e);if(ib(e))return Array[nb].slice.call(e);const n=cq(e);if(t===!0||t==="class_only"&&!n){const r=Di.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[Ny]===!1&&(l[Ny]=!0,l[iC]=!0),(l.get||l.set)&&(r[o]={[iC]:!0,[Ny]:!0,[hx]:l[hx],[$m]:e[o]})}return Di.create(pd(e),r)}else{const r=pd(e);if(r!==null&&n)return{...e};const i=Di.create(r);return Di.assign(i,e)}}function uA(e,t=!1){return sb(e)||xs(e)||!qa(e)||(Bp(e)>1&&Di.defineProperties(e,{set:Gv,add:Gv,clear:Gv,delete:Gv}),Di.freeze(e),t&&rb(e,(n,r)=>{uA(r,!0)},!1)),e}function Dye(){Ma(2)}var Gv={[$m]:Dye};function sb(e){return e===null||!sA(e)?!0:Di.isFrozen(e)}var px="MapSet",sC="Patches",bL="ArrayMethods",fq={};function pc(e){const t=fq[e];return t||Ma(0,e),t}var wL=e=>!!fq[e],Bm,dq=()=>Bm,Rye=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wL(px)?pc(px):void 0,arrayMethodsPlugin_:wL(bL)?pc(bL):void 0});function SL(e,t){t&&(e.patchPlugin_=pc(sC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lC(e){uC(e),e.drafts_.forEach(Iye),e.drafts_=null}function uC(e){e===Bm&&(Bm=e.parent_)}var jL=e=>Bm=Rye(Bm,e);function Iye(e){const t=e[ri];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function EL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ri].modified_&&(lC(t),Ma(4)),qa(e)&&(e=_L(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ri].base_,e,t)}else e=_L(t,n);return Lye(t,e,!0),lC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uq?e:void 0}function _L(e,t){if(sb(t))return t;const n=t[ri];if(!n)return gx(t,e.handledSet_,e);if(!lb(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 Lye(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uA(t,n)}function hq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var lb=(e,t)=>e.scope_===t,zye=[];function mq(e,t,n,r){const i=ns(e),a=e.type_;if(r!==void 0&&aC(i,r,a)===t){mx(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;rb(i,(c,f)=>{if(xs(f)){const h=l.get(f)||[];h.push(c),l.set(f,h)}})}const o=e.draftLocations_.get(t)??zye;for(const l of o)mx(i,l,n,a)}function $ye(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!lb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=lA(a);mq(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)}hq(e)}}function Bye(e,t,n){const{scope_:r}=e;if(xs(n)){const i=n[ri];lb(i,r)&&i.callbacks_.push(function(){Ay(e);const o=lA(i);mq(e,n,o,t)})}else qa(n)&&e.callbacks_.push(function(){const a=ns(e);e.type_===3?a.has(n)&&gx(n,r.handledSet_,r):aC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&gx(aC(e.copy_,t,e.type_),r.handledSet_,r)})}function gx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xs(e)||t.has(e)||!qa(e)||sb(e)||(t.add(e),rb(e,(r,i)=>{if(xs(i)){const a=i[ri];if(lb(a,n)){const o=lA(a);mx(e,r,o,e.type_),hq(a)}}else qa(i)&&gx(i,t,n)})),e}function Fye(e,t){const n=ib(e),r={type_:n?1:0,scope_:t?t.scope_:dq(),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=vx;n&&(i=[r],a=Fm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var vx={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(!xL(i,t,e.type_))return Uye(e,i,t);const a=i[t];if(e.finalized_||!qa(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Mye(t))return a;if(a===tE(e.base_,t)){Ay(e);const o=e.type_===1?+t:t,l=fC(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=gq(ns(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=tE(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(Pye(n,i)&&(n!==void 0||xL(e.base_,t,e.type_)))return!0;Ay(e),cC(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),Bye(e,t,n)),!0},deleteProperty(e,t){return Ay(e),tE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),cC(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&&{[Ny]:!0,[iC]:e.type_!==1||t!=="length",[hx]:r[hx],[$m]:n[t]}},defineProperty(){Ma(11)},getPrototypeOf(e){return pd(e.base_)},setPrototypeOf(){Ma(12)}},Fm={};for(let e in vx){let t=vx[e];Fm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Fm.deleteProperty=function(e,t){return Fm.set.call(this,e,t,void 0)};Fm.set=function(e,t,n){return vx.set.call(this,e[0],t,n,e[0])};function tE(e,t){const n=e[ri];return(n?ns(n):e)[t]}function Uye(e,t,n){var i;const r=gq(t,n);return r?$m in r?r[$m]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function gq(e,t){if(!(t in e))return;let n=pd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=pd(n)}}function cC(e){e.modified_||(e.modified_=!0,e.parent_&&cC(e.parent_))}function Ay(e){e.copy_||(e.assigned_=new Map,e.copy_=oC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Hye=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Df(n)&&!Df(r)){const o=r;r=n;const l=this;return function(f=o,...h){return l.produce(f,d=>r.call(this,d,...h))}}Df(r)||Ma(6),i!==void 0&&!Df(i)&&Ma(7);let a;if(qa(n)){const o=jL(this),l=fC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?lC(o):uC(o)}return SL(o,i),EL(a,o)}else if(!n||!sA(n)){if(a=r(n),a===void 0&&(a=n),a===uq&&(a=void 0),this.autoFreeze_&&uA(a,!0),i){const o=[],l=[];pc(sC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else Ma(1,n)},this.produceWithPatches=(n,r)=>{if(Df(n))return(l,...c)=>this.produceWithPatches(l,f=>n(f,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},eE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),eE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),eE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){qa(t)||Ma(8),xs(t)&&(t=sa(t));const n=jL(this),r=fC(n,t,void 0);return r[ri].isManual_=!0,uC(n),r}finishDraft(t,n){const r=t&&t[ri];(!r||!r.isManual_)&&Ma(9);const{scope_:i}=r;return SL(i,n),EL(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=pc(sC).applyPatches_;return xs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function fC(e,t,n,r){const[i,a]=ab(t)?pc(px).proxyMap_(t,n):ob(t)?pc(px).proxySet_(t,n):Fye(t,n);return((n==null?void 0:n.scope_)??dq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?$ye(n,a,r):a.callbacks_.push(function(c){var h;(h=c.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:f}=c;a.modified_&&f&&f.generatePatches_(a,[],c)}),i}function sa(e){return xs(e)||Ma(10,e),vq(e)}function vq(e){if(!qa(e)||sb(e))return e;const t=e[ri];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=oC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=oC(e,!0);return rb(n,(i,a)=>{mx(n,i,vq(a))},r),t&&(t.finalized_=!1),n}var qye=new Hye,yq=qye.produce;function xq(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Vye=xq(),Kye=xq,Yye=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?fx:fx.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=>lq(r)&&r.type===e,n}var bq=class ym extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ym.prototype)}static get[Symbol.species](){return ym}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ym(...t[0].concat(this)):new ym(...t.concat(this))}};function CL(e){return qa(e)?yq(e,()=>{}):e}function Wv(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Xye(e){return typeof e=="boolean"}var Gye=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new bq;return n&&(Xye(n)?o.push(Vye):o.push(Kye(n.extraArgument))),o},wq="RTK_autoBatch",gn=()=>e=>({payload:e,meta:{[wq]:!0}}),kL=e=>t=>{setTimeout(t,e)},Sq=(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:kL(10):e.type==="callback"?e.queueNotification:kL(e.timeout),f=()=>{o=!1,a&&(a=!1,l.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const d=()=>i&&h(),g=r.subscribe(d);return l.add(h),()=>{g(),l.delete(h)}},dispatch(h){var d;try{return i=!((d=h==null?void 0:h.meta)!=null&&d[wq]),a=!i,a&&(o||(o=!0,c(f))),r.dispatch(h)}finally{i=!0}}})},Wye=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new bq(e);return r&&i.push(Sq(typeof r=="object"?r:void 0)),i};function Qye(e){const t=Gye(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(oA(n))l=sq(n);else throw new Error(zi(1));let c;typeof r=="function"?c=r(t):c=t();let f=fx;i&&(f=Yye({trace:!1,...typeof i=="object"&&i}));const h=Oye(...c),d=Wye(h);let g=typeof o=="function"?o(d):d();const v=f(...g);return oq(l,a,v)}function jq(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 Zye(e){return typeof e=="function"}function Jye(e,t){let[n,r,i]=jq(t),a;if(Zye(e))a=()=>CL(e());else{const l=CL(e);a=()=>l}function o(l=a(),c){let f=[n[c.type],...r.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return f.filter(h=>!!h).length===0&&(f=[i]),f.reduce((h,d)=>{if(d)if(xs(h)){const v=d(h,c);return v===void 0?h:v}else{if(qa(h))return yq(h,g=>d(g,c));{const g=d(h,c);if(g===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return h},l)}return o.getInitialState=a,o}var exe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",txe=(e=21)=>{let t="",n=e;for(;n--;)t+=exe[Math.random()*64|0];return t},nxe=Symbol.for("rtk-slice-createasyncthunk");function rxe(e,t){return`${e}/${t}`}function ixe({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[nxe];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(oxe()):i.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(N,O){const A=typeof N=="string"?N:N.type;if(!A)throw new Error(zi(12));if(A in f.sliceCaseReducersByType)throw new Error(zi(13));return f.sliceCaseReducersByType[A]=O,h},addMatcher(N,O){return f.sliceMatchers.push({matcher:N,reducer:O}),h},exposeAction(N,O){return f.actionCreators[N]=O,h},exposeCaseReducer(N,O){return f.sliceCaseReducersByName[N]=O,h}};c.forEach(N=>{const O=l[N],A={reducerName:N,type:rxe(a,N),createNotation:typeof i.reducers=="function"};lxe(O)?cxe(A,O,h,t):sxe(A,O,h)});function d(){const[N={},O=[],A=void 0]=typeof i.extraReducers=="function"?jq(i.extraReducers):[i.extraReducers],T={...N,...f.sliceCaseReducersByType};return Jye(i.initialState,P=>{for(let L in T)P.addCase(L,T[L]);for(let L of f.sliceMatchers)P.addMatcher(L.matcher,L.reducer);for(let L of O)P.addMatcher(L.matcher,L.reducer);A&&P.addDefaultCase(A)})}const g=N=>N,v=new Map,b=new WeakMap;let w;function S(N,O){return w||(w=d()),w(N,O)}function j(){return w||(w=d()),w.getInitialState()}function C(N,O=!1){function A(P){let L=P[N];return typeof L>"u"&&O&&(L=Wv(b,A,j)),L}function T(P=g){const L=Wv(v,O,()=>new WeakMap);return Wv(L,P,()=>{const I={};for(const[F,$]of Object.entries(i.selectors??{}))I[F]=axe($,P,()=>Wv(b,P,j),O);return I})}return{reducerPath:N,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const _={name:a,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:j,...C(o),injectInto(N,{reducerPath:O,...A}={}){const T=O??o;return N.inject({reducerPath:T,reducer:S},A),{..._,...C(T,!0)}}};return _}}function axe(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=ixe();function oxe(){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 sxe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!uxe(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 lxe(e){return e._reducerDefinitionType==="asyncThunk"}function uxe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function cxe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(zi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:f,options:h}=n,d=i(e,a,h);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),l&&r.addCase(d.pending,l),c&&r.addCase(d.rejected,c),f&&r.addMatcher(d.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Qv,pending:l||Qv,rejected:c||Qv,settled:f||Qv})}function Qv(){}var fxe="task",Eq="listener",_q="completed",cA="cancelled",dxe=`task-${cA}`,hxe=`task-${_q}`,dC=`${Eq}-${cA}`,mxe=`${Eq}-${_q}`,ub=class{constructor(e){cS(this,"name","TaskAbortError");cS(this,"message");this.code=e,this.message=`${fxe} ${cA} (reason: ${e})`}},fA=(e,t)=>{if(typeof e!="function")throw new TypeError(zi(32))},yx=()=>{},Cq=(e,t=yx)=>(e.catch(t),e),kq=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wu=e=>{if(e.aborted)throw new ub(e.reason)};function Nq(e,t){let n=yx;return new Promise((r,i)=>{const a=()=>i(new ub(e.reason));if(e.aborted){a();return}n=kq(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=yx})}var pxe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ub?"cancelled":"rejected",error:n}}finally{t==null||t()}},xx=e=>t=>Cq(Nq(e,t).then(n=>(Wu(e),n))),Aq=e=>{const t=xx(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Uf}=Object,NL={},cb="listenerMiddleware",gxe=(e,t)=>{const n=r=>kq(e,()=>r.abort(e.reason));return(r,i)=>{fA(r);const a=new AbortController;n(a);const o=pxe(async()=>{Wu(e),Wu(a.signal);const l=await r({pause:xx(a.signal),delay:Aq(a.signal),signal:a.signal});return Wu(a.signal),l},()=>a.abort(hxe));return i!=null&&i.autoJoin&&t.push(o.catch(yx)),{result:xx(e)(o),cancel(){a.abort(dxe)}}}},vxe=(e,t)=>{const n=async(r,i)=>{Wu(t);let a=()=>{};const l=[new Promise((c,f)=>{let h=e({predicate:r,effect:(d,g)=>{g.unsubscribe(),c([d,g.getState(),g.getOriginalState()])}});a=()=>{h(),f()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Nq(t,Promise.race(l));return Wu(t),c}finally{a()}};return(r,i)=>Cq(n(r,i))},Oq=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 fA(a),{predicate:i,type:t,effect:a}},Tq=Uf(e=>{const{type:t,predicate:n,effect:r}=Oq(e);return{id:txe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(zi(22))}}},{withTypes:()=>Tq}),AL=(e,t)=>{const{type:n,effect:r,predicate:i}=Oq(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},hC=e=>{e.pending.forEach(t=>{t.abort(dC)})},yxe=(e,t)=>()=>{for(const n of t.keys())hC(n);e.clear()},OL=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Pq=Uf(Bi(`${cb}/add`),{withTypes:()=>Pq}),xxe=Bi(`${cb}/removeAll`),Mq=Uf(Bi(`${cb}/remove`),{withTypes:()=>Mq}),bxe=(...e)=>{console.error(`${cb}/error`,...e)},Fp=(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;fA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&hC(v)}),c=v=>{const b=AL(t,v)??Tq(v);return l(b)};Uf(c,{withTypes:()=>c});const f=v=>{const b=AL(t,v);return b&&(b.unsubscribe(),v.cancelActive&&hC(b)),!!b};Uf(f,{withTypes:()=>f});const h=async(v,b,w,S)=>{const j=new AbortController,C=vxe(c,j.signal),_=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,Uf({},w,{getOriginalState:S,condition:(N,O)=>C(N,O).then(Boolean),take:C,delay:Aq(j.signal),pause:xx(j.signal),extra:a,signal:j.signal,fork:gxe(j.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((N,O,A)=>{N!==j&&(N.abort(dC),A.delete(N))})},cancel:()=>{j.abort(dC),v.pending.delete(j)},throwIfCancelled:()=>{Wu(j.signal)}})))}catch(N){N instanceof ub||OL(o,N,{raisedBy:"effect"})}finally{await Promise.all(_),j.abort(mxe),i(v),v.pending.delete(j)}},d=yxe(t,n);return{middleware:v=>b=>w=>{if(!lq(w))return b(w);if(Pq.match(w))return c(w.payload);if(xxe.match(w)){d();return}if(Mq.match(w))return f(w.payload);let S=v.getState();const j=()=>{if(S===NL)throw new Error(zi(23));return S};let C;try{if(C=b(w),t.size>0){const _=v.getState(),N=Array.from(t.values());for(const O of N){let A=!1;try{A=O.predicate(w,_,S)}catch(T){A=!1,OL(o,T,{raisedBy:"predicate"})}A&&h(O,w,v,j)}}}finally{S=NL}return C},startListening:c,stopListening:f,clearListeners:d}};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 wxe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Dq=Kr({name:"chartLayout",initialState:wxe,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:Sxe,setLayout:jxe,setChartSize:Exe,setScale:_xe}=Dq.actions,Cxe=Dq.reducer;function Rq(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ot(e){return Number.isFinite(e)}function jo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function TL(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 Rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TL(Object(n),!0).forEach(function(r){kxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kxe(e,t,n){return(t=Nxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nxe(e){var t=Axe(e,"string");return typeof t=="symbol"?t:t+""}function Axe(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 jn(e)||jn(t)?n:So(t)?hc(e,t,n):typeof t=="function"?t(e):n}var Oxe=(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"&&Me(e[a]))return Rf(Rf({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Me(e[o]))return Rf(Rf({},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",Iq=(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},Lq=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:f,tickCount:h,ticks:d,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?vr(a[0]-a[1])*2*w:w,d||g){var S=(d||g||[]).map((j,C)=>{var _=r?r.indexOf(j):j,N=o.map(_);return Ot(N)?{coordinate:N+w,value:j,offset:w,index:C}:null}).filter(yi);return S}return c&&f?f.map((j,C)=>{var _=o.map(j);return Ot(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.ticks&&h!=null?o.ticks(h).map((j,C)=>{var _=o.map(j);return Ot(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.domain().map((j,C)=>{var _=o.map(j);return Ot(_)?{coordinate:_+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(yi)},Txe=(e,t)=>{if(!t||t.length!==2||!Me(t[0])||!Me(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(!Me(e[0])||e[0]<n)&&(i[0]=n),(!Me(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Pxe=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],f=c==null?void 0:c[i];if(f!=null){var h=f[1],d=f[0],g=wo(h)?d:h;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=o,o+=g,f[1]=o)}}}},Mxe=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 f=wo(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Dxe={sign:Pxe,expand:nve,none:dc,silhouette:rve,wiggle:ive,positive:Mxe},Rxe=(e,t,n)=>{var r,i=(r=Dxe[n])!==null&&r!==void 0?r:dc,a=tve().keys(t).value((l,c)=>Number(en(l,c,0))).order(nC).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((f,h)=>{var d=en(e[h],t[c],0);Array.isArray(d)&&d.length===2&&Me(d[0])&&Me(d[1])&&(f[0]=d[0],f[1]=d[1])})}),o};function Ixe(e){return e==null?void 0:String(e)}function PL(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!jn(i[t.dataKey])){var l=BH(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,jn(o)?t.dataKey:o),f=t.scale.map(c);return Me(f)?f:null}var ML=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(jn(l))return null;var c=t.scale.map(l);return Me(c)?c-i/2+r:null},Lxe=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]},zxe=e=>{var t=e.flat(2).filter(Me);return[Math.min(...t),Math.max(...t)]},$xe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Bxe=(e,t,n)=>{if(e!=null)return $xe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,f)=>{var h=Rq(f,t,n),d=zxe(h);return!Ot(d[0])||!Ot(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},DL=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,RL=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gd=(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=tb(t,h=>h.coordinate),a=1/0,o=1,l=i.length;o<l;o++){var c=i[o],f=i[o-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((f==null?void 0:f.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function IL(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Rf(Rf({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Ud(e,t){if(e)return String(e);if(typeof t=="string")return t}var Fxe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Uxe=(e,t)=>t==="centric"?e.angle:e.radius,Ns=e=>e.layout.width,As=e=>e.layout.height,Hxe=e=>e.layout.scale,zq=e=>e.layout.margin,fb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),db=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),$q="data-recharts-item-index",Bq="data-recharts-item-id",Up=60;function LL(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 Zv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LL(Object(n),!0).forEach(function(r){qxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qxe(e,t,n){return(t=Vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vxe(e){var t=Kxe(e,"string");return typeof t=="symbol"?t:t+""}function Kxe(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 Yxe=e=>e.brush.height;function Xxe(e){var t=db(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Up;return n+i}return n},0)}function Gxe(e){var t=db(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Up;return n+i}return n},0)}function Wxe(e){var t=fb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Qxe(e){var t=fb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var ur=le([Ns,As,zq,Yxe,Xxe,Gxe,Wxe,Qxe,iq,jye],(e,t,n,r,i,a,o,l,c,f)=>{var h={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+o,bottom:(n.bottom||0)+l},g=Zv(Zv({},d),h),v=g.bottom;g.bottom+=r,g=Oxe(g,c,f);var b=e-g.left-g.right,w=t-g.top-g.bottom;return Zv(Zv({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),Zxe=le(ur,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),dA=le(Ns,As,(e,t)=>({x:0,y:0,width:e,height:t})),Jxe=y.createContext(null),Yr=()=>y.useContext(Jxe)!=null,hb=e=>e.brush,mb=le([hb,ur,zq],(e,t,n)=>({height:e.height,x:Me(e.x)?e.x:t.left,y:Me(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Me(e.width)?e.width:t.width})),nE={},rE={},iE={},zL;function e0e(){return zL||(zL=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"),f=a==null||a.includes("trailing"),h=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},d=()=>{f&&h(),w()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,d()},r)},b=()=>{g!==null&&(clearTimeout(g),g=null)},w=()=>{b(),o=void 0,l=null},S=()=>{h()},j=function(...C){if(i!=null&&i.aborted)return;o=this,l=C;const _=g==null;v(),c&&_&&h()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(iE)),iE}var $L;function t0e(){return $L||($L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e0e();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,f=Array(2);o&&(f[0]="leading"),l&&(f[1]="trailing");let h,d=null;const g=t.debounce(function(...w){h=r.apply(this,w),d=null},i,{edges:f}),v=function(...w){return c!=null&&(d===null&&(d=Date.now()),Date.now()-d>=c)?(h=r.apply(this,w),d=Date.now(),g.cancel(),g.schedule(),h):(g.apply(this,w),h)},b=()=>(g.flush(),h);return v.cancel=g.cancel,v.flush=b,v}e.debounce=n})(rE)),rE}var BL;function n0e(){return BL||(BL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=t0e();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})(nE)),nE}var aE,FL;function r0e(){return FL||(FL=1,aE=n0e().throttle),aE}var i0e=r0e();const a0e=Hi(i0e);var bx=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++]))}},mo={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Fq=(e,t,n)=>{var{width:r=mo.width,height:i=mo.height,aspect:a,maxHeight:o}=n,l=mc(r)?e:Number(r),c=mc(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}},o0e={width:0,height:0,overflow:"visible"},s0e={width:0,overflowX:"visible"},l0e={height:0,overflowY:"visible"},u0e={},c0e=e=>{var{width:t,height:n}=e,r=mc(t),i=mc(n);return r&&i?o0e:r?s0e:i?l0e:u0e};function f0e(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=mo.width,a=mo.height):i===void 0?i=r&&r>0?void 0:mo.width:a===void 0&&(a=r&&r>0?void 0:mo.height),{width:i,height:a}}function mC(){return mC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mC.apply(null,arguments)}function UL(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 HL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UL(Object(n),!0).forEach(function(r){d0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d0e(e,t,n){return(t=h0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h0e(e){var t=m0e(e,"string");return typeof t=="symbol"?t:t+""}function m0e(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 Uq=y.createContext(mo.initialDimension);function p0e(e){return jo(e.width)&&jo(e.height)}function Hq(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return p0e(i)?y.createElement(Uq.Provider,{value:i},t):null}var hA=()=>y.useContext(Uq),g0e=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=mo.initialDimension,width:i,height:a,minWidth:o=mo.minWidth,minHeight:l,maxHeight:c,children:f,debounce:h=mo.debounce,id:d,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,L)=>{C(I=>{var F=Math.round(P),$=Math.round(L);return I.containerWidth===F&&I.containerHeight===$?I:{containerWidth:F,containerHeight:$}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eu;var P=$=>{var G,D=$[0];if(D!=null){var{width:V,height:z}=D.contentRect;_(V,z),(G=S.current)===null||G===void 0||G.call(S,V,z)}};h>0&&(P=a0e(P,h,{trailing:!0,leading:!1}));var L=new ResizeObserver(P),{width:I,height:F}=w.current.getBoundingClientRect();return _(I,F),L.observe(w.current),()=>{L.disconnect()}},[_,h]);var{containerWidth:N,containerHeight:O}=j;bx(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=Fq(N,O,{width:i,height:a,aspect:n,maxHeight:c});return bx(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:d?"".concat(d):void 0,className:Mt("recharts-responsive-container",g),style:HL(HL({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},y.createElement("div",{style:c0e({width:i,height:a})},y.createElement(Hq,{width:A,height:T},f)))}),mA=y.forwardRef((e,t)=>{var n=hA();if(jo(n.width)&&jo(n.height))return e.children;var{width:r,height:i}=f0e({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=Fq(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Me(a)&&Me(o)?y.createElement(Hq,{width:a,height:o},e.children):y.createElement(g0e,mC({},e,{width:r,height:i,ref:t}))});function pA(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 pb=()=>{var e,t=Yr(),n=Ie(Zxe),r=Ie(mb),i=(e=Ie(hb))===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}},v0e={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},qq=()=>{var e;return(e=Ie(ur))!==null&&e!==void 0?e:v0e},gA=()=>Ie(Ns),vA=()=>Ie(As),y0e=()=>Ie(e=>e.layout.margin),Ft=e=>e.layout.layoutType,Tc=()=>Ie(Ft),Vq=()=>{var e=Tc();if(e==="horizontal"||e==="vertical")return e},Kq=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},x0e=()=>{var e=Tc();return e!==void 0},Hp=e=>{var t=tn(),n=Yr(),{width:r,height:i}=e,a=hA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&jo(o)&&jo(l)&&t(Exe({width:o,height:l}))},[t,n,o,l]),null},Yq=Symbol.for("immer-nothing"),qL=Symbol.for("immer-draftable"),Fi=Symbol.for("immer-state");function Da(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Um=Object.getPrototypeOf;function vd(e){return!!e&&!!e[Fi]}function gc(e){var t;return e?Xq(e)||Array.isArray(e)||!!e[qL]||!!((t=e.constructor)!=null&&t[qL])||qp(e)||vb(e):!1}var b0e=Object.prototype.constructor.toString(),VL=new WeakMap;function Xq(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=VL.get(n);return r===void 0&&(r=Function.toString.call(n),VL.set(n,r)),r===b0e}function wx(e,t,n=!0){gb(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 gb(e){const t=e[Fi];return t?t.type_:Array.isArray(e)?1:qp(e)?2:vb(e)?3:0}function pC(e,t){return gb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Gq(e,t,n){const r=gb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function w0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function qp(e){return e instanceof Map}function vb(e){return e instanceof Set}function Pu(e){return e.copy_||e.base_}function gC(e,t){if(qp(e))return new Map(e);if(vb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Xq(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(Um(e),r)}else{const r=Um(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function yA(e,t=!1){return yb(e)||vd(e)||!gc(e)||(gb(e)>1&&Object.defineProperties(e,{set:Jv,add:Jv,clear:Jv,delete:Jv}),Object.freeze(e),t&&Object.values(e).forEach(n=>yA(n,!0))),e}function S0e(){Da(2)}var Jv={value:S0e};function yb(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var j0e={};function vc(e){const t=j0e[e];return t||Da(0,e),t}var Hm;function Wq(){return Hm}function E0e(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function KL(e,t){t&&(vc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function vC(e){yC(e),e.drafts_.forEach(_0e),e.drafts_=null}function yC(e){e===Hm&&(Hm=e.parent_)}function YL(e){return Hm=E0e(Hm,e)}function _0e(e){const t=e[Fi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function XL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Fi].modified_&&(vC(t),Da(4)),gc(e)&&(e=Sx(t,e),t.parent_||jx(t,e)),t.patches_&&vc("Patches").generateReplacementPatches_(n[Fi].base_,e,t.patches_,t.inversePatches_)):e=Sx(t,n,[]),vC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Yq?e:void 0}function Sx(e,t,n){if(yb(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Fi];if(!i)return wx(t,(a,o)=>GL(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return jx(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),wx(o,(c,f)=>GL(e,i,a,c,f,n,l),r),jx(e,a,!1),n&&e.patches_&&vc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function GL(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=yb(i);if(!(l&&!o)){if(vd(i)){const c=a&&t&&t.type_!==3&&!pC(t.assigned_,r)?a.concat(r):void 0,f=Sx(e,i,c);if(Gq(n,r,f),vd(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(gc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Sx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(qp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&jx(e,i)}}}function jx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yA(t,n)}function C0e(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Wq(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=xA;n&&(i=[r],a=qm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var xA={get(e,t){if(t===Fi)return e;const n=Pu(e);if(!pC(n,t))return k0e(e,n,t);const r=n[t];return e.finalized_||!gc(r)?r:r===oE(e.base_,t)?(sE(e),e.copy_[t]=bC(r,e)):r},has(e,t){return t in Pu(e)},ownKeys(e){return Reflect.ownKeys(Pu(e))},set(e,t,n){const r=Qq(Pu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=oE(Pu(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(w0e(n,i)&&(n!==void 0||pC(e.base_,t)))return!0;sE(e),xC(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 oE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,sE(e),xC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Da(11)},getPrototypeOf(e){return Um(e.base_)},setPrototypeOf(){Da(12)}},qm={};wx(xA,(e,t)=>{qm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qm.deleteProperty=function(e,t){return qm.set.call(this,e,t,void 0)};qm.set=function(e,t,n){return xA.set.call(this,e[0],t,n,e[0])};function oE(e,t){const n=e[Fi];return(n?Pu(n):e)[t]}function k0e(e,t,n){var i;const r=Qq(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Qq(e,t){if(!(t in e))return;let n=Um(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Um(n)}}function xC(e){e.modified_||(e.modified_=!0,e.parent_&&xC(e.parent_))}function sE(e){e.copy_||(e.copy_=gC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var N0e=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,...f){return o.produce(c,h=>n.call(this,h,...f))}}typeof n!="function"&&Da(6),r!==void 0&&typeof r!="function"&&Da(7);let i;if(gc(t)){const a=YL(this),o=bC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?vC(a):yC(a)}return KL(a,r),XL(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Yq&&(i=void 0),this.autoFreeze_&&yA(i,!0),r){const a=[],o=[];vc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Da(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){gc(e)||Da(8),vd(e)&&(e=A0e(e));const t=YL(this),n=bC(e,void 0);return n[Fi].isManual_=!0,yC(t),n}finishDraft(e,t){const n=e&&e[Fi];(!n||!n.isManual_)&&Da(9);const{scope_:r}=n;return KL(r,t),XL(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=vc("Patches").applyPatches_;return vd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function bC(e,t){const n=qp(e)?vc("MapSet").proxyMap_(e,t):vb(e)?vc("MapSet").proxySet_(e,t):C0e(e,t);return(t?t.scope_:Wq()).drafts_.push(n),n}function A0e(e){return vd(e)||Da(10,e),Zq(e)}function Zq(e){if(!gc(e)||yb(e))return e;const t=e[Fi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=gC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=gC(e,!0);return wx(n,(i,a)=>{Gq(n,i,Zq(a))},r),t&&(t.finalized_=!1),n}var O0e=new N0e;O0e.produce;var T0e={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Jq=Kr({name:"legend",initialState:T0e,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:WL,setLegendSettings:P0e,addLegendPayload:e9,replaceLegendPayload:t9,removeLegendPayload:n9}=Jq.actions,M0e=Jq.reducer,lE={exports:{}},uE={};/**
 * @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 QL;function D0e(){if(QL)return uE;QL=1;var e=Td();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}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 uE.useSyncExternalStoreWithSelector=function(c,f,h,d,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=d(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=d(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,_=T)}var j=!1,C,_,N=h===void 0?null:h;return[function(){return S(f())},N===null?void 0:function(){return S(N())}]},[f,h,d,g]);var w=r(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},uE}var ZL;function R0e(){return ZL||(ZL=1,lE.exports=D0e()),lE.exports}R0e();function I0e(e){e()}function L0e(){let e=null,t=null;return{clear(){e=null,t=null},notify(){I0e(()=>{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 JL={notify(){},get:()=>[]};function z0e(e,t){let n,r=JL,i=0,a=!1;function o(w){h();const S=r.subscribe(w);let j=!1;return()=>{j||(j=!0,S(),d())}}function l(){r.notify()}function c(){b.onStateChange&&b.onStateChange()}function f(){return a}function h(){i++,n||(n=e.subscribe(c),r=L0e())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=JL)}function g(){a||(a=!0,h())}function v(){a&&(a=!1,d())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return b}var $0e=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",B0e=$0e(),F0e=()=>typeof navigator<"u"&&navigator.product==="ReactNative",U0e=F0e(),H0e=()=>B0e||U0e?y.useLayoutEffect:y.useEffect,q0e=H0e();function e3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function V0e(e,t){if(e3(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])||!e3(e[n[i]],t[n[i]]))return!1;return!0}var cE=Symbol.for("react-redux-context"),fE=typeof globalThis<"u"?globalThis:{};function K0e(){if(!y.createContext)return{};const e=fE[cE]??(fE[cE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var Y0e=K0e();function X0e(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const c=z0e(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);q0e(()=>{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||Y0e;return y.createElement(l.Provider,{value:a},t)}var G0e=X0e,W0e=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Q0e(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Hd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(W0e.has(r)){if(e[r]==null&&t[r]==null)continue;if(!V0e(e[r],t[r]))return!1}else if(!Q0e(e[r],t[r]))return!1;return!0}var Z0e=["contextPayload"];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 t3(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 yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t3(Object(n),!0).forEach(function(r){J0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J0e(e,t,n){return(t=ebe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ebe(e){var t=tbe(e,"string");return typeof t=="symbol"?t:t+""}function tbe(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 nbe(e,t){if(e==null)return{};var n,r,i=rbe(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 rbe(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 ibe(e){return e.value}function abe(e){var{contextPayload:t}=e,n=nbe(e,Z0e),r=JH(t,e.payloadUniqBy,ibe),i=yd(yd({},n),{},{payload:r});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(Mve,i)}function obe(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:c}=t,f,h;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=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"?h={top:((i||0)-a.height)/2}:h=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),yd(yd({},f),h)}function sbe(e){var t=tn();return y.useEffect(()=>{t(P0e(e))},[t,e]),null}function lbe(e){var t=tn();return y.useEffect(()=>(t(WL(e)),()=>{t(WL({width:0,height:0}))}),[t,e]),null}function ube(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var cbe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function fbe(e){var t=Zn(e,cbe),n=Cye(),r=_ge(),i=y0e(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[f,h]=aq([n]),d=gA(),g=vA();if(d==null||g==null)return null;var v=d-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),b=ube(t.layout,o,a,v),w=c?l:yd(yd({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},obe(l,t,i,d,g,f)),l),S=c??r;if(S==null||n==null)return null;var j=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:h},y.createElement(sbe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&y.createElement(lbe,{width:f.width,height:f.height}),y.createElement(abe,wC({},t,b,{margin:i,chartWidth:d,chartHeight:g,contextPayload:n})));return Gl.createPortal(j,S)}var r9=y.memo(fbe,Hd);r9.displayName="Legend";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 n3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n3(Object(n),!0).forEach(function(r){dbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dbe(e,t,n){return(t=hbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hbe(e){var t=mbe(e,"string");return typeof t=="symbol"?t:t+""}function mbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pbe(e){return Array.isArray(e)&&So(e[0])&&So(e[1])?e.join(" ~ "):e}var Sf={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 gbe(e,t){return t==null?e:tb(e,t)}var vbe=e=>{var{separator:t=Sf.separator,contentStyle:n,itemStyle:r,labelStyle:i=Sf.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:f,label:h,labelFormatter:d,accessibilityLayer:g=Sf.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=gbe(a,l),T=A.map((P,L)=>{if(P.type==="none")return null;var I=P.formatter||o||pbe,{value:F,name:$}=P,G=F,D=$;if(I){var V=I(F,$,P,L,a);if(Array.isArray(V))[G,D]=V;else if(V!=null)G=V;else return null}var z=tm(tm({},Sf.itemStyle),{},{color:P.color||Sf.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:z},So(D)?y.createElement("span",{className:"recharts-tooltip-item-name"},D):null,So(D)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},G),y.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},b=tm(tm({},Sf.contentStyle),n),w=tm({margin:0},i),S=!jn(h),j=S?h:"",C=Mt("recharts-default-tooltip",c),_=Mt("recharts-tooltip-label",f);S&&d&&a!==void 0&&a!==null&&(j=d(h,a));var N=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",SC({className:C,style:b},N),y.createElement("p",{className:_,style:w},y.isValidElement(j)?j:"".concat(j)),v())},nm="recharts-tooltip-wrapper",ybe={visibility:"hidden"};function xbe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Mt(nm,{["".concat(nm,"-right")]:Me(n)&&t&&Me(t.x)&&n>=t.x,["".concat(nm,"-left")]:Me(n)&&t&&Me(t.x)&&n<t.x,["".concat(nm,"-bottom")]:Me(r)&&t&&Me(t.y)&&r>=t.y,["".concat(nm,"-top")]:Me(r)&&t&&Me(t.y)&&r<t.y})}function r3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:f}=e;if(a&&Me(a[r]))return a[r];var h=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?h:d;var g=c[r];if(g==null)return 0;if(o[r]){var v=h,b=g;return v<b?Math.max(d,g):Math.max(h,g)}if(f==null)return 0;var w=d+l,S=g+f;return w>S?Math.max(h,g):Math.max(d,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 wbe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:f}=e,h,d,g;return l.height>0&&l.width>0&&n?(d=r3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),g=r3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),h=bbe({translateX:d,translateY:g,useTranslate3d:c})):h=ybe,{cssProperties:h,cssClasses:xbe({translateX:d,translateY:g,coordinate:n})}}var Sbe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Vp={isSsr:Sbe()};function i9(){var[e,t]=y.useState(()=>Vp.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 i3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i3(Object(n),!0).forEach(function(r){jbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jbe(e,t,n){return(t=Ebe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ebe(e){var t=_be(e,"string");return typeof t=="symbol"?t:t+""}function _be(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 Cbe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function kbe(e){var t,n,r,i,a,o,l=i9(),[c,f]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,_;f({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)&&f(jf(jf({},c),{},{dismissed:!1}));var{cssClasses:h,cssProperties:d}=wbe({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?{}:jf(jf({transition:Cbe({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=jf(jf({},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:h,style:v,ref:e.innerRef},e.children)}var Nbe=y.memo(kbe),a9=()=>{var e;return(e=Ie(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function jC(){return jC=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},jC.apply(null,arguments)}function a3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function o3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a3(Object(n),!0).forEach(function(r){Abe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Abe(e,t,n){return(t=Obe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Obe(e){var t=Tbe(e,"string");return typeof t=="symbol"?t:t+""}function Tbe(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 s3={curveBasisClosed:qge,curveBasisOpen:Vge,curveBasis:Hge,curveBumpX:Age,curveBumpY:Oge,curveLinearClosed:Kge,curveLinear:J0,curveMonotoneX:Yge,curveMonotoneY:Xge,curveNatural:Gge,curveStep:Wge,curveStepAfter:Zge,curveStepBefore:Qge},Ex=e=>Ot(e.x)&&Ot(e.y),l3=e=>e.base!=null&&Ex(e.base)&&Ex(e),rm=e=>e.x,im=e=>e.y,Pbe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(zp(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=s3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return s3[n]||J0},u3={connectNulls:!1,type:"linear"},Mbe=e=>{var{type:t=u3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=u3.connectNulls}=e,o=Pbe(t,i),l=a?n.filter(Ex):n;if(Array.isArray(r)){var c,f=n.map((b,w)=>o3(o3({},b),{},{base:r[w]}));i==="vertical"?c=Kv().y(im).x1(rm).x0(b=>b.base.x):c=Kv().x(rm).y1(im).y0(b=>b.base.y);var h=c.defined(l3).curve(o),d=a?f.filter(l3):f;return h(d)}var g;i==="vertical"&&Me(r)?g=Kv().y(im).x1(rm).x0(r):Me(r)?g=Kv().x(rm).y1(im).y0(r):g=kH().x(rm).y(im);var v=g.defined(Ex).curve(o);return v(l)},bA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Tc();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?Mbe(o):r;return y.createElement("path",jC({},$i(e),rA(e),{className:Mt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},Dbe=["x","y","top","left","width","height","className"];function EC(){return EC=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},EC.apply(null,arguments)}function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rbe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(n),!0).forEach(function(r){Ibe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ibe(e,t,n){return(t=Lbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lbe(e){var t=zbe(e,"string");return typeof t=="symbol"?t:t+""}function zbe(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 $be(e,t){if(e==null)return{};var n,r,i=Bbe(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 Bbe(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 Fbe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Ube=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=$be(e,Dbe),f=Rbe({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Me(t)||!Me(n)||!Me(a)||!Me(o)||!Me(r)||!Me(i)?null:y.createElement("path",EC({},ni(f),{className:Mt("recharts-cross",l),d:Fbe(t,n,a,o,r,i)}))};function Hbe(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 f3(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 d3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f3(Object(n),!0).forEach(function(r){qbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qbe(e,t,n){return(t=Vbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vbe(e){var t=Kbe(e,"string");return typeof t=="symbol"?t:t+""}function Kbe(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 Ybe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),o9=(e,t,n)=>e.map(r=>"".concat(Ybe(r)," ").concat(t,"ms ").concat(n)).join(","),Xbe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Vm=(e,t)=>Object.keys(t).reduce((n,r)=>d3(d3({},n),{},{[r]:e(r,t[r])}),{});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 ar(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){Gbe(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 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 _x=(e,t,n)=>e+(t-e)*n,_C=e=>{var{from:t,to:n}=e;return t!==n},s9=(e,t,n)=>{var r=Vm((i,a)=>{if(_C(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?Vm((i,a)=>_C(a)&&r[i]!=null?ar(ar({},a),{},{velocity:_x(a.velocity,r[i].velocity,n),from:_x(a.from,r[i].from,n)}):a,t):s9(e,r,n-1)};function Zbe(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=()=>Vm((g,v)=>v.from,l),f=()=>!Object.values(l).filter(_C).length,h=null,d=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=s9(n,l,b),i(ar(ar(ar({},e),t),c())),o=g,f()||(h=a.setTimeout(d))};return()=>(h=a.setTimeout(d),()=>{var g;(g=h)===null||g===void 0||g()})}function Jbe(e,t,n,r,i,a,o){var l=null,c=i.reduce((d,g)=>{var v=e[g],b=t[g];return v==null||b==null?d:ar(ar({},d),{},{[g]:[v,b]})},{}),f,h=d=>{f||(f=d);var g=(d-f)/r,v=Vm((w,S)=>_x(...S,n(g)),c);if(a(ar(ar(ar({},e),t),v)),g<1)l=o.setTimeout(h);else{var b=Vm((w,S)=>_x(...S,n(1)),c);a(ar(ar(ar({},e),t),b))}};return()=>(l=o.setTimeout(h),()=>{var d;(d=l)===null||d===void 0||d()})}const ewe=(e,t,n,r,i,a)=>{var o=Xbe(e,t);return n==null?()=>(i(ar(ar({},e),t)),()=>{}):n.isStepper===!0?Zbe(e,t,n,o,i,a):Jbe(e,t,n,r,o,i,a)};var Cx=1e-4,l9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],u9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),m3=(e,t)=>n=>{var r=l9(e,t);return u9(r,n)},twe=(e,t)=>n=>{var r=l9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return u9(i,n)},nwe=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]]},rwe=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=nwe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},iwe=(e,t,n,r)=>{var i=m3(e,n),a=m3(t,r),o=twe(e,n),l=f=>f>1?1:f<0?0:f,c=f=>{for(var h=f>1?1:f,d=h,g=0;g<8;++g){var v=i(d)-h,b=o(d);if(Math.abs(v-h)<Cx||b<Cx)return a(d);d=l(d-v/b)}return a(d)};return c.isStepper=!1,c},p3=function(){return iwe(...rwe(...arguments))},awe=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 f=-(o-l)*n,h=c*r,d=c+(f-h)*i/1e3,g=c*i/1e3+o;return Math.abs(g-l)<Cx&&Math.abs(d)<Cx?[l,0]:[g,d]};return a.isStepper=!0,a.dt=i,a},owe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return p3(e);case"spring":return awe();default:if(e.split("(")[0]==="cubic-bezier")return p3(e)}return typeof e=="function"?e:null};function swe(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,...f]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,f),c);return}a(c),i=e.setTimeout(a.bind(null,f));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 lwe{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 uwe(){return swe(new lwe)}var cwe=y.createContext(uwe);function fwe(e,t){var n=y.useContext(cwe);return y.useMemo(()=>t??n(e),[e,t,n])}var dwe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},g3={t:0},dE={t:1};function Kp(e){var t=Zn(e,dwe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:f}=t,h=i9(),d=n==="auto"?!Vp.isSsr&&!h:n,g=fwe(t.animationId,t.animationManager),[v,b]=y.useState(d?g3:dE),w=y.useRef(null);return y.useEffect(()=>{d||b(dE)},[d]),y.useEffect(()=>{if(!d||!r)return eu;var S=ewe(g3,dE,owe(a),i,b,g.getTimeoutController()),j=()=>{w.current=S()};return g.start([c,o,j,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[d,r,i,a,o,c,l,g]),f(v.t)}function Yp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(zm(t)),r=y.useRef(e);return r.current!==e&&(n.current=zm(t),r.current=e),n.current}var hwe=["radius"],mwe=["radius"],v3,y3,x3,b3,w3,S3,j3,E3,_3,C3;function k3(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 N3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k3(Object(n),!0).forEach(function(r){pwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k3(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)}function kx(){return kx=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},kx.apply(null,arguments)}function A3(e,t){if(e==null)return{};var n,r,i=ywe(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 ywe(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 ro(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var O3=(e,t,n,r,i)=>{var a=Rl(n),o=Rl(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,f=a>=0?1:-1,h=o>=0&&a>=0||o<0&&a<0?1:0,d;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}d=In(v3||(v3=ro(["M",",",""])),e,t+c*g[0]),g[0]>0&&(d+=In(y3||(y3=ro(["A ",",",",0,0,",",",",",""])),g[0],g[0],h,e+f*g[0],t)),d+=In(x3||(x3=ro(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(d+=In(b3||(b3=ro(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],h,e+n,t+c*g[1])),d+=In(w3||(w3=ro(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(d+=In(S3||(S3=ro(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],h,e+n-f*g[2],t+r)),d+=In(j3||(j3=ro(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(d+=In(E3||(E3=ro(["A ",",",",0,0,",`,
        `,",",""])),g[3],g[3],h,e,t+r-c*g[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);d=In(_3||(_3=ro(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*j,j,j,h,e+f*j,t,e+n-f*j,t,j,j,h,e+n,t+c*j,e+n,t+r-c*j,j,j,h,e+n-f*j,t+r,e+f*j,t+r,j,j,h,e,t+r-c*j)}else d=In(C3||(C3=ro(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},T3={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},c9=e=>{var t=Zn(e,T3),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var q=n.current.getTotalLength();q&&i(q)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:f,className:h}=t,{animationEasing:d,animationDuration:g,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=y.useRef(l),j=y.useRef(c),C=y.useRef(a),_=y.useRef(o),N=y.useMemo(()=>({x:a,y:o,width:l,height:c,radius:f}),[a,o,l,c,f]),O=Yp(N,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var A=Mt("recharts-rectangle",h);if(!w){var T=ni(t),{radius:P}=T,L=A3(T,hwe);return y.createElement("path",kx({},L,{x:Rl(a),y:Rl(o),width:Rl(l),height:Rl(c),radius:typeof f=="number"?f:void 0,className:A,d:O3(a,o,l,c,f)}))}var I=S.current,F=j.current,$=C.current,G=_.current,D="0px ".concat(r===-1?1:r,"px"),V="".concat(r,"px ").concat(r,"px"),z=o9(["strokeDasharray"],g,typeof d=="string"?d:T3.animationEasing);return y.createElement(Kp,{animationId:O,key:O,canBegin:r>0,duration:g,easing:d,isActive:w,begin:v},q=>{var X=bn(I,l,q),K=bn(F,c,q),R=bn($,a,q),H=bn(G,o,q);n.current&&(S.current=X,j.current=K,C.current=R,_.current=H);var U;b?q>0?U={transition:z,strokeDasharray:V}:U={strokeDasharray:D}:U={strokeDasharray:V};var B=ni(t),{radius:Q}=B,Z=A3(B,mwe);return y.createElement("path",kx({},Z,{radius:typeof f=="number"?f:void 0,className:A,d:O3(R,H,X,K,f),ref:n,style:N3(N3({},U),t.style)}))})};function P3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function M3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P3(Object(n),!0).forEach(function(r){xwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xwe(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=wwe(e,"string");return typeof t=="symbol"?t:t+""}function wwe(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 Nx=Math.PI/180,Swe=e=>e*180/Math.PI,Gn=(e,t,n,r)=>({x:e+Math.cos(-Nx*r)*n,y:t+Math.sin(-Nx*r)*n}),f9=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},jwe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Ewe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=jwe({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:Swe(c),angleInRadian:c}},_we=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}},Cwe=(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},kwe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Ewe({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:f}=_we(t),h=a,d;if(c<=f){for(;h>f;)h-=360;for(;h<c;)h+=360;d=h>=c&&h<=f}else{for(;h>c;)h-=360;for(;h<f;)h+=360;d=h>=f&&h<=c}return d?M3(M3({},t),{},{radius:i,angle:Cwe(h,t)}):null};function d9(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 D3,R3,I3,L3,z3,$3,B3;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 Iu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Nwe=(e,t)=>{var n=vr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},ey=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,f=l*(o?1:-1)+r,h=Math.asin(l/f)/Nx,d=c?i:i+a*h,g=Gn(t,n,f,d),v=Gn(t,n,r,d),b=c?i-a*h:i,w=Gn(t,n,f*Math.cos(h*Nx),b);return{center:g,circleTangency:v,lineTangency:w,theta:h}},h9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=Nwe(a,o),c=a+l,f=Gn(t,n,i,a),h=Gn(t,n,i,c),d=In(D3||(D3=Iu(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),f.x,f.y,i,i,+(Math.abs(l)>180),+(a>c),h.x,h.y);if(r>0){var g=Gn(t,n,r,a),v=Gn(t,n,r,c);d+=In(R3||(R3=Iu(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else d+=In(I3||(I3=Iu(["L ",","," Z"])),t,n);return d},Awe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:f}=e,h=vr(f-c),{circleTangency:d,lineTangency:g,theta:v}=ey({cx:t,cy:n,radius:i,angle:c,sign:h,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=ey({cx:t,cy:n,radius:i,angle:f,sign:-h,cornerRadius:a,cornerIsExternal:l}),j=l?Math.abs(c-f):Math.abs(c-f)-v-S;if(j<0)return o?In(L3||(L3=Iu(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):h9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var C=In(z3||(z3=Iu(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(h<0),d.x,d.y,i,i,+(j>180),+(h<0),b.x,b.y,a,a,+(h<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:N,theta:O}=ey({cx:t,cy:n,radius:r,angle:c,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:P}=ey({cx:t,cy:n,radius:r,angle:f,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),L=l?Math.abs(c-f):Math.abs(c-f)-O-P;if(L<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=In($3||($3=Iu(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(h<0),A.x,A.y,r,r,+(L>180),+(h>0),_.x,_.y,a,a,+(h<0),N.x,N.y)}else C+=In(B3||(B3=Iu(["L",",","Z"])),t,n);return C},Owe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},m9=e=>{var t=Zn(e,Owe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h,className:d}=t;if(a<i||f===h)return null;var g=Mt("recharts-sector",d),v=a-i,b=Hr(o,v,0,!0),w;return b>0&&Math.abs(f-h)<360?w=Awe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}):w=h9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:h}),y.createElement("path",CC({},ni(t),{className:g,d:w}))};function Twe(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(UH(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Gn(r,i,a,l),f=Gn(r,i,o,l);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return d9(t)}}var hE={},mE={},pE={},F3;function Pwe(){return F3||(F3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nq();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(pE)),pE}var U3;function Mwe(){return U3||(U3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pwe();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})(mE)),mE}var H3;function Dwe(){return H3||(H3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rq(),n=Mwe();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 f=0;f<l;f++)c[f]=i,i+=o;return c}e.range=r})(hE)),hE}var gE,q3;function Rwe(){return q3||(q3=1,gE=Dwe().range),gE}var Iwe=Rwe();const p9=Hi(Iwe);var Os=e=>e.chartData,xb=le([Os],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),wA=(e,t,n,r)=>r?xb(e):Os(e),Lwe=(e,t,n)=>n?xb(e):Os(e);function yo(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ot(t)&&Ot(n))return!0}return!1}function V3(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function g9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Ot(n))i=n;else if(typeof n=="function")return;if(Ot(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(yo(o))return o}}function zwe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(yo(r))return V3(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(Me(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"&&DL.test(i)){var c=DL.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var f=+c[1];o=t[0]-f}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Me(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"&&RL.test(a)){var h=RL.exec(a);if(h==null||h[1]==null||t==null)l=void 0;else{var d=+h[1];l=t[1]+d}}else l=t==null?void 0:t[1];var g=[o,l];if(yo(g))return t==null?g:V3(g,t,n)}}}var qd=1e9,$we={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},jA,Sn=!0,ga="[DecimalError] ",Qu=ga+"Invalid argument: ",SA=ga+"Exponent out of range: ",Vd=Math.floor,Mu=Math.pow,Bwe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pi,gr=1e7,vn=7,v9=9007199254740991,Ax=Vd(v9/vn),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.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};De.decimalPlaces=De.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};De.dividedBy=De.div=function(e){return fs(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return ln(fs(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return Qn(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.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(ga+"NaN");if(n.s<1)throw Error(ga+(n.s?"NaN":"-Infinity"));return n.eq(Pi)?new r(0):(Sn=!1,t=fs(Km(n,a),Km(e,a),a),Sn=!0,ln(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?b9(t,e):y9(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ga+"NaN");return n.s?(Sn=!1,t=fs(n,e,0,1).times(e),Sn=!0,n.minus(t)):ln(new r(n),i)};De.naturalExponential=De.exp=function(){return x9(this)};De.naturalLogarithm=De.ln=function(){return Km(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?y9(t,e):b9(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qu+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};De.squareRoot=De.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(ga+"NaN")}for(e=Qn(l),Sn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=po(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vd((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(fs(l,a,o+2)).times(.5),po(a.d).slice(0,o)===(t=po(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ln(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Sn=!0,ln(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,l,c,f,h=this,d=h.constructor,g=h.d,v=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,n=h.e+e.e,c=g.length,f=v.length,c<f&&(a=g,g=v,v=a,o=c,c=f,f=o),a=[],o=c+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+v[r]*g[i-r-1]+t,a[i--]=l%gr|0,t=l/gr|0;a[i]=(a[i]+t)%gr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Sn?ln(e,d.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Eo(e,0,qd),t===void 0?t=r.rounding:Eo(t,0,8),ln(n,e+Qn(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=yc(r,!0):(Eo(e,0,qd),t===void 0?t=i.rounding:Eo(t,0,8),r=ln(new i(r),e+1,t),n=yc(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?yc(i):(Eo(e,0,qd),t===void 0?t=a.rounding:Eo(t,0,8),r=ln(new a(i),e+Qn(i)+1,t),n=yc(r.abs(),!1,e+Qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return ln(new t(e),Qn(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,f=12,h=+(e=new c(e));if(!e.s)return new c(Pi);if(l=new c(l),!l.s){if(e.s<1)throw Error(ga+"Infinity");return l}if(l.eq(Pi))return l;if(r=c.precision,e.eq(Pi))return ln(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=h<0?-h:h)<=v9){for(i=new c(Pi),t=Math.ceil(r/vn+4),Sn=!1;n%2&&(i=i.times(l),Y3(i.d,t)),n=Vd(n/2),n!==0;)l=l.times(l),Y3(l.d,t);return Sn=!0,e.s<0?new c(Pi).div(i):ln(i,r)}}else if(a<0)throw Error(ga+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Sn=!1,i=e.times(Km(l,r+f)),Sn=!0,i=x9(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Qn(i),r=yc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Eo(e,1,qd),t===void 0?t=a.rounding:Eo(t,0,8),i=ln(new a(i),e,t),n=Qn(i),r=yc(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Eo(e,1,qd),t===void 0?t=r.rounding:Eo(t,0,8)),ln(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return yc(e,t<=n.toExpNeg||t>=n.toExpPos)};function y9(e,t){var n,r,i,a,o,l,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Sn?ln(t,d):t;if(c=e.d,f=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=f.length):(r=f,i=o,l=c.length),o=Math.ceil(d/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=f.length,l-a<0&&(a=l,r=f,f=c,c=r),n=0;a;)n=(c[--a]=c[a]+f[a]+n)/gr|0,c[a]%=gr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Sn?ln(t,d):t}function Eo(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Qu+e)}function po(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+=bl(n)),a+=r;o=e[t],r=o+"",n=vn-r.length,n&&(a+=bl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var fs=(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%gr|0,o=a/gr|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*gr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,f,h,d,g,v,b,w,S,j,C,_,N,O,A,T,P,L=r.constructor,I=r.s==i.s?1:-1,F=r.d,$=i.d;if(!r.s)return new L(r);if(!i.s)throw Error(ga+"Division by zero");for(c=r.e-i.e,T=$.length,O=F.length,v=new L(I),b=v.d=[],f=0;$[f]==(F[f]||0);)++f;if($[f]>(F[f]||0)&&--c,a==null?C=a=L.precision:o?C=a+(Qn(r)-Qn(i))+1:C=a,C<0)return new L(0);if(C=C/vn+2|0,f=0,T==1)for(h=0,$=$[0],C++;(f<O||h)&&C--;f++)_=h*gr+(F[f]||0),b[f]=_/$|0,h=_%$|0;else{for(h=gr/($[0]+1)|0,h>1&&($=e($,h),F=e(F,h),T=$.length,O=F.length),N=T,w=F.slice(0,T),S=w.length;S<T;)w[S++]=0;P=$.slice(),P.unshift(0),A=$[0],$[1]>=gr/2&&++A;do h=0,l=t($,w,T,S),l<0?(j=w[0],T!=S&&(j=j*gr+(w[1]||0)),h=j/A|0,h>1?(h>=gr&&(h=gr-1),d=e($,h),g=d.length,S=w.length,l=t(d,w,g,S),l==1&&(h--,n(d,T<g?P:$,g))):(h==0&&(l=h=1),d=$.slice()),g=d.length,g<S&&d.unshift(0),n(w,d,S),l==-1&&(S=w.length,l=t($,w,T,S),l<1&&(h++,n(w,T<S?P:$,S))),S=w.length):l===0&&(h++,w=[0]),b[f++]=h,l&&w[0]?w[S++]=F[N]||0:(w=[F[N]],S=1);while((N++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,ln(v,o?a+Qn(v)+1:a)}})();function x9(e,t){var n,r,i,a,o,l,c=0,f=0,h=e.constructor,d=h.precision;if(Qn(e)>16)throw Error(SA+Qn(e));if(!e.s)return new h(Pi);for(Sn=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Mu(2,f))/Math.LN10*2+5|0,l+=r,n=i=a=new h(Pi),h.precision=l;;){if(i=ln(i.times(e),l),n=n.times(++c),o=a.plus(fs(i,n,l)),po(o.d).slice(0,l)===po(a.d).slice(0,l)){for(;f--;)a=ln(a.times(a),l);return h.precision=d,t==null?(Sn=!0,ln(a,d)):a}a=o}}function Qn(e){for(var t=e.e*vn,n=e.d[0];n>=10;n/=10)t++;return t}function vE(e,t,n){if(t>e.LN10.sd())throw Sn=!0,n&&(e.precision=n),Error(ga+"LN10 precision limit exceeded");return ln(new e(e.LN10),t)}function bl(e){for(var t="";e--;)t+="0";return t}function Km(e,t){var n,r,i,a,o,l,c,f,h,d=1,g=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(ga+(v.s?"NaN":"-Infinity"));if(v.eq(Pi))return new w(0);if(t==null?(Sn=!1,f=S):f=t,v.eq(10))return t==null&&(Sn=!0),vE(w,f);if(f+=g,w.precision=f,n=po(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=po(v.d),r=n.charAt(0),d++;a=Qn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=vE(w,f+2,S).times(a+""),v=Km(new w(r+"."+n.slice(1)),f-g).plus(c),w.precision=S,t==null?(Sn=!0,ln(v,S)):v;for(l=o=v=fs(v.minus(Pi),v.plus(Pi),f),h=ln(v.times(v),f),i=3;;){if(o=ln(o.times(h),f),c=l.plus(fs(o,new w(i),f)),po(c.d).slice(0,f)===po(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus(vE(w,f+2,S).times(a+""))),l=fs(l,new w(d),f),w.precision=S,t==null?(Sn=!0,ln(l,S)):l;l=c,i+=2}}function K3(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=Vd(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),Sn&&(e.e>Ax||e.e<-Ax))throw Error(SA+n)}else e.s=0,e.e=0,e.d=[0];return e}function ln(e,t,n){var r,i,a,o,l,c,f,h,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=vn,i=t,f=d[h=0];else{if(h=Math.ceil((r+1)/vn),a=d.length,h>=a)return e;for(f=a=d[h],o=1;a>=10;a/=10)o++;r%=vn,i=r-vn+o}if(n!==void 0&&(a=Mu(10,o-i-1),l=f/a%10|0,c=t<0||d[h+1]!==void 0||f%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?f/Mu(10,o-i):0:d[h-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=Qn(e),d.length=1,t=t-a-1,d[0]=Mu(10,(vn-t%vn)%vn),e.e=Vd(-t/vn)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=h,a=1,h--):(d.length=h+1,a=Mu(10,vn-r),d[h]=i>0?(f/Mu(10,o-i)%Mu(10,i)|0)*a:0),c)for(;;)if(h==0){(d[0]+=a)==gr&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=gr)break;d[h--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(Sn&&(e.e>Ax||e.e<-Ax))throw Error(SA+Qn(e));return e}function b9(e,t){var n,r,i,a,o,l,c,f,h,d,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Sn?ln(t,v):t;if(c=e.d,d=t.d,r=t.e,f=e.e,c=c.slice(),o=f-r,o){for(h=o<0,h?(n=c,o=-o,l=d.length):(n=d,r=f,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=d.length,h=i<l,h&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){h=c[i]<d[i];break}o=0}for(h&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>o;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=gr-1;--c[a],c[i]+=gr}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Sn?ln(t,v):t):new g(0)}function yc(e,t,n){var r,i=Qn(e),a=po(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+bl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+bl(-i-1)+a,n&&(r=n-o)>0&&(a+=bl(r))):i>=o?(a+=bl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+bl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=bl(r))),e.s<0?"-"+a:a}function Y3(e,t){if(e.length>t)return e.length=t,!0}function w9(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(Qu+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 K3(o,a.toString())}else if(typeof a!="string")throw Error(Qu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Bwe.test(a))K3(o,a);else throw Error(Qu+a)}if(i.prototype=De,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=w9,i.config=i.set=Fwe,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 Fwe(e){if(!e||typeof e!="object")throw Error(ga+"Object expected");var t,n,r,i=["precision",1,qd,"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(Vd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Qu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Qu+n+": "+r);return this}var jA=w9($we);Pi=new jA(1);const At=jA;function S9(e){var t;return e===0?t=1:t=Math.floor(new At(e).abs().log(10).toNumber())+1,t}function j9(e,t,n){for(var r=new At(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var E9=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},EA=(e,t,n)=>{if(e.lte(0))return new At(0);var r=S9(e.toNumber()),i=new At(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new At(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new At(c.toNumber()):new At(Math.ceil(c.toNumber()))},_9=(e,t,n)=>{var r;if(e.lte(0))return new At(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new At(a).abs().log(10).toNumber()),l=new At(10).pow(o),c=e.div(l).toNumber(),f=i.findIndex(v=>v>=c-1e-10);if(f===-1&&(l=l.mul(10),f=0),f+=n,f>=i.length){var h=Math.floor(f/i.length);f%=i.length,l=l.mul(new At(10).pow(h))}var d=(r=i[f])!==null&&r!==void 0?r:1,g=new At(d).mul(l);return t?g:new At(Math.ceil(g.toNumber()))},Uwe=(e,t,n)=>{var r=new At(1),i=new At(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new At(10).pow(S9(e)-1),i=new At(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new At(Math.floor(e)))}else e===0?i=new At(Math.floor((t-1)/2)):n||(i=new At(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new At(c-o).mul(r)).toNumber());return l},C9=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]:EA;if(!Number.isFinite((n-t)/(r-1)))return{step:new At(0),tickMin:new At(0),tickMax:new At(0)};var l=o(new At(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new At(0):(c=new At(t).add(n).div(2),c=c.sub(new At(c).mod(l)));var f=Math.ceil(c.sub(t).div(l).toNumber()),h=Math.ceil(new At(n).sub(c).div(l).toNumber()),d=f+h+1;return d>r?C9(t,n,r,i,a+1,o):(d<r&&(h=n>0?h+(r-d):h,f=n>0?f:f+(r-d)),{step:l,tickMin:c.sub(new At(f).mul(l)),tickMax:c.add(new At(h).mul(l))})},X3=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,f]=E9([n,r]);if(c===-1/0||f===1/0){var h=f===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?h.reverse():h}if(c===f)return Uwe(c,i,a);var d=o==="snap125"?_9:EA,{step:g,tickMin:v,tickMax:b}=C9(c,f,l,a,0,d),w=j9(v,b.add(new At(.1).mul(g)),g);return n>r?w.reverse():w},G3=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]=E9([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var f=o==="snap125"?_9:EA,h=Math.max(n,2),d=f(new At(c).sub(l).div(h-1),a,0),g=[...j9(new At(l),new At(c),d),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},k9=e=>e.rootProps.maxBarSize,Hwe=e=>e.rootProps.barGap,N9=e=>e.rootProps.barCategoryGap,qwe=e=>e.rootProps.barSize,Xp=e=>e.rootProps.stackOffset,A9=e=>e.rootProps.reverseStackOrder,_A=e=>e.options.chartName,CA=e=>e.rootProps.syncId,O9=e=>e.rootProps.syncMethod,kA=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"},io={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},bb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function wb(e,t,n){if(n!=="auto")return n;if(e!=null)return ks(e,t)?"category":"number"}function W3(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 Ox(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W3(Object(n),!0).forEach(function(r){Vwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vwe(e,t,n){return(t=Kwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kwe(e){var t=Ywe(e,"string");return typeof t=="symbol"?t:t+""}function Ywe(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 Q3={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"},Z3={allowDataOverflow:io.allowDataOverflow,allowDecimals:io.allowDecimals,allowDuplicatedCategory:io.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:io.radiusAxisId,includeHidden:io.includeHidden,name:void 0,reversed:io.reversed,scale:io.scale,tick:io.tick,tickCount:io.tickCount,ticks:void 0,type:io.type,unit:void 0,niceTicks:"auto"},Xwe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},NA=le([Xwe,Kq],(e,t)=>{var n;if(e!=null)return e;var r=(n=wb(t,"angleAxis",Q3.type))!==null&&n!==void 0?n:"category";return Ox(Ox({},Q3),{},{type:r})}),Gwe=(e,t)=>e.polarAxis.radiusAxis[t],AA=le([Gwe,Kq],(e,t)=>{var n;if(e!=null)return e;var r=(n=wb(t,"radiusAxis",Z3.type))!==null&&n!==void 0?n:"category";return Ox(Ox({},Z3),{},{type:r})}),Sb=e=>e.polarOptions,OA=le([Ns,As,ur],f9),T9=le([Sb,OA],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),P9=le([Sb,OA],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),Wwe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},M9=le([Sb],Wwe);le([NA,M9],bb);var D9=le([OA,T9,P9],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([AA,D9],bb);var R9=le([Ft,Sb,T9,P9,Ns,As],(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:f}=t;return{cx:Hr(o,i,i/2),cy:Hr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),On=(e,t)=>t,Gp=(e,t,n)=>n;function TA(e){return e==null?void 0:e.id}function I9(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var c,f=(c=l.data)!==null&&c!==void 0?c:r;if(!(f==null||f.length===0)){var h=TA(l);f.forEach((d,g)=>{var v=a==null||i?g:String(en(d,a,null)),b=en(d,l.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[h]:b}),o.set(v,w)})}}),Array.from(o.values())}function jb(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Eb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function _b(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Qwe(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 br=e=>{var t=Ft(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Kd=e=>e.tooltip.settings.axisId;function PA(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 L9=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!yo(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ot(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 Ll(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Zwe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function MA(e){let t,n,r;e.length!==2?(t=Ll,n=(l,c)=>Ll(e(l),c),r=(l,c)=>e(l)-c):(t=e===Ll||e===Zwe?e:Jwe,n=e,r=e);function i(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;n(l[d],c)<0?f=d+1:h=d}while(f<h)}return f}function a(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;n(l[d],c)<=0?f=d+1:h=d}while(f<h)}return f}function o(l,c,f=0,h=l.length){const d=i(l,c,f,h-1);return d>f&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:o,right:a}}function Jwe(){return 0}function z9(e){return e===null?NaN:+e}function*e1e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const t1e=MA(Ll),Wp=t1e.right;MA(z9).center;class J3 extends Map{constructor(t,n=i1e){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(ez(this,t))}has(t){return super.has(ez(this,t))}set(t,n){return super.set(n1e(this,t),n)}delete(t){return super.delete(r1e(this,t))}}function ez({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function n1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function r1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function i1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function a1e(e=Ll){if(e===Ll)return $9;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 $9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const o1e=Math.sqrt(50),s1e=Math.sqrt(10),l1e=Math.sqrt(2);function Tx(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>=o1e?10:a>=s1e?5:a>=l1e?2:1;let l,c,f;return i<0?(f=Math.pow(10,-i)/o,l=Math.round(e*f),c=Math.round(t*f),l/f<e&&++l,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*o,l=Math.round(e/f),c=Math.round(t/f),l*f<e&&++l,c*f>t&&--c),c<l&&.5<=n&&n<2?Tx(e,t,n*2):[l,c,f]}function kC(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?Tx(t,e,n):Tx(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let f=0;f<l;++f)c[f]=(a-f)/-o;else for(let f=0;f<l;++f)c[f]=(a-f)*o;else if(o<0)for(let f=0;f<l;++f)c[f]=(i+f)/-o;else for(let f=0;f<l;++f)c[f]=(i+f)*o;return c}function NC(e,t,n){return t=+t,e=+e,n=+n,Tx(e,t,n)[2]}function AC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?NC(t,e,n):NC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function tz(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function nz(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function B9(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?$9:a1e(i);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,h=Math.log(c),d=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*d*(c-d)/c)*(f-c/2<0?-1:1),v=Math.max(n,Math.floor(t-f*d/c+g)),b=Math.min(r,Math.floor(t+(c-f)*d/c+g));B9(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(am(e,n,t),i(e[r],a)>0&&am(e,n,r);o<l;){for(am(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?am(e,n,l):(++l,am(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function am(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function u1e(e,t,n){if(e=Float64Array.from(e1e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return nz(e);if(t>=1)return tz(e);var r,i=(r-1)*t,a=Math.floor(i),o=tz(B9(e,a).subarray(0,a+1)),l=nz(e.subarray(a+1));return o+(l-o)*(i-a)}}function c1e(e,t,n=z9){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 f1e(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 wa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ts(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 OC=Symbol("implicit");function DA(){var e=new J3,t=[],n=[],r=OC;function i(a){let o=e.get(a);if(o===void 0){if(r!==OC)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 J3;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 DA(t,n).unknown(r)},wa.apply(i,arguments),i}function RA(){var e=DA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,f=0,h=.5;delete e.unknown;function d(){var g=t().length,v=i<r,b=v?i:r,w=v?r:i;a=(w-b)/Math.max(1,g-c+f*2),l&&(a=Math.floor(a)),b+=(w-b-a*(g-c))*h,o=a*(1-c),l&&(b=Math.round(b),o=Math.round(o));var S=f1e(g).map(function(j){return b+a*j});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),d()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(l=!!g,d()):l},e.padding=function(g){return arguments.length?(c=Math.min(1,f=+g),d()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),d()):c},e.paddingOuter=function(g){return arguments.length?(f=+g,d()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),d()):h},e.copy=function(){return RA(t(),[r,i]).round(l).paddingInner(c).paddingOuter(f).align(h)},wa.apply(d(),arguments)}function F9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return F9(t())},e}function d1e(){return F9(RA.apply(null,arguments).paddingInner(1))}function IA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function U9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qp(){}var Ym=.7,Px=1/Ym,Hf="\\s*([+-]?\\d+)\\s*",Xm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h1e=/^#([0-9a-f]{3,8})$/,m1e=new RegExp(`^rgb\\(${Hf},${Hf},${Hf}\\)$`),p1e=new RegExp(`^rgb\\(${xo},${xo},${xo}\\)$`),g1e=new RegExp(`^rgba\\(${Hf},${Hf},${Hf},${Xm}\\)$`),v1e=new RegExp(`^rgba\\(${xo},${xo},${xo},${Xm}\\)$`),y1e=new RegExp(`^hsl\\(${Xm},${xo},${xo}\\)$`),x1e=new RegExp(`^hsla\\(${Xm},${xo},${xo},${Xm}\\)$`),rz={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};IA(Qp,xc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:iz,formatHex:iz,formatHex8:b1e,formatHsl:w1e,formatRgb:az,toString:az});function iz(){return this.rgb().formatHex()}function b1e(){return this.rgb().formatHex8()}function w1e(){return H9(this).formatHsl()}function az(){return this.rgb().formatRgb()}function xc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=h1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?oz(t):n===3?new xi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ty(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ty(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=m1e.exec(e))?new xi(t[1],t[2],t[3],1):(t=p1e.exec(e))?new xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g1e.exec(e))?ty(t[1],t[2],t[3],t[4]):(t=v1e.exec(e))?ty(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=y1e.exec(e))?uz(t[1],t[2]/100,t[3]/100,1):(t=x1e.exec(e))?uz(t[1],t[2]/100,t[3]/100,t[4]):rz.hasOwnProperty(e)?oz(rz[e]):e==="transparent"?new xi(NaN,NaN,NaN,0):null}function oz(e){return new xi(e>>16&255,e>>8&255,e&255,1)}function ty(e,t,n,r){return r<=0&&(e=t=n=NaN),new xi(e,t,n,r)}function S1e(e){return e instanceof Qp||(e=xc(e)),e?(e=e.rgb(),new xi(e.r,e.g,e.b,e.opacity)):new xi}function TC(e,t,n,r){return arguments.length===1?S1e(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}IA(xi,TC,U9(Qp,{brighter(e){return e=e==null?Px:Math.pow(Px,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ym:Math.pow(Ym,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xi(Zu(this.r),Zu(this.g),Zu(this.b),Mx(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:sz,formatHex:sz,formatHex8:j1e,formatRgb:lz,toString:lz}));function sz(){return`#${Lu(this.r)}${Lu(this.g)}${Lu(this.b)}`}function j1e(){return`#${Lu(this.r)}${Lu(this.g)}${Lu(this.b)}${Lu((isNaN(this.opacity)?1:this.opacity)*255)}`}function lz(){const e=Mx(this.opacity);return`${e===1?"rgb(":"rgba("}${Zu(this.r)}, ${Zu(this.g)}, ${Zu(this.b)}${e===1?")":`, ${e})`}`}function Mx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lu(e){return e=Zu(e),(e<16?"0":"")+e.toString(16)}function uz(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ra(e,t,n,r)}function H9(e){if(e instanceof Ra)return new Ra(e.h,e.s,e.l,e.opacity);if(e instanceof Qp||(e=xc(e)),!e)return new Ra;if(e instanceof Ra)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 Ra(o,l,c,e.opacity)}function E1e(e,t,n,r){return arguments.length===1?H9(e):new Ra(e,t,n,r??1)}function Ra(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}IA(Ra,E1e,U9(Qp,{brighter(e){return e=e==null?Px:Math.pow(Px,e),new Ra(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ym:Math.pow(Ym,e),new Ra(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(yE(e>=240?e-240:e+120,i,r),yE(e,i,r),yE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ra(cz(this.h),ny(this.s),ny(this.l),Mx(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=Mx(this.opacity);return`${e===1?"hsl(":"hsla("}${cz(this.h)}, ${ny(this.s)*100}%, ${ny(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cz(e){return e=(e||0)%360,e<0?e+360:e}function ny(e){return Math.max(0,Math.min(1,e||0))}function yE(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 LA=e=>()=>e;function _1e(e,t){return function(n){return e+n*t}}function C1e(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 k1e(e){return(e=+e)==1?q9:function(t,n){return n-t?C1e(t,n,e):LA(isNaN(t)?n:t)}}function q9(e,t){var n=t-e;return n?_1e(e,n):LA(isNaN(e)?t:e)}const Dx=(function e(t){var n=k1e(t);function r(i,a){var o=n((i=TC(i)).r,(a=TC(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),f=q9(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=l(h),i.b=c(h),i.opacity=f(h),i+""}}return r.gamma=e,r})(1);function N1e(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 A1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function O1e(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]=ds(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 T1e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Pa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function P1e(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]=ds(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var PC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xE=new RegExp(PC.source,"g");function M1e(e){return function(){return e}}function D1e(e){return function(t){return e(t)+""}}function V9(e,t){var n=PC.lastIndex=xE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=PC.exec(e))&&(i=xE.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:Pa(r,i)})),n=xE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?D1e(c[0].x):M1e(t):(t=c.length,function(f){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(f);return l.join("")})}function ds(e,t){var n=typeof t,r;return t==null||n==="boolean"?LA(t):(n==="number"?Pa:n==="string"?(r=xc(t))?(t=r,Dx):V9:t instanceof xc?Dx:t instanceof Date?T1e:A1e(t)?N1e:Array.isArray(t)?O1e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?P1e:Pa)(e,t)}function zA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var fz=180/Math.PI,MC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function K9(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)*fz,skewX:Math.atan(c)*fz,scaleX:o,scaleY:l}}var ry;function R1e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?MC:K9(t.a,t.b,t.c,t.d,t.e,t.f)}function I1e(e){return e==null||(ry||(ry=document.createElementNS("http://www.w3.org/2000/svg","g")),ry.setAttribute("transform",e),!(e=ry.transform.baseVal.consolidate()))?MC:(e=e.matrix,K9(e.a,e.b,e.c,e.d,e.e,e.f))}function Y9(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,h,d,g,v,b){if(f!==d||h!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:Pa(f,d)},{i:w-2,x:Pa(h,g)})}else(d||g)&&v.push("translate("+d+t+g+n)}function o(f,h,d,g){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),g.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Pa(f,h)})):h&&d.push(i(d)+"rotate("+h+r)}function l(f,h,d,g){f!==h?g.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Pa(f,h)}):h&&d.push(i(d)+"skewX("+h+r)}function c(f,h,d,g,v,b){if(f!==d||h!==g){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:Pa(f,d)},{i:w-2,x:Pa(h,g)})}else(d!==1||g!==1)&&v.push(i(v)+"scale("+d+","+g+")")}return function(f,h){var d=[],g=[];return f=e(f),h=e(h),a(f.translateX,f.translateY,h.translateX,h.translateY,d,g),o(f.rotate,h.rotate,d,g),l(f.skewX,h.skewX,d,g),c(f.scaleX,f.scaleY,h.scaleX,h.scaleY,d,g),f=h=null,function(v){for(var b=-1,w=g.length,S;++b<w;)d[(S=g[b]).i]=S.x(v);return d.join("")}}}var L1e=Y9(R1e,"px, ","px)","deg)"),z1e=Y9(I1e,", ",")",")"),$1e=1e-12;function dz(e){return((e=Math.exp(e))+1/e)/2}function B1e(e){return((e=Math.exp(e))-1/e)/2}function F1e(e){return((e=Math.exp(2*e))-1)/(e+1)}const Oy=(function e(t,n,r){function i(a,o){var l=a[0],c=a[1],f=a[2],h=o[0],d=o[1],g=o[2],v=h-l,b=d-c,w=v*v+b*b,S,j;if(w<$1e)j=Math.log(g/f)/t,S=function(T){return[l+T*v,c+T*b,f*Math.exp(t*T*j)]};else{var C=Math.sqrt(w),_=(g*g-f*f+r*w)/(2*f*n*C),N=(g*g-f*f-r*w)/(2*g*n*C),O=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(N*N+1)-N);j=(A-O)/t,S=function(T){var P=T*j,L=dz(O),I=f/(n*C)*(L*F1e(t*P+O)-B1e(O));return[l+I*v,c+I*b,f*L/dz(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 U1e(e,t){t===void 0&&(t=e,e=ds);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 H1e(e){return function(){return e}}function Rx(e){return+e}var hz=[0,1];function ti(e){return e}function DC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:H1e(isNaN(t)?NaN:.5)}function q1e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function V1e(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=DC(i,r),a=n(o,a)):(r=DC(r,i),a=n(a,o)),function(l){return a(r(l))}}function K1e(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]=DC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=Wp(e,l,1,r)-1;return a[c](i[c](l))}}function Zp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Cb(){var e=hz,t=hz,n=ds,r,i,a,o=ti,l,c,f;function h(){var g=Math.min(e.length,t.length);return o!==ti&&(o=q1e(e[0],e[g-1])),l=g>2?K1e:V1e,c=f=null,d}function d(g){return g==null||isNaN(g=+g)?a:(c||(c=l(e.map(r),t,n)))(r(o(g)))}return d.invert=function(g){return o(i((f||(f=l(t,e.map(r),Pa)))(g)))},d.domain=function(g){return arguments.length?(e=Array.from(g,Rx),h()):e.slice()},d.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},d.rangeRound=function(g){return t=Array.from(g),n=zA,h()},d.clamp=function(g){return arguments.length?(o=g?!0:ti,h()):o!==ti},d.interpolate=function(g){return arguments.length?(n=g,h()):n},d.unknown=function(g){return arguments.length?(a=g,d):a},function(g,v){return r=g,i=v,h()}}function $A(){return Cb()(ti,ti)}function Y1e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ix(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 xd(e){return e=Ix(Math.abs(e)),e?e[1]:NaN}function X1e(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 G1e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var W1e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gm(e){if(!(t=W1e.exec(e)))throw new Error("invalid format: "+e);var t;return new BA({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]})}Gm.prototype=BA.prototype;function BA(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+""}BA.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 Q1e(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 Lx;function Z1e(e,t){var n=Ix(e,t);if(!n)return Lx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Lx=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")+Ix(e,Math.max(0,t+a-1))[0]}function mz(e,t){var n=Ix(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 pz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Y1e,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)=>mz(e*100,t),r:mz,s:Z1e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function gz(e){return e}var vz=Array.prototype.map,yz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function J1e(e){var t=e.grouping===void 0||e.thousands===void 0?gz:X1e(vz.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?gz:G1e(vz.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 f(d,g){d=Gm(d);var v=d.fill,b=d.align,w=d.sign,S=d.symbol,j=d.zero,C=d.width,_=d.comma,N=d.precision,O=d.trim,A=d.type;A==="n"?(_=!0,A="g"):pz[A]||(N===void 0&&(N=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:""),L=pz[A],I=/[defgprs%]/.test(A);N=N===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function F($){var G=T,D=P,V,z,q;if(A==="c")D=L($)+D,$="";else{$=+$;var X=$<0||1/$<0;if($=isNaN($)?c:L(Math.abs($),N),O&&($=Q1e($)),X&&+$==0&&w!=="+"&&(X=!1),G=(X?w==="("?w:l:w==="-"||w==="("?"":w)+G,D=(A==="s"&&!isNaN($)&&Lx!==void 0?yz[8+Lx/3]:"")+D+(X&&w==="("?")":""),I){for(V=-1,z=$.length;++V<z;)if(q=$.charCodeAt(V),48>q||q>57){D=(q===46?i+$.slice(V+1):$.slice(V))+D,$=$.slice(0,V);break}}}_&&!j&&($=t($,1/0));var K=G.length+$.length+D.length,R=K<C?new Array(C-K+1).join(v):"";switch(_&&j&&($=t(R+$,R.length?C-D.length:1/0),R=""),b){case"<":$=G+$+D+R;break;case"=":$=G+R+$+D;break;case"^":$=R.slice(0,K=R.length>>1)+G+$+D+R.slice(K);break;default:$=R+G+$+D;break}return a($)}return F.toString=function(){return d+""},F}function h(d,g){var v=Math.max(-8,Math.min(8,Math.floor(xd(g)/3)))*3,b=Math.pow(10,-v),w=f((d=Gm(d),d.type="f",d),{suffix:yz[8+v/3]});return function(S){return w(b*S)}}return{format:f,formatPrefix:h}}var iy,FA,X9;eSe({thousands:",",grouping:[3],currency:["$",""]});function eSe(e){return iy=J1e(e),FA=iy.format,X9=iy.formatPrefix,iy}function tSe(e){return Math.max(0,-xd(Math.abs(e)))}function nSe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xd(t)/3)))*3-xd(Math.abs(e)))}function rSe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xd(t)-xd(e))+1}function G9(e,t,n,r){var i=AC(e,t,n),a;switch(r=Gm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=nSe(i,o))&&(r.precision=a),X9(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=rSe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=tSe(i))&&(r.precision=a-(r.type==="%")*2);break}}return FA(r)}function tu(e){var t=e.domain;return e.ticks=function(n){var r=t();return kC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return G9(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,f,h=10;for(l<o&&(f=o,o=l,l=f,f=i,i=a,a=f);h-- >0;){if(f=NC(o,l,n),f===c)return r[i]=o,r[a]=l,t(r);if(f>0)o=Math.floor(o/f)*f,l=Math.ceil(l/f)*f;else if(f<0)o=Math.ceil(o*f)/f,l=Math.floor(l*f)/f;else break;c=f}return e},e}function W9(){var e=$A();return e.copy=function(){return Zp(e,W9())},wa.apply(e,arguments),tu(e)}function Q9(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,Rx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Q9(e).unknown(t)},e=arguments.length?Array.from(e,Rx):[0,1],tu(n)}function Z9(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 xz(e){return Math.log(e)}function bz(e){return Math.exp(e)}function iSe(e){return-Math.log(-e)}function aSe(e){return-Math.exp(-e)}function oSe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sSe(e){return e===10?oSe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function lSe(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 wz(e){return(t,n)=>-e(-t,n)}function UA(e){const t=e(xz,bz),n=t.domain;let r=10,i,a;function o(){return i=lSe(r),a=sSe(r),n()[0]<0?(i=wz(i),a=wz(a),e(iSe,aSe)):e(xz,bz),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 f=c[0],h=c[c.length-1];const d=h<f;d&&([f,h]=[h,f]);let g=i(f),v=i(h),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),f>0){for(;g<=v;++g)for(b=1;b<r;++b)if(w=g<0?b/a(-g):b*a(g),!(w<f)){if(w>h)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<f)){if(w>h)break;j.push(w)}j.length*2<S&&(j=kC(f,h,S))}else j=kC(g,v,Math.min(v-g,S)).map(a);return d?j.reverse():j},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Gm(c)).precision==null&&(c.trim=!0),c=FA(c)),l===1/0)return c;const f=Math.max(1,r*l/t.ticks().length);return h=>{let d=h/a(Math.round(i(h)));return d*r<r-.5&&(d*=r),d<=f?c(h):""}},t.nice=()=>n(Z9(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function J9(){const e=UA(Cb()).domain([1,10]);return e.copy=()=>Zp(e,J9()).base(e.base()),wa.apply(e,arguments),e}function Sz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function jz(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function HA(e){var t=1,n=e(Sz(t),jz(t));return n.constant=function(r){return arguments.length?e(Sz(t=+r),jz(t)):t},tu(n)}function e7(){var e=HA(Cb());return e.copy=function(){return Zp(e,e7()).constant(e.constant())},wa.apply(e,arguments)}function Ez(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function uSe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cSe(e){return e<0?-e*e:e*e}function qA(e){var t=e(ti,ti),n=1;function r(){return n===1?e(ti,ti):n===.5?e(uSe,cSe):e(Ez(n),Ez(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tu(t)}function VA(){var e=qA(Cb());return e.copy=function(){return Zp(e,VA()).exponent(e.exponent())},wa.apply(e,arguments),e}function fSe(){return VA.apply(null,arguments).exponent(.5)}function _z(e){return Math.sign(e)*e*e}function dSe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function t7(){var e=$A(),t=[0,1],n=!1,r;function i(a){var o=dSe(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(_z(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,Rx)).map(_z)),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 t7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},wa.apply(i,arguments),tu(i)}function n7(){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]=c1e(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Wp(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(Ll),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 n7().domain(e).range(t).unknown(r)},wa.apply(a,arguments)}function r7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Wp(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 f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return r7().domain([e,t]).range(i).unknown(a)},wa.apply(tu(o),arguments)}function i7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Wp(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 i7().domain(e).range(t).unknown(n)},wa.apply(i,arguments)}const bE=new Date,wE=new Date;function cr(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 f;do c.push(f=new Date(+a)),t(a,l),e(a);while(f<a&&a<o);return c},i.filter=a=>cr(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)=>(bE.setTime(+a),wE.setTime(+o),e(bE),e(wE),Math.floor(n(bE,wE))),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 zx=cr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);zx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?cr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):zx);zx.range;const ls=1e3,la=ls*60,us=la*60,bs=us*24,KA=bs*7,Cz=bs*30,SE=bs*365,zu=cr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ls)},(e,t)=>(t-e)/ls,e=>e.getUTCSeconds());zu.range;const YA=cr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getMinutes());YA.range;const XA=cr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCMinutes());XA.range;const GA=cr(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());GA.range;const WA=cr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*us)},(e,t)=>(t-e)/us,e=>e.getUTCHours());WA.range;const Jp=cr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*la)/bs,e=>e.getDate()-1);Jp.range;const kb=cr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>e.getUTCDate()-1);kb.range;const a7=cr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>Math.floor(e/bs));a7.range;function Pc(e){return cr(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)/KA)}const Nb=Pc(0),$x=Pc(1),hSe=Pc(2),mSe=Pc(3),bd=Pc(4),pSe=Pc(5),gSe=Pc(6);Nb.range;$x.range;hSe.range;mSe.range;bd.range;pSe.range;gSe.range;function Mc(e){return cr(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)/KA)}const Ab=Mc(0),Bx=Mc(1),vSe=Mc(2),ySe=Mc(3),wd=Mc(4),xSe=Mc(5),bSe=Mc(6);Ab.range;Bx.range;vSe.range;ySe.range;wd.range;xSe.range;bSe.range;const QA=cr(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());QA.range;const ZA=cr(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());ZA.range;const ws=cr(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());ws.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:cr(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)});ws.range;const Ss=cr(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());Ss.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:cr(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)});Ss.range;function o7(e,t,n,r,i,a){const o=[[zu,1,ls],[zu,5,5*ls],[zu,15,15*ls],[zu,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,bs],[r,2,2*bs],[n,1,KA],[t,1,Cz],[t,3,3*Cz],[e,1,SE]];function l(f,h,d){const g=h<f;g&&([f,h]=[h,f]);const v=d&&typeof d.range=="function"?d:c(f,h,d),b=v?v.range(f,+h+1):[];return g?b.reverse():b}function c(f,h,d){const g=Math.abs(h-f)/d,v=MA(([,,S])=>S).right(o,g);if(v===o.length)return e.every(AC(f/SE,h/SE,d));if(v===0)return zx.every(Math.max(AC(f,h,d),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[wSe,SSe]=o7(Ss,ZA,Ab,a7,WA,XA),[jSe,ESe]=o7(ws,QA,Nb,Jp,GA,YA);function jE(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 EE(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 om(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function _Se(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,f=sm(i),h=lm(i),d=sm(a),g=lm(a),v=sm(o),b=lm(o),w=sm(l),S=lm(l),j=sm(c),C=lm(c),_={a:q,A:X,b:K,B:R,c:null,d:Pz,e:Pz,f:XSe,g:ije,G:oje,H:VSe,I:KSe,j:YSe,L:s7,m:GSe,M:WSe,p:H,q:U,Q:Rz,s:Iz,S:QSe,u:ZSe,U:JSe,V:eje,w:tje,W:nje,x:null,X:null,y:rje,Y:aje,Z:sje,"%":Dz},N={a:B,A:Q,b:Z,B:te,c:null,d:Mz,e:Mz,f:fje,g:wje,G:jje,H:lje,I:uje,j:cje,L:u7,m:dje,M:hje,p:ae,q:re,Q:Rz,s:Iz,S:mje,u:pje,U:gje,V:vje,w:yje,W:xje,x:null,X:null,y:bje,Y:Sje,Z:Eje,"%":Dz},O={a:I,A:F,b:$,B:G,c:D,d:Oz,e:Oz,f:FSe,g:Az,G:Nz,H:Tz,I:Tz,j:LSe,L:BSe,m:ISe,M:zSe,p:L,q:RSe,Q:HSe,s:qSe,S:$Se,u:OSe,U:TSe,V:PSe,w:ASe,W:MSe,x:V,X:z,y:Az,Y:Nz,Z:DSe,"%":USe};_.x=A(n,_),_.X=A(r,_),_.c=A(t,_),N.x=A(n,N),N.X=A(r,N),N.c=A(t,N);function A(ee,se){return function(pe){var ie=[],we=-1,Ee=0,Be=ee.length,Ne,it,Qe;for(pe instanceof Date||(pe=new Date(+pe));++we<Be;)ee.charCodeAt(we)===37&&(ie.push(ee.slice(Ee,we)),(it=kz[Ne=ee.charAt(++we)])!=null?Ne=ee.charAt(++we):it=Ne==="e"?" ":"0",(Qe=se[Ne])&&(Ne=Qe(pe,it)),ie.push(Ne),Ee=we+1);return ie.push(ee.slice(Ee,we)),ie.join("")}}function T(ee,se){return function(pe){var ie=om(1900,void 0,1),we=P(ie,ee,pe+="",0),Ee,Be;if(we!=pe.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=EE(om(ie.y,0,1)),Be=Ee.getUTCDay(),Ee=Be>4||Be===0?Bx.ceil(Ee):Bx(Ee),Ee=kb.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=jE(om(ie.y,0,1)),Be=Ee.getDay(),Ee=Be>4||Be===0?$x.ceil(Ee):$x(Ee),Ee=Jp.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),Be="Z"in ie?EE(om(ie.y,0,1)).getUTCDay():jE(om(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(Be+5)%7:ie.w+ie.U*7-(Be+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,EE(ie)):jE(ie)}}function P(ee,se,pe,ie){for(var we=0,Ee=se.length,Be=pe.length,Ne,it;we<Ee;){if(ie>=Be)return-1;if(Ne=se.charCodeAt(we++),Ne===37){if(Ne=se.charAt(we++),it=O[Ne in kz?se.charAt(we++):Ne],!it||(ie=it(ee,pe,ie))<0)return-1}else if(Ne!=pe.charCodeAt(ie++))return-1}return ie}function L(ee,se,pe){var ie=f.exec(se.slice(pe));return ie?(ee.p=h.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function I(ee,se,pe){var ie=v.exec(se.slice(pe));return ie?(ee.w=b.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function F(ee,se,pe){var ie=d.exec(se.slice(pe));return ie?(ee.w=g.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function $(ee,se,pe){var ie=j.exec(se.slice(pe));return ie?(ee.m=C.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function G(ee,se,pe){var ie=w.exec(se.slice(pe));return ie?(ee.m=S.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function D(ee,se,pe){return P(ee,t,se,pe)}function V(ee,se,pe){return P(ee,n,se,pe)}function z(ee,se,pe){return P(ee,r,se,pe)}function q(ee){return o[ee.getDay()]}function X(ee){return a[ee.getDay()]}function K(ee){return c[ee.getMonth()]}function R(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+="",N);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var kz={"-":"",_:" ",0:"0"},wr=/^\s*\d+/,CSe=/^%/,kSe=/[\\^$*+?|[\]().{}]/g;function $t(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 NSe(e){return e.replace(kSe,"\\$&")}function sm(e){return new RegExp("^(?:"+e.map(NSe).join("|")+")","i")}function lm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function ASe(e,t,n){var r=wr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function OSe(e,t,n){var r=wr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function TSe(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function PSe(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function MSe(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Nz(e,t,n){var r=wr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Az(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function DSe(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 RSe(e,t,n){var r=wr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ISe(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Oz(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function LSe(e,t,n){var r=wr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Tz(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zSe(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $Se(e,t,n){var r=wr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function BSe(e,t,n){var r=wr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function FSe(e,t,n){var r=wr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function USe(e,t,n){var r=CSe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function HSe(e,t,n){var r=wr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qSe(e,t,n){var r=wr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Pz(e,t){return $t(e.getDate(),t,2)}function VSe(e,t){return $t(e.getHours(),t,2)}function KSe(e,t){return $t(e.getHours()%12||12,t,2)}function YSe(e,t){return $t(1+Jp.count(ws(e),e),t,3)}function s7(e,t){return $t(e.getMilliseconds(),t,3)}function XSe(e,t){return s7(e,t)+"000"}function GSe(e,t){return $t(e.getMonth()+1,t,2)}function WSe(e,t){return $t(e.getMinutes(),t,2)}function QSe(e,t){return $t(e.getSeconds(),t,2)}function ZSe(e){var t=e.getDay();return t===0?7:t}function JSe(e,t){return $t(Nb.count(ws(e)-1,e),t,2)}function l7(e){var t=e.getDay();return t>=4||t===0?bd(e):bd.ceil(e)}function eje(e,t){return e=l7(e),$t(bd.count(ws(e),e)+(ws(e).getDay()===4),t,2)}function tje(e){return e.getDay()}function nje(e,t){return $t($x.count(ws(e)-1,e),t,2)}function rje(e,t){return $t(e.getFullYear()%100,t,2)}function ije(e,t){return e=l7(e),$t(e.getFullYear()%100,t,2)}function aje(e,t){return $t(e.getFullYear()%1e4,t,4)}function oje(e,t){var n=e.getDay();return e=n>=4||n===0?bd(e):bd.ceil(e),$t(e.getFullYear()%1e4,t,4)}function sje(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$t(t/60|0,"0",2)+$t(t%60,"0",2)}function Mz(e,t){return $t(e.getUTCDate(),t,2)}function lje(e,t){return $t(e.getUTCHours(),t,2)}function uje(e,t){return $t(e.getUTCHours()%12||12,t,2)}function cje(e,t){return $t(1+kb.count(Ss(e),e),t,3)}function u7(e,t){return $t(e.getUTCMilliseconds(),t,3)}function fje(e,t){return u7(e,t)+"000"}function dje(e,t){return $t(e.getUTCMonth()+1,t,2)}function hje(e,t){return $t(e.getUTCMinutes(),t,2)}function mje(e,t){return $t(e.getUTCSeconds(),t,2)}function pje(e){var t=e.getUTCDay();return t===0?7:t}function gje(e,t){return $t(Ab.count(Ss(e)-1,e),t,2)}function c7(e){var t=e.getUTCDay();return t>=4||t===0?wd(e):wd.ceil(e)}function vje(e,t){return e=c7(e),$t(wd.count(Ss(e),e)+(Ss(e).getUTCDay()===4),t,2)}function yje(e){return e.getUTCDay()}function xje(e,t){return $t(Bx.count(Ss(e)-1,e),t,2)}function bje(e,t){return $t(e.getUTCFullYear()%100,t,2)}function wje(e,t){return e=c7(e),$t(e.getUTCFullYear()%100,t,2)}function Sje(e,t){return $t(e.getUTCFullYear()%1e4,t,4)}function jje(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wd(e):wd.ceil(e),$t(e.getUTCFullYear()%1e4,t,4)}function Eje(){return"+0000"}function Dz(){return"%"}function Rz(e){return+e}function Iz(e){return Math.floor(+e/1e3)}var Ef,f7,d7;_je({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 _je(e){return Ef=_Se(e),f7=Ef.format,Ef.parse,d7=Ef.utcFormat,Ef.utcParse,Ef}function Cje(e){return new Date(e)}function kje(e){return e instanceof Date?+e:+new Date(+e)}function JA(e,t,n,r,i,a,o,l,c,f){var h=$A(),d=h.invert,g=h.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),S=f("%I %p"),j=f("%a %d"),C=f("%b %d"),_=f("%B"),N=f("%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?_:N)(A)}return h.invert=function(A){return new Date(d(A))},h.domain=function(A){return arguments.length?g(Array.from(A,kje)):g().map(Cje)},h.ticks=function(A){var T=g();return e(T[0],T[T.length-1],A??10)},h.tickFormat=function(A,T){return T==null?O:f(T)},h.nice=function(A){var T=g();return(!A||typeof A.range!="function")&&(A=t(T[0],T[T.length-1],A??10)),A?g(Z9(T,A)):h},h.copy=function(){return Zp(h,JA(e,t,n,r,i,a,o,l,c,f))},h}function Nje(){return wa.apply(JA(jSe,ESe,ws,QA,Nb,Jp,GA,YA,zu,f7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Aje(){return wa.apply(JA(wSe,SSe,Ss,ZA,Ab,kb,WA,XA,zu,d7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ob(){var e=0,t=1,n,r,i,a,o=ti,l=!1,c;function f(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(a(d)-n)*i,l?Math.max(0,Math.min(1,d)):d))}f.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(d){return arguments.length?(l=!!d,f):l},f.interpolator=function(d){return arguments.length?(o=d,f):o};function h(d){return function(g){var v,b;return arguments.length?([v,b]=g,o=d(v,b),f):[o(0),o(1)]}}return f.range=h(ds),f.rangeRound=h(zA),f.unknown=function(d){return arguments.length?(c=d,f):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),f}}function nu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function h7(){var e=tu(Ob()(ti));return e.copy=function(){return nu(e,h7())},Ts.apply(e,arguments)}function m7(){var e=UA(Ob()).domain([1,10]);return e.copy=function(){return nu(e,m7()).base(e.base())},Ts.apply(e,arguments)}function p7(){var e=HA(Ob());return e.copy=function(){return nu(e,p7()).constant(e.constant())},Ts.apply(e,arguments)}function eO(){var e=qA(Ob());return e.copy=function(){return nu(e,eO()).exponent(e.exponent())},Ts.apply(e,arguments)}function Oje(){return eO.apply(null,arguments).exponent(.5)}function g7(){var e=[],t=ti;function n(r){if(r!=null&&!isNaN(r=+r))return t((Wp(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(Ll),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)=>u1e(e,a/r))},n.copy=function(){return g7(t).domain(e)},Ts.apply(n,arguments)}function Tb(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,f=ti,h,d=!1,g;function v(w){return isNaN(w=+w)?g:(w=.5+((w=+h(w))-a)*(r*w<r*a?l:c),f(d?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=h(e=+e),a=h(t=+t),o=h(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?(d=!!w,v):d},v.interpolator=function(w){return arguments.length?(f=w,v):f};function b(w){return function(S){var j,C,_;return arguments.length?([j,C,_]=S,f=U1e(w,[j,C,_]),v):[f(0),f(.5),f(1)]}}return v.range=b(ds),v.rangeRound=b(zA),v.unknown=function(w){return arguments.length?(g=w,v):g},function(w){return h=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 v7(){var e=tu(Tb()(ti));return e.copy=function(){return nu(e,v7())},Ts.apply(e,arguments)}function y7(){var e=UA(Tb()).domain([.1,1,10]);return e.copy=function(){return nu(e,y7()).base(e.base())},Ts.apply(e,arguments)}function x7(){var e=HA(Tb());return e.copy=function(){return nu(e,x7()).constant(e.constant())},Ts.apply(e,arguments)}function tO(){var e=qA(Tb());return e.copy=function(){return nu(e,tO()).exponent(e.exponent())},Ts.apply(e,arguments)}function Tje(){return tO.apply(null,arguments).exponent(.5)}const xm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:RA,scaleDiverging:v7,scaleDivergingLog:y7,scaleDivergingPow:tO,scaleDivergingSqrt:Tje,scaleDivergingSymlog:x7,scaleIdentity:Q9,scaleImplicit:OC,scaleLinear:W9,scaleLog:J9,scaleOrdinal:DA,scalePoint:d1e,scalePow:VA,scaleQuantile:n7,scaleQuantize:r7,scaleRadial:t7,scaleSequential:h7,scaleSequentialLog:m7,scaleSequentialPow:eO,scaleSequentialQuantile:g7,scaleSequentialSqrt:Oje,scaleSequentialSymlog:p7,scaleSqrt:fSe,scaleSymlog:e7,scaleThreshold:i7,scaleTime:Nje,scaleUtc:Aje,tickFormat:G9},Symbol.toStringTag,{value:"Module"}));function Pje(e){if(e in xm)return xm[e]();var t="scale".concat(zp(e));if(t in xm)return xm[t]()}function Lz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Pje(e);if(r!=null)return r.domain(t).range(n),r}}function nO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Lz(e.scale,n,r):Lz(t,n,r)}function Mje(e){return"scale".concat(zp(e))}function Dje(e){return Mje(e)in xm}var b7=(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 Dje(r)?r:"point"}};function Rje(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 w7(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=Rje(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var f=(o=r[c-1])!==null&&o!==void 0?o:0,h=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-f)<=Math.abs(a-h)?n[c-1]:n[c]}}}function Ije(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):w7(e,void 0)}function zz(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 Fx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zz(Object(n),!0).forEach(function(r){Lje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lje(e,t,n){return(t=zje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zje(e){var t=$je(e,"string");return typeof t=="symbol"?t:t+""}function $je(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 RC=[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"},S7=(e,t)=>e.cartesianAxis.xAxis[t],Ps=(e,t)=>{var n=S7(e,t);return n??rr},ir={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:RC,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:Up},j7=(e,t)=>e.cartesianAxis.yAxis[t],Ms=(e,t)=>{var n=j7(e,t);return n??ir},Bje={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:""},rO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Bje},zn=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"zAxis":return rO(e,n);case"angleAxis":return NA(e,n);case"radiusAxis":return AA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Fje=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Yd=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"angleAxis":return NA(e,n);case"radiusAxis":return AA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},E7=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function iO(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Pb=e=>e.graphicalItems.cartesianItems,Uje=le([On,Gp],iO),aO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),eg=le([Pb,zn,Uje],aO,{memoizeOptions:{resultEqualityCheck:_b}}),_7=le([eg],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(jb)),C7=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Hje=le([eg],C7),oO=e=>e.map(t=>t.data).filter(Boolean).flat(1),qje=le([eg],oO,{memoizeOptions:{resultEqualityCheck:_b}}),sO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},lO=le([qje,wA],sO),uO=(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})),tg=le([lO,zn,eg],uO);function qf(e){if(So(e)||e instanceof Date){var t=Number(e);if(Ot(t))return t}}function $z(e){if(Array.isArray(e)){var t=[qf(e[0]),qf(e[1])];return yo(t)?t:void 0}var n=qf(e);if(n!=null)return[n,n]}function js(e){return e.map(qf).filter(yi)}function Vje(e,t){var n=qf(e),r=qf(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Kje=le([tg],e=>e==null?void 0:e.map(t=>t.value).sort(Vje));function k7(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Yje(e,t,n){return!n||typeof t!="number"||wo(t)?[]:n.length?js(n.flatMap(r=>{var i=en(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!Ot(a)||!Ot(o)))return[t-a,t+o]})):[]}var fr=e=>{var t=br(e),n=Kd(e);return Yd(e,t,n)},ng=le([fr],e=>e==null?void 0:e.dataKey),Xje=le([_7,wA,fr],I9),N7=(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,f=r?[...c].reverse():c,h=f.map(TA);return[l,{stackedData:Rxe(e,h,n),graphicalItems:f}]}))},IC=le([Xje,_7,Xp,A9],N7),A7=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Bxe(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Gje=le([zn],e=>e.allowDataOverflow),cO=e=>{var t;if(e==null||!("domain"in e))return RC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=js(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:RC},fO=le([zn],cO),dO=le([fO,Gje],g9),Wje=le([IC,Os,On,dO],A7,{memoizeOptions:{resultEqualityCheck:Eb}}),Mb=e=>e.errorBars,Qje=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>k7(n,r)),Ux=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]}},hO=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var f,h,d=(f=r[c.id])===null||f===void 0?void 0:f.filter(j=>k7(i,j)),g=en(l,(h=t.dataKey)!==null&&h!==void 0?h:c.dataKey),v=Yje(l,g,d);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=$z(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=$z(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]))}),Ot(a)&&Ot(o))return[a,o]},Zje=le([lO,zn,Hje,Mb,On],hO,{memoizeOptions:{resultEqualityCheck:Eb}});function Jje(e){var{value:t}=e;if(So(t)||t instanceof Date)return t}var eEe=(e,t,n)=>{var r=e.map(Jje).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&$H(r))?p9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},O7=e=>e.referenceElements.dots,Xd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),tEe=le([O7,On,Gp],Xd),T7=e=>e.referenceElements.areas,nEe=le([T7,On,Gp],Xd),P7=e=>e.referenceElements.lines,rEe=le([P7,On,Gp],Xd),M7=(e,t)=>{if(e!=null){var n=js(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},iEe=le(tEe,On,M7),D7=(e,t)=>{if(e!=null){var n=js(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)]}},aEe=le([nEe,On],D7);function oEe(e){var t;if(e.x!=null)return js([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:js(n)}function sEe(e){var t;if(e.y!=null)return js([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:js(n)}var R7=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?oEe(r):sEe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},lEe=le([rEe,On],R7),uEe=le(iEe,lEe,aEe,(e,t,n)=>Ux(e,n,t)),mO=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",f=c?Ux(r,a,i):Ux(a,i);return zwe(t,f,e.allowDataOverflow)},cEe=le([zn,fO,dO,Wje,Zje,uEe,Ft,On],mO,{memoizeOptions:{resultEqualityCheck:Eb}}),fEe=[0,1],pO=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,f=ks(t,a);if(f&&l==null){var h;return p9(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return c==="category"?eEe(r,e,f):i==="expand"?fEe:o}},gO=le([zn,Ft,lO,tg,Xp,On,cEe],pO),ru=le([zn,E7,_A],b7),vO=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=cO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&yo(e)){if(a)return X3(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return G3(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&yo(e))return X3(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&yo(e))return G3(e,t.tickCount,t.allowDecimals,"adaptive")}}},yO=le([gO,Yd,ru],vO),xO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&yo(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],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,f)]}return t},dEe=le([zn,gO,yO,On],xO),hEe=le(tg,zn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(js(e.map(d=>d.value))).sort((d,g)=>d-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],f=r[l+1];if(!(c==null||f==null)){var h=f-c;n=Math.min(n,h)}}return n/o}}),I7=le(hEe,Ft,N9,ur,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ot(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}),mEe=(e,t,n)=>{var r=Ps(e,t);return r==null||typeof r.padding!="string"?0:I7(e,"xAxis",t,n,r.padding)},pEe=(e,t,n)=>{var r=Ms(e,t);return r==null||typeof r.padding!="string"?0:I7(e,"yAxis",t,n,r.padding)},gEe=le(Ps,mEe,(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}}),vEe=le(Ms,pEe,(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}}),yEe=le([ur,gEe,mb,hb,(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]}),xEe=le([ur,Ft,vEe,mb,hb,(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]}),rg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return yEe(e,n,r);case"yAxis":return xEe(e,n,r);case"zAxis":return(i=rO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return M9(e);case"radiusAxis":return D9(e,n);default:return}},L7=le([zn,rg],bb),bEe=le([ru,dEe],L9),bO=le([zn,ru,bEe,L7],nO),z7=(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)}},wO=le([Ft,tg,Yd,On],z7),Db=le([bO],PA);le([bO],Ije);le([bO,Kje],w7);le([eg,Mb,On],Qje);function $7(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Rb=(e,t)=>t,Ib=(e,t,n)=>n,wEe=le(fb,Rb,Ib,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($7)),SEe=le(db,Rb,Ib,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($7)),B7=(e,t)=>({width:e.width,height:t.height}),jEe=(e,t)=>{var n=typeof t.width=="number"?t.width:Up;return{width:n,height:e.height}},F7=le(ur,Ps,B7),EEe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},_Ee=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},CEe=le(As,ur,wEe,Rb,Ib,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=B7(t,l);o==null&&(o=EEe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(f)*c.height,o+=(f?-1:1)*c.height}),a}),kEe=le(Ns,ur,SEe,Rb,Ib,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=jEe(t,l);o==null&&(o=_Ee(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(f)*c.width,o+=(f?-1:1)*c.width}),a}),NEe=(e,t)=>{var n=Ps(e,t);if(n!=null)return CEe(e,n.orientation,n.mirror)},AEe=le([ur,Ps,NEe,(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}}}),OEe=(e,t)=>{var n=Ms(e,t);if(n!=null)return kEe(e,n.orientation,n.mirror)},TEe=le([ur,Ms,OEe,(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}}}),U7=le(ur,Ms,(e,t)=>{var n=typeof t.width=="number"?t.width:Up;return{width:n,height:e.height}}),Bz=(e,t,n)=>{switch(t){case"xAxis":return F7(e,n).width;case"yAxis":return U7(e,n).height;default:return}},H7=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=ks(e,r),c=t.map(f=>f.value);if(o&&l&&a==="category"&&i&&$H(c))return c}},SO=le([Ft,tg,zn,On],H7),Fz=le([Ft,Fje,ru,Db,SO,wO,rg,yO,On],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var f=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:f,niceTicks:l,range:o,realScaleType:n,scale:r}}}),PEe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var f=ks(e,c),{type:h,ticks:d,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=h==="category"&&r.bandwidth?r.bandwidth()/v:0;b=c==="angleAxis"&&a!=null&&a.length>=2?vr(a[0]-a[1])*2*b:b;var w=d||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,_=r.map(C);return Ot(_)?{index:j,coordinate:_+b,value:S,offset:b}:null}).filter(yi):f&&l?l.map((S,j)=>{var C=r.map(S);return Ot(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 Ot(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(yi):r.domain().map((S,j)=>{var C=r.map(S);return Ot(C)?{coordinate:C+b,value:o?o[S]:S,index:j,offset:b}:null}).filter(yi)}},q7=le([Ft,Yd,ru,Db,yO,rg,SO,wO,On],PEe),MEe=(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,f=0;return f=o==="angleAxis"&&(r==null?void 0:r.length)>=2?vr(r[0]-r[1])*2*f:f,l&&a?a.map((h,d)=>{var g=n.map(h);return Ot(g)?{coordinate:g+f,value:h,index:d,offset:f}:null}).filter(yi):n.ticks?n.ticks(c).map((h,d)=>{var g=n.map(h);return Ot(g)?{coordinate:g+f,value:h,index:d,offset:f}:null}).filter(yi):n.domain().map((h,d)=>{var g=n.map(h);return Ot(g)?{coordinate:g+f,value:i?i[h]:h,index:d,offset:f}:null}).filter(yi)}},ql=le([Ft,Yd,Db,rg,SO,wO,On],MEe),Vl=le(zn,Db,(e,t)=>{if(!(e==null||t==null))return Fx(Fx({},e),{},{scale:t})}),DEe=le([zn,ru,gO,L7],nO),REe=le([DEe],PA);le((e,t,n)=>rO(e,n),REe,(e,t)=>{if(!(e==null||t==null))return Fx(Fx({},e),{},{scale:t})});var IEe=le([Ft,fb,db],(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}}),LEe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([LEe],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 V7=e=>e.options.defaultTooltipEventType,K7=e=>e.options.validateTooltipEventTypes;function Y7(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function jO(e,t){var n=V7(e),r=K7(e);return Y7(t,n,r)}function zEe(e){return Ie(t=>jO(t,e))}var X7=(e,t)=>{var n,r=Number(t);if(!(wo(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},$Ee=e=>e.tooltip.settings,jl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},BEe={itemInteraction:{click:jl,hover:jl},axisInteraction:{click:jl,hover:jl},keyboardInteraction:jl,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}},G7=Kr({name:"tooltip",initialState:BEe,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:FEe,replaceTooltipEntrySettings:UEe,removeTooltipEntrySettings:HEe,setTooltipSettingsState:qEe,setActiveMouseOverItemIndex:W7,mouseLeaveItem:VEe,mouseLeaveChart:Q7,setActiveClickItemIndex:KEe,setMouseOverAxisIndex:Z7,setMouseClickAxisIndex:YEe,setSyncInteraction:LC,setKeyboardInteraction:Hx}=G7.actions,XEe=G7.reducer;function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ay(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uz(Object(n),!0).forEach(function(r){GEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GEe(e,t,n){return(t=WEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WEe(e){var t=QEe(e,"string");return typeof t=="symbol"?t:t+""}function QEe(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 ZEe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function JEe(e){return e.index!=null}var J7=(e,t,n,r)=>{if(t==null)return jl;var i=ZEe(e,t,n);if(i==null)return jl;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(JEe(i)){if(a)return ay(ay({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return ay(ay({},jl),{},{coordinate:i.coordinate})};function e_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 t_e(e,t){var n=e_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 n_e(e,t,n){if(n==null||t==null)return!0;var r=en(e,t);return r==null||!yo(n)?!0:t_e(r,n)}var EO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Ot(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)),f=t[c];return f==null||n_e(f,n,r)?String(c):null},eV=(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 f=i==null?void 0:i[Number(a)];if(f)switch(n){case"horizontal":return{x:f.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:f.coordinate}}}},tV=(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})},nV=e=>e.options.tooltipPayloadSearcher,Gd=e=>e.tooltip;function Hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hz(Object(n),!0).forEach(function(r){r_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r_e(e,t,n){return(t=i_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i_e(e){var t=a_e(e,"string");return typeof t=="symbol"?t:t+""}function a_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 o_e(e){if(typeof e=="string"||typeof e=="number")return e}function s_e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function l_e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function Vz(e){if(typeof e=="string")return e}function u_e(e){if(!(e==null||typeof e!="object")){var t="name"in e?o_e(e.name):void 0,n="unit"in e?s_e(e.unit):void 0,r="dataKey"in e?l_e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Vz(e.color):void 0,o="fill"in e?Vz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function c_e(e,t){return e??t}var rV=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:f,dataEndIndex:h}=n,d=[];return e.reduce((g,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,j=c_e(w,l),C=Array.isArray(j)?Rq(j,f,h):j,_=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,N=S==null?void 0:S.nameKey,O;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?O=BH(C,r,i):O=a(C,t,c,N),Array.isArray(O))O.forEach(T=>{var P,L,I=u_e(T),F=I==null?void 0:I.name,$=I==null?void 0:I.dataKey,G=I==null?void 0:I.payload,D=qz(qz({},S),{},{name:F,unit:I==null?void 0:I.unit,color:(P=I==null?void 0:I.color)!==null&&P!==void 0?P:S==null?void 0:S.color,fill:(L=I==null?void 0:I.fill)!==null&&L!==void 0?L:S==null?void 0:S.fill});g.push(IL({tooltipEntrySettings:D,dataKey:$,payload:G,value:en(G,$),name:F==null?void 0:String(F)}))});else{var A;g.push(IL({tooltipEntrySettings:S,dataKey:_,payload:O,value:en(O,_),name:(A=en(O,N))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},d)}},_O=le([fr,E7,_A],b7),f_e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),d_e=le([br,Kd],iO),Wd=le([f_e,fr,d_e],aO,{memoizeOptions:{resultEqualityCheck:_b}}),h_e=le([Wd],e=>e.filter(jb)),m_e=le([Wd],oO,{memoizeOptions:{resultEqualityCheck:_b}}),Qd=le([m_e,Os],sO),p_e=le([h_e,Os,fr],I9),CO=le([Qd,fr,Wd],uO),iV=le([fr],cO),g_e=le([fr],e=>e.allowDataOverflow),aV=le([iV,g_e],g9),v_e=le([Wd],e=>e.filter(jb)),y_e=le([p_e,v_e,Xp,A9],N7),x_e=le([y_e,Os,br,aV],A7),b_e=le([Wd],C7),w_e=le([Qd,fr,b_e,Mb,br],hO,{memoizeOptions:{resultEqualityCheck:Eb}}),S_e=le([O7,br,Kd],Xd),j_e=le([S_e,br],M7),E_e=le([T7,br,Kd],Xd),__e=le([E_e,br],D7),C_e=le([P7,br,Kd],Xd),k_e=le([C_e,br],R7),N_e=le([j_e,k_e,__e],Ux),A_e=le([fr,iV,aV,x_e,w_e,N_e,Ft,br],mO),ig=le([fr,Ft,Qd,CO,Xp,br,A_e],pO),O_e=le([ig,fr,_O],vO),T_e=le([fr,ig,O_e,br],xO),oV=e=>{var t=br(e),n=Kd(e),r=!1;return rg(e,t,n,r)},sV=le([fr,oV],bb),P_e=le([fr,_O,T_e,sV],nO),lV=le([P_e],PA),M_e=le([Ft,CO,fr,br],H7),D_e=le([Ft,CO,fr,br],z7),R_e=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,f=ks(e,l);if(r){var h=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/h:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?vr(i[0]-i[1])*2*d:d,f&&o?o.map((g,v)=>{var b=r.map(g);return Ot(b)?{coordinate:b+d,value:g,index:v,offset:d}:null}).filter(yi):r.domain().map((g,v)=>{var b=r.map(g);return Ot(b)?{coordinate:b+d,value:a?a[g]:g,index:v,offset:d}:null}).filter(yi)}}},Ds=le([Ft,fr,_O,lV,oV,M_e,D_e,br],R_e),kO=le([V7,K7,$Ee],(e,t,n)=>Y7(n.shared,e,t)),uV=e=>e.tooltip.settings.trigger,NO=e=>e.tooltip.settings.defaultIndex,ag=le([Gd,kO,uV,NO],J7),Kl=le([ag,Qd,ng,ig],EO),cV=le([Ds,Kl],X7),AO=le([ag],e=>{if(e)return e.dataKey}),fV=le([ag],e=>{if(e)return e.graphicalItemId}),dV=le([Gd,kO,uV,NO],tV),I_e=le([Ns,As,Ft,ur,Ds,NO,dV],eV),L_e=le([ag,I_e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),z_e=le([ag],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),$_e=le([dV,Kl,Os,ng,cV,nV,kO],rV),B_e=le([$_e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function Kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kz(Object(n),!0).forEach(function(r){F_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F_e(e,t,n){return(t=U_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U_e(e){var t=H_e(e,"string");return typeof t=="symbol"?t:t+""}function H_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var q_e=()=>Ie(fr),V_e=()=>{var e=q_e(),t=Ie(Ds),n=Ie(lV);return gd(!e||!n?void 0:Yz(Yz({},e),{},{scale:n}),t)};function Xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _f(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(r){K_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function K_e(e,t,n){return(t=Y_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y_e(e){var t=X_e(e,"string");return typeof t=="symbol"?t:t+""}function X_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var G_e=(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}},W_e=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return _f(_f(_f({},r),Gn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return _f(_f(_f({},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 Q_e(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 hV=(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,f,h,d,g,v=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,b=(h=n[l])===null||h===void 0?void 0:h.coordinate,w=l>=o-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(g=n[l+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||b==null||w==null))if(vr(b-v)!==vr(w-b)){var j=[];if(vr(w-b)===vr(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 N=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>N[0]&&e<=N[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 L=0;L<o;L++){var I=t[L];if(I!=null){var F=t[L+1],$=t[L-1];if(L===0&&F!=null&&e<=(I.coordinate+F.coordinate)/2||L===o-1&&$!=null&&e>(I.coordinate+$.coordinate)/2||L>0&&L<o-1&&$!=null&&F!=null&&e>(I.coordinate+$.coordinate)/2&&e<=(I.coordinate+F.coordinate)/2)return I.index}}return-1},Z_e=()=>Ie(_A),OO=(e,t)=>t,mV=(e,t,n)=>n,TO=(e,t,n,r)=>r,J_e=le(Ds,e=>tb(e,t=>t.coordinate)),PO=le([Gd,OO,mV,TO],J7),MO=le([PO,Qd,ng,ig],EO),eCe=(e,t,n)=>{if(t!=null){var r=Gd(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([Gd,OO,mV,TO],tV),qx=le([Ns,As,Ft,ur,Ds,TO,pV],eV),tCe=le([PO,qx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),gV=le([Ds,MO],X7),nCe=le([pV,MO,Os,ng,gV,nV,OO],rV),rCe=le([PO,MO],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),iCe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&Q_e(e,o)){var l=Fxe(e,t),c=hV(l,a,i,n,r),f=G_e(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},aCe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=kwe(e,n);if(l){var c=Uxe(l,t),f=hV(c,o,a,r,i),h=W_e(t,a,f,l);return{activeIndex:String(f),activeCoordinate:h}}}},oCe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?iCe(e,t,r,i,a,o,l):aCe(e,t,n,r,i,a,o)},sCe=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}}),lCe=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:Qwe}});function Gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gz(Object(n),!0).forEach(function(r){uCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uCe(e,t,n){return(t=cCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cCe(e){var t=fCe(e,"string");return typeof t=="symbol"?t:t+""}function fCe(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 dCe={},hCe={zIndexMap:Object.values(Wn).reduce((e,t)=>Wz(Wz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),dCe)},mCe=new Set(Object.values(Wn));function pCe(e){return mCe.has(e)}var vV=Kr({name:"zIndex",initialState:hCe,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&&!pCe(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:gCe,unregisterZIndexPortal:vCe,registerZIndexPortalElement:yCe,unregisterZIndexPortalElement:xCe}=vV.actions,bCe=vV.reducer;function wi(e){var{zIndex:t,children:n}=e,r=x0e(),i=r&&t!==void 0&&t!==0,a=Yr(),o=tn();y.useLayoutEffect(()=>i?(o(gCe({zIndex:t})),()=>{o(vCe({zIndex:t}))}):eu,[o,t,i]);var l=Ie(c=>sCe(c,t,a));return i?l?Gl.createPortal(n,l):null:n}function zC(){return zC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zC.apply(null,arguments)}function Qz(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 oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qz(Object(n),!0).forEach(function(r){wCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wCe(e,t,n){return(t=SCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SCe(e){var t=jCe(e,"string");return typeof t=="symbol"?t:t+""}function jCe(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 ECe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function _Ce(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:f,chartName:h}=e,d=n,g=r,v=i;if(!c||!d||h!=="ScatterChart"&&f!=="axis")return null;var b,w,S;if(h==="ScatterChart")b=d,w=Ube,S=Wn.cursorLine;else if(h==="BarChart")b=Hbe(l,d,a,o),w=c9,S=Wn.cursorRectangle;else if(l==="radial"&&UH(d)){var{cx:j,cy:C,radius:_,startAngle:N,endAngle:O}=d9(d);b={cx:j,cy:C,startAngle:N,endAngle:O,innerRadius:_,outerRadius:_},w=m9,S=Wn.cursorLine}else b={points:Twe(l,d,a)},w=bA,S=Wn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=oy(oy(oy(oy({stroke:"#ccc",pointerEvents:"none"},a),b),fc(c)),{},{payload:g,payloadIndex:v,className:Mt("recharts-tooltip-cursor",A)});return y.createElement(wi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(ECe,{cursor:c,cursorComp:w,cursorProps:T}))}function CCe(e){var t=V_e(),n=qq(),r=Tc(),i=Z_e();return t==null||n==null||r==null||i==null?null:y.createElement(_Ce,zC({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var yV=y.createContext(null),kCe=()=>y.useContext(yV),_E={exports:{}},Zz;function NCe(){return Zz||(Zz=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,f,h){this.fn=c,this.context=f,this.once=h||!1}function a(c,f,h,d,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new i(h,d||c,g),b=n?n+f:f;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,f){--c._eventsCount===0?c._events=new r:delete c._events[f]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var f=[],h,d;if(this._eventsCount===0)return f;for(d in h=this._events)t.call(h,d)&&f.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},l.prototype.listeners=function(f){var h=n?n+f:f,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var g=0,v=d.length,b=new Array(v);g<v;g++)b[g]=d[g].fn;return b},l.prototype.listenerCount=function(f){var h=n?n+f:f,d=this._events[h];return d?d.fn?1:d.length:0},l.prototype.emit=function(f,h,d,g,v,b){var w=n?n+f:f;if(!this._events[w])return!1;var S=this._events[w],j=arguments.length,C,_;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),j){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,h),!0;case 3:return S.fn.call(S.context,h,d),!0;case 4:return S.fn.call(S.context,h,d,g),!0;case 5:return S.fn.call(S.context,h,d,g,v),!0;case 6:return S.fn.call(S.context,h,d,g,v,b),!0}for(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];S.fn.apply(S.context,C)}else{var N=S.length,O;for(_=0;_<N;_++)switch(S[_].once&&this.removeListener(f,S[_].fn,void 0,!0),j){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,h);break;case 3:S[_].fn.call(S[_].context,h,d);break;case 4:S[_].fn.call(S[_].context,h,d,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(f,h,d){return a(this,f,h,d,!1)},l.prototype.once=function(f,h,d){return a(this,f,h,d,!0)},l.prototype.removeListener=function(f,h,d,g){var v=n?n+f:f;if(!this._events[v])return this;if(!h)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===h&&(!g||b.once)&&(!d||b.context===d)&&o(this,v);else{for(var w=0,S=[],j=b.length;w<j;w++)(b[w].fn!==h||g&&!b[w].once||d&&b[w].context!==d)&&S.push(b[w]);S.length?this._events[v]=S.length===1?S[0]:S:o(this,v)}return this},l.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(_E)),_E.exports}var ACe=NCe();const OCe=Hi(ACe);var Wm=new OCe,$C="recharts.syncEvent.tooltip",Jz="recharts.syncEvent.brush",DO=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!wo(n))return e[n]}},TCe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},xV=Kr({name:"options",initialState:TCe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),PCe=xV.reducer,{createEventEmitter:MCe}=xV.actions;function DCe(e){return e.tooltip.syncInteraction}var RCe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},bV=Kr({name:"chartData",initialState:RCe,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:e4,setDataStartEndIndexes:ICe,setComputedData:A5e}=bV.actions,LCe=bV.reducer,zCe=["x","y"];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 Cf(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){$Ce(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 $Ce(e,t,n){return(t=BCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BCe(e){var t=FCe(e,"string");return typeof t=="symbol"?t:t+""}function FCe(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 UCe(e,t){if(e==null)return{};var n,r,i=HCe(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 HCe(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 qCe(){var e=Ie(CA),t=Ie(kA),n=tn(),r=Ie(O9),i=Ie(Ds),a=Tc(),o=pb(),l=Ie(c=>c.rootProps.className);y.useEffect(()=>{if(e==null)return eu;var c=(f,h,d)=>{if(t!==d&&e===f){if(r==="index"){var g;if(o&&h!==null&&h!==void 0&&(g=h.payload)!==null&&g!==void 0&&g.coordinate&&h.payload.sourceViewBox){var v=h.payload.coordinate,{x:b,y:w}=v,S=UCe(v,zCe),{x:j,y:C,width:_,height:N}=h.payload.sourceViewBox,O=Cf(Cf({},S),{},{x:o.x+(_?(b-j)/_:0)*o.width,y:o.y+(N?(w-C)/N:0)*o.height});n(Cf(Cf({},h),{},{payload:Cf(Cf({},h.payload),{},{coordinate:O})}))}else n(h);return}if(i!=null){var A;if(typeof r=="function"){var T={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},P=r(i,T);A=i[P]}else r==="value"&&(A=i.find(z=>String(z.value)===h.payload.label));var{coordinate:L}=h.payload;if(A==null||h.payload.active===!1||L==null||o==null){n(LC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:F}=L,$=Math.min(I,o.x+o.width),G=Math.min(F,o.y+o.height),D={x:a==="horizontal"?A.coordinate:$,y:a==="horizontal"?G:A.coordinate},V=LC({active:h.payload.active,coordinate:D,dataKey:h.payload.dataKey,index:String(A.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(V)}}};return Wm.on($C,c),()=>{Wm.off($C,c)}},[l,n,t,e,r,i,a,o])}function VCe(){var e=Ie(CA),t=Ie(kA),n=tn();y.useEffect(()=>{if(e==null)return eu;var r=(i,a,o)=>{t!==o&&e===i&&n(ICe(a))};return Wm.on(Jz,r),()=>{Wm.off(Jz,r)}},[n,t,e])}function KCe(){var e=tn();y.useEffect(()=>{e(MCe())},[e]),qCe(),VCe()}function YCe(e,t,n,r,i,a){var o=Ie(b=>eCe(b,e,t)),l=Ie(fV),c=Ie(kA),f=Ie(CA),h=Ie(O9),d=Ie(DCe),g=d==null?void 0:d.active,v=pb();y.useEffect(()=>{if(!g&&f!=null&&c!=null){var b=LC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});Wm.emit($C,f,b,c)}},[g,n,o,l,i,r,c,f,h,a,v])}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 r4(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){XCe(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 XCe(e,t,n){return(t=GCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GCe(e){var t=WCe(e,"string");return typeof t=="symbol"?t:t+""}function WCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QCe(e){return e.dataKey}function ZCe(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(vbe,t)}var i4=[],JCe={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 wV(e){var t,n,r=Zn(e,JCe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:c,filterNull:f,isAnimationActive:h,offset:d,payloadUniqBy:g,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:j,shared:C,trigger:_,defaultIndex:N,portal:O,axisId:A}=r,T=tn(),P=typeof N=="number"?String(N):N;y.useEffect(()=>{T(qEe({shared:C,trigger:_,axisId:A,active:i,defaultIndex:P}))},[T,C,_,A,i,P]);var L=pb(),I=a9(),F=zEe(C),{activeIndex:$,isActive:G}=(t=Ie(re=>rCe(re,F,_,P)))!==null&&t!==void 0?t:{},D=Ie(re=>nCe(re,F,_,P)),V=Ie(re=>gV(re,F,_,P)),z=Ie(re=>tCe(re,F,_,P)),q=D,X=kCe(),K=(n=i??G)!==null&&n!==void 0?n:!1,[R,H]=aq([q,K]),U=F==="axis"?V:void 0;YCe(F,_,z,U,$,K);var B=O??X;if(B==null||L==null||F==null)return null;var Q=q??i4;K||(Q=i4),f&&Q.length&&(Q=JH(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,QCe));var Z=Q.length>0,te=r4(r4({},r),{},{payload:Q,label:U,active:K,activeIndex:$,coordinate:z,accessibilityLayer:I}),ae=y.createElement(Nbe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:h,active:K,coordinate:z,hasPayload:Z,offset:d,position:v,reverseDirection:b,useTranslate3d:w,viewBox:L,wrapperStyle:S,lastBoundingBox:R,innerRef:H,hasPortalFromProps:!!O},ZCe(c,te));return y.createElement(y.Fragment,null,Gl.createPortal(ae,B),K&&y.createElement(CCe,{cursor:j,tooltipEventType:F,coordinate:z,payload:Q,index:$}))}var og=e=>null;og.displayName="Cell";function eke(e,t,n){return(t=tke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tke(e){var t=nke(e,"string");return typeof t=="symbol"?t:t+""}function nke(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 rke{constructor(t){eke(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 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 ike(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){ake(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 ake(e,t,n){return(t=oke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oke(e){var t=ske(e,"string");return typeof t=="symbol"?t:t+""}function ske(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lke={cacheSize:2e3,enableCache:!0},SV=ike({},lke),o4=new rke(SV.cacheSize),uke={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},s4="recharts_measurement_span";function cke(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 l4=(e,t)=>{try{var n=document.getElementById(s4);n||(n=document.createElement("span"),n.setAttribute("id",s4),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,uke,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Cm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Vp.isSsr)return{width:0,height:0};if(!SV.enableCache)return l4(t,n);var r=cke(t,n),i=o4.get(r);if(i)return i;var a=l4(t,n);return o4.set(r,a),a},jV;function fke(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=hke(e,"string");return typeof t=="symbol"?t:t+""}function hke(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 u4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,c4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,mke=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,pke=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,gke={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},vke=["cm","mm","pt","pc","in","Q","px"];function yke(e){return vke.includes(e)}var If="NaN";function xke(e,t){return e*gke[t]}class Ar{static parse(t){var n,[,r,i]=(n=pke.exec(t))!==null&&n!==void 0?n:[];return r==null?Ar.NaN:new Ar(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,wo(t)&&(this.unit=""),n!==""&&!mke.test(n)&&(this.num=NaN,this.unit=""),yke(n)&&(this.num=xke(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Ar(NaN,""):new Ar(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Ar(NaN,""):new Ar(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ar(NaN,""):new Ar(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ar(NaN,""):new Ar(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return wo(this.num)}}jV=Ar;fke(Ar,"NaN",new jV(NaN,""));function EV(e){if(e==null||e.includes(If))return If;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=u4.exec(t))!==null&&n!==void 0?n:[],o=Ar.parse(r??""),l=Ar.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return If;t=t.replace(u4,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,h,d,g]=(f=c4.exec(t))!==null&&f!==void 0?f:[],v=Ar.parse(h??""),b=Ar.parse(g??""),w=d==="+"?v.add(b):v.subtract(b);if(w.isNaN())return If;t=t.replace(c4,w.toString())}return t}var f4=/\(([^()]*)\)/;function bke(e){for(var t=e,n;(n=f4.exec(t))!=null;){var[,r]=n;t=t.replace(f4,EV(r))}return t}function wke(e){var t=e.replace(/\s+/g,"");return t=bke(t),t=EV(t),t}function Ske(e){try{return wke(e)}catch{return If}}function CE(e){var t=Ske(e.slice(5,-1));return t===If?"":t}var jke=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Eke=["dx","dy","angle","className","breakAll"];function BC(){return BC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BC.apply(null,arguments)}function d4(e,t){if(e==null)return{};var n,r,i=_ke(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 _ke(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 _V=/[ \f\n\r\t\v\u2028\u2029]+/,CV=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];jn(t)||(n?i=t.toString().split(""):i=t.toString().split(_V));var a=i.map(l=>({word:l,width:Cm(l,r).width})),o=n?0:Cm(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function kV(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Cke(e){return jn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var NV=(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 f={words:[o],width:l};i.push(f)}return i},[]),AV=e=>e.reduce((t,n)=>t.width>n.width?t:n),kke="…",h4=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),f=CV({breakAll:n,style:r,children:c+kke});if(!f)return[!1,[]];var h=NV(f.wordsWithComputedWidth,a,o,l),d=h.length>i||AV(h).width>Number(a);return[d,h]},Nke=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,f=Me(a),h=String(o),d=NV(t,r,n,i);if(!f||i)return d;var g=d.length>a||AV(d).width>Number(r);if(!g)return d;for(var v=0,b=h.length-1,w=0,S;v<=b&&w<=h.length-1;){var j=Math.floor((v+b)/2),C=j-1,[_,N]=h4(h,C,c,l,a,r,n,i),[O]=h4(h,j,c,l,a,r,n,i);if(!_&&!O&&(v=j+1),_&&O&&(b=j-1),!_&&O){S=N;break}w++}return S||d},m4=e=>{var t=jn(e)?[]:e.toString().split(_V);return[{words:t,width:void 0}]},Ake=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Vp.isSsr){var l,c,f=CV({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:h,spaceWidth:d}=f;l=h,c=d}else return m4(r);return Nke({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return m4(r)},OV="#808080",Oke={angle:0,breakAll:!1,capHeight:"0.71em",fill:OV,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Lb=y.forwardRef((e,t)=>{var n=Zn(e,Oke),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:f,verticalAnchor:h}=n,d=d4(n,jke),g=y.useMemo(()=>Ake({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:v,dy:b,angle:w,className:S,breakAll:j}=d,C=d4(d,Eke);if(!So(r)||!So(i)||g.length===0)return null;var _=Number(r)+(Me(v)?v:0),N=Number(i)+(Me(b)?b:0);if(!Ot(_)||!Ot(N))return null;var O;switch(h){case"start":O=CE("calc(".concat(o,")"));break;case"middle":O=CE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=CE("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(c&&T!=null){var P=T.width,{width:L}=d;A.push("scale(".concat(Me(L)&&Me(P)?L/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(_,", ").concat(N,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",BC({},ni(C),{ref:t,x:_,y:N,className:Mt("recharts-text",S),textAnchor:f,fill:l.includes("url")?OV:l}),g.map((I,F)=>{var $=I.words.join(j?"":" ");return y.createElement("tspan",{x:_,dy:F===0?O:a,key:"".concat($,"-").concat(F)},$)}))});Lb.displayName="Text";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 ao(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){Tke(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 Tke(e,t,n){return(t=Pke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pke(e){var t=Mke(e,"string");return typeof t=="symbol"?t:t+""}function Mke(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 Dke=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:f}=pA(t),h=a,d=a+(c-f)/2,g=(h+d)/2,v=(c+f)/2,b=h+c/2,w=l>=0?1:-1,S=w*r,j=w>0?"end":"start",C=w>0?"start":"end",_=c>=0?1:-1,N=_*r,O=_>0?"end":"start",A=_>0?"start":"end",T=i;if(n==="top"){var P={x:h+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 L={x:d+f/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(L.height=Math.max(T.y+T.height-(o+l),0),L.width=f),L}if(n==="left"){var I={x:g-N,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(n==="right"){var F={x:g+v+N,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 $=T?{width:v,height:l}:{};return n==="insideLeft"?ao({x:g+N,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},$):n==="insideRight"?ao({x:g+v-N,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},$):n==="insideTop"?ao({x:h+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},$):n==="insideBottom"?ao({x:d+f/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},$):n==="insideTopLeft"?ao({x:h+N,y:o+S,horizontalAnchor:A,verticalAnchor:C},$):n==="insideTopRight"?ao({x:h+c-N,y:o+S,horizontalAnchor:O,verticalAnchor:C},$):n==="insideBottomLeft"?ao({x:d+N,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},$):n==="insideBottomRight"?ao({x:d+f-N,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},$):n&&typeof n=="object"&&(Me(n.x)||mc(n.x))&&(Me(n.y)||mc(n.y))?ao({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},$):ao({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},Rke=["labelRef"],Ike=["content"];function g4(e,t){if(e==null)return{};var n,r,i=Lke(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 Lke(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 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 bm(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){zke(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 zke(e,t,n){return(t=$ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ke(e){var t=Bke(e,"string");return typeof t=="symbol"?t:t+""}function Bke(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 TV=y.createContext(null),Fke=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(TV.Provider,{value:c},l)},PV=()=>{var e=y.useContext(TV),t=pb();return e||(t?pA(t):void 0)},Uke=y.createContext(null),Hke=()=>{var e=y.useContext(Uke),t=Ie(R9);return e||t},qke=e=>{var{value:t,formatter:n}=e,r=jn(e.children)?t:e.children;return typeof n=="function"?n(r):r},RO=e=>e!=null&&typeof e=="function",Vke=(e,t)=>{var n=vr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Kke=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:f,outerRadius:h,startAngle:d,endAngle:g,clockWise:v}=i,b=(f+h)/2,w=Vke(d,g),S=w>=0?1:-1,j,C;switch(t){case"insideStart":j=d+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),N=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(N.x,",").concat(N.y),A=jn(e.id)?zm("recharts-radial-line-"):e.id;return y.createElement("text",ss({},r,{dominantBaseline:"central",className:Mt("recharts-radial-bar-label",o)}),y.createElement("defs",null,y.createElement("path",{id:A,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(A)},n))},Yke=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,f=(l+c)/2;if(n==="outside"){var{x:h,y:d}=Gn(r,i,o+t,f);return{x:h,y:d,textAnchor:h>=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,f);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Ty=e=>e!=null&&"cx"in e&&Me(e.cx),Xke={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function Gke(e){if(!Ty(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 wl(e){var t=Zn(e,Xke),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:f,labelRef:h}=t,d=Hke(),g=PV(),v=i==="center"?g:d??g,b,w,S;n==null?b=v:Ty(n)?b=n:b=pA(n);var j=Gke(b);if(!b||jn(a)&&jn(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=bm(bm({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:_}=C,N=g4(C,Rke);return y.cloneElement(l,N)}if(typeof l=="function"){var{content:O}=C,A=g4(C,Ike);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=qke(t);var T=ni(t);if(Ty(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Kke(t,i,w,T,b);S=Yke(b,t.offset,t.position)}else{if(!j)return null;var P=Dke({viewBox:j,position:i,offset:t.offset,parentViewBox:Ty(r)?void 0:r});S=bm(bm({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(Lb,ss({ref:h,className:Mt("recharts-label",c)},T,S,{textAnchor:kV(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:f}),w))}wl.displayName="Label";var Wke=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(wl,ss({key:"label-implicit"},r)):So(e)?y.createElement(wl,ss({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===wl?y.cloneElement(e,bm({key:"label-implicit"},r)):y.createElement(wl,ss({key:"label-implicit",content:e},r)):RO(e)?y.createElement(wl,ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(wl,ss({},e,{key:"label-implicit"},r)):null};function Qke(e){var{label:t,labelRef:n}=e,r=PV();return Wke(t,r,n)||null}var Zke=["valueAccessor"],Jke=["dataKey","clockWise","id","textBreakAll","zIndex"];function Vx(){return Vx=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},Vx.apply(null,arguments)}function y4(e,t){if(e==null)return{};var n,r,i=eNe(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 eNe(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 tNe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Cke(t))return t},MV=y.createContext(void 0),DV=MV.Provider,RV=y.createContext(void 0),nNe=RV.Provider;function rNe(){return y.useContext(MV)}function iNe(){return y.useContext(RV)}function Py(e){var{valueAccessor:t=tNe}=e,n=y4(e,Zke),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=y4(n,Jke),f=rNe(),h=iNe(),d=f||h;return!d||!d.length?null:y.createElement(wi,{zIndex:l??Wn.label},y.createElement(lr,{className:"recharts-label-list"},d.map((g,v)=>{var b,w=jn(r)?t(g,v):en(g.payload,r),S=jn(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(wl,Vx({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}))})))}Py.displayName="LabelList";function IO(e){var{label:t}=e;return t?t===!0?y.createElement(Py,{key:"labelList-implicit"}):y.isValidElement(t)||RO(t)?y.createElement(Py,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Py,Vx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(null,arguments)}var IV=e=>{var{cx:t,cy:n,r,className:i}=e,a=Mt("recharts-dot",i);return Me(t)&&Me(n)&&Me(r)?y.createElement("circle",FC({},$i(e),rA(e),{className:a,cx:t,cy:n,r})):null},LV=e=>e.graphicalItems.polarItems,aNe=le([On,Gp],iO),zb=le([LV,zn,aNe],aO),oNe=le([zb],oO),$b=le([oNe,xb],sO),sNe=le([$b,zn,zb],uO);le([$b,zn,zb],(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 x4=()=>{},lNe=le([$b,zn,zb,Mb,On],hO),uNe=le([zn,fO,dO,x4,lNe,x4,Ft,On],mO),zV=le([zn,Ft,$b,sNe,Xp,On,uNe],pO),cNe=le([zV,Yd,ru],vO),fNe=le([zn,zV,cNe,On],xO);le([ru,fNe],L9);var dNe={radiusAxis:{},angleAxis:{}},$V=Kr({name:"polarAxis",initialState:dNe,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:O5e,removeRadiusAxis:T5e,addAngleAxis:P5e,removeAngleAxis:M5e}=$V.actions,hNe=$V.reducer;function BV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function b4(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 w4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b4(Object(n),!0).forEach(function(r){mNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b4(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)}var vNe=(e,t)=>t,LO=le([LV,vNe],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),yNe=[],zO=(e,t,n)=>(n==null?void 0:n.length)===0?yNe:n,FV=le([xb,LO,zO],(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=>w4(w4({},t.presentationProps),a.props))),i!=null)return i}}),xNe=le([FV,LO,zO],(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:Ud(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),bNe=le([FV,LO,zO,ur],(e,t,n,r)=>{if(!(t==null||e==null))return EAe({offset:r,pieSettings:t,displayedData:e,cells:n})}),kE={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 S4;function wNe(){if(S4)return Jt;S4=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"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=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 f:case g:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case d:case h: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=d,Jt.Memo=h,Jt.Portal=t,Jt.Profiler=i,Jt.StrictMode=r,Jt.Suspense=c,Jt.SuspenseList=f,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)===d},Jt.isMemo=function(w){return b(w)===h},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)===f},Jt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===c||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===h||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Jt.typeOf=b,Jt}var j4;function SNe(){return j4||(j4=1,kE.exports=wNe()),kE.exports}var jNe=SNe(),E4=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",_4=null,NE=null,UV=e=>{if(e===_4&&Array.isArray(NE))return NE;var t=[];return y.Children.forEach(e,n=>{jn(n)||(jNe.isFragment(n)?t=t.concat(UV(n.props.children)):t.push(n))}),NE=t,_4=e,t};function $O(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>E4(i)):r=[E4(t)],UV(e).forEach(i=>{var a=hc(i,"type.displayName")||hc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var HV=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,AE={},C4;function ENe(){return C4||(C4=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})(AE)),AE}var OE,k4;function _Ne(){return k4||(k4=1,OE=ENe().isPlainObject),OE}var CNe=_Ne();const kNe=Hi(CNe);var N4,A4,O4,T4,P4;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 D4(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){NNe(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 NNe(e,t,n){return(t=ANe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ANe(e){var t=ONe(e,"string");return typeof t=="symbol"?t:t+""}function ONe(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 Kx(){return Kx=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},Kx.apply(null,arguments)}function um(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var R4=(e,t,n,r,i)=>{var a=n-r,o;return o=In(N4||(N4=um(["M ",",",""])),e,t),o+=In(A4||(A4=um(["L ",",",""])),e+n,t),o+=In(O4||(O4=um(["L ",",",""])),e+n-a/2,t+i),o+=In(T4||(T4=um(["L ",",",""])),e+n-a/2-r,t+i),o+=In(P4||(P4=um(["L ",","," Z"])),e,t),o},TNe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PNe=e=>{var t=Zn(e,TNe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:f,animationBegin:h,isUpdateAnimationActive:d}=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),N=Yp(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var D=g.current.getTotalLength();D&&b(D)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var O=Mt("recharts-trapezoid",l);if(!d)return y.createElement("g",null,y.createElement("path",Kx({},ni(t),{className:O,d:R4(n,r,i,a,o)})));var A=w.current,T=S.current,P=j.current,L=C.current,I=_.current,F="0px ".concat(v===-1?1:v,"px"),$="".concat(v,"px ").concat(v,"px"),G=o9(["strokeDasharray"],f,c);return y.createElement(Kp,{animationId:N,key:N,canBegin:v>0,duration:f,easing:c,isActive:d,begin:h},D=>{var V=bn(A,i,D),z=bn(T,a,D),q=bn(P,o,D),X=bn(L,n,D),K=bn(I,r,D);g.current&&(w.current=V,S.current=z,j.current=q,C.current=X,_.current=K);var R=D>0?{transition:G,strokeDasharray:$}:{strokeDasharray:F};return y.createElement("path",Kx({},ni(t),{className:O,d:R4(X,K,V,z,q),ref:g,style:D4(D4({},R),t.style)}))})},MNe=["option","shapeType","activeClassName","inActiveClassName"];function DNe(e,t){if(e==null)return{};var n,r,i=RNe(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 RNe(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 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 Yx(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){INe(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 INe(e,t,n){return(t=LNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LNe(e){var t=zNe(e,"string");return typeof t=="symbol"?t:t+""}function zNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Ne(e,t){return Yx(Yx({},t),e)}function BNe(e,t){return e==="symbols"}function L4(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(c9,n);case"trapezoid":return y.createElement(PNe,n);case"sector":return y.createElement(m9,n);case"symbols":if(BNe(t))return y.createElement(nA,n);break;case"curve":return y.createElement(bA,n);default:return null}}function FNe(e){return y.isValidElement(e)?e.props:e}function BO(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=DNe(e,MNe),o;if(y.isValidElement(t))o=y.cloneElement(t,Yx(Yx({},a),FNe(t)));else if(typeof t=="function")o=t(a,a.index);else if(kNe(t)&&typeof t!="boolean"){var l=$Ne(t,a);o=y.createElement(L4,{shapeType:n,elementProps:l})}else{var c=a;o=y.createElement(L4,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(lr,{className:r},o):y.createElement(lr,{className:i},o)}var FO=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(W7({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},UO=e=>{var t=tn();return(n,r)=>i=>{e==null||e(n,r,i),t(VEe())}},HO=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(KEe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function qO(e){var{tooltipEntrySettings:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(FEe(t)):i.current!==t&&n(UEe({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(HEe(i.current)),i.current=null)},[n]),null}function qV(e){var{legendPayload:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(e9(t)):i.current!==t&&n(t9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(n9(i.current)),i.current=null)},[n]),null}function UNe(e){var{legendPayload:t}=e,n=tn(),r=Ie(Ft),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(e9(t)):i.current!==t&&n(t9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(n9(i.current)),i.current=null)},[n]),null}var TE,HNe=()=>{var[e]=y.useState(()=>zm("uid-"));return e},qNe=(TE=ck.useId)!==null&&TE!==void 0?TE:HNe;function VNe(e,t){var n=qNe();return t||(e?"".concat(e,"-").concat(n):n)}var KNe=y.createContext(void 0),VO=e=>{var{id:t,type:n,children:r}=e,i=VNe("recharts-".concat(n),t);return y.createElement(KNe.Provider,{value:i},r(i))},YNe={cartesianItems:[],polarItems:[]},VV=Kr({name:"graphicalItems",initialState:YNe,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:XNe,replaceCartesianGraphicalItem:GNe,removeCartesianGraphicalItem:WNe,addPolarGraphicalItem:QNe,removePolarGraphicalItem:ZNe,replacePolarGraphicalItem:JNe}=VV.actions,eAe=VV.reducer,tAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(XNe(e)):n.current!==e&&t(GNe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(WNe(n.current)),n.current=null)},[t]),null},KV=y.memo(tAe),nAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(QNe(e)):n.current!==e&&t(JNe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(ZNe(n.current)),n.current=null)},[t]),null},rAe=y.memo(nAe),iAe=["key"],aAe=["onMouseEnter","onClick","onMouseLeave"],oAe=["id"],sAe=["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 Bb(e,t){if(e==null)return{};var n,r,i=lAe(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 lAe(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 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 wn(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){uAe(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 uAe(e,t,n){return(t=cAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cAe(e){var t=fAe(e,"string");return typeof t=="symbol"?t:t+""}function fAe(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 dAe(e){var t=y.useMemo(()=>$O(e.children,og),[e.children]),n=Ie(r=>xNe(r,e.id,t));return n==null?null:y.createElement(UNe,{legendPayload:n})}function hAe(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 mAe=y.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:f,id:h,activeShape:d}=e,g=hAe(d),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(j=>wn(wn({},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:Ud(l,t),hide:c,type:f,color:o,unit:"",graphicalItemId:h}};return y.createElement(qO,{tooltipEntrySettings:b})}),pAe=(e,t)=>e>t?"start":e<t?"end":"middle",gAe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),vAe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=f9(a,o),c=i+Hr(e.cx,a,a/2),f=r+Hr(e.cy,o,o/2),h=Hr(e.innerRadius,l,0),d=gAe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:f,innerRadius:h,outerRadius:d,maxRadius:g}},yAe=(e,t)=>{var n=vr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},xAe=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Mt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Bb(t,iAe);return y.createElement(bA,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=Mt("recharts-pie-label-text",BV(e));return y.createElement(Lb,Yl({},t,{alignmentBaseline:"middle",className:i}),r)};function wAe(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),f=fc(a),h=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((g,v)=>{var b=(g.startAngle+g.endAngle)/2,w=Gn(g.cx,g.cy,g.outerRadius+h,b),S=wn(wn(wn(wn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:pAe(w.x,g.cx)},w),j=wn(wn(wn(wn({},l),g),{},{fill:"none",stroke:g.fill},f),{},{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(lr,null,a&&xAe(a,j),bAe(i,S,en(g,o))))});return y.createElement(lr,{className:"recharts-pie-labels"},d)}function SAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(IO,{label:i}):y.createElement(wAe,{sectors:t,props:n,showLabels:r})}function jAe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=Ie(Kl),c=Ie(AO),f=Ie(fV),{onMouseEnter:h,onClick:d,onMouseLeave:g}=i,v=Bb(i,aAe),b=FO(h,i.dataKey,o),w=UO(g),S=HO(d,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 _=f==null||f===o,N=String(C)===l&&(c==null||i.dataKey===c)&&_,O=l?r:null,A=n&&N?n:O,T=wn(wn({},j),{},{stroke:j.stroke,tabIndex:-1,[$q]:C,[Bq]:o});return y.createElement(lr,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"},$p(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(BO,Yl({option:a??A,index:C,shapeType:"sector",isActive:N},T)))}))}function EAe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:f,nameKey:h,tooltipType:d}=n,g=Math.abs(n.minAngle),v=yAe(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,f,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,_=r.reduce((A,T)=>{var P=en(T,f,0);return A+(Me(P)?P:0)},0),N;if(_>0){var O;N=r.map((A,T)=>{var P=en(A,f,0),L=en(A,h,T),I=vAe(n,a,A),F=(Me(P)?P:0)/_,$,G=wn(wn({},A),i&&i[T]&&i[T].props),D=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;T?$=O.endAngle+vr(v)*w*(P!==0?1:0):$=l;var V=$+vr(v)*((P!==0?g:0)+F*C),z=($+V)/2,q=(I.innerRadius+I.outerRadius)/2,X=[{name:L,value:P,payload:G,dataKey:f,type:d,color:D,fill:D,graphicalItemId:n.id}],K=Gn(I.cx,I.cy,q,z);return O=wn(wn(wn(wn({},n.presentationProps),{},{percent:F,cornerRadius:typeof o=="string"?parseFloat(o):o,name:L,tooltipPayload:X,midAngle:z,middleRadius:q,tooltipPosition:K},G),I),{},{value:P,dataKey:f,startAngle:$,endAngle:V,payload:G,paddingAngle:vr(v)*w}),O})}return N}function _Ae(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(nNe,{value:t?i:void 0},r)}function CAe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:f,inactiveShape:h,onAnimationStart:d,onAnimationEnd:g}=t,v=Yp(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 d=="function"&&d(),S(!0)},[d]);return y.createElement(_Ae,{showLabels:!w,sectors:i},y.createElement(Kp,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:j,key:v},_=>{var N,O=[],A=i&&i[0],T=(N=A==null?void 0:A.startAngle)!==null&&N!==void 0?N:0;return i==null||i.forEach((P,L)=>{var I=b&&b[L],F=L>0?hc(P,"paddingAngle",0):0;if(I){var $=bn(I.endAngle-I.startAngle,P.endAngle-P.startAngle,_),G=wn(wn({},P),{},{startAngle:T+F,endAngle:T+$+F});O.push(G),T=G.endAngle}else{var{endAngle:D,startAngle:V}=P,z=bn(0,D-V,_),q=wn(wn({},P),{},{startAngle:T+F,endAngle:T+z+F});O.push(q),T=q.endAngle}}),n.current=O,y.createElement(lr,null,y.createElement(jAe,{sectors:O,activeShape:f,inactiveShape:h,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(SAe,{showLabels:!w,sectors:i,props:t}),t.children)}var kAe={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 NAe(e){var{id:t}=e,n=Bb(e,oAe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>$O(e.children,og),[e.children]),l=Ie(h=>bNe(h,t,o)),c=y.useRef(null),f=Mt("recharts-pie",i);return r||l==null?(c.current=null,y.createElement(lr,{tabIndex:a,className:f})):y.createElement(wi,{zIndex:e.zIndex},y.createElement(mAe,{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(lr,{tabIndex:a,className:f},y.createElement(CAe,{props:wn(wn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function AAe(e){var t=Zn(e,kAe),{id:n}=t,r=Bb(t,sAe),i=$i(r);return y.createElement(VO,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(rAe,{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(dAe,Yl({},r,{id:a})),y.createElement(NAe,Yl({},r,{id:a}))))}var YV=AAe;YV.displayName="Pie";var OAe=["points"];function $4(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 PE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$4(Object(n),!0).forEach(function(r){TAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TAe(e,t,n){return(t=PAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PAe(e){var t=MAe(e,"string");return typeof t=="symbol"?t:t+""}function MAe(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 Xx(){return Xx=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},Xx.apply(null,arguments)}function DAe(e,t){if(e==null)return{};var n,r,i=RAe(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 RAe(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 IAe(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=Mt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=DAe(a,OAe);return y.createElement(IV,Xx({},l,{className:i}))}function LAe(e,t){return e==null?!1:t?!0:e.length===1}function zAe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:f=Wn.scatter}=e;if(!LAe(t,n))return null;var h=HV(n),d=yge(n),g=t.map((b,w)=>{var S,j,C=PE(PE(PE({r:3},o),d),{},{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(IAe,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(h?"":"dots-").concat(c,")")),y.createElement(wi,{zIndex:f},y.createElement(lr,Xx({className:r},v),g))}function B4(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 F4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B4(Object(n),!0).forEach(function(r){$Ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ae(e,t,n){return(t=BAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BAe(e){var t=FAe(e,"string");return typeof t=="symbol"?t:t+""}function FAe(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 XV=0,UAe={xAxis:{},yAxis:{},zAxis:{}},GV=Kr({name:"cartesianAxis",initialState:UAe,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]=F4(F4({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:HAe,replaceXAxis:qAe,removeXAxis:VAe,addYAxis:KAe,replaceYAxis:YAe,removeYAxis:XAe,addZAxis:D5e,replaceZAxis:R5e,removeZAxis:I5e,updateYAxisWidth:GAe}=GV.actions,WAe=GV.reducer,QAe=le([ur],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),ZAe=le([QAe,Ns,As],(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)}}),KO=()=>Ie(ZAe),JAe=()=>Ie(B_e);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 ME(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){eOe(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 eOe(e,t,n){return(t=tOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tOe(e){var t=nOe(e,"string");return typeof t=="symbol"?t:t+""}function nOe(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 rOe=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=ME(ME(ME({},l),fc(i)),rA(i)),f;return y.isValidElement(i)?f=y.cloneElement(i,c):typeof i=="function"?f=i(c):f=y.createElement(IV,c),y.createElement(lr,{className:"recharts-active-dot",clipPath:o},f)};function iOe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Wn.activeDot}=e,l=Ie(Kl),c=JAe();if(t==null||c==null)return null;var f=t.find(h=>c.includes(h.payload));return jn(f)?null:y.createElement(wi,{zIndex:o},y.createElement(rOe,{point:f,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var H4=(e,t,n)=>{var r=n??e;if(!jn(r))return Hr(r,t,0)},aOe=(e,t,n)=>{var r={},i=e.filter(jb),a=e.filter(f=>f.stackId==null),o=i.reduce((f,h)=>{var d=f[h.stackId];return d==null&&(d=[]),d.push(h),f[h.stackId]=d,f},r),l=Object.entries(o).map(f=>{var h,[d,g]=f,v=g.map(w=>w.dataKey),b=H4(t,n,(h=g[0])===null||h===void 0?void 0:h.barSize);return{stackId:d,dataKeys:v,barSize:b}}),c=a.map(f=>{var h=[f.dataKey].filter(g=>g!=null),d=H4(t,n,f.barSize);return{stackId:void 0,dataKeys:h,barSize:d}});return[...l,...c]};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 sy(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){oOe(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 oOe(e,t,n){return(t=sOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sOe(e){var t=lOe(e,"string");return typeof t=="symbol"?t:t+""}function lOe(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 uOe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),c,f=[];if(Ot((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,d=n/o,g=r.reduce((C,_)=>C+(_.barSize||0),0);g+=(o-1)*l,g>=n&&(g-=(o-1)*l,l=0),g>=n&&d>0&&(h=!0,d*=.9,g=o*d);var v=(n-g)/2>>0,b={offset:v-l,size:0};c=r.reduce((C,_)=>{var N,O={stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:b.offset+b.size+l,size:h?d:(N=_.barSize)!==null&&N!==void 0?N:0}},A=[...C,O];return b=O.position,A},f)}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=Ot(i)?Math.min(S,i):S;c=r.reduce((C,_,N)=>[...C,{stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:w+(S+l)*N+(S-j)/2,size:j}}],f)}return c}}var cOe=(e,t,n,r,i,a,o)=>{var l=jn(o)?t:o,c=uOe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(f=>sy(sy({},f),{},{position:sy(sy({},f.position),{},{offset:f.position.offset-i/2})}))),c},fOe=(e,t)=>{var n=TA(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)}}}},dOe=(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 hOe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ot(e.zIndex)?e.zIndex:t}var WV=e=>{var{chartData:t}=e,n=tn(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(e4(t)),()=>{n(e4(void 0))}),[t,n,r]),null},V4={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},QV=Kr({name:"brush",initialState:V4,reducers:{setBrushSettings(e,t){return t.payload==null?V4:t.payload}}}),{setBrushSettings:L5e}=QV.actions,mOe=QV.reducer;function pOe(e){return(e%180+180)%180}var gOe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=pOe(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)},vOe={dots:[],areas:[],lines:[]},ZV=Kr({name:"referenceElements",initialState:vOe,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:z5e,removeDot:$5e,addArea:B5e,removeArea:F5e,addLine:U5e,removeLine:H5e}=ZV.actions,yOe=ZV.reducer,xOe=y.createContext(void 0),bOe=e=>{var{children:t}=e,[n]=y.useState("".concat(zm("recharts"),"-clip")),r=KO();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement(xOe.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 JV(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 wOe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return gOe(r,n)}function SOe(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 Qm(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 jOe(e,t){return JV(e,t+1)}function EOe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,c=0,f=1,h=o,d=function(){var b=r==null?void 0:r[c];if(b===void 0)return{v:JV(r,f)};var w=c,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,_=c===0||Qm(e,C,j,h,l);_||(c=0,h=o,f+=1),_&&(h=C+e*(j()/2+i),c+=f)},g;f<=a.length;)if(g=d(),g)return g.v;return[]}function _Oe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:l,end:c}=t,f=1;f<=o;f++){for(var h=(o-1)%f,d=l,g=!0,v=function(){var N=r[w];if(N==null)return 0;var O=w,A,T=()=>(A===void 0&&(A=n(N,O)),A),P=N.coordinate,L=w===h||Qm(e,P,T,d,c);if(!L)return g=!1,1;L&&(d=P+e*(T()/2+i))},b,w=h;w<o&&(b=v(),!(b!==0&&b===1));w+=f);if(g){for(var S=[],j=h;j<o;j+=f){var C=r[j];C!=null&&S.push(C)}return S}}return[]}function K4(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?K4(Object(n),!0).forEach(function(r){COe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function COe(e,t,n){return(t=kOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kOe(e){var t=NOe(e,"string");return typeof t=="symbol"?t:t+""}function NOe(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){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:c}=t,f=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=Qm(e,b.tickCoord,S,l,c);C&&(c=b.tickCoord-e*(S()/2+i),a[g]=$r($r({},b),{},{isShow:!0}))}},h=o-1;h>=0;h--)f(h);return a}function OOe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:c,end:f}=t;if(a){var h=r[l-1];if(h!=null){var d=n(h,l-1),g=e*(h.coordinate+e*d/2-f);if(o[l-1]=h=$r($r({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate}),h.tickCoord!=null){var v=Qm(e,h.tickCoord,()=>d,c,f);v&&(f=h.tickCoord-e*(d/2+i),o[l-1]=$r($r({},h),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var _=o[C];if(_==null)return 1;var N=_,O,A=()=>(O===void 0&&(O=n(_,C)),O);if(C===0){var T=e*(N.coordinate-e*A()/2-c);o[C]=N=$r($r({},N),{},{tickCoord:T<0?N.coordinate-T*e:N.coordinate})}else o[C]=N=$r($r({},N),{},{tickCoord:N.coordinate});if(N.tickCoord!=null){var P=Qm(e,N.tickCoord,A,c,f);P&&(c=N.tickCoord+e*(A()/2+i),o[C]=$r($r({},N),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function YO(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:c,tickFormatter:f,unit:h,angle:d}=e;if(!i||!i.length||!r)return[];if(Me(c)||Vp.isSsr){var g;return(g=jOe(i,Me(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=h&&b==="width"?Cm(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(O,A)=>{var T=typeof f=="function"?f(O.value,A):O.value;return b==="width"?wOe(Cm(T,{fontSize:t,letterSpacing:n}),w,d):Cm(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],_=i.length>=2&&j!=null&&C!=null?vr(C.coordinate-j.coordinate):1,N=SOe(a,_,b);return c==="equidistantPreserveStart"?EOe(_,N,S,i,o):c==="equidistantPreserveEnd"?_Oe(_,N,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=OOe(_,N,S,i,o,c==="preserveStartEnd"):v=AOe(_,N,S,i,o),v.filter(O=>O.isShow))}var TOe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(h=>{if(h){var d=h.getBoundingClientRect();d.width>o&&(o=d.width)}});var l=n?n.getBoundingClientRect().width:0,c=i+a,f=o+c+l+(n?r:0);return Math.round(f)}return 0},POe={xAxis:{},yAxis:{}},eK=Kr({name:"renderedTicks",initialState:POe,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:MOe,removeRenderedTicks:DOe}=eK.actions,ROe=eK.reducer,IOe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function LOe(e,t){if(e==null)return{};var n,r,i=zOe(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 zOe(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 bc(){return bc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bc.apply(null,arguments)}function Y4(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 Rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y4(Object(n),!0).forEach(function(r){$Oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Oe(e,t,n){return(t=BOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BOe(e){var t=FOe(e,"string");return typeof t=="symbol"?t:t+""}function FOe(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 UOe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var f=Rn(Rn(Rn({},c),$i(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!o||a==="bottom"&&o);f=Rn(Rn({},f),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var d=+(a==="left"&&!o||a==="right"&&o);f=Rn(Rn({},f),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return y.createElement("line",bc({},f,{className:Mt("recharts-cartesian-axis-line",hc(l,"className"))}))}function HOe(e,t,n,r,i,a,o,l,c){var f,h,d,g,v,b,w=l?-1:1,S=e.tickSize||o,j=Me(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=h=e.coordinate,g=n+ +!l*i,d=g-w*S,b=d-w*c,v=j;break;case"left":d=g=e.coordinate,h=t+ +!l*r,f=h-w*S,v=f-w*c,b=j;break;case"right":d=g=e.coordinate,h=t+ +l*r,f=h+w*S,v=f+w*c,b=j;break;default:f=h=e.coordinate,g=n+ +l*i,d=g+w*S,b=d+w*c,v=j;break}return{line:{x1:f,y1:d,x2:h,y2:g},tick:{x:v,y:b}}}function qOe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function VOe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function KOe(e){var{option:t,tickProps:n,value:r}=e,i,a=Mt(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,Rn(Rn({},n),{},{className:a}));else if(typeof t=="function")i=t(Rn(Rn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Mt(o,BV(t))),i=y.createElement(Lb,bc({},n,{className:o}),r)}return i}function YOe(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(MOe({ticks:a,axisId:r,axisType:n})),()=>{i(DOe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var XOe=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:c,tickTextProps:f,orientation:h,mirror:d,x:g,y:v,width:b,height:w,tickSize:S,tickMargin:j,fontSize:C,letterSpacing:_,getTicksConfig:N,events:O,axisType:A,axisId:T}=e,P=YO(Rn(Rn({},N),{},{ticks:n}),C,_),L=$i(N),I=fc(r),F=kV(L.textAnchor)?L.textAnchor:qOe(h,d),$=VOe(h,d),G={};typeof i=="object"&&(G=i);var D=Rn(Rn({},L),{},{fill:"none"},G),V=P.map(X=>Rn({entry:X},HOe(X,g,v,b,w,h,S,d,j))),z=V.map(X=>{var{entry:K,line:R}=X;return y.createElement(lr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&y.createElement("line",bc({},D,R,{className:Mt("recharts-cartesian-axis-tick-line",hc(i,"className"))})))}),q=V.map((X,K)=>{var R,H,{entry:U,tick:B}=X,Q=Rn(Rn(Rn(Rn({verticalAnchor:$},L),{},{textAnchor:F,stroke:"none",fill:a},B),{},{index:K,payload:U,visibleTicksCount:P.length,tickFormatter:o,padding:c},f),{},{angle:(R=(H=f==null?void 0:f.angle)!==null&&H!==void 0?H:L.angle)!==null&&R!==void 0?R:0}),Z=Rn(Rn({},Q),I);return y.createElement(lr,bc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},$p(O,U,K)),r&&y.createElement(KOe,{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(YOe,{ticks:P,axisId:T,axisType:A}),q.length>0&&y.createElement(wi,{zIndex:Wn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},q)),z.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},z))}),GOe=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:f}=e,h=LOe(e,IOe),[d,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return TOe({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 N=window.getComputedStyle(_),O=N.fontSize,A=N.letterSpacing;(O!==d||A!==v)&&(g(O),b(A))}}},[d,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(wi,{zIndex:e.zIndex},y.createElement(lr,{className:Mt("recharts-cartesian-axis",a)},y.createElement(UOe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:$i(e)}),y.createElement(XOe,{ref:S,axisType:c,events:h,fontSize:d,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:f}),y.createElement(Fke,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(Qke,{label:e.label,labelRef:e.labelRef}),e.children)))}),XO=y.forwardRef((e,t)=>{var n=Zn(e,hs);return y.createElement(GOe,bc({},n,{ref:t}))});XO.displayName="CartesianAxis";var WOe=["x1","y1","x2","y2","key"],QOe=["offset"],ZOe=["xAxisId","yAxisId"],JOe=["xAxisId","yAxisId"];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 Fr(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){eTe(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 eTe(e,t,n){return(t=tTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tTe(e){var t=nTe(e,"string");return typeof t=="symbol"?t:t+""}function nTe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $u(){return $u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$u.apply(null,arguments)}function Gx(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 iTe=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 tK(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:f}=n,h=Gx(n,WOe),d=(i=$i(h))!==null&&i!==void 0?i:{},{offset:g}=d,v=Gx(d,QOe);r=y.createElement("line",$u({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:f}))}return r}function aTe(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=Gx(e,ZOe),c=i.map((f,h)=>{var d=Fr(Fr({},l),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(h),index:h});return y.createElement(tK,{key:"line-".concat(h),option:r,lineItemProps:d})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function oTe(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=Gx(e,JOe),c=i.map((f,h)=>{var d=Fr(Fr({},l),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(h),index:h});return y.createElement(tK,{option:r,lineItemProps:d,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function sTe(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 f=l.map(d=>Math.round(d+i-i)).sort((d,g)=>d-g);i!==f[0]&&f.unshift(0);var h=f.map((d,g)=>{var v=f[g+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:d,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"},h)}function lTe(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 f=c.map(d=>Math.round(d+i-i)).sort((d,g)=>d-g);i!==f[0]&&f.unshift(0);var h=f.map((d,g)=>{var v=f[g+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=g%n.length;return y.createElement("rect",{key:"react-".concat(g),x:d,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"},h)}var uTe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return Iq(YO(Fr(Fr(Fr({},hs),n),{},{ticks:Lq(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},cTe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return Iq(YO(Fr(Fr(Fr({},hs),n),{},{ticks:Lq(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},fTe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function GO(e){var t=gA(),n=vA(),r=qq(),i=Fr(Fr({},Zn(e,fTe)),{},{x:Me(e.x)?e.x:r.left,y:Me(e.y)?e.y:r.top,width:Me(e.width)?e.width:r.width,height:Me(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:c,width:f,height:h,syncWithTicks:d,horizontalValues:g,verticalValues:v}=i,b=Yr(),w=Ie(L=>Fz(L,"xAxis",a,b)),S=Ie(L=>Fz(L,"yAxis",o,b));if(!jo(f)||!jo(h)||!Me(l)||!Me(c))return null;var j=i.verticalCoordinatesGenerator||uTe,C=i.horizontalCoordinatesGenerator||cTe,{horizontalPoints:_,verticalPoints:N}=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??f,height:n??h,offset:r},O?!0:d);bx(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(_=A)}if((!N||!N.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??f,height:n??h,offset:r},T?!0:d);bx(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(N=P)}return y.createElement(wi,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(iTe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(sTe,$u({},i,{horizontalPoints:_})),y.createElement(lTe,$u({},i,{verticalPoints:N})),y.createElement(aTe,$u({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:S})),y.createElement(oTe,$u({},i,{offset:r,verticalPoints:N,xAxis:w,yAxis:S}))))}GO.displayName="CartesianGrid";var dTe={},nK=Kr({name:"errorBars",initialState:dTe,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:q5e,replaceErrorBar:V5e,removeErrorBar:K5e}=nK.actions,hTe=nK.reducer,mTe=["children"];function pTe(e,t){if(e==null)return{};var n,r,i=gTe(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 gTe(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 vTe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},yTe=y.createContext(vTe);function rK(e){var{children:t}=e,n=pTe(e,mTe);return y.createElement(yTe.Provider,{value:n},t)}function WO(e,t){var n,r,i=Ie(f=>Ps(f,e)),a=Ie(f=>Ms(f,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 iK(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=KO(),{needClipX:a,needClipY:o,needClip:l}=WO(t,n);if(!l||!i)return null;var{x:c,y:f,width:h,height:d}=i;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.createElement("rect",{x:a?c:c-h/2,y:o?f:f-d/2,width:a?h:h*2,height:o?d:d*2}))}var aK=(e,t,n,r)=>Vl(e,"xAxis",t,r),oK=(e,t,n,r)=>ql(e,"xAxis",t,r),sK=(e,t,n,r)=>Vl(e,"yAxis",n,r),lK=(e,t,n,r)=>ql(e,"yAxis",n,r),xTe=le([Ft,aK,sK,oK,lK],(e,t,n,r,i)=>ks(e,"xAxis")?gd(t,r,!1):gd(n,i,!1)),bTe=(e,t,n,r,i)=>i;function wTe(e){return e.type==="line"}var STe=le([Pb,bTe],(e,t)=>e.filter(wTe).find(n=>n.id===t)),jTe=le([Ft,aK,sK,oK,lK,STe,xTe,wA],(e,t,n,r,i,a,o,l)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:h}=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:d,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=c==null?void 0:c.slice(f,h+1),v!=null)return qTe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:v})}});function ETe(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 _Te=["id"],CTe=["type","layout","connectNulls","needClip","shape"],kTe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Zm(){return Zm=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},Zm.apply(null,arguments)}function G4(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 co(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G4(Object(n),!0).forEach(function(r){NTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NTe(e,t,n){return(t=ATe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ATe(e){var t=OTe(e,"string");return typeof t=="symbol"?t:t+""}function OTe(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 QO(e,t){if(e==null)return{};var n,r,i=TTe(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 TTe(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 PTe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ud(n,t),payload:e}]},MTe=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:f,id:h}=e,d={dataDefinedOnItem:n,getPosition:eu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ud(o,t),hide:l,type:f,color:r,unit:c,graphicalItemId:h}};return y.createElement(qO,{tooltipEntrySettings:d})}),uK=(e,t)=>"".concat(t,"px ").concat(e,"px");function DTe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var RTe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return uK(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],l=0,c=0;l<n.length;c+=(f=n[l])!==null&&f!==void 0?f:0,++l){var f,h=n[l];if(h!=null&&c+h>a){o=[...n.slice(0,l),a-c];break}}var d=o.length%2===0?[0,t]:[t];return[...DTe(n,i),...o,...d].map(g=>"".concat(g,"px")).join(", ")};function ITe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=QO(r,_Te),f=$i(c);return y.createElement(zAe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:o,clipPathId:t})}function LTe(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 co(co({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(DV,{value:t?i:void 0},n)}function W4(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:c,needClip:f,shape:h}=a,d=QO(a,CTe),g=co(co({},ni(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"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(BO,Zm({shapeType:"curve",option:h},g,{pathRef:n})),y.createElement(ITe,{points:r,clipPathId:t,props:a}))}function zTe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function $Te(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:f,animationDuration:h,animationEasing:d,animateNewValues:g,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,j=i.current,C=Yp(o,"recharts-line-"),_=y.useRef(C),[N,O]=y.useState(!1),A=!N,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),P=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),L=zTe(r.current),I=y.useRef(0);_.current!==C&&(I.current=a.current,_.current=C);var F=I.current;return y.createElement(LTe,{points:o,showLabels:A},n.children,y.createElement(Kp,{animationId:C,begin:f,duration:h,isActive:c,easing:d,onAnimationEnd:T,onAnimationStart:P,key:C},$=>{var G=bn(F,L+F,$),D=Math.min(G,L),V;if(c)if(l){var z="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));V=RTe(D,L,z)}else V=uK(L,D);else V=l==null?void 0:String(l);if($>0&&L>0&&(i.current=o,a.current=Math.max(a.current,D)),j){var q=j.length/o.length,X=$===1?o:o.map((K,R)=>{var H=Math.floor(R*q);if(j[H]){var U=j[H];return co(co({},K),{},{x:bn(U.x,K.x,$),y:bn(U.y,K.y,$)})}return g?co(co({},K),{},{x:bn(v*2,K.x,$),y:bn(b/2,K.y,$)}):co(co({},K),{},{x:K.x,y:K.y})});return i.current=X,y.createElement(W4,{props:n,points:X,clipPathId:t,pathRef:r,strokeDasharray:V})}return y.createElement(W4,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:V})}),y.createElement(IO,{label:n.label}))}function BTe(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement($Te,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var FTe=(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 UTe extends y.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:c,width:f,height:h,id:d,needClip:g,zIndex:v}=this.props;if(t)return null;var b=Mt("recharts-line",i),w=d,{r:S,strokeWidth:j}=ETe(n),C=HV(n),_=S*2+j,N=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(wi,{zIndex:v},y.createElement(lr,{className:b},g&&y.createElement("defs",null,y.createElement(iK,{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:f+_,height:h+_}))),y.createElement(rK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:FTe,errorBarOffset:0},y.createElement(BTe,{props:this.props,clipPathId:w}))),y.createElement(iOe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:N}))}}var cK={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 HTe(e){var t=Zn(e,cK),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,hide:f,isAnimationActive:h,label:d,legendType:g,xAxisId:v,yAxisId:b,id:w}=t,S=QO(t,kTe),{needClip:j}=WO(v,b),C=KO(),_=Tc(),N=Yr(),O=Ie(I=>jTe(I,v,b,N,w));if(_!=="horizontal"&&_!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:P,y:L}=C;return y.createElement(UTe,Zm({},S,{id:w,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:h,hide:f,label:d,legendType:g,xAxisId:v,yAxisId:b,points:O,layout:_,height:A,width:T,left:P,top:L,needClip:j}))}function qTe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((f,h)=>{var d=en(f,o);if(t==="horizontal"){var g=PL({axis:n,ticks:i,bandSize:l,entry:f,index:h}),v=jn(d)?null:r.scale.map(d);return{x:g,y:v??null,value:d,payload:f}}var b=jn(d)?null:n.scale.map(d),w=PL({axis:r,ticks:a,bandSize:l,entry:f,index:h});return b==null||w==null?null:{x:b,y:w,value:d,payload:f}}).filter(Boolean)}function VTe(e){var t=Zn(e,cK),n=Yr();return y.createElement(VO,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(qV,{legendPayload:PTe(t)}),y.createElement(MTe,{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(KV,{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(HTe,Zm({},t,{id:r}))))}var fK=y.memo(VTe,Hd);fK.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:XV}function Rc(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:XV}var KTe="Invariant failed";function YTe(e,t){throw new Error(KTe)}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 ZO(e){return y.createElement(BO,UC({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var XTe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Me(t))return t;var a=Me(r)||jn(r);return a?t(r,i):(a||YTe(),n)}},GTe=(e,t,n)=>n,WTe=(e,t)=>t,sg=le([Pb,WTe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),QTe=le([sg],e=>e==null?void 0:e.maxBarSize),ZTe=(e,t,n,r)=>r,JTe=le([Ft,Pb,Dc,Rc,GTe],(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")),e2e=(e,t,n)=>{var r=Ft(e),i=Dc(e,t),a=Rc(e,t);if(!(i==null||a==null))return r==="horizontal"?IC(e,"yAxis",a,n):IC(e,"xAxis",i,n)},t2e=(e,t)=>{var n=Ft(e),r=Dc(e,t),i=Rc(e,t);if(!(r==null||i==null))return n==="horizontal"?Bz(e,"xAxis",r):Bz(e,"yAxis",i)},n2e=le([JTe,qwe,t2e],aOe),r2e=(e,t,n)=>{var r,i,a=sg(e,t);if(a==null)return 0;var o=Dc(e,t),l=Rc(e,t);if(o==null||l==null)return 0;var c=Ft(e),f=k9(e),{maxBarSize:h}=a,d=jn(h)?f:h,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=gd(g,v,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},dK=(e,t,n)=>{var r=Ft(e),i=Dc(e,t),a=Rc(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)),gd(o,l)}},i2e=le([n2e,k9,Hwe,N9,r2e,dK,QTe],cOe),a2e=(e,t,n)=>{var r=Dc(e,t);if(r!=null)return Vl(e,"xAxis",r,n)},o2e=(e,t,n)=>{var r=Rc(e,t);if(r!=null)return Vl(e,"yAxis",r,n)},s2e=(e,t,n)=>{var r=Dc(e,t);if(r!=null)return ql(e,"xAxis",r,n)},l2e=(e,t,n)=>{var r=Rc(e,t);if(r!=null)return ql(e,"yAxis",r,n)},u2e=le([i2e,sg],dOe),c2e=le([e2e,sg],fOe),f2e=le([ur,dA,a2e,o2e,s2e,l2e,u2e,Ft,Lwe,dK,c2e,sg,ZTe],(e,t,n,r,i,a,o,l,c,f,h,d,g)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=c;if(!(d==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:S}=d,j;if(S!=null&&S.length>0?j=S:j=v==null?void 0:v.slice(b,w+1),j!=null)return $2e({layout:l,barSettings:d,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:j,offset:e,cells:g,dataStartIndex:b})}}),d2e=["index"];function HC(){return HC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HC.apply(null,arguments)}function h2e(e,t){if(e==null)return{};var n,r,i=m2e(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 m2e(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 hK=y.createContext(void 0),p2e=e=>{var t=y.useContext(hK);if(t!=null)return t.stackId;if(e!=null)return Ixe(e)},g2e=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),v2e=e=>{var t=y.useContext(hK);if(t!=null){var{stackId:n}=t;return"url(#".concat(g2e(n,e),")")}},mK=e=>{var{index:t}=e,n=h2e(e,d2e),r=v2e(t);return y.createElement(lr,HC({className:"recharts-bar-stack-layer",clipPath:r},n))},y2e=["onMouseEnter","onMouseLeave","onClick"],x2e=["value","background","tooltipPosition"],b2e=["id"],w2e=["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 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 Jr(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){S2e(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 S2e(e,t,n){return(t=j2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j2e(e){var t=E2e(e,"string");return typeof t=="symbol"?t:t+""}function E2e(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 Wx(e,t){if(e==null)return{};var n,r,i=_2e(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 _2e(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 C2e=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ud(n,t),payload:e}]},k2e=y.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:c,id:f}=e,h={dataDefinedOnItem:void 0,getPosition:eu,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ud(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:f}};return y.createElement(qO,{tooltipEntrySettings:h})});function N2e(e){var t=Ie(Kl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,f=Wx(a,y2e),h=FO(o,r,a.id),d=UO(l),g=HO(c,r,a.id);if(!i||n==null)return null;var v=fc(i);return y.createElement(wi,{zIndex:hOe(i,Wn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,_=Wx(b,x2e);if(!j)return null;var N=h(b,w),O=d(b,w),A=g(b,w),T=Jr(Jr(Jr(Jr(Jr({option:i,isActive:String(w)===t},_),{},{fill:"#eee"},j),v),$p(f,b,w)),{},{onMouseEnter:N,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(ZO,Xl({key:"background-bar-".concat(w)},T))}))}function A2e(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(DV,{value:t?i:void 0},n)}function O2e(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=Ie(Kl),c=Ie(AO),f=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[h,d]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var _;return f?(d(!0),_=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(_)}},[f]);var b=y.useCallback(()=>{f||d(!1)},[f]),w=f&&g,S=f||h,j;f?n===!0?j=t:j=n:j=t;var C=y.createElement(ZO,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(mK,{index:i.originalDataIndex},C)):C}function T2e(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(ZO,Xl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function P2e(e){var t,{data:n,props:r}=e,i=(t=$i(r))!==null&&t!==void 0?t:{},{id:a}=i,o=Wx(i,b2e),{shape:l,dataKey:c,activeBar:f}=r,{onMouseEnter:h,onClick:d,onMouseLeave:g}=r,v=Wx(r,w2e),b=FO(h,c,a),w=UO(g),S=HO(d,c,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(mK,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"},$p(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),f?y.createElement(O2e,{shape:l,activeBar:f,baseProps:o,entry:j,index:C,dataKey:c}):y.createElement(T2e,{shape:l,baseProps:o,entry:j,index:C,dataKey:c})))):null}function M2e(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:f,onAnimationStart:h}=t,d=n.current,g=Yp(t,"recharts-bar-"),[v,b]=y.useState(!1),w=!v,S=y.useCallback(()=>{typeof f=="function"&&f(),b(!1)},[f]),j=y.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);return y.createElement(A2e,{showLabels:w,rects:r},y.createElement(Kp,{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((N,O)=>{var A=d&&d[O];if(A)return Jr(Jr({},N),{},{x:bn(A.x,N.x,C),y:bn(A.y,N.y,C),width:bn(A.width,N.width,C),height:bn(A.height,N.height,C)});if(i==="horizontal"){var T=bn(0,N.height,C),P=bn(N.stackedBarStart,N.y,C);return Jr(Jr({},N),{},{y:P,height:T})}var L=bn(0,N.width,C),I=bn(N.stackedBarStart,N.x,C);return Jr(Jr({},N),{},{width:L,x:I})});return C>0&&(n.current=_??null),_==null?null:y.createElement(lr,null,y.createElement(P2e,{props:t,data:_}))}),y.createElement(IO,{label:t.label}),t.children)}function D2e(e){var t=y.useRef(null);return y.createElement(M2e,{previousRectanglesRef:t,props:e})}var pK=0,R2e=(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 I2e extends y.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:c,id:f}=this.props;if(t||n==null)return null;var h=Mt("recharts-bar",i),d=f;return y.createElement(lr,{className:h,id:f},l&&y.createElement("defs",null,y.createElement(iK,{clipPathId:d,xAxisId:a,yAxisId:o})),y.createElement(lr,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},y.createElement(N2e,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),y.createElement(D2e,this.props)))}}var L2e={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 z2e(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:f,isAnimationActive:h}=e,{needClip:d}=WO(t,n),g=Tc(),v=Yr(),b=$O(e.children,og),w=Ie(C=>f2e(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(rK,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:R2e,errorBarOffset:S},y.createElement(I2e,Xl({},e,{layout:g,needClip:d,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:f,isAnimationActive:h})))}function $2e(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:f,yAxisTicks:h,stackedData:d,displayedData:g,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?c:l,C=d?j.scale.domain():null,_=Lxe({numericAxis:j}),N=j.scale.map(_);return g.map((O,A)=>{var T,P,L,I,F,$;if(d){var G=d[A+S];if(G==null)return null;T=Txe(G,C)}else T=en(O,n),Array.isArray(T)||(T=[_,T]);var D=XTe(r,pK)(T[1],A);if(t==="horizontal"){var V,z=c.scale.map(T[0]),q=c.scale.map(T[1]);if(z==null||q==null)return null;P=ML({axis:l,ticks:f,bandSize:o,offset:a.offset,entry:O,index:A}),L=(V=q??z)!==null&&V!==void 0?V:void 0,I=a.size;var X=z-q;if(F=wo(X)?0:X,$={x:P,y:v.top,width:I,height:v.height},Math.abs(D)>0&&Math.abs(F)<Math.abs(D)){var K=vr(F||D)*(Math.abs(D)-Math.abs(F));L-=K,F+=K}}else{var R=l.scale.map(T[0]),H=l.scale.map(T[1]);if(R==null||H==null)return null;if(P=R,L=ML({axis:c,ticks:h,bandSize:o,offset:a.offset,entry:O,index:A}),I=H-R,F=a.size,$={x:v.left,y:L,width:v.width,height:F},Math.abs(D)>0&&Math.abs(I)<Math.abs(D)){var U=vr(I||D)*(Math.abs(D)-Math.abs(I));I+=U}}if(P==null||L==null||I==null||F==null||!i&&(I===0||F===0))return null;var B=Jr(Jr({},O),{},{stackedBarStart:N,x:P,y:L,width:I,height:F,value:d?T:T[1],payload:O,background:$,tooltipPosition:{x:P+I/2,y:L+F/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return B}).filter(Boolean)}function B2e(e){var t=Zn(e,L2e),n=p2e(t.stackId),r=Yr();return y.createElement(VO,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(qV,{legendPayload:C2e(t)}),y.createElement(k2e,{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(KV,{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(z2e,Xl({},t,{id:i})))))}var qC=y.memo(B2e,Hd);qC.displayName="Bar";var F2e=["domain","range"],U2e=["domain","range"];function Z4(e,t){if(e==null)return{};var n,r,i=H2e(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 H2e(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 J4(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 gK(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=Z4(e,F2e),{domain:a,range:o}=t,l=Z4(t,U2e);return!J4(n,a)||!J4(r,o)?!1:Hd(i,l)}var q2e=["type"],V2e=["dangerouslySetInnerHTML","ticks","scale"],K2e=["id","scale"];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)}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 t5(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){Y2e(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 Y2e(e,t,n){return(t=X2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X2e(e){var t=G2e(e,"string");return typeof t=="symbol"?t:t+""}function G2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KC(e,t){if(e==null)return{};var n,r,i=W2e(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 W2e(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 Q2e(e){var t=tn(),n=y.useRef(null),r=Vq(),{type:i}=e,a=KC(e,q2e),o=wb(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return t5(t5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(HAe(l)):n.current!==l&&t(qAe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(VAe(n.current)),n.current=null)},[t]),null}var Z2e=e=>{var{xAxisId:t,className:n}=e,r=Ie(dA),i=Yr(),a="xAxis",o=Ie(j=>q7(j,a,t,i)),l=Ie(j=>F7(j,t)),c=Ie(j=>AEe(j,t)),f=Ie(j=>S7(j,t));if(l==null||c==null||f==null)return null;var{dangerouslySetInnerHTML:h,ticks:d,scale:g}=e,v=KC(e,V2e),{id:b,scale:w}=f,S=KC(f,K2e);return y.createElement(XO,VC({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:Mt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},J2e={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},ePe=e=>{var t=Zn(e,J2e);return y.createElement(y.Fragment,null,y.createElement(Q2e,{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(Z2e,t))},JO=y.memo(ePe,gK);JO.displayName="XAxis";var tPe=["type"],nPe=["dangerouslySetInnerHTML","ticks","scale"],rPe=["id","scale"];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 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 r5(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){iPe(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 iPe(e,t,n){return(t=aPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aPe(e){var t=oPe(e,"string");return typeof t=="symbol"?t:t+""}function oPe(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 XC(e,t){if(e==null)return{};var n,r,i=sPe(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 sPe(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 lPe(e){var t=tn(),n=y.useRef(null),r=Vq(),{type:i}=e,a=XC(e,tPe),o=wb(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return r5(r5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(KAe(l)):n.current!==l&&t(YAe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(XAe(n.current)),n.current=null)},[t]),null}function uPe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=Ie(dA),c=Yr(),f=tn(),h="yAxis",d=Ie(A=>U7(A,t)),g=Ie(A=>TEe(A,t)),v=Ie(A=>q7(A,h,t,c)),b=Ie(A=>j7(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!d||RO(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(d.width)!==Math.round(T)&&f(GAe({id:t,width:T}))}}},[v,d,f,i,t,r,b]),d==null||g==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:j}=e,C=XC(e,nPe),{id:_,scale:N}=b,O=XC(b,rPe);return y.createElement(XO,YC({},C,O,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:Mt("recharts-".concat(h," ").concat(h),n),viewBox:l,ticks:v,axisType:h,axisId:t}))}var cPe={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},fPe=e=>{var t=Zn(e,cPe);return y.createElement(y.Fragment,null,y.createElement(lPe,{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(uPe,t))},eT=y.memo(fPe,gK);eT.displayName="YAxis";var dPe=(e,t)=>t,tT=le([dPe,Ft,R9,br,sV,Ds,J_e,ur],oCe);function hPe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nT(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(hPe(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 vK=Bi("mouseClick"),yK=Fp();yK.startListening({actionCreator:vK,effect:(e,t)=>{var n=e.payload,r=tT(t.getState(),nT(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(YEe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var GC=Bi("mouseMove"),xK=Fp(),kf=null,ku=null,DE=null;xK.startListening({actionCreator:GC,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"));kf!==null&&(cancelAnimationFrame(kf),kf=null),ku!==null&&(typeof i!="number"||!o)&&(clearTimeout(ku),ku=null),DE=nT(n);var l=()=>{var c=t.getState(),f=jO(c,c.tooltip.settings.shared);if(!DE){kf=null,ku=null;return}if(f==="axis"){var h=tT(c,DE);(h==null?void 0:h.activeIndex)!=null?t.dispatch(Z7({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate})):t.dispatch(Q7())}kf=null,ku=null};if(!o){l();return}i==="raf"?kf=requestAnimationFrame(l):typeof i=="number"&&ku===null&&(ku=setTimeout(l,i))}});function mPe(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 i5={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},bK=Kr({name:"rootProps",initialState:i5,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:i5.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}}}),pPe=bK.reducer,{updateOptions:gPe}=bK.actions,vPe=null,yPe={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)},wK=Kr({name:"polarOptions",initialState:vPe,reducers:yPe}),{updatePolarOptions:xPe}=wK.actions,bPe=wK.reducer,SK=Bi("keyDown"),jK=Bi("focus"),EK=Bi("blur"),Fb=Fp(),Nf=null,Nu=null,ly=null;Fb.startListening({actionCreator:SK,effect:(e,t)=>{ly=e.payload,Nf!==null&&(cancelAnimationFrame(Nf),Nf=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Nu!==null&&(typeof r!="number"||!a)&&(clearTimeout(Nu),Nu=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:f}=l.tooltip,h=ly;if(h!=="ArrowRight"&&h!=="ArrowLeft"&&h!=="Enter")return;var d=EO(f,Qd(l),ng(l),ig(l)),g=d==null?-1:Number(d);if(!Number.isFinite(g)||g<0)return;var v=Ds(l);if(h==="Enter"){var b=qx(l,"axis","hover",String(f.index));t.dispatch(Hx({active:!f.active,activeIndex:f.index,activeCoordinate:b}));return}var w=IEe(l),S=w==="left-to-right"?1:-1,j=h==="ArrowRight"?1:-1,C=g+j*S;if(v==null||C>=v.length||C<0)return;var _=qx(l,"axis","hover",String(C));t.dispatch(Hx({active:!0,activeIndex:C.toString(),activeCoordinate:_}))}finally{Nf=null,Nu=null}};if(!a){o();return}r==="raf"?Nf=requestAnimationFrame(o):typeof r=="number"&&Nu===null&&(o(),ly=null,Nu=setTimeout(()=>{ly?o():(Nu=null,Nf=null)},r))}});Fb.startListening({actionCreator:jK,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=qx(n,"axis","hover",String(a));t.dispatch(Hx({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Fb.startListening({actionCreator:EK,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Hx({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function _K(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"),CK=Fp(),uy=new Map,cm=new Map,RE=new Map;CK.startListening({actionCreator:ta,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=_K(r);RE.set(i,{handler:n,reactEvent:a});var o=uy.get(i);o!==void 0&&(cancelAnimationFrame(o),uy.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:f}=l.eventSettings,h=f,d=h==="all"||(h==null?void 0:h.includes(i)),g=cm.get(i);g!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(g),cm.delete(i));var v=()=>{var S=RE.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,_=t.getState(),N={activeCoordinate:L_e(_),activeDataKey:AO(_),activeIndex:Kl(_),activeLabel:cV(_),activeTooltipIndex:Kl(_),isTooltipActive:z_e(_)};j&&j(N,C)}finally{uy.delete(i),cm.delete(i),RE.delete(i)}};if(!d){v();return}if(c==="raf"){var b=requestAnimationFrame(v);uy.set(i,b)}else if(typeof c=="number"){if(!cm.has(i)){v();var w=setTimeout(v,c);cm.set(i,w)}}else v()}}});var wPe=le([Gd],e=>e.tooltipItemPayloads),SPe=le([wPe,(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)}}}),kK=Bi("touchMove"),NK=Fp(),Au=null,pl=null,a5=null,fm=null;NK.startListening({actionCreator:kK,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){fm=_K(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Au!==null&&(cancelAnimationFrame(Au),Au=null),pl!==null&&(typeof i!="number"||!o)&&(clearTimeout(pl),pl=null),a5=Array.from(n.touches).map(c=>nT({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(fm!=null){var c=t.getState(),f=jO(c,c.tooltip.settings.shared);if(f==="axis"){var h,d=(h=a5)===null||h===void 0?void 0:h[0];if(d==null){Au=null,pl=null;return}var g=tT(c,d);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(Z7({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="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($q),j=(v=w.getAttribute(Bq))!==null&&v!==void 0?v:void 0,C=Wd(c).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:_}=C,N=SPe(c,S,j);t.dispatch(W7({activeDataKey:_,activeIndex:S,activeCoordinate:N,activeGraphicalItemId:j}))}Au=null,pl=null}};if(!o){l();return}i==="raf"?Au=requestAnimationFrame(l):typeof i=="number"&&pl===null&&(l(),fm=null,pl=setTimeout(()=>{fm?l():(pl=null,Au=null)},i))}}});var rT={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},AK=Kr({name:"eventSettings",initialState:rT,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:jPe}=AK.actions,EPe=AK.reducer,_Pe=sq({brush:mOe,cartesianAxis:WAe,chartData:LCe,errorBars:hTe,eventSettings:EPe,graphicalItems:eAe,layout:Cxe,legend:M0e,options:PCe,polarAxis:hNe,polarOptions:bPe,referenceElements:yOe,renderedTicks:ROe,rootProps:pPe,tooltip:XEe,zIndex:bCe}),CPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Qye({reducer:_Pe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([yK.middleware,xK.middleware,Fb.middleware,CK.middleware,NK.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Sq({type:"raf"}))},devTools:{serialize:{replacer:mPe},name:"recharts-".concat(n)}})};function OK(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=CPe(t,r));var o=aA;return y.createElement(G0e,{context:o,store:a.current},n)}function kPe(e){var{layout:t,margin:n}=e,r=tn(),i=Yr();return y.useEffect(()=>{i||(r(jxe(t)),r(Sxe(n)))},[r,i,t,n]),null}var TK=y.memo(kPe,Hd);function PK(e){var t=tn();return y.useEffect(()=>{t(gPe(e))},[t,e]),null}var NPe=e=>{var t=tn();return y.useEffect(()=>{t(jPe(e))},[t,e]),null},MK=y.memo(NPe,Hd);function o5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=tn();return y.useLayoutEffect(()=>(r.current&&i(yCe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(xCe({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function s5(e){var{children:t,isPanorama:n}=e,r=Ie(lCe);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(o5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(o5,{key:o,zIndex:o,isPanorama:n})))}var APe=["children"];function OPe(e,t){if(e==null)return{};var n,r,i=TPe(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 TPe(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 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)}var PPe={width:"100%",height:"100%",display:"block"},MPe=y.forwardRef((e,t)=>{var n=gA(),r=vA(),i=a9();if(!jo(n)||!jo(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=e,f,h;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?h=o.role:h=i?"application":void 0),y.createElement(GN,Qx({},o,{title:l,desc:c,role:h,tabIndex:f,width:n,height:r,style:PPe,ref:t}),a)}),DPe=e=>{var{children:t}=e,n=Ie(mb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(GN,{width:r,height:i,x:o,y:a},t)},l5=y.forwardRef((e,t)=>{var{children:n}=e,r=OPe(e,APe),i=Yr();return i?y.createElement(DPe,null,y.createElement(s5,{isPanorama:!0},n)):y.createElement(MPe,Qx({ref:t},r),y.createElement(s5,{isPanorama:!1},n))});function RPe(){var e=tn(),[t,n]=y.useState(null),r=Ie(Hxe);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Ot(a)&&a!==r&&e(_xe(a))}},[t,e,r]),n}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 IPe(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){LPe(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 LPe(e,t,n){return(t=zPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zPe(e){var t=$Pe(e,"string");return typeof t=="symbol"?t:t+""}function $Pe(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 zl(){return zl=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},zl.apply(null,arguments)}var BPe=()=>(KCe(),null);function Zx(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var FPe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:Zx((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Zx((r=e.style)===null||r===void 0?void 0:r.height)}),l=y.useCallback((f,h)=>{o(d=>{var g=Math.round(f),v=Math.round(h);return d.containerWidth===g&&d.containerHeight===v?d:{containerWidth:g,containerHeight:v}})},[]),c=y.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null&&typeof ResizeObserver<"u"){var{width:h,height:d}=f.getBoundingClientRect();l(h,d);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(f),i.current=v}},[t,l]);return y.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[l]),y.createElement(y.Fragment,null,y.createElement(Hp,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",zl({ref:c},e)))}),UPe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:Zx(n),containerHeight:Zx(r)}),o=y.useCallback((c,f)=>{a(h=>{var d=Math.round(c),g=Math.round(f);return h.containerWidth===d&&h.containerHeight===g?h:{containerWidth:d,containerHeight:g}})},[]),l=y.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:f,height:h}=c.getBoundingClientRect();o(f,h)}},[t,o]);return y.createElement(y.Fragment,null,y.createElement(Hp,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",zl({ref:l},e)))}),HPe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(Hp,{width:n,height:r}),y.createElement("div",zl({ref:t},e)))}),qPe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(UPe,zl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(HPe,zl({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(Hp,{width:n,height:r}),y.createElement("div",zl({ref:t},e)))});function VPe(e){return e?FPe:qPe}var KPe=y.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:f,onMouseLeave:h,onMouseMove:d,onMouseUp:g,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:j,responsive:C,dispatchTouchEvents:_=!0}=e,N=y.useRef(null),O=tn(),[A,T]=y.useState(null),[P,L]=y.useState(null),I=RPe(),F=hA(),$=(F==null?void 0:F.width)>0?F.width:j,G=(F==null?void 0:F.height)>0?F.height:i,D=y.useCallback(se=>{I(se),typeof t=="function"&&t(se),T(se),L(se),se!=null&&(N.current=se)},[I,t,T,L]),V=y.useCallback(se=>{O(vK(se)),O(ta({handler:a,reactEvent:se}))},[O,a]),z=y.useCallback(se=>{O(GC(se)),O(ta({handler:f,reactEvent:se}))},[O,f]),q=y.useCallback(se=>{O(Q7()),O(ta({handler:h,reactEvent:se}))},[O,h]),X=y.useCallback(se=>{O(GC(se)),O(ta({handler:d,reactEvent:se}))},[O,d]),K=y.useCallback(()=>{O(jK())},[O]),R=y.useCallback(()=>{O(EK())},[O]),H=y.useCallback(se=>{O(SK(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(kK(se)),O(ta({handler:b,reactEvent:se}))},[O,_,b]),re=y.useCallback(se=>{O(ta({handler:v,reactEvent:se}))},[O,v]),ee=VPe(C);return y.createElement(yV.Provider,{value:A},y.createElement(wH.Provider,{value:P},y.createElement(ee,{width:$??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:Mt("recharts-wrapper",r),style:IPe({position:"relative",cursor:"default",width:$,height:G},S),onClick:V,onContextMenu:U,onDoubleClick:B,onFocus:K,onBlur:R,onKeyDown:H,onMouseDown:Q,onMouseEnter:z,onMouseLeave:q,onMouseMove:X,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:D},y.createElement(BPe,null),n)))}),YPe=["width","height","responsive","children","className","style","compact","title","desc"];function XPe(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}var DK=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:f,desc:h}=e,d=XPe(e,YPe),g=$i(d);return c?y.createElement(y.Fragment,null,y.createElement(Hp,{width:n,height:r}),y.createElement(l5,{otherAttributes:g,title:f,desc:h},a)):y.createElement(KPe,{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(l5,{otherAttributes:g,title:f,desc:h,ref:t},y.createElement(bOe,null,a)))});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 c5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WPe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c5(Object(n),!0).forEach(function(r){QPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QPe(e,t,n){return(t=ZPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZPe(e){var t=JPe(e,"string");return typeof t=="symbol"?t:t+""}function JPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eMe={top:5,right:5,bottom:5,left:5},tMe=WPe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:eMe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},rT),RK=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,tMe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:f}=t,h={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return y.createElement(OK,{preloadedState:{options:h},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},y.createElement(WV,{chartData:f.data}),y.createElement(TK,{layout:i.layout,margin:i.margin}),y.createElement(MK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(PK,{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(DK,WC({},i,{ref:n})))}),nMe=["axis"],rMe=y.forwardRef((e,t)=>y.createElement(RK,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:nMe,tooltipPayloadSearcher:DO,categoricalChartProps:e,ref:t})),iMe=["axis","item"],aMe=y.forwardRef((e,t)=>y.createElement(RK,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:iMe,tooltipPayloadSearcher:DO,categoricalChartProps:e,ref:t}));function oMe(e){var t=tn();return y.useEffect(()=>{t(xPe(e))},[t,e]),null}var sMe=["layout"];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 lMe(e,t){if(e==null)return{};var n,r,i=uMe(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 uMe(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 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 cMe(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){fMe(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 fMe(e,t,n){return(t=dMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dMe(e){var t=hMe(e,"string");return typeof t=="symbol"?t:t+""}function hMe(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 mMe={top:5,right:5,bottom:5,left:5},IK=cMe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:mMe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rT),pMe=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,IK),{layout:a}=i,o=lMe(i,sMe),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h}=t,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h,eventEmitter:void 0};return y.createElement(OK,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(WV,{chartData:i.data}),y.createElement(TK,{layout:a,margin:i.margin}),y.createElement(MK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(PK,{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(oMe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(DK,QC({},o,{ref:n})))});function d5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function h5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(n),!0).forEach(function(r){gMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gMe(e,t,n){return(t=vMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vMe(e){var t=yMe(e,"string");return typeof t=="symbol"?t:t+""}function yMe(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 xMe=["item"],bMe=h5(h5({},IK),{},{layout:"centric",startAngle:0,endAngle:360}),wMe=y.forwardRef((e,t)=>{var n=Zn(e,bMe);return y.createElement(pMe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:xMe,tooltipPayloadSearcher:DO,categoricalChartProps:n,ref:t})});function SMe({completed:e,failed:t}){const n=e+t;if(n===0)return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsxs("div",{className:"relative h-32 w-32",children:[m.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:m.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),m.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:m.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 m.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[m.jsx(mA,{width:140,height:140,children:m.jsx(wMe,{children:m.jsx(YV,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>m.jsx(og,{fill:a[l]},l))})})}),m.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:m.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function m5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function jMe({data:e}){return e.some(n=>n.total>0)?m.jsx(mA,{width:"100%",height:280,children:m.jsxs(aMe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[m.jsx(GO,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),m.jsx(JO,{dataKey:"date",tickFormatter:m5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(eT,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(wV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>m5(String(n))}),m.jsx(r9,{wrapperStyle:{fontSize:12,paddingTop:8}}),m.jsx(qC,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),m.jsx(qC,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):m.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function p5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function EMe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function _Me({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return m.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 m.jsx(mA,{width:"100%",height:280,children:m.jsxs(rMe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[m.jsx(GO,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),m.jsx(JO,{dataKey:"date",tickFormatter:p5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(eT,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),m.jsx(wV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>p5(String(r)),formatter:r=>[EMe(Number(r)*6e4),"Avg Duration"]}),m.jsx(fK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const CMe=["7d","30d","90d"];function kMe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function LK({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=mge(e,t);return i?m.jsxs("div",{className:"space-y-4",children:[m.jsx(hn,{className:"h-8 w-48"}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(hn,{className:"h-32"}),m.jsx(hn,{className:"h-32"}),m.jsx(hn,{className:"h-32"})]}),m.jsx(hn,{className:"h-72"})]}):r?m.jsxs("div",{className:"space-y-6",children:[m.jsx("div",{className:"flex gap-1",children:CMe.map(a=>m.jsx(Se,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsxs(kn,{children:[m.jsx(Gh,{className:"pb-2",children:m.jsx(Wh,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),m.jsxs(Nn,{children:[m.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),m.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),m.jsxs(kn,{children:[m.jsx(Gh,{className:"pb-2",children:m.jsx(Wh,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),m.jsx(Nn,{className:"h-36",children:m.jsx(SMe,{completed:r.completed,failed:r.failed})})]}),m.jsxs(kn,{children:[m.jsx(Gh,{className:"pb-2",children:m.jsx(Wh,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),m.jsxs(Nn,{children:[m.jsx("div",{className:"text-3xl font-bold",children:kMe(r.avg_duration_ms)}),m.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),m.jsxs(kn,{children:[m.jsx(Gh,{children:m.jsx(Wh,{className:"text-base",children:"Run Frequency"})}),m.jsx(Nn,{children:m.jsx(jMe,{data:r.daily})})]}),m.jsxs(kn,{children:[m.jsx(Gh,{children:m.jsx(Wh,{className:"text-base",children:"Duration Trends"})}),m.jsx(Nn,{children:m.jsx(_Me,{data:r.daily})})]})]}):null}function NMe(){return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-48"}),m.jsx(hn,{className:"h-24 rounded-lg"}),m.jsx(hn,{className:"h-64 rounded-lg"})]})}function AMe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),c=y.useRef(null),f=SN(e);function h(v){v.stopPropagation(),l(n??""),a(!0),setTimeout(()=>{var b;return(b=c.current)==null?void 0:b.select()},0)}function d(v){v.stopPropagation();const b=o.trim();f.mutate({conversationId:t,title:b||null}),a(!1)}function g(v){v.key==="Enter"&&(v.preventDefault(),d(v)),v.key==="Escape"&&(v.stopPropagation(),a(!1))}return i?m.jsx(et,{ref:c,value:o,onChange:v=>l(v.target.value),onBlur:d,onKeyDown:g,onClick:v=>v.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):m.jsxs("div",{className:"flex items-center gap-1.5 group",children:[m.jsx("span",{className:"font-medium",children:n??r}),m.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:h,"aria-label":"Rename",children:m.jsx(Np,{className:"h-3 w-3"})})]})}function OMe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=YF(e);return r?m.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[m.jsx(Se,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):m.jsx(Se,{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:m.jsx(Ya,{className:"h-3.5 w-3.5"})})}const g5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function TMe(){var I,F,$;const{projectId:e}=gp(),t=Number(e),n=xa(),r=xN(t),[i,a]=y.useState(1),[o]=y.useState(1),l=GF(t,i),c=$d(t),f=wN(t,o),h=UF(),[d,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 m.jsx(NMe,{});if(C)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",C.message]})]});if(!r.data)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsx("span",{children:"Project not found"})]});const _=r.data,N=l.data,O=(N==null?void 0:N.items)??[],A=(N==null?void 0:N.total)??0,T=N?Math.ceil(N.total/N.per_page):0,P=c.data??[],L=P.reduce((G,D)=>(G[D.type]=(G[D.type]||0)+1,G),{});return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(Se,{variant:"outline",size:"sm",asChild:!0,children:m.jsxs(Pr,{to:"/projects",children:[m.jsx(M0,{className:"mr-2 h-4 w-4"}),"Back"]})}),m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:_.display_name})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs(Se,{disabled:!_.dir_exists||h.isPending,onClick:()=>{h.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[m.jsx(kp,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),m.jsxs(Se,{variant:"outline",onClick:()=>g(!0),disabled:!_.dir_exists,children:[m.jsx(L0,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),m.jsxs(Se,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[m.jsx(I0,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),m.jsx(kn,{children:m.jsx(Nn,{className:"pt-6",children:m.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),m.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[_.working_dir,_.dir_exists?m.jsx(pt,{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"}):m.jsx(pt,{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"})]}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),m.jsx("dd",{children:new Date(_.created_at).toLocaleString()}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),m.jsx("dd",{children:P.length===0?m.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):m.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(L).map(([G,D])=>m.jsxs(pt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[D," ",D===1?g5[G]??G:`${g5[G]??G}s`]},G))})})]})})}),m.jsx(yue,{projectId:t,open:d,onOpenChange:g}),m.jsx(YN,{open:v,onOpenChange:b,projectId:t}),m.jsxs(Mp,{value:w,onValueChange:S,children:[m.jsxs(Dp,{children:[m.jsxs(or,{value:"conversations",children:["Conversations (",((I=f.data)==null?void 0:I.total)??0,")"]}),m.jsxs(or,{value:"sessions",children:["Sessions (",A,")"]}),m.jsx(or,{value:"activity",children:"Activity"}),m.jsxs(or,{value:"resources",children:["Resources (",P.length,")"]}),m.jsx(or,{value:"files",children:"Files"})]}),m.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:A===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):m.jsxs(m.Fragment,{children:[m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsx(Zy,{sessions:O})})}),m.jsx(NN,{page:i,totalPages:T,onPageChange:a})]})}),m.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(((F=f.data)==null?void 0:F.items)??[]).length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[m.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),m.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),m.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),m.jsx("th",{className:"px-4 py-2"})]})}),m.jsx("tbody",{children:((($=f.data)==null?void 0:$.items)??[]).map(G=>m.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${G.id}`),children:[m.jsx("td",{className:"px-4 py-2",children:m.jsx(AMe,{projectId:t,conversationId:G.id,title:G.title,fallback:`Conversation #${G.id}`})}),m.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.session_count}),m.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.last_activity?new Date(G.last_activity).toLocaleString():"—"}),m.jsx("td",{className:"px-4 py-2 text-right",children:m.jsx(OMe,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),m.jsx(sr,{value:"activity",className:"mt-4",children:m.jsx(LK,{projectId:t})}),m.jsx(sr,{value:"resources",className:"mt-4",children:m.jsx(dge,{projectId:t,installOpen:v,onInstallOpenChange:b})}),m.jsx(sr,{value:"files",className:"mt-4",children:m.jsx(cU,{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 PMe={value:()=>{}};function Ub(){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 My(n)}function My(e){this._=e}function MMe(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}})}My.prototype=Ub.prototype={constructor:My,on:function(e,t){var n=this._,r=MMe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=DMe(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]=v5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=v5(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 My(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 DMe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function v5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=PMe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ZC="http://www.w3.org/1999/xhtml";const y5={svg:"http://www.w3.org/2000/svg",xhtml:ZC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Hb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),y5.hasOwnProperty(t)?{space:y5[t],local:e}:e}function RMe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ZC&&t.documentElement.namespaceURI===ZC?t.createElement(e):t.createElementNS(n,e)}}function IMe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zK(e){var t=Hb(e);return(t.local?IMe:RMe)(t)}function LMe(){}function iT(e){return e==null?LMe:function(){return this.querySelector(e)}}function zMe(e){typeof e!="function"&&(e=iT(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,f,h=0;h<o;++h)(c=a[h])&&(f=e.call(c,c.__data__,h,a))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f);return new Ui(r,this._parents)}function $Me(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function BMe(){return[]}function $K(e){return e==null?BMe:function(){return this.querySelectorAll(e)}}function FMe(e){return function(){return $Me(e.apply(this,arguments))}}function UMe(e){typeof e=="function"?e=FMe(e):e=$K(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,f=0;f<l;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new Ui(r,i)}function BK(e){return function(){return this.matches(e)}}function FK(e){return function(t){return t.matches(e)}}var HMe=Array.prototype.find;function qMe(e){return function(){return HMe.call(this.children,e)}}function VMe(){return this.firstElementChild}function KMe(e){return this.select(e==null?VMe:qMe(typeof e=="function"?e:FK(e)))}var YMe=Array.prototype.filter;function XMe(){return Array.from(this.children)}function GMe(e){return function(){return YMe.call(this.children,e)}}function WMe(e){return this.selectAll(e==null?XMe:GMe(typeof e=="function"?e:FK(e)))}function QMe(e){typeof e!="function"&&(e=BK(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,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new Ui(r,this._parents)}function UK(e){return new Array(e.length)}function ZMe(){return new Ui(this._enter||this._groups.map(UK),this._parents)}function Jx(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Jx.prototype={constructor:Jx,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 JMe(e){return function(){return e}}function eDe(e,t,n,r,i,a){for(var o=0,l,c=t.length,f=a.length;o<f;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new Jx(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function tDe(e,t,n,r,i,a,o){var l,c,f=new Map,h=t.length,d=a.length,g=new Array(h),v;for(l=0;l<h;++l)(c=t[l])&&(g[l]=v=o.call(c,c.__data__,l,t)+"",f.has(v)?i[l]=c:f.set(v,c));for(l=0;l<d;++l)v=o.call(e,a[l],l,a)+"",(c=f.get(v))?(r[l]=c,c.__data__=a[l],f.delete(v)):n[l]=new Jx(e,a[l]);for(l=0;l<h;++l)(c=t[l])&&f.get(g[l])===c&&(i[l]=c)}function nDe(e){return e.__data__}function rDe(e,t){if(!arguments.length)return Array.from(this,nDe);var n=t?tDe:eDe,r=this._parents,i=this._groups;typeof e!="function"&&(e=JMe(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),f=0;f<a;++f){var h=r[f],d=i[f],g=d.length,v=iDe(e.call(h,h&&h.__data__,f,r)),b=v.length,w=l[f]=new Array(b),S=o[f]=new Array(b),j=c[f]=new Array(g);n(h,d,w,S,j,v,t);for(var C=0,_=0,N,O;C<b;++C)if(N=w[C]){for(C>=_&&(_=C+1);!(O=S[_])&&++_<b;);N._next=O||null}}return o=new Ui(o,r),o._enter=l,o._exit=c,o}function iDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aDe(){return new Ui(this._exit||this._groups.map(UK),this._parents)}function oDe(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 sDe(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 f=n[c],h=r[c],d=f.length,g=l[c]=new Array(d),v,b=0;b<d;++b)(v=f[b]||h[b])&&(g[b]=v);for(;c<i;++c)l[c]=n[c];return new Ui(l,this._parents)}function lDe(){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 uDe(e){e||(e=cDe);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!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),f,h=0;h<l;++h)(f=o[h])&&(c[h]=f);c.sort(t)}return new Ui(i,this._parents).order()}function cDe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function fDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dDe(){return Array.from(this)}function hDe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function mDe(){let e=0;for(const t of this)++e;return e}function pDe(){return!this.node()}function gDe(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 vDe(e){return function(){this.removeAttribute(e)}}function yDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xDe(e,t){return function(){this.setAttribute(e,t)}}function bDe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wDe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function SDe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jDe(e,t){var n=Hb(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?yDe:vDe:typeof t=="function"?n.local?SDe:wDe:n.local?bDe:xDe)(n,t))}function HK(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function EDe(e){return function(){this.style.removeProperty(e)}}function _De(e,t,n){return function(){this.style.setProperty(e,t,n)}}function CDe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function kDe(e,t,n){return arguments.length>1?this.each((t==null?EDe:typeof t=="function"?CDe:_De)(e,t,n??"")):Sd(this.node(),e)}function Sd(e,t){return e.style.getPropertyValue(t)||HK(e).getComputedStyle(e,null).getPropertyValue(t)}function NDe(e){return function(){delete this[e]}}function ADe(e,t){return function(){this[e]=t}}function ODe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function TDe(e,t){return arguments.length>1?this.each((t==null?NDe:typeof t=="function"?ODe:ADe)(e,t)):this.node()[e]}function qK(e){return e.trim().split(/^|\s+/)}function aT(e){return e.classList||new VK(e)}function VK(e){this._node=e,this._names=qK(e.getAttribute("class")||"")}VK.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 KK(e,t){for(var n=aT(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function YK(e,t){for(var n=aT(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function PDe(e){return function(){KK(this,e)}}function MDe(e){return function(){YK(this,e)}}function DDe(e,t){return function(){(t.apply(this,arguments)?KK:YK)(this,e)}}function RDe(e,t){var n=qK(e+"");if(arguments.length<2){for(var r=aT(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?DDe:t?PDe:MDe)(n,t))}function IDe(){this.textContent=""}function LDe(e){return function(){this.textContent=e}}function zDe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $De(e){return arguments.length?this.each(e==null?IDe:(typeof e=="function"?zDe:LDe)(e)):this.node().textContent}function BDe(){this.innerHTML=""}function FDe(e){return function(){this.innerHTML=e}}function UDe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function HDe(e){return arguments.length?this.each(e==null?BDe:(typeof e=="function"?UDe:FDe)(e)):this.node().innerHTML}function qDe(){this.nextSibling&&this.parentNode.appendChild(this)}function VDe(){return this.each(qDe)}function KDe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function YDe(){return this.each(KDe)}function XDe(e){var t=typeof e=="function"?e:zK(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GDe(){return null}function WDe(e,t){var n=typeof e=="function"?e:zK(e),r=t==null?GDe:typeof t=="function"?t:iT(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function QDe(){var e=this.parentNode;e&&e.removeChild(this)}function ZDe(){return this.each(QDe)}function JDe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eRe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tRe(e){return this.select(e?eRe:JDe)}function nRe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rRe(e){return function(t){e.call(this,t,this.__data__)}}function iRe(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 aRe(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 oRe(e,t,n){return function(){var r=this.__on,i,a=rRe(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 sRe(e,t,n){var r=iRe(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,h;c<f;++c)for(i=0,h=l[c];i<a;++i)if((o=r[i]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?oRe:aRe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function XK(e,t,n){var r=HK(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 lRe(e,t){return function(){return XK(this,e,t)}}function uRe(e,t){return function(){return XK(this,e,t.apply(this,arguments))}}function cRe(e,t){return this.each((typeof t=="function"?uRe:lRe)(e,t))}function*fRe(){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 GK=[null];function Ui(e,t){this._groups=e,this._parents=t}function lg(){return new Ui([[document.documentElement]],GK)}function dRe(){return this}Ui.prototype=lg.prototype={constructor:Ui,select:zMe,selectAll:UMe,selectChild:KMe,selectChildren:WMe,filter:QMe,data:rDe,enter:ZMe,exit:aDe,join:oDe,merge:sDe,selection:dRe,order:lDe,sort:uDe,call:fDe,nodes:dDe,node:hDe,size:mDe,empty:pDe,each:gDe,attr:jDe,style:kDe,property:TDe,classed:RDe,text:$De,html:HDe,raise:VDe,lower:YDe,append:XDe,insert:WDe,remove:ZDe,clone:tRe,datum:nRe,on:sRe,dispatch:cRe,[Symbol.iterator]:fRe};function Mi(e){return typeof e=="string"?new Ui([[document.querySelector(e)]],[document.documentElement]):new Ui([[e]],GK)}function hRe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ta(e,t){if(e=hRe(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 mRe={passive:!1},Jm={capture:!0,passive:!1};function IE(e){e.stopImmediatePropagation()}function Vf(e){e.preventDefault(),e.stopImmediatePropagation()}function WK(e){var t=e.document.documentElement,n=Mi(e).on("dragstart.drag",Vf,Jm);"onselectstart"in t?n.on("selectstart.drag",Vf,Jm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function QK(e,t){var n=e.document.documentElement,r=Mi(e).on("dragstart.drag",null);t&&(r.on("click.drag",Vf,Jm),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const cy=e=>()=>e;function JC(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:f,dispatch:h}){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:f,enumerable:!0,configurable:!0},_:{value:h}})}JC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pRe(e){return!e.ctrlKey&&!e.button}function gRe(){return this.parentNode}function vRe(e,t){return t??{x:e.x,y:e.y}}function yRe(){return navigator.maxTouchPoints||"ontouchstart"in this}function ZK(){var e=pRe,t=gRe,n=vRe,r=yRe,i={},a=Ub("start","drag","end"),o=0,l,c,f,h,d=0;function g(N){N.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,mRe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,O){if(!(h||!e.call(this,N,O))){var A=_(this,t.call(this,N,O),N,O,"mouse");A&&(Mi(N.view).on("mousemove.drag",b,Jm).on("mouseup.drag",w,Jm),WK(N.view),IE(N),f=!1,l=N.clientX,c=N.clientY,A("start",N))}}function b(N){if(Vf(N),!f){var O=N.clientX-l,A=N.clientY-c;f=O*O+A*A>d}i.mouse("drag",N)}function w(N){Mi(N.view).on("mousemove.drag mouseup.drag",null),QK(N.view,f),Vf(N),i.mouse("end",N)}function S(N,O){if(e.call(this,N,O)){var A=N.changedTouches,T=t.call(this,N,O),P=A.length,L,I;for(L=0;L<P;++L)(I=_(this,T,N,O,A[L].identifier,A[L]))&&(IE(N),I("start",N,A[L]))}}function j(N){var O=N.changedTouches,A=O.length,T,P;for(T=0;T<A;++T)(P=i[O[T].identifier])&&(Vf(N),P("drag",N,O[T]))}function C(N){var O=N.changedTouches,A=O.length,T,P;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),T=0;T<A;++T)(P=i[O[T].identifier])&&(IE(N),P("end",N,O[T]))}function _(N,O,A,T,P,L){var I=a.copy(),F=Ta(L||A,O),$,G,D;if((D=n.call(N,new JC("beforestart",{sourceEvent:A,target:g,identifier:P,active:o,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),T))!=null)return $=D.x-F[0]||0,G=D.y-F[1]||0,function V(z,q,X){var K=F,R;switch(z){case"start":i[P]=V,R=o++;break;case"end":delete i[P],--o;case"drag":F=Ta(X||q,O),R=o;break}I.call(z,N,new JC(z,{sourceEvent:q,subject:D,target:g,identifier:P,active:R,x:F[0]+$,y:F[1]+G,dx:F[0]-K[0],dy:F[1]-K[1],dispatch:I}),T)}}return g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:cy(!!N),g):e},g.container=function(N){return arguments.length?(t=typeof N=="function"?N:cy(N),g):t},g.subject=function(N){return arguments.length?(n=typeof N=="function"?N:cy(N),g):n},g.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:cy(!!N),g):r},g.on=function(){var N=a.on.apply(a,arguments);return N===a?g:N},g.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,g):Math.sqrt(d)},g}var jd=0,wm=0,dm=0,JK=1e3,e0,Sm,t0=0,wc=0,qb=0,ep=typeof performance=="object"&&performance.now?performance:Date,eY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oT(){return wc||(eY(xRe),wc=ep.now()+qb)}function xRe(){wc=0}function n0(){this._call=this._time=this._next=null}n0.prototype=tY.prototype={constructor:n0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?oT():+n)+(t==null?0:+t),!this._next&&Sm!==this&&(Sm?Sm._next=this:e0=this,Sm=this),this._call=e,this._time=n,ek()},stop:function(){this._call&&(this._call=null,this._time=1/0,ek())}};function tY(e,t,n){var r=new n0;return r.restart(e,t,n),r}function bRe(){oT(),++jd;for(var e=e0,t;e;)(t=wc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--jd}function x5(){wc=(t0=ep.now())+qb,jd=wm=0;try{bRe()}finally{jd=0,SRe(),wc=0}}function wRe(){var e=ep.now(),t=e-t0;t>JK&&(qb-=t,t0=e)}function SRe(){for(var e,t=e0,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:e0=n);Sm=e,ek(r)}function ek(e){if(!jd){wm&&(wm=clearTimeout(wm));var t=e-wc;t>24?(e<1/0&&(wm=setTimeout(x5,e-ep.now()-qb)),dm&&(dm=clearInterval(dm))):(dm||(t0=ep.now(),dm=setInterval(wRe,JK)),jd=1,eY(x5))}}function b5(e,t,n){var r=new n0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var jRe=Ub("start","end","cancel","interrupt"),ERe=[],nY=0,w5=1,tk=2,Dy=3,S5=4,nk=5,Ry=6;function Vb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;_Re(e,n,{name:t,index:r,group:i,on:jRe,tween:ERe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:nY})}function sT(e,t){var n=Ga(e,t);if(n.state>nY)throw new Error("too late; already scheduled");return n}function Mo(e,t){var n=Ga(e,t);if(n.state>Dy)throw new Error("too late; already running");return n}function Ga(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _Re(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=tY(a,0,n.time);function a(f){n.state=w5,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var h,d,g,v;if(n.state!==w5)return c();for(h in r)if(v=r[h],v.name===n.name){if(v.state===Dy)return b5(o);v.state===S5?(v.state=Ry,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[h]):+h<t&&(v.state=Ry,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[h])}if(b5(function(){n.state===Dy&&(n.state=S5,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=tk,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tk){for(n.state=Dy,i=new Array(g=n.tween.length),h=0,d=-1;h<g;++h)(v=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=v);i.length=d+1}}function l(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=nk,1),d=-1,g=i.length;++d<g;)i[d].call(e,h);n.state===nk&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ry,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Iy(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>tk&&r.state<nk,r.state=Ry,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function CRe(e){return this.each(function(){Iy(this,e)})}function kRe(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 NRe(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,f=i.length;c<f;++c)if(i[c].name===t){i[c]=l;break}c===f&&i.push(l)}a.tween=i}}function ARe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ga(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?kRe:NRe)(n,e,t))}function lT(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 Ga(i,r).value[t]}}function rY(e,t){var n;return(typeof t=="number"?Pa:t instanceof xc?Dx:(n=xc(t))?(t=n,Dx):V9)(e,t)}function ORe(e){return function(){this.removeAttribute(e)}}function TRe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PRe(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 MRe(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 DRe(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 RRe(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 IRe(e,t){var n=Hb(e),r=n==="transform"?z1e:rY;return this.attrTween(e,typeof t=="function"?(n.local?RRe:DRe)(n,r,lT(this,"attr."+e,t)):t==null?(n.local?TRe:ORe)(n):(n.local?MRe:PRe)(n,r,t))}function LRe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function zRe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function $Re(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&zRe(e,a)),n}return i._value=t,i}function BRe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&LRe(e,a)),n}return i._value=t,i}function FRe(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=Hb(e);return this.tween(n,(r.local?$Re:BRe)(r,t))}function URe(e,t){return function(){sT(this,e).delay=+t.apply(this,arguments)}}function HRe(e,t){return t=+t,function(){sT(this,e).delay=t}}function qRe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?URe:HRe)(t,e)):Ga(this.node(),t).delay}function VRe(e,t){return function(){Mo(this,e).duration=+t.apply(this,arguments)}}function KRe(e,t){return t=+t,function(){Mo(this,e).duration=t}}function YRe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?VRe:KRe)(t,e)):Ga(this.node(),t).duration}function XRe(e,t){if(typeof t!="function")throw new Error;return function(){Mo(this,e).ease=t}}function GRe(e){var t=this._id;return arguments.length?this.each(XRe(t,e)):Ga(this.node(),t).ease}function WRe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Mo(this,e).ease=n}}function QRe(e){if(typeof e!="function")throw new Error;return this.each(WRe(this._id,e))}function ZRe(e){typeof e!="function"&&(e=BK(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,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new Es(r,this._parents,this._name,this._id)}function JRe(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],f=n[l],h=c.length,d=o[l]=new Array(h),g,v=0;v<h;++v)(g=c[v]||f[v])&&(d[v]=g);for(;l<r;++l)o[l]=t[l];return new Es(o,this._parents,this._name,this._id)}function eIe(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 tIe(e,t,n){var r,i,a=eIe(t)?sT:Mo;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function nIe(e,t){var n=this._id;return arguments.length<2?Ga(this.node(),n).on.on(e):this.each(tIe(n,e,t))}function rIe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function iIe(){return this.on("end.remove",rIe(this._id))}function aIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=iT(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,f=a[o]=new Array(c),h,d,g=0;g<c;++g)(h=l[g])&&(d=e.call(h,h.__data__,g,l))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d,Vb(f[g],t,n,g,f,Ga(h,n)));return new Es(a,this._parents,t,n)}function oIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$K(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],f=c.length,h,d=0;d<f;++d)if(h=c[d]){for(var g=e.call(h,h.__data__,d,c),v,b=Ga(h,n),w=0,S=g.length;w<S;++w)(v=g[w])&&Vb(v,t,n,w,g,b);a.push(g),o.push(h)}return new Es(a,o,t,n)}var sIe=lg.prototype.constructor;function lIe(){return new sIe(this._groups,this._parents)}function uIe(e,t){var n,r,i;return function(){var a=Sd(this,e),o=(this.style.removeProperty(e),Sd(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function iY(e){return function(){this.style.removeProperty(e)}}function cIe(e,t,n){var r,i=n+"",a;return function(){var o=Sd(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function fIe(e,t,n){var r,i,a;return function(){var o=Sd(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),Sd(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function dIe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=Mo(this,e),f=c.on,h=c.value[a]==null?l||(l=iY(t)):void 0;(f!==n||i!==h)&&(r=(n=f).copy()).on(o,i=h),c.on=r}}function hIe(e,t,n){var r=(e+="")=="transform"?L1e:rY;return t==null?this.styleTween(e,uIe(e,r)).on("end.style."+e,iY(e)):typeof t=="function"?this.styleTween(e,fIe(e,r,lT(this,"style."+e,t))).each(dIe(this._id,e)):this.styleTween(e,cIe(e,r,t),n).on("end.style."+e,null)}function mIe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function pIe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&mIe(e,o,n)),r}return a._value=t,a}function gIe(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,pIe(e,t,n??""))}function vIe(e){return function(){this.textContent=e}}function yIe(e){return function(){var t=e(this);this.textContent=t??""}}function xIe(e){return this.tween("text",typeof e=="function"?yIe(lT(this,"text",e)):vIe(e==null?"":e+""))}function bIe(e){return function(t){this.textContent=e.call(this,t)}}function wIe(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 SIe(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,wIe(e))}function jIe(){for(var e=this._name,t=this._id,n=aY(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)if(c=o[f]){var h=Ga(c,t);Vb(c,e,n,f,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Es(r,this._parents,e,n)}function EIe(){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 f=Mo(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),f.on=t}),i===0&&a()})}var _Ie=0;function Es(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function aY(){return++_Ie}var es=lg.prototype;Es.prototype={constructor:Es,select:aIe,selectAll:oIe,selectChild:es.selectChild,selectChildren:es.selectChildren,filter:ZRe,merge:JRe,selection:lIe,transition:jIe,call:es.call,nodes:es.nodes,node:es.node,size:es.size,empty:es.empty,each:es.each,on:nIe,attr:IRe,attrTween:FRe,style:hIe,styleTween:gIe,text:xIe,textTween:SIe,remove:iIe,tween:ARe,delay:qRe,duration:YRe,ease:GRe,easeVarying:QRe,end:EIe,[Symbol.iterator]:es[Symbol.iterator]};function CIe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var kIe={time:null,delay:0,duration:250,ease:CIe};function NIe(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 AIe(e){var t,n;e instanceof Es?(t=e._id,e=e._name):(t=aY(),(n=kIe).time=oT(),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,f=0;f<l;++f)(c=o[f])&&Vb(c,e,t,f,o,n||NIe(c,t));return new Es(r,this._parents,e,t)}lg.prototype.interrupt=CRe;lg.prototype.transition=AIe;const fy=e=>()=>e;function OIe(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 Kb=new cs(1,0,0);oY.prototype=cs.prototype;function oY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Kb;return e.__zoom}function LE(e){e.stopImmediatePropagation()}function hm(e){e.preventDefault(),e.stopImmediatePropagation()}function TIe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function PIe(){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 j5(){return this.__zoom||Kb}function MIe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function RIe(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 sY(){var e=TIe,t=PIe,n=RIe,r=MIe,i=DIe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Oy,f=Ub("start","zoom","end"),h,d,g,v=500,b=150,w=0,S=10;function j(D){D.property("__zoom",j5).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(D,V,z,q){var X=D.selection?D.selection():D;X.property("__zoom",j5),D!==X?O(D,V,z,q):X.interrupt().each(function(){A(this,arguments).event(q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},j.scaleBy=function(D,V,z,q){j.scaleTo(D,function(){var X=this.__zoom.k,K=typeof V=="function"?V.apply(this,arguments):V;return X*K},z,q)},j.scaleTo=function(D,V,z,q){j.transform(D,function(){var X=t.apply(this,arguments),K=this.__zoom,R=z==null?N(X):typeof z=="function"?z.apply(this,arguments):z,H=K.invert(R),U=typeof V=="function"?V.apply(this,arguments):V;return n(_(C(K,U),R,H),X,o)},z,q)},j.translateBy=function(D,V,z,q){j.transform(D,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),o)},null,q)},j.translateTo=function(D,V,z,q,X){j.transform(D,function(){var K=t.apply(this,arguments),R=this.__zoom,H=q==null?N(K):typeof q=="function"?q.apply(this,arguments):q;return n(Kb.translate(H[0],H[1]).scale(R.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof z=="function"?-z.apply(this,arguments):-z),K,o)},q,X)};function C(D,V){return V=Math.max(a[0],Math.min(a[1],V)),V===D.k?D:new cs(V,D.x,D.y)}function _(D,V,z){var q=V[0]-z[0]*D.k,X=V[1]-z[1]*D.k;return q===D.x&&X===D.y?D:new cs(D.k,q,X)}function N(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function O(D,V,z,q){D.on("start.zoom",function(){A(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,K=arguments,R=A(X,K).event(q),H=t.apply(X,K),U=z==null?N(H):typeof z=="function"?z.apply(X,K):z,B=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=X.__zoom,Z=typeof V=="function"?V.apply(X,K):V,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)}R.zoom(null,ae)}})}function A(D,V,z){return!z&&D.__zooming||new T(D,V)}function T(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}T.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,V){return this.mouse&&D!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var V=Mi(this.that).datum();f.call(D,this.that,new OIe(D,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:f}),V)}};function P(D,...V){if(!e.apply(this,arguments))return;var z=A(this,V).event(D),q=this.__zoom,X=Math.max(a[0],Math.min(a[1],q.k*Math.pow(2,r.apply(this,arguments)))),K=Ta(D);if(z.wheel)(z.mouse[0][0]!==K[0]||z.mouse[0][1]!==K[1])&&(z.mouse[1]=q.invert(z.mouse[0]=K)),clearTimeout(z.wheel);else{if(q.k===X)return;z.mouse=[K,q.invert(K)],Iy(this),z.start()}hm(D),z.wheel=setTimeout(R,b),z.zoom("mouse",n(_(C(q,X),z.mouse[0],z.mouse[1]),z.extent,o));function R(){z.wheel=null,z.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var z=D.currentTarget,q=A(this,V,!0).event(D),X=Mi(D.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",B,!0),K=Ta(D,z),R=D.clientX,H=D.clientY;WK(D.view),LE(D),q.mouse=[K,this.__zoom.invert(K)],Iy(this),q.start();function U(Q){if(hm(Q),!q.moved){var Z=Q.clientX-R,te=Q.clientY-H;q.moved=Z*Z+te*te>w}q.event(Q).zoom("mouse",n(_(q.that.__zoom,q.mouse[0]=Ta(Q,z),q.mouse[1]),q.extent,o))}function B(Q){X.on("mousemove.zoom mouseup.zoom",null),QK(Q.view,q.moved),hm(Q),q.event(Q).end()}}function I(D,...V){if(e.apply(this,arguments)){var z=this.__zoom,q=Ta(D.changedTouches?D.changedTouches[0]:D,this),X=z.invert(q),K=z.k*(D.shiftKey?.5:2),R=n(_(C(z,K),q,X),t.apply(this,V),o);hm(D),l>0?Mi(this).transition().duration(l).call(O,R,q,D):Mi(this).call(j.transform,R,q,D)}}function F(D,...V){if(e.apply(this,arguments)){var z=D.touches,q=z.length,X=A(this,V,D.changedTouches.length===q).event(D),K,R,H,U;for(LE(D),R=0;R<q;++R)H=z[R],U=Ta(H,this),U=[U,this.__zoom.invert(U),H.identifier],X.touch0?!X.touch1&&X.touch0[2]!==U[2]&&(X.touch1=U,X.taps=0):(X.touch0=U,K=!0,X.taps=1+!!h);h&&(h=clearTimeout(h)),K&&(X.taps<2&&(d=U[0],h=setTimeout(function(){h=null},v)),Iy(this),X.start())}}function $(D,...V){if(this.__zooming){var z=A(this,V).event(D),q=D.changedTouches,X=q.length,K,R,H,U;for(hm(D),K=0;K<X;++K)R=q[K],H=Ta(R,this),z.touch0&&z.touch0[2]===R.identifier?z.touch0[0]=H:z.touch1&&z.touch1[2]===R.identifier&&(z.touch1[0]=H);if(R=z.that.__zoom,z.touch1){var B=z.touch0[0],Q=z.touch0[1],Z=z.touch1[0],te=z.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;R=C(R,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(z.touch0)H=z.touch0[0],U=z.touch0[1];else return;z.zoom("touch",n(_(R,H,U),z.extent,o))}}function G(D,...V){if(this.__zooming){var z=A(this,V).event(D),q=D.changedTouches,X=q.length,K,R;for(LE(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),K=0;K<X;++K)R=q[K],z.touch0&&z.touch0[2]===R.identifier?delete z.touch0:z.touch1&&z.touch1[2]===R.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(R=Ta(R,this),Math.hypot(d[0]-R[0],d[1]-R[1])<S)){var H=Mi(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return j.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:fy(+D),j):r},j.filter=function(D){return arguments.length?(e=typeof D=="function"?D:fy(!!D),j):e},j.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:fy(!!D),j):i},j.extent=function(D){return arguments.length?(t=typeof D=="function"?D:fy([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),j):t},j.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],j):[a[0],a[1]]},j.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(D){return arguments.length?(n=D,j):n},j.duration=function(D){return arguments.length?(l=+D,j):l},j.interpolate=function(D){return arguments.length?(c=D,j):c},j.on=function(){var D=f.on.apply(f,arguments);return D===f?j:D},j.clickDistance=function(D){return arguments.length?(w=(D=+D)*D,j):Math.sqrt(w)},j.tapDistance=function(D){return arguments.length?(S=+D,j):S},j}const _o={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."},tp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],lY=["Enter"," ","Escape"],uY={"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 Ed;(function(e){e.Strict="strict",e.Loose="loose"})(Ed||(Ed={}));var Ju;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ju||(Ju={}));var np;(function(e){e.Partial="partial",e.Full="full"})(np||(np={}));const cY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var El;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(El||(El={}));var _d;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(_d||(_d={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const E5={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function fY(e){return e===null?null:e?"valid":"invalid"}const dY=e=>"id"in e&&"source"in e&&"target"in e,IIe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),uT=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ug=(e,t=[0,0])=>{const{width:n,height:r}=Rs(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},LIe=(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):uT(i)?i:t.nodeLookup.get(i.id));const l=o?r0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Yb(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Xb(n)},cg=(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=Yb(n,r0(i)),r=!0)}),r?Xb(n):{x:0,y:0,width:0,height:0}},cT=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...dg(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const f of e.values()){const{measured:h,selectable:d=!0,hidden:g=!1}=f;if(o&&!d||g)continue;const v=h.width??f.width??f.initialWidth??null,b=h.height??f.height??f.initialHeight??null,w=rp(l,kd(f)),S=(v??0)*(b??0),j=a&&w>0;(!f.internals.handleBounds||j||w>=S||f.dragging)&&c.push(f)}return c},zIe=(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 $Ie(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 BIe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=$Ie(e,o),c=cg(l),f=fT(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(f,{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 hY({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:f}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??r;let d=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",_o.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(d=[[c,f],[c+v,f+b]])}else l&&Nd(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const g=Nd(d)?Sc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",_o.error015())),{position:{x:g.x-c+(o.measured.width??0)*h[0],y:g.y-f+(o.measured.height??0)*h[1]},positionAbsolute:g}}async function FIe({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),h=zIe(o,c);for(const g of c)l.has(g.id)&&!h.find(b=>b.id===g.id)&&h.push(g);if(!i)return{edges:h,nodes:o};const d=await i({nodes:o,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:o}:{edges:[],nodes:[]}:d}const Cd=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Sc=(e={x:0,y:0},t,n)=>({x:Cd(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Cd(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function mY(e,t,n){const{width:r,height:i}=Rs(n),{x:a,y:o}=n.internals.positionAbsolute;return Sc(e,[[a,o],[a+r,o+i]],t)}const _5=(e,t,n)=>e<t?Cd(Math.abs(e-t),1,t)/t:e>n?-Cd(Math.abs(e-n),1,t)/t:0,pY=(e,t,n=15,r=40)=>{const i=_5(e.x,r,t.width-r)*n,a=_5(e.y,r,t.height-r)*n;return[i,a]},Yb=(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)}),rk=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Xb=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),kd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=uT(e)?e.internals.positionAbsolute:ug(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}},r0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=uT(e)?e.internals.positionAbsolute:ug(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)}},gY=(e,t)=>Xb(Yb(rk(e),rk(t))),rp=(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)},C5=e=>Ia(e.width)&&Ia(e.height)&&Ia(e.x)&&Ia(e.y),Ia=e=>!isNaN(e)&&isFinite(e),UIe=(e,t)=>{},fg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),dg=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?fg(l,o):l},i0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Af(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 HIe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Af(e,n),i=Af(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Af(e.top??e.y??0,n),i=Af(e.bottom??e.y??0,n),a=Af(e.left??e.x??0,t),o=Af(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 qIe(e,t,n,r,i,a){const{x:o,y:l}=i0(e,[t,n,r]),{x:c,y:f}=i0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=i-c,d=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const fT=(e,t,n,r,i,a)=>{const o=HIe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),h=Cd(f,r,i),d=e.x+e.width/2,g=e.y+e.height/2,v=t/2-d*h,b=n/2-g*h,w=qIe(e,v,b,h,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:h}},ip=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Nd(e){return e!=null&&e!=="parent"}function Rs(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 vY(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 yY(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 k5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function VIe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function KIe(e){return{...uY,...e||{}}}function km(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=La(e),l=dg({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?fg(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const dT=e=>({width:e.offsetWidth,height:e.offsetHeight}),xY=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},YIe=["INPUT","SELECT","TEXTAREA"];function bY(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:YIe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const wY=e=>"clientX"in e,La=(e,t)=>{var a,o;const n=wY(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)}},N5=(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,...dT(o)}})};function SY({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,f=t*.125+a*.375+l*.375+r*.125,h=Math.abs(c-e),d=Math.abs(f-t);return[c,f,h,d]}function dy(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function A5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ke.Left:return[t-dy(t-r,a),n];case Ke.Right:return[t+dy(r-t,a),n];case Ke.Top:return[t,n-dy(n-i,a)];case Ke.Bottom:return[t,n+dy(i-n,a)]}}function jY({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,curvature:o=.25}){const[l,c]=A5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,h]=A5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,g,v,b]=SY({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${c} ${f},${h} ${r},${i}`,d,g,v,b]}function EY({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 XIe({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 GIe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Yb(r0(e),r0(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 rp(o,Xb(a))>0}const WIe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,QIe=(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)),ZIe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||WIe;let i;return dY(e)?i={...e}:i={...e,id:r(e)},QIe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function _Y({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=EY({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const O5={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},JIe=({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},T5=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function eLe({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:r=Ke.Top,center:i,offset:a,stepPosition:o}){const l=O5[t],c=O5[r],f={x:e.x+l.x*a,y:e.y+l.y*a},h={x:n.x+c.x*a,y:n.y+c.y*a},d=JIe({source:f,sourcePosition:t,target:h}),g=d.x!==0?"x":"y",v=d[g];let b=[],w,S;const j={x:0,y:0},C={x:0,y:0},[,,_,N]=EY({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[g]*c[g]===-1){g==="x"?(w=i.x??f.x+(h.x-f.x)*o,S=i.y??(f.y+h.y)/2):(w=i.x??(f.x+h.x)/2,S=i.y??f.y+(h.y-f.y)*o);const A=[{x:w,y:f.y},{x:w,y:h.y}],T=[{x:f.x,y:S},{x:h.x,y:S}];l[g]===v?b=g==="x"?A:T:b=g==="x"?T:A}else{const A=[{x:f.x,y:h.y}],T=[{x:h.x,y:f.y}];if(g==="x"?b=l.x===v?T:A:b=l.y===v?A:T,t===r){const $=Math.abs(e[g]-n[g]);if($<=a){const G=Math.min(a-1,a-$);l[g]===v?j[g]=(f[g]>e[g]?-1:1)*G:C[g]=(h[g]>n[g]?-1:1)*G}}if(t!==r){const $=g==="x"?"y":"x",G=l[g]===c[$],D=f[$]>h[$],V=f[$]<h[$];(l[g]===1&&(!G&&D||G&&V)||l[g]!==1&&(!G&&V||G&&D))&&(b=g==="x"?A:T)}const P={x:f.x+j.x,y:f.y+j.y},L={x:h.x+C.x,y:h.y+C.y},I=Math.max(Math.abs(P.x-b[0].x),Math.abs(L.x-b[0].x)),F=Math.max(Math.abs(P.y-b[0].y),Math.abs(L.y-b[0].y));I>=F?(w=(P.x+L.x)/2,S=b[0].y):(w=b[0].x,S=(P.y+L.y)/2)}return[[e,{x:f.x+j.x,y:f.y+j.y},...b,{x:h.x+C.x,y:h.y+C.y},n],w,S,_,N]}function tLe(e,t,n,r){const i=Math.min(T5(e,t)/2,T5(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 f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${a+i*f},${o}Q ${a},${o} ${a},${o+i*h}`}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 ik({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20,stepPosition:h=.5}){const[d,g,v,b,w]=eLe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:f,stepPosition:h});return[d.reduce((j,C,_)=>{let N="";return _>0&&_<d.length-1?N=tLe(d[_-1],C,d[_+1],o):N=`${_===0?"M":"L"}${C.x} ${C.y}`,j+=N,j},""),g,v,b,w]}function P5(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nLe(e){var d;const{sourceNode:t,targetNode:n}=e;if(!P5(t)||!P5(n))return null;const r=t.internals.handleBounds||M5(t.handles),i=n.internals.handleBounds||M5(n.handles),a=D5((r==null?void 0:r.source)??[],e.sourceHandle),o=D5(e.connectionMode===Ed.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(d=e.onError)==null||d.call(e,"008",_o.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,f=jc(t,a,l),h=jc(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function M5(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 jc(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??Rs(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 D5(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ak(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function rLe(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 f=ak(c,t);a.has(f)||(o.push({id:f,color:c.color||n,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const CY=1e3,iLe=10,hT={nodeOrigin:[0,0],nodeExtent:tp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aLe={...hT,checkEquality:!0};function mT(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function oLe(e,t,n){const r=mT(hT,n);for(const i of e.values())if(i.parentId)gT(i,e,t,r);else{const a=ug(i,r.nodeOrigin),o=Nd(i.extent)?i.extent:r.nodeExtent,l=Sc(a,o,Rs(i));i.internals.positionAbsolute=l}}function sLe(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 pT(e){return e==="manual"}function ok(e,t,n,r={}){var f,h;const i=mT(aLe,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!pT(i.zIndexMode)?CY:0;let c=e.length>0;t.clear(),n.clear();for(const d of e){let g=o.get(d.id);if(i.checkEquality&&d===(g==null?void 0:g.internals.userNode))t.set(d.id,g);else{const v=ug(d,i.nodeOrigin),b=Nd(d.extent)?d.extent:i.nodeExtent,w=Sc(v,b,Rs(d));g={...i.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:sLe(d,g),z:kY(d,l,i.zIndexMode),userNode:d}},t.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),d.parentId&&gT(g,t,n,r,a)}return c}function lLe(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 gT(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=mT(hT,r),f=e.parentId,h=t.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}lLe(e,n),i&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++i.i,h.internals.z=h.internals.z+i.i*iLe),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const d=a&&!pT(c)?CY:0,{x:g,y:v,z:b}=uLe(e,h,o,l,d,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 kY(e,t,n){const r=Ia(e.zIndex)?e.zIndex:0;return pT(n)?r:r+(e.selected?t:0)}function uLe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Rs(e),f=ug(e,n),h=Nd(e.extent)?Sc(f,e.extent,c):f;let d=Sc({x:o+h.x,y:l+h.y},r,c);e.extent==="parent"&&(d=mY(d,c,t));const g=kY(e,i,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=g?v+1:g}}function vT(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 f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??kd(c),h=gY(f,l.rect);a.set(l.parentId,{expandedRect:h,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var _;const h=c.internals.positionAbsolute,d=Rs(c),g=c.origin??r,v=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,b=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),j=(w-d.width)*g[0],C=(S-d.height)*g[1];(v>0||b>0||j||C)&&(i.push({id:f,type:"position",position:{x:c.position.x-v+j,y:c.position.y-b+C}}),(_=n.get(f))==null||_.forEach(N=>{e.some(O=>O.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+v,y:N.position.y+b}})})),(d.width<l.width||d.height<l.height||v||b)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-j:0),height:S+(b?g[1]*b-C:0)}})}),i}function cLe(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 f=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.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=dT(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(),_=Nd(b.extent)?b.extent:a;let{positionAbsolute:N}=b.internals;b.parentId&&b.extent==="parent"?N=mY(N,w,t.get(b.parentId)):_&&(N=Sc(N,_,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:N,handleBounds:{source:N5("source",v.nodeElement,C,d,b.id),target:N5("target",v.nodeElement,C,d,b.id)}}};t.set(b.id,O),b.parentId&&gT(O,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,S&&(f.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:kd(O,i)}))}}if(g.length>0){const v=vT(g,t,n,i);f.push(...v)}return{changes:f,updatedInternals:c}}async function fLe({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 R5(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 f=r.get(o)||new Map;r.set(o,f.set(n,t))}}function NY(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},f=`${i}-${o}--${a}-${l}`,h=`${a}-${l}--${i}-${o}`;R5("source",c,h,e,i,o),R5("target",c,f,e,a,l),t.set(r.id,r)}}function AY(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:AY(n,t):!1}function I5(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 dLe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!AY(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function zE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[f,h]of t){const d=(o=n.get(f))==null?void 0:o.internals.userNode;d&&i.push({...d,position:h.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 hLe({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=fg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function mLe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},h=null,d=!1,g=null,v=!1,b=!1,w=null;function S({noDragClassName:C,handleSelector:_,domNode:N,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Mi(N);function P({x:$,y:G}){const{nodeLookup:D,nodeExtent:V,snapGrid:z,snapToGrid:q,nodeOrigin:X,onNodeDrag:K,onSelectionDrag:R,onError:H,updateNodePositions:U}=t();a={x:$,y:G};let B=!1;const Q=l.size>1,Z=Q&&V?rk(cg(l)):null,te=Q&&q?hLe({dragItems:l,snapGrid:z,x:$,y:G}):null;for(const[ae,re]of l){if(!D.has(ae))continue;let ee={x:$-re.distance.x,y:G-re.distance.y};q&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:fg(ee,z));let se=null;if(Q&&V&&!re.extent&&Z){const{positionAbsolute:we}=re.internals,Ee=we.x-Z.x+V[0][0],Be=we.x+re.measured.width-Z.x2+V[1][0],Ne=we.y-Z.y+V[0][1],it=we.y+re.measured.height-Z.y2+V[1][1];se=[[Ee,Ne],[Be,it]]}const{position:pe,positionAbsolute:ie}=hY({nodeId:ae,nextPosition:ee,nodeLookup:D,nodeExtent:se||V,nodeOrigin:X,onError:H});B=B||re.position.x!==pe.x||re.position.y!==pe.y,re.position=pe,re.internals.positionAbsolute=ie}if(b=b||B,!!B&&(U(l,!0),w&&(r||K||!A&&R))){const[ae,re]=zE({nodeId:A,dragItems:l,nodeLookup:D});r==null||r(w,l,ae,re),K==null||K(w,ae,re),A||R==null||R(w,re)}}async function L(){if(!h)return;const{transform:$,panBy:G,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(o);return}const[z,q]=pY(f,h,D);(z!==0||q!==0)&&(a.x=(a.x??0)-z/$[2],a.y=(a.y??0)-q/$[2],await G({x:z,y:q})&&P(a)),o=requestAnimationFrame(L)}function I($){var Q;const{nodeLookup:G,multiSelectionActive:D,nodesDraggable:V,transform:z,snapGrid:q,snapToGrid:X,selectNodesOnDrag:K,onNodeDragStart:R,onSelectionDragStart:H,unselectNodesAndEdges:U}=t();d=!0,(!K||!O)&&!D&&A&&((Q=G.get(A))!=null&&Q.selected||U()),O&&K&&A&&(e==null||e(A));const B=km($.sourceEvent,{transform:z,snapGrid:q,snapToGrid:X,containerBounds:h});if(a=B,l=dLe(G,V,B,A),l.size>0&&(n||R||!A&&H)){const[Z,te]=zE({nodeId:A,dragItems:l,nodeLookup:G});n==null||n($.sourceEvent,l,Z,te),R==null||R($.sourceEvent,Z,te),A||H==null||H($.sourceEvent,te)}}const F=ZK().clickDistance(T).on("start",$=>{const{domNode:G,nodeDragThreshold:D,transform:V,snapGrid:z,snapToGrid:q}=t();h=(G==null?void 0:G.getBoundingClientRect())||null,v=!1,b=!1,w=$.sourceEvent,D===0&&I($),a=km($.sourceEvent,{transform:V,snapGrid:z,snapToGrid:q,containerBounds:h}),f=La($.sourceEvent,h)}).on("drag",$=>{const{autoPanOnNodeDrag:G,transform:D,snapGrid:V,snapToGrid:z,nodeDragThreshold:q,nodeLookup:X}=t(),K=km($.sourceEvent,{transform:D,snapGrid:V,snapToGrid:z,containerBounds:h});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||A&&!X.has(A))&&(v=!0),!v){if(!c&&G&&d&&(c=!0,L()),!d){const R=La($.sourceEvent,h),H=R.x-f.x,U=R.y-f.y;Math.sqrt(H*H+U*U)>q&&I($)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&l&&d&&(f=La($.sourceEvent,h),P(K))}}).on("end",$=>{if(!(!d||v)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:G,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:z}=t();if(b&&(D(l,!1),b=!1),i||V||!A&&z){const[q,X]=zE({nodeId:A,dragItems:l,nodeLookup:G,dragging:!1});i==null||i($.sourceEvent,l,q,X),V==null||V($.sourceEvent,q,X),A||z==null||z($.sourceEvent,X)}}}).filter($=>{const G=$.target;return!$.button&&(!C||!I5(G,`.${C}`,N))&&(!_||I5(G,_,N))});g.call(F)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function pLe(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())rp(i,kd(a))>0&&r.push(a);return r}const gLe=250;function vLe(e,t,n,r){var l,c;let i=[],a=1/0;const o=pLe(e,n,t+gLe);for(const f of o){const h=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:g,y:v}=jc(f,d,d.position,!0),b=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(v-e.y,2));b>t||(b<a?(i=[{...d,x:g,y:v}],a=b):b===a&&i.push({...d,x:g,y:v}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(h=>h.type===f)??i[0]}return i[0]}function OY(e,t,n,r,i,a=!1){var f,h,d;const o=r.get(e);if(!o)return null;const l=i==="strict"?(f=o.internals.handleBounds)==null?void 0:f[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(g=>g.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...jc(o,c,c.position,!0)}:c}function TY(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function yLe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const PY=()=>!0;function xLe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:h,flowId:d,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:j=PY,onReconnectEnd:C,updateConnection:_,getTransform:N,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:P}){const L=xY(e.target);let I=0,F;const{x:$,y:G}=La(e),D=TY(a,P),V=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!V||!D)return;const q=OY(i,D,r,c,t);if(!q)return;let X=La(e,V),K=!1,R=null,H=!1,U=null;function B(){if(!h||!V)return;const[pe,ie]=pY(X,V,A);g({x:pe,y:ie}),I=requestAnimationFrame(B)}const Q={...q,nodeId:i,type:D,position:q.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:jc(Z,Q,Ke.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:X,toHandle:null,toPosition:E5[Q.position],toNode:null,pointer:X};function re(){z=!0,_(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:D})}T===0&&re();function ee(pe){if(!z){const{x:it,y:Qe}=La(pe),Xe=it-$,It=Qe-G;if(!(Xe*Xe+It*It>T*T))return;re()}if(!O()||!Q){se(pe);return}const ie=N();X=La(pe,V),F=vLe(dg(X,ie,!1,[1,1]),n,c,Q),K||(B(),K=!0);const we=MY(pe,{handle:F,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:L,lib:f,flowId:d,nodeLookup:c});U=we.handleDomNode,R=we.connection,H=yLe(!!F,we.isValid);const Ee=c.get(i),Be=Ee?jc(Ee,Q,Ke.Left,!0):ae.from,Ne={...ae,from:Be,isValid:H,to:we.toHandle&&H?i0({x:we.toHandle.x,y:we.toHandle.y},ie):X,toHandle:we.toHandle,toPosition:H&&we.toHandle?we.toHandle.position:E5[Q.position],toNode:we.toHandle?c.get(we.toHandle.nodeId):null,pointer:X};_(Ne),ae=Ne}function se(pe){if(!("touches"in pe&&pe.touches.length>0)){if(z){(F||U)&&R&&H&&(w==null||w(R));const{inProgress:ie,...we}=ae,Ee={...we,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(pe,Ee),a&&(C==null||C(pe,Ee))}v(),cancelAnimationFrame(I),K=!1,H=!1,R=null,U=null,L.removeEventListener("mousemove",ee),L.removeEventListener("mouseup",se),L.removeEventListener("touchmove",ee),L.removeEventListener("touchend",se)}}L.addEventListener("mousemove",ee),L.addEventListener("mouseup",se),L.addEventListener("touchmove",ee),L.addEventListener("touchend",se)}function MY(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=PY,nodeLookup:h}){const d=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}=La(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=TY(void 0,S),_=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!_||!C)return j;const T={source:d?_:r,sourceHandle:d?N:i,target:d?r:_,targetHandle:d?i:N};j.connection=T;const L=O&&A&&(n===Ed.Strict?d&&C==="source"||!d&&C==="target":_!==r||N!==i);j.isValid=L&&f(T),j.toHandle=OY(_,C,N,h,n,!0)}return j}const sk={onPointerDown:xLe,isValid:MY};function bLe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:c,height:f,zoomStep:h=1,pannable:d=!0,zoomable:g=!0,inversePan:v=!1}){const b=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const N=n(),O=_.sourceEvent.ctrlKey&&ip()?10:1,A=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*h,T=N[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 N=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(N[2],Math.log(N[2]))*(v?-1:1),P={x:N[0]-A[0]*T,y:N[1]-A[1]*T},L=[[0,0],[c,f]];t.setViewportConstrained({x:P.x,y:P.y,zoom:N[2]},L,l)},C=sY().on("start",S).on("zoom",d?j:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Ta}}const Gb=e=>({x:e.x,y:e.y,zoom:e.k}),$E=({x:e,y:t,zoom:n})=>Kb.translate(e,t).scale(n),Lf=(e,t)=>e.target.closest(`.${t}`),DY=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),wLe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,BE=(e,t=0,n=wLe,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},RY=e=>{const t=e.ctrlKey&&ip()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SLe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return h=>{if(Lf(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&o){const S=Ta(h),j=RY(h),C=d*Math.pow(2,j);r.scaleTo(n,C,S,h);return}const g=h.deltaMode===1?20:1;let v=i===Ju.Vertical?0:h.deltaX*g,b=i===Ju.Horizontal?0:h.deltaY*g;!ip()&&h.shiftKey&&i!==Ju.Vertical&&(v=h.deltaY*g,b=0),r.translateBy(n,-(v/d)*a,-(b/d)*a,{internal:!0});const w=Gb(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function jLe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Lf(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function ELe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Gb(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 _Le({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&DY(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,Gb(a.transform)))}}function CLe({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&&DY(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=Gb(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function kLe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:h}){return d=>{var S;const g=e||t,v=n&&d.ctrlKey,b=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Lf(d,`${f}-flow__node`)||Lf(d,`${f}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||h&&!b||Lf(d,l)&&b||Lf(d,c)&&(!b||i&&b&&!e)||!n&&d.ctrlKey&&b)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!g&&!i&&!v&&b||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||b)&&w}}function NLe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=sY().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(d);C({x:i.x,y:i.y,zoom:Cd(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");d.wheelDelta(RY);function w(F,$){return g?new Promise(G=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Oy).transform(BE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>G(!0)),F)}):Promise.resolve(!1)}function S({noWheelClassName:F,noPanClassName:$,onPaneContextMenu:G,userSelectionActive:D,panOnScroll:V,panOnDrag:z,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:K,zoomOnPinch:R,zoomOnScroll:H,zoomOnDoubleClick:U,zoomActivationKeyPressed:B,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){D&&!f.isZoomingOrPanning&&j();const ee=V&&!B&&!D;d.clickDistance(re?1/0:!Ia(ae)||ae<0?0:ae);const se=ee?SLe({zoomPanValues:f,noWheelClassName:F,d3Selection:g,d3Zoom:d,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:R,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):jLe({noWheelClassName:F,preventScrolling:K,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!D){const ie=ELe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});d.on("start",ie);const we=_Le({zoomPanValues:f,panOnDrag:z,onPaneContextMenu:!!G,onPanZoom:a,onTransformChange:Z});d.on("zoom",we);const Ee=CLe({zoomPanValues:f,panOnDrag:z,panOnScroll:V,onPaneContextMenu:G,onPanZoomEnd:l,onDraggingChange:c});d.on("end",Ee)}const pe=kLe({zoomActivationKeyPressed:B,panOnDrag:z,zoomOnScroll:H,panOnScroll:V,zoomOnDoubleClick:U,zoomOnPinch:R,userSelectionActive:D,noPanClassName:$,noWheelClassName:F,lib:Q,connectionInProgress:te});d.filter(pe),U?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){d.on("zoom",null)}async function C(F,$,G){const D=$E(F),V=d==null?void 0:d.constrain()(D,$,G);return V&&await w(V),new Promise(z=>z(V))}async function _(F,$){const G=$E(F);return await w(G,$),new Promise(D=>D(G))}function N(F){if(g){const $=$E(F),G=g.property("__zoom");(G.k!==F.zoom||G.x!==F.x||G.y!==F.y)&&(d==null||d.transform(g,$,null,{sync:!0}))}}function O(){const F=g?oY(g.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function A(F,$){return g?new Promise(G=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Oy).scaleTo(BE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>G(!0)),F)}):Promise.resolve(!1)}function T(F,$){return g?new Promise(G=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Oy).scaleBy(BE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>G(!0)),F)}):Promise.resolve(!1)}function P(F){d==null||d.scaleExtent(F)}function L(F){d==null||d.translateExtent(F)}function I(F){const $=!Ia(F)||F<0?0:F;d==null||d.clickDistance($)}return{update:S,destroy:j,setViewport:_,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:P,setTranslateExtent:L,syncViewport:N,setClickDistance:I}}var Ad;(function(e){e.Line="line",e.Handle="handle"})(Ad||(Ad={}));function ALe({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 L5(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 gl(e,t){return Math.max(0,t-e)}function vl(e,t){return Math.max(0,e-t)}function hy(e,t,n){return Math.max(0,t-e,e-n)}function z5(e,t){return e?!t:t}function OLe(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:f}=t;const{isHorizontal:h,isVertical:d}=t,g=h&&d,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:j,maxHeight:C}=r,{x:_,y:N,width:O,height:A,aspectRatio:T}=e;let P=Math.floor(h?v-e.pointerX:0),L=Math.floor(d?b-e.pointerY:0);const I=O+(c?-P:P),F=A+(f?-L:L),$=-a[0]*O,G=-a[1]*A;let D=hy(I,w,S),V=hy(F,j,C);if(o){let X=0,K=0;c&&P<0?X=gl(_+P+$,o[0][0]):!c&&P>0&&(X=vl(_+I+$,o[1][0])),f&&L<0?K=gl(N+L+G,o[0][1]):!f&&L>0&&(K=vl(N+F+G,o[1][1])),D=Math.max(D,X),V=Math.max(V,K)}if(l){let X=0,K=0;c&&P>0?X=vl(_+P,l[0][0]):!c&&P<0&&(X=gl(_+I,l[1][0])),f&&L>0?K=vl(N+L,l[0][1]):!f&&L<0&&(K=gl(N+F,l[1][1])),D=Math.max(D,X),V=Math.max(V,K)}if(i){if(h){const X=hy(I/T,j,C)*T;if(D=Math.max(D,X),o){let K=0;!c&&!f||c&&!f&&g?K=vl(N+G+I/T,o[1][1])*T:K=gl(N+G+(c?P:-P)/T,o[0][1])*T,D=Math.max(D,K)}if(l){let K=0;!c&&!f||c&&!f&&g?K=gl(N+I/T,l[1][1])*T:K=vl(N+(c?P:-P)/T,l[0][1])*T,D=Math.max(D,K)}}if(d){const X=hy(F*T,w,S)/T;if(V=Math.max(V,X),o){let K=0;!c&&!f||f&&!c&&g?K=vl(_+F*T+$,o[1][0])/T:K=gl(_+(f?L:-L)*T+$,o[0][0])/T,V=Math.max(V,K)}if(l){let K=0;!c&&!f||f&&!c&&g?K=gl(_+F*T,l[1][0])/T:K=vl(_+(f?L:-L)*T,l[0][0])/T,V=Math.max(V,K)}}}L=L+(L<0?V:-V),P=P+(P<0?D:-D),i&&(g?I>F*T?L=(z5(c,f)?-P:P)/T:P=(z5(c,f)?-L:L)*T:h?(L=P/T,f=c):(P=L*T,c=f));const z=c?_+P:_,q=f?N+L:N;return{width:O+(c?-P:P),height:A+(f?-L:L),x:a[0]*P*(c?-1:1)+z,y:a[1]*L*(f?-1:1)+q}}const IY={width:0,height:0,x:0,y:0},TLe={...IY,pointerX:0,pointerY:0,aspectRatio:1};function PLe(e){return[[0,0],[e.measured.width,e.measured.height]]}function MLe(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 DLe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:L5("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:h,keepAspectRatio:d,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let j={...IY},C={...TLe};o={boundaries:h,resizeDirection:g,keepAspectRatio:d,controlDirection:L5(f)};let _,N=null,O=[],A,T,P,L=!1;const I=ZK().on("start",F=>{const{nodeLookup:$,transform:G,snapGrid:D,snapToGrid:V,nodeOrigin:z,paneDomNode:q}=n();if(_=$.get(t),!_)return;N=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:X,ySnapped:K}=km(F.sourceEvent,{transform:G,snapGrid:D,snapToGrid:V,containerBounds:N});j={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...j,pointerX:X,pointerY:K,aspectRatio:j.width/j.height},A=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(A=$.get(_.parentId),T=A&&_.extent==="parent"?PLe(A):void 0),O=[],P=void 0;for(const[R,H]of $)if(H.parentId===t&&(O.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const U=MLe(H,_,H.origin??z);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:$,snapGrid:G,snapToGrid:D,nodeOrigin:V}=n(),z=km(F.sourceEvent,{transform:$,snapGrid:G,snapToGrid:D,containerBounds:N}),q=[];if(!_)return;const{x:X,y:K,width:R,height:H}=j,U={},B=_.origin??V,{width:Q,height:Z,x:te,y:ae}=OLe(C,o.controlDirection,z,o.boundaries,o.keepAspectRatio,B,T,P),re=Q!==R,ee=Z!==H,se=te!==X&&re,pe=ae!==K&&ee;if(!se&&!pe&&!re&&!ee)return;if((se||pe||B[0]===1||B[1]===1)&&(U.x=se?te:j.x,U.y=pe?ae:j.y,j.x=U.x,j.y=U.y,O.length>0)){const Be=te-X,Ne=ae-K;for(const it of O)it.position={x:it.position.x-Be+B[0]*(Q-R),y:it.position.y-Ne+B[1]*(Z-H)},q.push(it)}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 Be=B[0]*(U.width??0);U.x&&U.x<Be&&(j.x=Be,C.x=C.x-(U.x-Be));const Ne=B[1]*(U.height??0);U.y&&U.y<Ne&&(j.y=Ne,C.y=C.y-(U.y-Ne))}const ie=ALe({width:j.width,prevWidth:R,height:j.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),we={...j,direction:ie};(S==null?void 0:S(F,we))!==!1&&(L=!0,b==null||b(F,we),r(U,q))}).on("end",F=>{L&&(w==null||w(F,{...j}),i==null||i({...j}),L=!1)});a.call(I)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const RLe={},$5=e=>{let t;const n=new Set,r=(h,d)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const v=t;t=d??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(RLe?"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()}},f=t=e(r,i,c);return c},ILe=e=>e?$5(e):$5,{useDebugValue:LLe}=Ce,{useSyncExternalStoreWithSelector:zLe}=nye,$Le=e=>e;function LY(e,t=$Le,n){const r=zLe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return LLe(r),r}const B5=(e,t)=>{const n=ILe(e),r=(i,a=t)=>LY(n,i,a);return Object.assign(r,n),r},BLe=(e,t)=>e?B5(e,t):B5;function En(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 Wb=y.createContext(null),FLe=Wb.Provider,zY=_o.error001();function Pt(e,t){const n=y.useContext(Wb);if(n===null)throw new Error(zY);return LY(n,e,t)}function _n(){const e=y.useContext(Wb);if(e===null)throw new Error(zY);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const F5={display:"none"},ULe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$Y="react-flow__node-desc",BY="react-flow__edge-desc",HLe="react-flow__aria-live",qLe=e=>e.ariaLiveMessage,VLe=e=>e.ariaLabelConfig;function KLe({rfId:e}){const t=Pt(qLe);return m.jsx("div",{id:`${HLe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ULe,children:t})}function YLe({rfId:e,disableKeyboardA11y:t}){const n=Pt(VLe);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${$Y}-${e}`,style:F5,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${BY}-${e}`,style:F5,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(KLe,{rfId:e})]})}const Qb=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return m.jsx("div",{className:Jn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});Qb.displayName="Panel";function XLe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Qb,{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:m.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const GLe=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}},my=e=>e.id;function WLe(e,t){return En(e.selectedNodes.map(my),t.selectedNodes.map(my))&&En(e.selectedEdges.map(my),t.selectedEdges.map(my))}function QLe({onSelectionChange:e}){const t=_n(),{selectedNodes:n,selectedEdges:r}=Pt(GLe,WLe);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 ZLe=e=>!!e.onSelectionChangeHandlers;function JLe({onSelectionChange:e}){const t=Pt(ZLe);return e||t?m.jsx(QLe,{onSelectionChange:e}):null}const FY=[0,0],e3e={x:0,y:0,zoom:1},t3e=["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"],U5=[...t3e,"rfId"],n3e=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}),H5={translateExtent:tp,nodeOrigin:FY,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function r3e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Pt(n3e,En),f=_n();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=H5,l()}),[]);const h=y.useRef(H5);return y.useEffect(()=>{for(const d of U5){const g=e[d],v=h.current[d];g!==v&&(typeof e[d]>"u"||(d==="nodes"?t(g):d==="edges"?n(g):d==="minZoom"?r(g):d==="maxZoom"?i(g):d==="translateExtent"?a(g):d==="nodeExtent"?o(g):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:KIe(g)}):d==="fitView"?f.setState({fitViewQueued:g}):d==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[d]:g})))}h.current=e},U5.map(d=>e[d])),null}function q5(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function i3e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=q5(),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=q5())!=null&&r.matches?"dark":"light"}const V5=typeof document<"u"?document:null;function ap(e=null,t={target:V5,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 f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
`).replace(`

`,`
+`).split(`
`)),h=f.reduce((d,g)=>d.concat(...g),[]);return[f,h]}return[[],[]]},[e]);return y.useEffect(()=>{const c=(t==null?void 0:t.target)??V5,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=v=>{var S,j;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!f)&&bY(v))return!1;const w=Y5(v.code,l);if(a.current.add(v[w]),K5(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)}},d=v=>{const b=Y5(v.code,l);K5(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",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function K5(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Y5(e,t){return t.includes(e)?"code":"key"}const a3e=()=>{const e=_n();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=fT(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(),f={x:t.x-l,y:t.y-c},h=n.snapGrid??i,d=n.snapToGrid??a;return dg(f,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=i0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function UY(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)o3e(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 o3e(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 s3e(e,t){return UY(e,t)}function l3e(e,t){return UY(e,t)}function Du(e,t){return{id:e,type:"select",selected:t}}function zf(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 X5({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 G5(e){return{id:e.id,type:"remove"}}const W5=e=>IIe(e),u3e=e=>dY(e);function HY(e){return y.forwardRef(e)}const c3e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Q5(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>f3e(()=>n(i=>i+BigInt(1))));return c3e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function f3e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const qY=y.createContext(null);function d3e({children:e}){const t=_n(),n=y.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:h,onNodesChange:d,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=X5({items:w,lookup:g});for(const j of b.values())S=j(S);h&&f(w),S.length>0?d==null||d(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:C,setNodes:_}=t.getState();j&&_(C)})},[]),r=Q5(n),i=y.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;h?f(v):d&&d(X5({items:v,lookup:g}))},[]),a=Q5(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return m.jsx(qY.Provider,{value:o,children:e})}function h3e(){const e=y.useContext(qY);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const m3e=e=>!!e.panZoom;function Zb(){const e=a3e(),t=_n(),n=h3e(),r=Pt(m3e),i=y.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var j,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=W5(d)?d:g.get(d.id),w=b.parentId?yY(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 kd(S)},f=(d,g,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===d){const S=typeof g=="function"?g(w):g;return v.replace&&W5(S)?S:{...w,...S}}return w}))},h=(d,g,v={replace:!1})=>{l(b=>b.map(w=>{if(w.id===d){const S=typeof g=="function"?g(w):g;return v.replace&&u3e(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=a(d))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(g=>({...g}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const g=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:d.map(j=>({...j})),edges:g.map(j=>({...j})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:j,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:N}=t.getState(),{nodes:O,edges:A}=await FIe({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:N}),T=A.length>0,P=O.length>0;if(T){const L=A.map(G5);S==null||S(A),C(L)}if(P){const L=O.map(G5);w==null||w(O),j(L)}return(P||T)&&(_==null||_({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(d,g=!0,v)=>{const b=C5(d),w=b?d:c(d),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===d.id||!C.internals.positionAbsolute))return!1;const _=kd(S?j:C),N=rp(_,w);return g&&N>0||N>=_.width*_.height||N>=w.width*w.height}):[]},isNodeIntersecting:(d,g,v=!0)=>{const w=C5(d)?d:c(d);if(!w)return!1;const S=rp(w,g);return v&&S>0||S>=g.width*g.height||S>=w.width*w.height},updateNode:f,updateNodeData:(d,g,v={replace:!1})=>{f(d,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:h,updateEdgeData:(d,g,v={replace:!1})=>{h(d,b=>{const w=typeof g=="function"?g(b):g;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:v}=t.getState();return LIe(d,{nodeLookup:g,nodeOrigin:v})},getHandleConnections:({type:d,id:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${d}${g?`-${g}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:b.values())??[])},fitView:async d=>{const g=t.getState().fitViewResolver??VIe();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const Z5=e=>e.selected,p3e=typeof window<"u"?window:void 0;function g3e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=_n(),{deleteElements:r}=Zb(),i=ap(e,{actInsideInputWithModifier:!1}),a=ap(t,{target:p3e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(Z5),edges:o.filter(Z5)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function v3e(e){const t=_n();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=dT(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",_o.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 Jb={position:"absolute",width:"100%",height:"100%",top:0,left:0},y3e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function x3e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Ju.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:h,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:j,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:N}){const O=_n(),A=y.useRef(null),{userSelectionActive:T,lib:P,connectionInProgress:L}=Pt(y3e,En),I=ap(g),F=y.useRef();v3e(A);const $=y.useCallback(G=>{j==null||j({x:G[0],y:G[1],zoom:G[2]}),C||O.setState({transform:G})},[j,C]);return y.useEffect(()=>{if(A.current){F.current=NLe({domNode:A.current,minZoom:h,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:z=>O.setState(q=>q.paneDragging===z?q:{paneDragging:z}),onPanZoomStart:(z,q)=>{const{onViewportChangeStart:X,onMoveStart:K}=O.getState();K==null||K(z,q),X==null||X(q)},onPanZoom:(z,q)=>{const{onViewportChange:X,onMove:K}=O.getState();K==null||K(z,q),X==null||X(q)},onPanZoomEnd:(z,q)=>{const{onViewportChangeEnd:X,onMoveEnd:K}=O.getState();K==null||K(z,q),X==null||X(q)}});const{x:G,y:D,zoom:V}=F.current.getViewport();return O.setState({panZoom:F.current,transform:[G,D,V],domNode:A.current.closest(".react-flow")}),()=>{var z;(z=F.current)==null||z.destroy()}}},[]),y.useEffect(()=>{var G;(G=F.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:P,onTransformChange:$,connectionInProgress:L,selectionOnDrag:N,paneClickDistance:_})},[e,t,n,r,i,a,o,l,I,v,S,T,w,P,$,L,N,_]),m.jsx("div",{className:"react-flow__renderer",ref:A,style:Jb,children:b})}const b3e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function w3e(){const{userSelectionActive:e,userSelectionRect:t}=Pt(b3e,En);return e&&t?m.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 FE=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},S3e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function j3e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=np.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=_n(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:_}=Pt(S3e,En),N=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),P=y.useRef(new Set),L=y.useRef(!1),I=X=>{if(L.current||_){L.current=!1;return}c==null||c(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},F=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}f==null||f(X)},$=h?X=>h(X):void 0,G=X=>{L.current&&(X.stopPropagation(),L.current=!1)},D=X=>{var Z,te;const{domNode:K}=w.getState();if(A.current=K==null?void 0:K.getBoundingClientRect(),!A.current)return;const R=X.target===O.current;if(!R&&!!X.target.closest(".nokey")||!e||!(a&&R||t)||X.button!==0||!X.isPrimary)return;(te=(Z=X.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,X.pointerId),L.current=!1;const{x:B,y:Q}=La(X.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:Q,x:B,y:Q}}),R||(X.stopPropagation(),X.preventDefault())},V=X=>{const{userSelectionRect:K,transform:R,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}=La(X.nativeEvent,A.current),{startX:se,startY:pe}=K;if(!L.current){const Ne=t?0:i;if(Math.hypot(re-se,ee-pe)<=Ne)return;ae(),o==null||o(X)}L.current=!0;const ie={startX:se,startY:pe,x:re<se?re:se,y:ee<pe?ee:pe,width:Math.abs(re-se),height:Math.abs(ee-pe)},we=T.current,Ee=P.current;T.current=new Set(cT(H,ie,R,n===np.Partial,!0).map(Ne=>Ne.id)),P.current=new Set;const Be=(te==null?void 0:te.selectable)??!0;for(const Ne of T.current){const it=B.get(Ne);if(it)for(const{edgeId:Qe}of it.values()){const Xe=U.get(Qe);Xe&&(Xe.selectable??Be)&&P.current.add(Qe)}}if(!k5(we,T.current)){const Ne=zf(H,T.current,!0);Q(Ne)}if(!k5(Ee,P.current)){const Ne=zf(U,P.current);Z(Ne)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},z=X=>{var K,R;X.button===0&&((R=(K=X.target)==null?void 0:K.releasePointerCapture)==null||R.call(K,X.pointerId),!S&&X.target===O.current&&w.getState().userSelectionRect&&(I==null||I(X)),w.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(l==null||l(X),w.setState({nodesSelectionActive:T.current.size>0})))},q=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:Jn(["react-flow__pane",{draggable:q,dragging:C,selection:e}]),onClick:N?void 0:FE(I,O),onContextMenu:FE(F,O),onWheel:FE($,O),onPointerEnter:N?void 0:d,onPointerMove:N?V:g,onPointerUp:N?z:void 0,onPointerDownCapture:N?D:void 0,onClickCapture:N?G:void 0,onPointerLeave:v,ref:O,style:Jb,children:[b,m.jsx(w3e,{})]})}function lk({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),f=l.get(e);if(!f){c==null||c("012",_o.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([e])}function VY({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=_n(),[c,f]=y.useState(!1),h=y.useRef();return y.useEffect(()=>{h.current=mLe({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{lk({id:d,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),y.useEffect(()=>{if(!(t||!e.current||!h.current))return h.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var d;(d=h.current)==null||d.destroy()}},[n,r,t,a,e,i,o]),c}const E3e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function KY(){const e=_n();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:h}=e.getState(),d=new Map,g=E3e(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 f){if(!g(j))continue;let C={x:j.internals.positionAbsolute.x+w,y:j.internals.positionAbsolute.y+S};i&&(C=fg(C,a));const{position:_,positionAbsolute:N}=hY({nodeId:j.id,nextPosition:C,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:l});j.position=_,j.internals.positionAbsolute=N,d.set(j.id,j)}c(d)},[])}const yT=y.createContext(null),_3e=yT.Provider;yT.Consumer;const YY=()=>y.useContext(yT),C3e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),k3e=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o,h=(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:h,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===Ed.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:h&&f}};function N3e({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:f,onMouseDown:h,onTouchStart:d,...g},v){var V,z;const b=o||null,w=e==="target",S=_n(),j=YY(),{connectOnClick:C,noPanClassName:_,rfId:N}=Pt(C3e,En),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:P,connectionInProcess:L,clickConnectionInProcess:I,valid:F}=Pt(k3e(j,b,e),En);j||(z=(V=S.getState()).onError)==null||z.call(V,"010",_o.error010());const $=q=>{const{defaultEdgeOptions:X,onConnect:K,hasDefaultEdges:R}=S.getState(),H={...X,...q};if(R){const{edges:U,setEdges:B}=S.getState();B(ZIe(H,U))}K==null||K(H),l==null||l(H)},G=q=>{if(!j)return;const X=wY(q.nativeEvent);if(i&&(X&&q.button===0||!X)){const K=S.getState();sk.onPointerDown(q.nativeEvent,{handleDomNode:q.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:(...R)=>{var H,U;return(U=(H=S.getState()).onConnectEnd)==null?void 0:U.call(H,...R)},updateConnection:K.updateConnection,onConnect:$,isValidConnection:n||((...R)=>{var H,U;return((U=(H=S.getState()).isValidConnection)==null?void 0:U.call(H,...R))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}X?h==null||h(q):d==null||d(q)},D=q=>{const{onClickConnectStart:X,onClickConnectEnd:K,connectionClickStartHandle:R,connectionMode:H,isValidConnection:U,lib:B,rfId:Q,nodeLookup:Z,connection:te}=S.getState();if(!j||!R&&!i)return;if(!R){X==null||X(q.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=xY(q.target),re=n||U,{connection:ee,isValid:se}=sk.isValid(q.nativeEvent,{handle:{nodeId:j,id:b,type:e},connectionMode:H,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:re,flowId:Q,doc:ae,lib:B,nodeLookup:Z});se&&ee&&$(ee);const pe=structuredClone(te);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,K==null||K(q,pe),S.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${N}-${j}-${b}-${e}`,className:Jn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:F,connectionindicator:r&&(!L||P)&&(L||I?a:i)}]),onMouseDown:G,onTouchStart:G,onClick:C?D:void 0,ref:v,...g,children:c})}const Od=y.memo(HY(N3e));function A3e({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(Od,{type:"source",position:n,isConnectable:t})]})}function O3e({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:r=Ke.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(Od,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(Od,{type:"source",position:r,isConnectable:t})]})}function T3e(){return null}function P3e({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(Od,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const a0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J5={input:A3e,default:O3e,output:P3e,group:T3e};function M3e(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 D3e=e=>{const{width:t,height:n,x:r,y:i}=cg(e.nodeLookup,{filter:a=>!!a.selected});return{width:Ia(t)?t:null,height:Ia(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 R3e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=_n(),{width:i,height:a,transformString:o,userSelectionActive:l}=Pt(D3e,En),c=KY(),f=y.useRef(null);y.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const h=!l&&i!==null&&a!==null;if(VY({nodeRef:f,disabled:!h}),!h)return null;const d=e?v=>{const b=r.getState().nodes.filter(w=>w.selected);e(v,b)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(a0,v.key)&&(v.preventDefault(),c({direction:a0[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Jn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const e$=typeof window<"u"?window:void 0,I3e=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function XY({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:h,selectionMode:d,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:N,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:P,defaultViewport:L,translateExtent:I,minZoom:F,maxZoom:$,preventScrolling:G,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:z,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:K}){const{nodesSelectionActive:R,userSelectionActive:H}=Pt(I3e,En),U=ap(f,{target:e$}),B=ap(w,{target:e$}),Q=B||P,Z=B||N,te=h&&Q!==!0,ae=U||H||te;return g3e({deleteKeyCode:c,multiSelectionKeyCode:b}),m.jsx(x3e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!U&&Q,defaultViewport:L,translateExtent:I,minZoom:F,maxZoom:$,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:V,noPanClassName:z,onViewportChange:X,isControlledViewport:K,paneClickDistance:l,selectionOnDrag:te,children:m.jsxs(j3e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:te,children:[e,R&&m.jsx(R3e,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:q})]})})}XY.displayName="FlowRenderer";const L3e=y.memo(XY),z3e=e=>t=>e?cT(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 $3e(e){return Pt(y.useCallback(z3e(e),[e]),En)}const B3e=e=>e.updateNodeInternals;function F3e(){const e=Pt(B3e),[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 U3e({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=_n(),a=y.useRef(null),o=y.useRef(null),l=y.useRef(e.sourcePosition),c=y.useRef(e.targetPosition),f=y.useRef(t),h=n&&!!e.internals.handleBounds;return y.useEffect(()=>{a.current&&!e.hidden&&(!h||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[h,e.hidden]),y.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),y.useEffect(()=>{if(a.current){const d=f.current!==t,g=l.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||g||v)&&(f.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 H3e({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:h,resizeObserver:d,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:j,onError:C}){const{node:_,internals:N,isParent:O}=Pt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},En);let A=_.type||"default",T=(S==null?void 0:S[A])||J5[A];T===void 0&&(C==null||C("003",_o.error003(A)),A="default",T=(S==null?void 0:S.default)||J5.default);const P=!!(_.draggable||l&&typeof _.draggable>"u"),L=!!(_.selectable||c&&typeof _.selectable>"u"),I=!!(_.connectable||f&&typeof _.connectable>"u"),F=!!(_.focusable||h&&typeof _.focusable>"u"),$=_n(),G=vY(_),D=U3e({node:_,nodeType:A,hasDimensions:G,resizeObserver:d}),V=VY({nodeRef:D,disabled:_.hidden||!P,noDragClassName:g,handleSelector:_.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:j}),z=KY();if(_.hidden)return null;const q=Rs(_),X=M3e(_),K=L||P||t||n||r||i,R=n?re=>n(re,{...N.userNode}):void 0,H=r?re=>r(re,{...N.userNode}):void 0,U=i?re=>i(re,{...N.userNode}):void 0,B=a?re=>a(re,{...N.userNode}):void 0,Q=o?re=>o(re,{...N.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=$.getState();L&&(!ee||!P||se>0)&&lk({id:e,store:$,nodeRef:D}),t&&t(re,{...N.userNode})},te=re=>{if(!(bY(re.nativeEvent)||b)){if(lY.includes(re.key)&&L){const ee=re.key==="Escape";lk({id:e,store:$,unselect:ee,nodeRef:D})}else if(P&&_.selected&&Object.prototype.hasOwnProperty.call(a0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=$.getState();$.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),z({direction:a0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=D.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:pe,setCenter:ie}=$.getState();if(!pe)return;cT(new Map([[e,_]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(_.position.x+q.width/2,_.position.y+q.height/2,{zoom:re[2]})};return m.jsx("div",{className:Jn(["react-flow__node",`react-flow__node-${A}`,{[v]:P},_.className,{selected:_.selected,selectable:L,parent:O,draggable:P,dragging:V}]),ref:D,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:G?"visible":"hidden",..._.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,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:`${$Y}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:m.jsx(_3e,{value:e,children:m.jsx(T,{id:e,data:_.data,type:A,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:_.selected??!1,selectable:L,draggable:P,deletable:_.deletable??!0,isConnectable:I,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:N.z,parentId:_.parentId,...q})})})}var q3e=y.memo(H3e);const V3e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function GY(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Pt(V3e,En),o=$3e(e.onlyRenderVisibleElements),l=F3e();return m.jsx("div",{className:"react-flow__nodes",style:Jb,children:o.map(c=>m.jsx(q3e,{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))})}GY.displayName="NodeRenderer";const K3e=y.memo(GY);function Y3e(e){return Pt(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&&GIe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),En)}const X3e=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},G3e=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},t$={[_d.Arrow]:X3e,[_d.ArrowClosed]:G3e};function W3e(e){const t=_n();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(t$,e)?t$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",_o.error009(e)),null)},[e])}const Q3e=({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=W3e(t);return c?m.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:m.jsx(c,{color:n,strokeWidth:o})}):null},WY=({defaultColor:e,rfId:t})=>{const n=Pt(a=>a.edges),r=Pt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>rLe(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?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:i.map(a=>m.jsx(Q3e,{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};WY.displayName="MarkerDefinitions";var Z3e=y.memo(WY);function QY({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,...h}){const[d,g]=y.useState({x:1,y:0,width:0,height:0}),v=Jn(["react-flow__edge-textwrapper",f]),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?m.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...h,children:[i&&m.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),m.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:b,style:r,children:n}),c]}):null}QY.displayName="EdgeText";const J3e=y.memo(QY);function ew({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,...h}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...h,d:e,fill:"none",className:Jn(["react-flow__edge-path",h.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Ia(t)&&Ia(n)?m.jsx(J3e,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function n$({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 ZY({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top}){const[o,l]=n$({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=n$({pos:a,x1:r,y1:i,x2:e,y2:t}),[h,d,g,v]=SY({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${o},${l} ${c},${f} ${r},${i}`,h,d,g,v]}function JY(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})=>{const[C,_,N]=ZY({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return m.jsx(ew,{id:O,path:C,labelX:_,labelY:N,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const eze=JY({isInternal:!1}),eX=JY({isInternal:!0});eze.displayName="SimpleBezierEdge";eX.displayName="SimpleBezierEdgeInternal";function tX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,sourcePosition:v=Ke.Bottom,targetPosition:b=Ke.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,N,O]=ik({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 m.jsx(ew,{id:A,path:_,labelX:N,labelY:O,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const nX=tX({isInternal:!1}),rX=tX({isInternal:!0});nX.displayName="SmoothStepEdge";rX.displayName="SmoothStepEdgeInternal";function iX(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return m.jsx(nX,{...n,id:r,pathOptions:y.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const tze=iX({isInternal:!1}),aX=iX({isInternal:!0});tze.displayName="StepEdge";aX.displayName="StepEdgeInternal";function oX(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,j,C]=_Y({sourceX:n,sourceY:r,targetX:i,targetY:a}),_=e.isInternal?void 0:t;return m.jsx(ew,{id:_,path:S,labelX:j,labelY:C,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const nze=oX({isInternal:!1}),sX=oX({isInternal:!0});nze.displayName="StraightEdge";sX.displayName="StraightEdgeInternal";function lX(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:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,N,O]=jY({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 m.jsx(ew,{id:A,path:_,labelX:N,labelY:O,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const rze=lX({isInternal:!1}),uX=lX({isInternal:!0});rze.displayName="BezierEdge";uX.displayName="BezierEdgeInternal";const r$={default:uX,straight:sX,step:aX,smoothstep:rX,simplebezier:eX},i$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ize=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,aze=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,a$="react-flow__edgeupdater";function o$({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return m.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Jn([a$,`${a$}-${l}`]),cx:ize(t,r,e),cy:aze(n,r,e),r,stroke:"transparent",fill:"transparent"})}function oze({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:h,onReconnectEnd:d,setReconnecting:g,setUpdateHover:v}){const b=_n(),w=(N,O)=>{if(N.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:P,connectionRadius:L,lib:I,onConnectStart:F,cancelConnection:$,nodeLookup:G,rfId:D,panBy:V,updateConnection:z}=b.getState(),q=O.type==="target",X=(H,U)=>{g(!1),d==null||d(H,n,O.type,U)},K=H=>f==null?void 0:f(n,H),R=(H,U)=>{g(!0),h==null||h(N,n,O.type),F==null||F(H,U)};sk.onPointerDown(N.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:L,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:G,isTarget:q,edgeUpdaterType:O.type,lib:I,flowId:D,cancelConnection:$,panBy:V,isValidConnection:(...H)=>{var U,B;return((B=(U=b.getState()).isValidConnection)==null?void 0:B.call(U,...H))??!0},onConnect:K,onConnectStart:R,onConnectEnd:(...H)=>{var U,B;return(B=(U=b.getState()).onConnectEnd)==null?void 0:B.call(U,...H)},onReconnectEnd:X,updateConnection:z,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},S=N=>w(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),j=N=>w(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),_=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(o$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&m.jsx(o$,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function sze({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:j,disableKeyboardA11y:C}){let _=Pt(ie=>ie.edgeLookup.get(e));const N=Pt(ie=>ie.defaultEdgeOptions);_=N?{...N,..._}:_;let O=_.type||"default",A=(w==null?void 0:w[O])||r$[O];A===void 0&&(j==null||j("011",_o.error011(O)),O="default",A=(w==null?void 0:w.default)||r$.default);const T=!!(_.focusable||t&&typeof _.focusable>"u"),P=typeof d<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),L=!!(_.selectable||r&&typeof _.selectable>"u"),I=y.useRef(null),[F,$]=y.useState(!1),[G,D]=y.useState(!1),V=_n(),{zIndex:z,sourceX:q,sourceY:X,targetX:K,targetY:R,sourcePosition:H,targetPosition:U}=Pt(y.useCallback(ie=>{const we=ie.nodeLookup.get(_.source),Ee=ie.nodeLookup.get(_.target);if(!we||!Ee)return{zIndex:_.zIndex,...i$};const Be=nLe({id:e,sourceNode:we,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:XIe({selected:_.selected,zIndex:_.zIndex,sourceNode:we,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...Be||i$}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),En),B=y.useMemo(()=>_.markerStart?`url('#${ak(_.markerStart,b)}')`:void 0,[_.markerStart,b]),Q=y.useMemo(()=>_.markerEnd?`url('#${ak(_.markerEnd,b)}')`:void 0,[_.markerEnd,b]);if(_.hidden||q===null||X===null||K===null||R===null)return null;const Z=ie=>{var Ne;const{addSelectedEdges:we,unselectNodesAndEdges:Ee,multiSelectionActive:Be}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),_.selected&&Be?(Ee({nodes:[],edges:[_]}),(Ne=I.current)==null||Ne.blur()):we([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=f?ie=>{f(ie,{..._})}:void 0,pe=ie=>{var we;if(!C&&lY.includes(ie.key)&&L){const{unselectNodesAndEdges:Ee,addSelectedEdges:Be}=V.getState();ie.key==="Escape"?((we=I.current)==null||we.blur(),Ee({edges:[_]})):Be([e])}};return m.jsx("svg",{style:{zIndex:z},children:m.jsxs("g",{className:Jn(["react-flow__edge",`react-flow__edge-${O}`,_.className,S,{selected:_.selected,animated:_.animated,inactive:!L&&!i,updating:F,selectable:L}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?pe: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?`${BY}-${b}`:void 0,ref:I,..._.domAttributes,children:[!G&&m.jsx(A,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:L,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:K,targetY:R,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&&m.jsx(oze,{edge:_,isReconnectable:P,reconnectRadius:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:K,targetY:R,sourcePosition:H,targetPosition:U,setUpdateHover:$,setReconnecting:D})]})})}var lze=y.memo(sze);const uze=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function cX({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,onError:_}=Pt(uze,En),N=Y3e(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(Z3e,{defaultColor:e,rfId:n}),N.map(O=>m.jsx(lze,{id:O,edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:h,reconnectRadius:d,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:_,edgeTypes:r,disableKeyboardA11y:w},O))]})}cX.displayName="EdgeRenderer";const cze=y.memo(cX),fze=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function dze({children:e}){const t=Pt(fze);return m.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function hze(e){const t=Zb(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const mze=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function pze(e){const t=Pt(mze),n=_n();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function gze(e){return e.connection.inProgress?{...e.connection,to:dg(e.connection.to,e.transform)}:{...e.connection}}function vze(e){return gze}function yze(e){const t=vze();return Pt(t,En)}const xze=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}=Pt(xze,En);return!(a&&i&&c)?null:m.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:Jn(["react-flow__connection",fY(l)]),children:m.jsx(fX,{style:t,type:n,CustomComponent:r,isValid:l})})})}const fX=({style:e,type:t=El.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:h,toHandle:d,toPosition:g,pointer:v}=yze();if(!i)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:g,connectionStatus:fY(r),toNode:h,toHandle:d,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case El.Bezier:[b]=jY(w);break;case El.SimpleBezier:[b]=ZY(w);break;case El.Step:[b]=ik({...w,borderRadius:0});break;case El.SmoothStep:[b]=ik(w);break;default:[b]=_Y(w)}return m.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};fX.displayName="ConnectionLine";const wze={};function s$(e=wze){y.useRef(e),_n(),y.useEffect(()=>{},[e])}function Sze(){_n(),y.useRef(!1),y.useEffect(()=>{},[])}function dX({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:j,selectionKeyCode:C,selectionOnDrag:_,selectionMode:N,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:L,elementsSelectable:I,defaultViewport:F,translateExtent:$,minZoom:G,maxZoom:D,preventScrolling:V,defaultMarkerColor:z,zoomOnScroll:q,zoomOnPinch:X,panOnScroll:K,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:B,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:pe,onEdgeContextMenu:ie,onEdgeMouseEnter:we,onEdgeMouseMove:Ee,onEdgeMouseLeave:Be,reconnectRadius:Ne,onReconnect:it,onReconnectStart:Qe,onReconnectEnd:Xe,noDragClassName:It,noWheelClassName:ft,noPanClassName:St,disableKeyboardA11y:Kt,nodeExtent:Dt,rfId:cn,viewport:de,onViewportChange:xe}){return s$(e),s$(t),Sze(),hze(n),pze(de),m.jsx(L3e,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:_,selectionMode:N,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:U,panOnScroll:K,panOnScrollSpeed:R,panOnScrollMode:H,panOnDrag:B,defaultViewport:F,translateExtent:$,minZoom:G,maxZoom:D,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:It,noWheelClassName:ft,noPanClassName:St,disableKeyboardA11y:Kt,onViewportChange:xe,isControlledViewport:!!de,children:m.jsxs(dze,{children:[m.jsx(cze,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:it,onReconnectStart:Qe,onReconnectEnd:Xe,onlyRenderVisibleElements:L,onEdgeContextMenu:ie,onEdgeMouseEnter:we,onEdgeMouseMove:Ee,onEdgeMouseLeave:Be,reconnectRadius:Ne,defaultMarkerColor:z,noPanClassName:St,disableKeyboardA11y:Kt,rfId:cn}),m.jsx(bze,{style:w,type:b,component:S,containerStyle:j}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(K3e,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:pe,onlyRenderVisibleElements:L,noPanClassName:St,noDragClassName:It,disableKeyboardA11y:Kt,nodeExtent:Dt,rfId:cn}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}dX.displayName="GraphView";const jze=y.memo(dX),l$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:d,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,j=r??t??[],C=n??e??[],_=h??[0,0],N=d??tp;NY(w,S,j);const O=ok(C,v,b,{nodeOrigin:_,nodeExtent:N,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=cg(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:P,y:L,zoom:I}=fT(T,i,a,c,f,(l==null?void 0:l.padding)??.1);A=[P,L,I]}return{rfId:"1",width:i??0,height:a??0,transform:A,nodes:C,nodesInitialized:O,nodeLookup:v,parentLookup:b,edges:j,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:tp,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ed.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:{...cY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:UIe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:uY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Eze=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:h,nodeExtent:d,zIndexMode:g})=>BLe((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:_,width:N,height:O,minZoom:A,maxZoom:T}=b();j&&(await BIe({nodes:S,width:N,height:O,panZoom:j,minZoom:A,maxZoom:T},C),_==null||_.resolve(!0),v({fitViewResolver:null}))}return{...l$({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:S=>{const{nodeLookup:j,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:N,fitViewQueued:O,zIndexMode:A}=b(),T=ok(S,j,C,{nodeOrigin:_,nodeExtent:d,elevateNodesOnSelect:N,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();NY(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:N,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:P,zIndexMode:L}=b(),{changes:I,updatedInternals:F}=cLe(S,C,_,N,O,A,L);F&&(oLe(C,_,{nodeOrigin:O,nodeExtent:A,zIndexMode:L}),P?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),j==null||j(I)))},updateNodePositions:(S,j=!1)=>{const C=[];let _=[];const{nodeLookup:N,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:P}=b();for(const[L,I]of S){const F=N.get(L),$=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(I!=null&&I.position)),G={id:L,type:"position",position:$?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:j};if(F&&A.inProgress&&A.fromNode.id===F.id){const D=jc(F,A.fromHandle,Ke.Left,!0);T({...A,from:D})}$&&F.parentId&&C.push({id:L,parentId:F.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),_.push(G)}if(C.length>0){const{parentLookup:L,nodeOrigin:I}=b(),F=vT(C,N,L,I);_.push(...F)}for(const L of P.values())_=L(_);O(_)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:_,hasDefaultNodes:N,debug:O}=b();if(S!=null&&S.length){if(N){const A=s3e(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:N,debug:O}=b();if(S!=null&&S.length){if(N){const A=l3e(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:N,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Du(T,!0));N(A);return}N(zf(_,new Set([...S]),!0)),O(zf(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Du(T,!0));O(A);return}O(zf(C,new Set([...S]))),N(zf(_,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:_,nodeLookup:N,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||_,P=j||C,L=[];for(const F of T){if(!F.selected)continue;const $=N.get(F.id);$&&($.selected=!1),L.push(Du(F.id,!1))}const I=[];for(const F of P)F.selected&&I.push(Du(F.id,!1));O(L),A(I)},setMinZoom:S=>{const{panZoom:j,maxZoom:C}=b();j==null||j.setScaleExtent([S,C]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:j,minZoom:C}=b();j==null||j.setScaleExtent([C,S]),v({maxZoom:S})},setTranslateExtent:S=>{var j;(j=b().panZoom)==null||j.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:j,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:N}=b();if(!N)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:N,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]||(ok(j,C,_,{nodeOrigin:N,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:_,panZoom:N,translateExtent:O}=b();return fLe({delta:S,panZoom:N,transform:j,translateExtent:O,width:C,height:_})},setCenter:async(S,j,C)=>{const{width:_,height:N,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:N/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:{...cY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...l$()})}},Object.is);function hX({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:h,nodeExtent:d,zIndexMode:g,children:v}){const[b]=y.useState(()=>Eze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d,zIndexMode:g}));return m.jsx(FLe,{value:b,children:m.jsx(d3e,{children:v})})}function _ze({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:d,nodeExtent:g,zIndexMode:v}){return y.useContext(Wb)?m.jsx(m.Fragment,{children:e}):m.jsx(hX,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:d,nodeExtent:g,zIndexMode:v,children:e})}const Cze={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function kze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:h,onMoveStart:d,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:N,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:L,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onSelectionChange:G,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:z,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onBeforeDelete:R,connectionMode:H,connectionLineType:U=El.Bezier,connectionLineStyle:B,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=np.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:pe=ip()?"Meta":"Control",zoomActivationKeyCode:ie=ip()?"Meta":"Control",snapToGrid:we,snapGrid:Ee,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:Ne,nodesDraggable:it,autoPanOnNodeFocus:Qe,nodesConnectable:Xe,nodesFocusable:It,nodeOrigin:ft=FY,edgesFocusable:St,edgesReconnectable:Kt,elementsSelectable:Dt=!0,defaultViewport:cn=e3e,minZoom:de=.5,maxZoom:xe=2,translateExtent:Te=tp,preventScrolling:Ze=!0,nodeExtent:Je,defaultMarkerColor:Gt="#b1b1b7",zoomOnScroll:nn=!0,zoomOnPinch:je=!0,panOnScroll:ot=!1,panOnScrollSpeed:yt=.5,panOnScrollMode:lt=Ju.Free,zoomOnDoubleClick:$n=!0,panOnDrag:rn=!0,onPaneClick:dr,onPaneMouseEnter:Xr,onPaneMouseMove:Dr,onPaneMouseLeave:ai,onPaneScroll:Sr,onPaneContextMenu:Ge,paneClickDistance:qt=1,nodeClickDistance:me=0,children:We,onReconnect:an,onReconnectStart:jt,onReconnectEnd:Tn,onEdgeContextMenu:Gr,onEdgeDoubleClick:hr,onEdgeMouseEnter:er,onEdgeMouseMove:Wa,onEdgeMouseLeave:Wr,reconnectRadius:Is=10,onNodesChange:ge,onEdgesChange:dt,noDragClassName:Rt="nodrag",noWheelClassName:on="nowheel",noPanClassName:Sa="nopan",fitView:Qa,fitViewOptions:hg,connectOnClick:tw,attributionPosition:mg,proOptions:iu,defaultEdgeOptions:Zd,elevateNodesOnSelect:Ls=!0,elevateEdgesOnSelect:zs=!1,disableKeyboardA11y:$s=!1,autoPanOnConnect:Bs,autoPanOnNodeDrag:Hn,autoPanSpeed:pg,connectionRadius:gg,isValidConnection:Do,onError:Fs,style:nw,id:Jd,nodeDragThreshold:vg,connectionDragThreshold:rw,viewport:Ic,onViewportChange:Lc,width:ja,height:oi,colorMode:yg="light",debug:iw,onScroll:Us,ariaLabelConfig:xg,zIndexMode:au="basic",...aw},si){const ou=Jd||"1",bg=i3e(yg),eh=y.useCallback(Ro=>{Ro.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Us==null||Us(Ro)},[Us]);return m.jsx("div",{"data-testid":"rf__wrapper",...aw,onScroll:eh,style:{...nw,...Cze},ref:si,className:Jn(["react-flow",i,bg]),id:Jd,role:"application",children:m.jsxs(_ze,{nodes:e,edges:t,width:ja,height:oi,fitView:Qa,fitViewOptions:hg,minZoom:de,maxZoom:xe,nodeOrigin:ft,nodeExtent:Je,zIndexMode:au,children:[m.jsx(jze,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:N,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:pe,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:Be,defaultViewport:cn,translateExtent:Te,minZoom:de,maxZoom:xe,preventScrolling:Ze,zoomOnScroll:nn,zoomOnPinch:je,zoomOnDoubleClick:$n,panOnScroll:ot,panOnScrollSpeed:yt,panOnScrollMode:lt,panOnDrag:rn,onPaneClick:dr,onPaneMouseEnter:Xr,onPaneMouseMove:Dr,onPaneMouseLeave:ai,onPaneScroll:Sr,onPaneContextMenu:Ge,paneClickDistance:qt,nodeClickDistance:me,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:K,onReconnect:an,onReconnectStart:jt,onReconnectEnd:Tn,onEdgeContextMenu:Gr,onEdgeDoubleClick:hr,onEdgeMouseEnter:er,onEdgeMouseMove:Wa,onEdgeMouseLeave:Wr,reconnectRadius:Is,defaultMarkerColor:Gt,noDragClassName:Rt,noWheelClassName:on,noPanClassName:Sa,rfId:ou,disableKeyboardA11y:$s,nodeExtent:Je,viewport:Ic,onViewportChange:Lc}),m.jsx(r3e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:it,autoPanOnNodeFocus:Qe,nodesConnectable:Xe,nodesFocusable:It,edgesFocusable:St,edgesReconnectable:Kt,elementsSelectable:Dt,elevateNodesOnSelect:Ls,elevateEdgesOnSelect:zs,minZoom:de,maxZoom:xe,nodeExtent:Je,onNodesChange:ge,onEdgesChange:dt,snapToGrid:we,snapGrid:Ee,connectionMode:H,translateExtent:Te,connectOnClick:tw,defaultEdgeOptions:Zd,fitView:Qa,fitViewOptions:hg,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:z,onMove:h,onMoveStart:d,onMoveEnd:g,noPanClassName:Sa,nodeOrigin:ft,rfId:ou,autoPanOnConnect:Bs,autoPanOnNodeDrag:Hn,autoPanSpeed:pg,onError:Fs,connectionRadius:gg,isValidConnection:Do,selectNodesOnDrag:Ne,nodeDragThreshold:vg,connectionDragThreshold:rw,onBeforeDelete:R,debug:iw,ariaLabelConfig:xg,zIndexMode:au}),m.jsx(JLe,{onSelectionChange:G}),We,m.jsx(XLe,{proOptions:iu,position:mg}),m.jsx(YLe,{rfId:ou,disableKeyboardA11y:$s})]})})}var Nze=HY(kze);function Aze({dimensions:e,lineWidth:t,variant:n,className:r}){return m.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 Oze({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Jn(["react-flow__background-pattern","dots",t])})}var $l;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($l||($l={}));const Tze={[$l.Dots]:1,[$l.Lines]:1,[$l.Cross]:6},Pze=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function mX({id:e,variant:t=$l.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:h}){const d=y.useRef(null),{transform:g,patternId:v}=Pt(Pze,En),b=r||Tze[t],w=t===$l.Dots,S=t===$l.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],_=b*g[2],N=Array.isArray(a)?a:[a,a],O=S?[_,_]:C,A=[N[0]*g[2]||1+O[0]/2,N[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return m.jsxs("svg",{className:Jn(["react-flow__background",f]),style:{...c,...Jb,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[m.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?m.jsx(Oze,{radius:_/2,className:h}):m.jsx(Aze,{dimensions:O,lineWidth:i,variant:t,className:h})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}mX.displayName="Background";y.memo(mX);function Mze(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Dze(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Rze(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.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 Ize(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.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 Lze(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.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 py({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Jn(["react-flow__controls-button",t]),...n,children:e})}const zze=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:f,children:h,position:d="bottom-left",orientation:g="vertical","aria-label":v}){const b=_n(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Pt(zze,En),{zoomIn:_,zoomOut:N,fitView:O}=Zb(),A=()=>{_(),a==null||a()},T=()=>{N(),o==null||o()},P=()=>{O(i),l==null||l()},L=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},I=g==="horizontal"?"horizontal":"vertical";return m.jsxs(Qb,{className:Jn(["react-flow__controls",I,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(py,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:m.jsx(Mze,{})}),m.jsx(py,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:m.jsx(Dze,{})})]}),n&&m.jsx(py,{className:"react-flow__controls-fitview",onClick:P,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:m.jsx(Rze,{})}),r&&m.jsx(py,{className:"react-flow__controls-interactive",onClick:L,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?m.jsx(Lze,{}):m.jsx(Ize,{})}),h]})}pX.displayName="Controls";y.memo(pX);function $ze({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:h,shapeRendering:d,selected:g,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return m.jsx("rect",{className:Jn(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:h,ry:h,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:c},shapeRendering:d,onClick:v?j=>v(j,e):void 0})}const Bze=y.memo($ze),Fze=e=>e.nodes.map(t=>t.id),UE=e=>e instanceof Function?e:()=>e;function Uze({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Bze,onClick:o}){const l=Pt(Fze,En),c=UE(t),f=UE(e),h=UE(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:l.map(g=>m.jsx(qze,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},g))})}function Hze({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:h,y:d,width:g,height:v}=Pt(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:N}=Rs(S);return{node:S,x:j,y:C,width:_,height:N}},En);return!f||f.hidden||!vY(f)?null:m.jsx(l,{x:h,y:d,width:g,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:i,strokeColor:n(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const qze=y.memo(Hze);var Vze=y.memo(Uze);const Kze=200,Yze=150,Xze=e=>!e.hidden,Gze=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?gY(cg(e.nodeLookup,{filter:Xze}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wze="react-flow__minimap-desc";function gX({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:h,maskStrokeWidth:d,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:j,inversePan:C,zoomStep:_=1,offsetScale:N=5}){const O=_n(),A=y.useRef(null),{boundingRect:T,viewBB:P,rfId:L,panZoom:I,translateExtent:F,flowWidth:$,flowHeight:G,ariaLabelConfig:D}=Pt(Gze,En),V=(e==null?void 0:e.width)??Kze,z=(e==null?void 0:e.height)??Yze,q=T.width/V,X=T.height/z,K=Math.max(q,X),R=K*V,H=K*z,U=N*K,B=T.x-(R-T.width)/2-U,Q=T.y-(H-T.height)/2-U,Z=R+U*2,te=H+U*2,ae=`${Wze}-${L}`,re=y.useRef(0),ee=y.useRef();re.current=K,y.useEffect(()=>{if(A.current&&I)return ee.current=bLe({domNode:A.current,panZoom:I,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var we;(we=ee.current)==null||we.destroy()}},[I]),y.useEffect(()=>{var we;(we=ee.current)==null||we.update({translateExtent:F,width:$,height:G,inversePan:C,pannable:w,zoomStep:_,zoomable:S})},[w,S,C,_,F,$,G]);const se=v?we=>{var Ne;const[Ee,Be]=((Ne=ee.current)==null?void 0:Ne.pointer(we))||[0,0];v(we,{x:Ee,y:Be})}:void 0,pe=b?y.useCallback((we,Ee)=>{const Be=O.getState().nodeLookup.get(Ee).internals.userNode;b(we,Be)},[]):void 0,ie=j??D["minimap.ariaLabel"];return m.jsx(Qb,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*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:m.jsxs("svg",{width:V,height:z,viewBox:`${B} ${Q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:A,onClick:se,children:[ie&&m.jsx("title",{id:ae,children:ie}),m.jsx(Vze,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),m.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"})]})})}gX.displayName="MiniMap";y.memo(gX);const Qze=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Zze={[Ad.Line]:"right",[Ad.Handle]:"bottom-right"};function Jze({nodeId:e,position:t,variant:n=Ad.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:j}){const C=YY(),_=typeof e=="string"?e:C,N=_n(),O=y.useRef(null),A=n===Ad.Handle,T=Pt(y.useCallback(Qze(A&&v),[A,v]),En),P=y.useRef(null),L=t??Zze[n];y.useEffect(()=>{if(!(!O.current||!_))return P.current||(P.current=DLe({domNode:O.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:F,transform:$,snapGrid:G,snapToGrid:D,nodeOrigin:V,domNode:z}=N.getState();return{nodeLookup:F,transform:$,snapGrid:G,snapToGrid:D,nodeOrigin:V,paneDomNode:z}},onChange:(F,$)=>{const{triggerNodeChanges:G,nodeLookup:D,parentLookup:V,nodeOrigin:z}=N.getState(),q=[],X={x:F.x,y:F.y},K=D.get(_);if(K&&K.expandParent&&K.parentId){const R=K.origin??z,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,...yY({x:F.x??K.position.x,y:F.y??K.position.y},{width:H,height:U},K.parentId,D,R)}},Q=vT([B],D,V,z);q.push(...Q),X.x=F.x?Math.max(R[0]*H,F.x):void 0,X.y=F.y?Math.max(R[1]*U,F.y):void 0}if(X.x!==void 0&&X.y!==void 0){const R={id:_,type:"position",position:{...X}};q.push(R)}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}};q.push(H)}for(const R of $){const H={...R,type:"position"};q.push(H)}G(q)},onEnd:({width:F,height:$})=>{const G={id:_,type:"dimensions",resizing:!1,dimensions:{width:F,height:$}};N.getState().triggerNodeChanges([G])}})),P.current.update({controlPosition:L,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:h},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:j,shouldResize:b}),()=>{var F;(F=P.current)==null||F.destroy()}},[L,l,c,f,h,d,w,S,j,b]);const I=L.split("-");return m.jsx("div",{className:Jn(["react-flow__resize-control","nodrag",...I,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(Jze);const vX=180,e4e=70,o0=24,t4e=60;function n4e({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${wR(e.status)}`;return m.jsxs("div",{className:t,children:[m.jsx(Od,{type:"target",position:Ke.Top}),m.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&m.jsxs("div",{className:"agent-flow-meta",children:[m.jsx("span",{className:`status-dot ${wR(e.status)}`}),m.jsx("span",{children:e.status}),e.duration_ms!=null&&m.jsx("span",{children:q0(e.duration_ms)}),e.exit_code!=null&&m.jsxs("span",{children:["exit ",e.exit_code]})]}),m.jsx(Od,{type:"source",position:Ke.Bottom})]})}const r4e={agent:n4e};function i4e(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),f=(i.get(l)||[]).map(h=>({id:`pending-${h.span_id}`,children:[]}));return{id:l,children:[...c,...f]}}return(r.get(null)||[]).map(a)}function s0(e){return e.children.length===0?vX:e.children.reduce((t,n)=>t+s0(n)+o0,-o0)}function yX(e,t,n,r){if(r.set(e.id,{x:t-vX/2,y:n}),e.children.length===0)return;const i=s0(e);let a=t-i/2;for(const o of e.children){const l=s0(o),c=a+l/2;yX(o,c,n+e4e+t4e,r),a+=l+o0}}function a4e({treeData:e,connected:t}){return m.jsx(hX,{children:m.jsx(o4e,{treeData:e,connected:t})})}function o4e({treeData:e,connected:t}){const{fitView:n}=Zb(),r=y.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=i4e(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=s0(v),w=c+b/2;yX(v,w,0,l),c+=b+o0*2}const f=new Map(e.nodes.map(v=>[v.agent_id,v])),h=new Map(e.pending_delegations.map(v=>[`pending-${v.span_id}`,v])),d=[];for(const[v,b]of l){const w=f.get(v),S=h.get(v);w?d.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&&d.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:_d.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:_d.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:d,flowEdges:g}},[e]);return e?m.jsxs("div",{children:[m.jsxs("div",{className:"react-flow-wrapper",children:[m.jsx(Nze,{nodes:i,edges:a,nodeTypes:r4e,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),m.jsx("button",{className:"tree-reset-btn",onClick:r,children:"Reset View"})]}),e.denied_delegations.length>0&&m.jsxs("div",{className:"denied-list",children:[m.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(o=>m.jsxs("span",{className:"denied-item",children:[o.role," (",o.reason,")"]},o.span_id))]})]}):m.jsx("div",{className:"agent-tree",children:m.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Ou=18,u$=10;function s4e({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]??"",[f,h]=y.useState(c),d=y.useRef(null);y.useEffect(()=>{!f||!i||(d.current&&d.current!==f&&o(d.current),d.current=f,a(f))},[f,i,a,o]);const g=r.get(f),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),[]):[],N=y.useRef(null),[O,A]=y.useState(0),[T,P]=y.useState(0),[L,I]=y.useState(!0),F=y.useRef(0),$=v.length*Ou,G=Math.max(0,Math.floor(O/Ou)-u$),D=Math.ceil(T/Ou)+u$*2,V=Math.min(v.length,G+D),z=v.slice(G,V),q=String(v.length).length,X=y.useCallback(()=>{const U=N.current;if(!U)return;A(U.scrollTop),P(U.clientHeight);const B=U.scrollTop+U.clientHeight>=U.scrollHeight-Ou*2;I(B)},[]);y.useEffect(()=>{const U=N.current;U&&P(U.clientHeight)},[]),y.useEffect(()=>{if(L&&v.length>F.current){const U=N.current;U&&(U.scrollTop=U.scrollHeight)}F.current=v.length},[v.length,L]);const K=()=>{const U=N.current;U&&(U.scrollTop=U.scrollHeight,I(!0))},R=async()=>{try{const U=await fetch(`/api/sessions/${e}/logs/${f}/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=`${f}.log`,te.click(),URL.revokeObjectURL(Z)}catch{}};return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[l.length>1&&m.jsxs(da,{value:f,onValueChange:h,children:[m.jsx(ma,{className:"w-[220px]",children:m.jsx(ha,{})}),m.jsx(pa,{children:l.map(U=>m.jsxs(An,{value:U,children:[t[U].role," (",U.slice(0,8),")"]},U))})]}),l.length===1&&m.jsxs("span",{className:"text-sm text-muted-foreground",children:[(H=t[f])==null?void 0:H.role," (",f.slice(0,8),")"]}),m.jsxs("div",{className:"relative ml-auto",children:[m.jsx(RF,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),m.jsx(et,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:S,onChange:U=>j(U.target.value)})]}),S&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[_.length," match",_.length!==1?"es":""]}),m.jsxs(Se,{variant:"outline",size:"sm",onClick:R,children:[m.jsx(I0,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),m.jsx(l4e,{connected:w,done:b,active:n})]}),m.jsxs("div",{className:"relative",children:[m.jsx("div",{ref:N,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:X,children:v.length===0?m.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!b?"Waiting for log output...":"No log output."}):m.jsx("div",{style:{height:$,position:"relative"},children:m.jsx("div",{style:{position:"absolute",top:G*Ou,left:0,right:0},children:z.map((U,B)=>{const Q=G+B,Z=S&&U.toLowerCase().includes(C);return m.jsxs("div",{className:Z?"bg-yellow-900/30":void 0,style:{height:Ou,lineHeight:`${Ou}px`,display:"flex",whiteSpace:"pre"},children:[m.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(q+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),m.jsx("span",{children:Z?m.jsx(u4e,{line:U,search:C}):U})]},Q)})})})}),!L&&v.length>0&&m.jsxs(Se,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:K,children:[m.jsx(Jae,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function l4e({connected:e,done:t,active:n}){return t||!n?m.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):m.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[m.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 u4e({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(m.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)),m.jsx(m.Fragment,{children:n})}function c4e({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(d=>{const g=new Set(d.map(w=>w.id)),v=t.filter(w=>!g.has(w.id));if(v.length===0)return d;const b=[...v,...d];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 d=[];for(const g of e)c.current.has(g.request_id)||(c.current.add(g.request_id),d.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));d.length>0&&i(g=>[...g,...d])},[e]),y.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({behavior:"smooth"})},[r]);const f=(d,g)=>{if(!d.trim())return;const v=`user-${g.request_id}`;c.current.has(v)||(c.current.add(v),i(b=>[...b,{id:v,role:"user",text:d.trim(),timestamp:Date.now()/1e3}])),o(""),n(g.request_id,d.trim())},h=e.length>0?e[0]:null;return m.jsx(kn,{className:"flex h-[500px] flex-col",children:m.jsxs(Nn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[m.jsx(V0,{className:"flex-1",children:m.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&m.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[m.jsx(kp,{className:"h-8 w-8"}),m.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(d=>{const g=d.role==="agent"?e.find(v=>v.request_id===d.id):void 0;return m.jsxs("div",{children:[m.jsx("div",{className:Oe("flex",d.role==="user"?"justify-end":"justify-start"),children:m.jsx("div",{className:Oe("max-w-[80%] rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:m.jsx(Li,{content:d.text,className:"whitespace-pre-wrap"})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&m.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(v=>m.jsx(Se,{variant:"outline",size:"sm",onClick:()=>f(v,g),children:v},v))})]},d.id)}),m.jsx("div",{ref:l})]})}),e.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:m.jsxs(pt,{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:[m.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`]})}),m.jsxs("form",{className:"flex gap-2",onSubmit:d=>{d.preventDefault(),h&&f(a,h)},children:[m.jsx(et,{value:a,onChange:d=>o(d.target.value),placeholder:h?"Type your response...":"Waiting for agent question...",disabled:!h}),m.jsx(Se,{type:"submit",size:"icon",disabled:!h||!a.trim(),children:m.jsx(tse,{className:"h-4 w-4"})})]})]})})}const HE=1e4;function xT(e,t){const[n,r]=y.useState([]),[i,a]=y.useState([]),[o,l]=y.useState([]),[c,f]=y.useState(null),[h,d]=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),N=y.useCallback((T,P)=>{var L;(L=b.current)==null||L.send(JSON.stringify({type:"ask_user_response",request_id:T,text:P}))},[]),O=y.useCallback((T,P)=>{var L;_.current.add(T),(L=b.current)==null||L.send(JSON.stringify({type:"subscribe_logs",agent_id:T,...P!=null&&{offset:P}}))},[]),A=y.useCallback(T=>{var P;_.current.delete(T),v(L=>{const I=new Map(L);return I.delete(T),I}),(P=b.current)==null||P.send(JSON.stringify({type:"unsubscribe_logs",agent_id:T}))},[]);return y.useEffect(()=>{r([]),a([]),l([]),f(null),v(new Map),_.current.clear(),C.current=!1,w.current=0},[e]),y.useEffect(()=>{if(!t){r([]),d(!1);return}function T(){if(C.current)return;const L=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,I=new WebSocket(L);b.current=I,I.onopen=()=>{d(!0),j.current=1e3,I.send(JSON.stringify({type:"init",trace_offset:w.current}));for(const F of _.current)I.send(JSON.stringify({type:"subscribe_logs",agent_id:F}))},I.onmessage=F=>{let $;try{$=JSON.parse(F.data)}catch{return}switch($.type){case"tree_snapshot":case"tree_delta":{const{type:G,...D}=$;f(D);break}case"trace_snapshot":Array.isArray($.events)&&l($.events),typeof $.next_offset=="number"&&(w.current=$.next_offset);break;case"trace_delta":Array.isArray($.events)&&l(G=>[...G,...$.events]),typeof $.next_offset=="number"&&(w.current=$.next_offset);break;case"ask_user":{const G=$;r(D=>D.some(V=>V.request_id===G.request_id)?D:[...D,G]);break}case"ask_user_resolved":typeof $.request_id=="string"?r(G=>G.filter(D=>D.request_id!==$.request_id)):r([]);break;case"chat_history":Array.isArray($.messages)&&a($.messages);break;case"agent_log_snapshot":{const G=$.agent_id,D=$.lines??[],V=$.offset??0;v(z=>{const q=new Map(z);return q.set(G,{lines:D.slice(-HE),offset:V,done:!1}),q});break}case"agent_log_delta":{const G=$.agent_id,D=$.lines??[],V=$.offset??0;D.length>0&&v(z=>{const q=new Map(z),X=q.get(G),K=[...(X==null?void 0:X.lines)??[],...D];return q.set(G,{lines:K.length>HE?K.slice(-HE):K,offset:V,done:(X==null?void 0:X.done)??!1}),q});break}case"agent_log_done":{const G=$.agent_id;v(D=>{const V=new Map(D),z=V.get(G);return z&&V.set(G,{...z,done:!0}),V});break}case"stream_complete":C.current=!0,r([]),I.close(),b.current=null,d(!1);break}},I.onclose=()=>{b.current=null,d(!1),!C.current&&(S.current=setTimeout(()=>{j.current=Math.min(j.current*2,15e3),T()},j.current))},I.onerror=()=>{I.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:h,agentLogs:g,respond:N,subscribeLogs:O,unsubscribeLogs:A}}function f4e(){return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-64"}),m.jsx(hn,{className:"h-32 rounded-lg"}),m.jsx(hn,{className:"h-64 rounded-lg"})]})}function d4e(){const{projectId:e,runId:t}=gp(),[n]=dZ(),r=Number(e),i=I=>I==="starting"||I==="running",a=Xse(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const I=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(I)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:f,chatMessages:h,traceEvents:d,treeData:g,connected:v,agentLogs:b,respond:w,subscribeLogs:S,unsubscribeLogs:j}=xT(t??"",!0),C=g??(o==null?void 0:o.tree)??null,_=(o==null?void 0:o.events)??[],N=d.length>0?d:_,[O,A]=y.useState(void 0);if(y.useEffect(()=>{f.length>0&&A("chat")},[f]),a.isLoading)return m.jsx(f4e,{});if(a.error)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsx("span",{children:"Session not found"})]});const T=x4e(N),P=y4e(N),L=n.get("tab")??(l?"agent-tree":"overview");return m.jsxs("div",{className:"space-y-6",children:[m.jsx(h4e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),m.jsx(g4e,{session:o}),m.jsxs(Mp,{value:O??L,onValueChange:A,children:[m.jsxs(Dp,{children:[m.jsx(or,{value:"overview",children:"Overview"}),c&&m.jsxs(or,{value:"chat",className:"relative",children:["Chat",f.length>0&&m.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),m.jsx(or,{value:"agent-tree",children:"Agent Tree"}),m.jsx(or,{value:"logs",children:"Logs"}),m.jsxs(or,{value:"trace",children:["Trace",N.length>0&&` (${N.length})`]}),m.jsxs(or,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),m.jsxs(sr,{value:"overview",className:"space-y-4",children:[o.user_task&&m.jsx(qE,{label:"User Task",defaultOpen:!0,children:m.jsx(c$,{content:o.user_task})}),o.task&&m.jsx(qE,{label:"Task",defaultOpen:!o.user_task,children:m.jsx(c$,{content:o.task})}),P&&m.jsx(qE,{label:"Output",defaultOpen:!0,children:m.jsx(v4e,{runId:o.run_id,hash:P})}),!o.user_task&&!o.task&&!P&&m.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&m.jsx(sr,{value:"chat",children:m.jsx(c4e,{pendingAskUsers:f,initialMessages:h,respond:w})}),m.jsx(sr,{value:"agent-tree",children:m.jsx(a4e,{treeData:C,connected:v})}),m.jsx(sr,{value:"logs",children:Object.keys(o.agents).length>0?m.jsx(s4e,{runId:o.run_id,agents:o.agents,active:l,agentLogs:b,wsConnected:v,subscribeLogs:S,unsubscribeLogs:j}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),m.jsx(sr,{value:"trace",children:N.length>0?m.jsx(E4e,{events:N,runId:o.run_id}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),m.jsx(sr,{value:"artifacts",children:T.length>0?m.jsx(b4e,{artifacts:T,runId:o.run_id}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function h4e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=kN(),l=e.status==="starting"||e.status==="running";return m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(Se,{variant:"outline",size:"sm",asChild:!0,children:m.jsxs(Pr,{to:t===0?"/imu":`/projects/${t}`,children:[m.jsx(M0,{className:"mr-2 h-4 w-4"}),"Back"]})}),m.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),m.jsx("div",{className:"flex gap-2",children:l&&(i?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Se,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):m.jsxs(Se,{variant:"destructive",onClick:()=>a(!0),children:[m.jsx(PF,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function m4e({status:e}){const t=p4e(e);return m.jsxs(pt,{variant:"outline",className:Oe("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"&&m.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function p4e(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 g4e({session:e}){return m.jsx(kn,{children:m.jsx(Nn,{className:"pt-6",children:m.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),m.jsx("dd",{children:m.jsx(m4e,{status:e.status})}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),m.jsx("dd",{children:e.role}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),m.jsx("dd",{children:e.runtime}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),m.jsx("dd",{children:e.isolation}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),m.jsx("dd",{children:Jy(e.started_at)}),e.ended_at&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),m.jsx("dd",{children:Jy(e.ended_at)})]}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),m.jsx("dd",{children:q0(e.duration_ms)}),e.exit_code!==null&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),m.jsx("dd",{children:e.exit_code})]})]})})})}function qE({label:e,defaultOpen:t,children:n}){return m.jsx(Op,{defaultOpen:t,children:m.jsxs("div",{className:"space-y-2",children:[m.jsxs(Tp,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[m.jsx(Cp,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),e]}),m.jsx(Pp,{children:m.jsx(kn,{children:m.jsx(Nn,{className:"pt-4",children:n})})})]})})}function c$({content:e}){const[t,n]=y.useState("markdown");return m.jsxs(m.Fragment,{children:[m.jsx(Q0,{view:t,onChange:n}),t==="markdown"?m.jsx(Li,{content:e,className:"text-sm"}):m.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e})]})}function v4e({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?m.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?m.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):m.jsxs(m.Fragment,{children:[m.jsx(Q0,{view:o,onChange:l}),o==="markdown"?m.jsx(Li,{content:n,className:"text-sm"}):m.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:n})]})}function y4e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function x4e(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 m.jsx("div",{className:"space-y-1",children:e.map(n=>m.jsxs(Op,{children:[m.jsxs(Tp,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[m.jsx(Cp,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),m.jsx("span",{className:"font-medium text-primary",children:n.label})]}),m.jsx(Pp,{children:m.jsx(w4e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function w4e({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?m.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?m.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):m.jsx(V0,{className:"max-h-[300px] overflow-hidden",children:m.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 S4e({event:e}){const t=j4e(e);return m.jsx(pt,{variant:"outline",className:Oe("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 j4e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function E4e({events:e,runId:t}){const[n,r]=y.useState(null);return m.jsxs(m.Fragment,{children:[m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Time"}),m.jsx(qe,{children:"Event"}),m.jsx(qe,{children:"Span"}),m.jsx(qe,{children:"Details"})]})}),m.jsx(Ha,{children:e.map((i,a)=>m.jsxs(Cn,{children:[m.jsx(He,{className:"text-sm text-muted-foreground",children:Jy(i.ts)}),m.jsx(He,{children:m.jsx(S4e,{event:i.event})}),m.jsx(He,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),m.jsx(He,{className:"max-w-[400px] text-sm",children:C4e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),m.jsx(No,{open:!!n,onOpenChange:()=>r(null),children:m.jsxs(Ao,{className:"max-w-3xl overflow-hidden",children:[m.jsx(Oo,{children:m.jsx(To,{children:n==null?void 0:n.label})}),n&&m.jsx(_4e,{runId:t,hash:n.hash})]})})]})}function _4e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown"),c=y.useRef(null),f=y.useRef(null);return y.useEffect(()=>{const h=d=>{const g=f.current??c.current;if(g&&(d.metaKey||d.ctrlKey)&&d.key==="a"){d.preventDefault();const v=window.getSelection();if(v){v.removeAllRanges();const b=document.createRange();b.selectNodeContents(g),v.addRange(b)}}};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[]),y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(h=>{if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return h.text()}).then(r).catch(h=>a(h.message))},[e,t]),m.jsx("div",{ref:c,className:"space-y-2",children:i?m.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):m.jsxs(m.Fragment,{children:[m.jsx(Q0,{view:o,onChange:l}),m.jsx("div",{ref:f,className:"max-h-[60vh] overflow-y-auto",children:o==="markdown"?m.jsx("div",{className:"p-4",children:m.jsx(Li,{content:n,className:"text-sm"})}):m.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})]})})}function C4e(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(m.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"?q0(o):Array.isArray(o)?o.join(", "):String(o);i.push(m.jsxs("span",{children:[m.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),m.jsx("span",{children:l})]},a))}return m.jsxs(m.Fragment,{children:[r.length>0&&m.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&m.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function k4e(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 N4e({status:e}){return e==="running"||e==="starting"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[m.jsx(Tr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[m.jsx(R0,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[m.jsx(gN,{className:"h-3 w-3"}),"Failed"]}):m.jsx(pt,{variant:"outline",children:e})}function A4e({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";return m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),m.jsx(N4e,{status:e.status}),e.duration_ms!==null&&m.jsx("span",{className:"text-xs text-muted-foreground",children:k4e(e.duration_ms)}),m.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),m.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?m.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(Tr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?m.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):m.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),m.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:[m.jsx(vN,{className:"h-3 w-3"}),"View session"]})]})}function O4e({task:e}){return m.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),m.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:m.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function T4e(){var Is;const{projectId:e,conversationId:t}=gp(),n=Number(e),r=Number(t),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState([]),[h,d]=y.useState(!1),[g,v]=y.useState(!1),[b,w]=y.useState(!1),[S,j]=y.useState(""),[C,_]=y.useState(!1),[N,O]=y.useState(""),[A,T]=y.useState(!1),[P,L]=y.useState(""),[I,F]=y.useState(""),[$,G]=y.useState(""),[D,V]=y.useState(""),[z,q]=y.useState(""),[X,K]=y.useState(""),[R,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),pe=y.useRef(null),ie=y.useRef(null),we=gt(),{data:Ee}=$d(n),Be=(Ee??[]).filter(ge=>ge.type==="roles").map(ge=>ge.name),Ne=bN(n),it=B0(n),Qe=(Is=Ne.data)==null?void 0:Is.merged,{data:Xe,isLoading:It,error:ft,fetchPreviousPage:St,hasPreviousPage:Kt,isFetchingPreviousPage:Dt}=Qy(r),cn=(Xe==null?void 0:Xe.pages.flatMap(ge=>ge.sessions))??[],de=Xe==null?void 0:Xe.pages[Xe.pages.length-1],xe=cn[cn.length-1],Te=(xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="starting";Qy(r,{refetchInterval:Te?2e3:!1});const Ze=HF(r),Je=kN(),Gt=qF(r),nn=SN(n),{pendingAskUsers:je,chatMessages:ot,respond:yt}=xT((xe==null?void 0:xe.run_id)??"",Te&&U),lt=o.trim()&&!Be.includes(o.trim())?"Role not found in installed roles":"",$n=Te;y.useEffect(()=>{if(!te.current)return;const ge=te.current.scrollHeight-re.current;ge>0&&(te.current.scrollTop+=ge,re.current=0)},[Xe==null?void 0:Xe.pages.length]),y.useEffect(()=>{te.current&&((xe==null?void 0:xe.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=xe==null?void 0:xe.run_id)},[xe==null?void 0:xe.run_id]),y.useEffect(()=>{te.current&&(ot.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=ot.length)},[ot.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const ge=new IntersectionObserver(([dt])=>{var Rt;dt.isIntersecting&&Kt&&!Dt&&(re.current=((Rt=te.current)==null?void 0:Rt.scrollHeight)??0,St())},{root:te.current,threshold:.1});return ge.observe(ae.current),()=>ge.disconnect()},[Kt,Dt,St]);const rn=(Ee??[]).filter(ge=>ge.type==="agents").map(ge=>ge.name),dr=[...new Set((Ee??[]).filter(ge=>ge.type==="memories").map(ge=>ge.name)),"none"].sort(),Xr=P.trim()&&rn.length>0&&!rn.includes(P.trim())?"Runtime not found in installed agents":"",Dr=I.trim()&&dr.length>0&&!dr.includes(I.trim())?"Memory not found in installed providers":"",ai=!!Xr||!!Dr,Sr=[P,I,$,D,z,X,R].filter(ge=>ge.trim()).length,Ge=ge=>f(dt=>dt.includes(ge)?dt.filter(Rt=>Rt!==ge):[...dt,ge]),qt=ge=>{ge.preventDefault(),v(!0)},me=ge=>{ge.preventDefault(),v(!0)},We=ge=>{ge.preventDefault(),v(!1)},an=async ge=>{ge.preventDefault(),v(!1);const dt=Array.from(ge.dataTransfer.files);if(dt.length){w(!0);try{const Rt=await Fe.upload(`/projects/${n}/files`,dt);we.invalidateQueries({queryKey:$e.projects.files(n)}),f(on=>{const Sa=Rt.map(Qa=>Qa.path).filter(Qa=>!on.includes(Qa));return[...on,...Sa]})}catch{}finally{w(!1)}}};function jt(ge){ge.preventDefault();const dt=i.trim();if(!dt||lt||ai)return;const Rt={task:dt,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:U,system_prompt:$.trim()||void 0,runtime:P.trim()||void 0,memory:I.trim()||void 0,max_num_delegations:D.trim()?Number(D):void 0,cache_delegations:z?z==="true":void 0,cache_max_entries:X.trim()?Number(X):void 0,cache_ttl_seconds:R.trim()?Number(R):void 0};Ze.mutate(Rt,{onSuccess:()=>{a(""),f([]),d(!1),setTimeout(()=>{var on;return(on=ie.current)==null?void 0:on.focus()},0)}})}function Tn(ge,dt){dt.trim()&&(yt(ge.request_id,dt.trim()),Z(""))}function Gr(ge){ge.key==="Enter"&&!ge.shiftKey&&(ge.preventDefault(),jt(ge))}function hr(){O((de==null?void 0:de.title)??""),_(!0),setTimeout(()=>{var ge;return(ge=pe.current)==null?void 0:ge.select()},0)}function er(){const ge=N.trim();nn.mutate({conversationId:r,title:ge||null}),_(!1)}function Wa(ge){ge.key==="Enter"&&(ge.preventDefault(),er()),ge.key==="Escape"&&_(!1)}if(ft)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",ft.message]})]});const Wr=(de==null?void 0:de.title)??`Conversation #${r}`;return m.jsxs("div",{className:"flex h-full flex-col",children:[m.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[m.jsx("div",{className:"flex items-center gap-3",children:C?m.jsx(et,{ref:pe,value:N,onChange:ge=>O(ge.target.value),onBlur:er,onKeyDown:Wa,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):m.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:hr,title:"Click to rename",children:Wr})}),cn.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[cn.length," session",cn.length!==1?"s":""]})]}),m.jsx("div",{ref:te,className:"min-h-0 flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[m.jsx("div",{ref:ae,className:"h-1"}),Dt&&m.jsx("div",{className:"flex justify-center py-2",children:m.jsx(Tr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!It&&cn.length===0&&m.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),cn.map((ge,dt)=>{const Rt=dt===cn.length-1;return m.jsxs("div",{className:"space-y-4",children:[(ge.user_task??ge.task)&&m.jsx(O4e,{task:ge.user_task??ge.task}),(Rt&&Te?ot:ge.chat_messages??[]).map(on=>m.jsx("div",{className:`flex ${on.role==="user"?"justify-end":"justify-start"}`,children:m.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:m.jsx(Li,{content:on.text,className:"whitespace-pre-wrap"})})},on.id)),m.jsx(A4e,{session:ge,projectId:n})]},ge.run_id)})]})}),(de==null?void 0:de.pending_task)&&(()=>{const ge=de.pending_task.split(`

`).filter(Boolean);return m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:m.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[ge.map((dt,Rt)=>m.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[m.jsx(Tr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),m.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",ge.length>1?` (${Rt+1}/${ge.length})`:"",":"," ",m.jsx("span",{className:"text-foreground",children:dt.split(`
`)[0]})]})]},Rt)),m.jsx("div",{className:"flex justify-end",children:m.jsxs(Se,{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:[m.jsx(lc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),je.length>0&&m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:m.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:je.map(ge=>m.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[m.jsx(Li,{content:ge.question,className:"text-sm font-medium"}),ge.why&&m.jsx(Li,{content:ge.why,className:"text-xs text-muted-foreground"}),ge.choices&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:ge.choices.map(dt=>m.jsx(Se,{type:"button",size:"sm",variant:"outline",onClick:()=>Tn(ge,dt),children:dt},dt))}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(et,{value:Q,onChange:dt=>Z(dt.target.value),onKeyDown:dt=>{dt.key==="Enter"&&!dt.shiftKey&&(dt.preventDefault(),Tn(ge,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),m.jsx(Se,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>Tn(ge,Q),children:m.jsx(Wy,{className:"h-4 w-4"})})]})]},ge.request_id))})}),m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:m.jsxs("form",{onSubmit:jt,className:"mx-auto max-w-2xl space-y-2",children:[m.jsxs("div",{className:"relative",onDragOver:qt,onDragEnter:me,onDragLeave:We,onDrop:an,children:[m.jsx(bo,{ref:ie,value:i,onChange:ge=>a(ge.target.value),onKeyDown:Gr,placeholder:$n?"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:Ze.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(g||b)&&m.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?m.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(Tr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):m.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[m.jsx($0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(it.data??[]).length>0&&m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(fd,{children:[m.jsx(dd,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[m.jsx(yN,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),m.jsxs(hd,{align:"start",className:"w-64",onCloseAutoFocus:ge=>ge.preventDefault(),children:[m.jsx("div",{className:"px-2 py-1.5",children:m.jsx(et,{placeholder:"Filter files…",value:S,onChange:ge=>j(ge.target.value),className:"h-7 text-xs",onKeyDown:ge=>ge.stopPropagation()})}),m.jsx("div",{className:"max-h-48 overflow-y-auto",children:(it.data??[]).filter(ge=>ge.path.toLowerCase().includes(S.toLowerCase())).map(ge=>m.jsx(CN,{checked:c.includes(ge.path),onCheckedChange:()=>Ge(ge.path),onSelect:dt=>dt.preventDefault(),children:m.jsx("span",{className:"font-mono text-xs",children:ge.path})},ge.path))})]})]}),c.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," attached"]})]}),c.length>0&&m.jsxs("div",{className:"flex flex-wrap gap-1",children:[(h?c:c.slice(0,3)).map(ge=>m.jsxs(pt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[m.jsx("button",{type:"button",onClick:()=>Ge(ge),className:"mr-0.5 rounded-sm hover:bg-muted",children:m.jsx(lc,{className:"h-3 w-3"})}),"@",ge]},ge)),!h&&c.length>3&&m.jsxs("button",{type:"button",onClick:()=>d(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",c.length-3," more"]}),h&&c.length>3&&m.jsx("button",{type:"button",onClick:()=>d(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),m.jsx("div",{className:"flex flex-col gap-1.5",children:m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx(et,{list:"datalist-role",value:o,onChange:ge=>l(ge.target.value),placeholder:"Default role",className:"w-48 text-sm"}),lt&&m.jsx("p",{className:"text-xs text-destructive",children:lt})]}),m.jsx("datalist",{id:"datalist-role",children:Be.map(ge=>m.jsx("option",{value:ge},ge))}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(Se,{type:"button",variant:U?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>B(ge=>!ge),title:U?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[m.jsx(kp,{className:"h-3.5 w-3.5"}),U?"Interactive":"Auto"]}),m.jsxs(Se,{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:[m.jsx(z0,{className:"h-4 w-4"}),Sr>0&&m.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Sr})]}),$n&&m.jsxs(Se,{type:"button",variant:"destructive",onClick:()=>xe&&Je.mutate(xe.run_id),disabled:Je.isPending,children:[Je.isPending?m.jsx(Tr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(IF,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),m.jsx(Se,{type:"submit",disabled:!i.trim()||Ze.isPending||!!lt||ai,variant:$n?"outline":"default",title:$n?"Queue task (runs after current session)":void 0,children:Ze.isPending?m.jsx(Tr,{className:"h-4 w-4 animate-spin"}):m.jsx(Wy,{className:"h-4 w-4"})})]})]})})]})}),m.jsx(No,{open:A,onOpenChange:T,children:m.jsxs(Ao,{className:"max-w-lg",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Advanced Options"})}),m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Runtime"}),m.jsx(et,{list:"adv-datalist-runtime",value:P,onChange:ge=>L(ge.target.value),placeholder:(Qe==null?void 0:Qe.runtime)??"default",className:"text-sm"}),m.jsx("datalist",{id:"adv-datalist-runtime",children:rn.map(ge=>m.jsx("option",{value:ge},ge))}),Xr&&m.jsx("p",{className:"text-xs text-destructive",children:Xr})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Memory"}),m.jsx(et,{list:"adv-datalist-memory",value:I,onChange:ge=>F(ge.target.value),placeholder:(Qe==null?void 0:Qe.memory)??"dial",className:"text-sm"}),m.jsx("datalist",{id:"adv-datalist-memory",children:dr.map(ge=>m.jsx("option",{value:ge},ge))}),Dr&&m.jsx("p",{className:"text-xs text-destructive",children:Dr})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"System Prompt"}),m.jsx(bo,{value:$,onChange:ge=>G(ge.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Max Delegations"}),m.jsx(et,{type:"number",min:"0",value:D,onChange:ge=>V(ge.target.value),placeholder:Qe!=null&&Qe.max_num_delegations?String(Qe.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Delegations"}),m.jsxs(da,{value:z||"__empty__",onValueChange:ge=>q(ge==="__empty__"?"":ge),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{placeholder:`Default (${(Qe==null?void 0:Qe.cache_delegations)!==!1?"true":"false"})`})}),m.jsxs(pa,{children:[m.jsxs(An,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Qe==null?void 0:Qe.cache_delegations)!==!1?"true":"false",")"]}),m.jsx(An,{value:"true",children:"true"}),m.jsx(An,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Max Entries"}),m.jsx(et,{type:"number",min:"0",value:X,onChange:ge=>K(ge.target.value),placeholder:Qe!=null&&Qe.cache_max_entries?String(Qe.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache TTL (seconds)"}),m.jsx(et,{type:"number",min:"0",value:R,onChange:ge=>H(ge.target.value),placeholder:Qe!=null&&Qe.cache_ttl_seconds?String(Qe.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),m.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[m.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{L(""),F(""),G(""),V(""),q(""),K(""),H("")},children:"Reset"}),m.jsx(Se,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const VE="imu";function P4e(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 M4e({status:e}){return e==="running"||e==="starting"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[m.jsx(Tr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[m.jsx(R0,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?m.jsxs(pt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[m.jsx(gN,{className:"h-3 w-3"}),"Failed"]}):m.jsx(pt,{variant:"outline",children:e})}function D4e({session:e}){const t=e.status==="running"||e.status==="starting";return m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Bot Imu"}),m.jsx(M4e,{status:e.status}),e.duration_ms!==null&&m.jsx("span",{className:"text-xs text-muted-foreground",children:P4e(e.duration_ms)})]}),m.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:t?m.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(Tr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?m.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):m.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),m.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:[m.jsx(vN,{className:"h-3 w-3"}),"View session"]})]})}function R4e({task:e}){return m.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),m.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:m.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}const I4e=[{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 L4e({onSelectPrompt:e}){return m.jsxs("div",{className:"flex flex-col items-center gap-6 py-12 px-4",children:[m.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[m.jsx(D0,{className:"h-10 w-10 text-muted-foreground"}),m.jsx("h2",{className:"text-lg font-semibold",children:"Hi, I'm Imu"}),m.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."})]}),m.jsx("div",{className:"w-full max-w-md space-y-4",children:I4e.map(t=>m.jsxs("div",{className:"space-y-2",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.group}),m.jsx("div",{className:"flex flex-col gap-1.5",children:t.prompts.map(n=>m.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 z4e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(!0),[a,o]=y.useState(!1),[l,c]=y.useState(""),[f,h]=y.useState(!1),[d,g]=y.useState(""),[v,b]=y.useState(""),[w,S]=y.useState(""),[j,C]=y.useState(""),[_,N]=y.useState(""),[O,A]=y.useState(""),[T,P]=y.useState(""),[L,I]=y.useState(!1),[F,$]=y.useState(!1),[G,D]=y.useState([]),[V,z]=y.useState(!1),[q,X]=y.useState(""),[K,R]=y.useState(""),H=gt(),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}=Gu("agents"),{data:se}=Gu("memories"),pe=B0(0),ie=me=>D(We=>We.includes(me)?We.filter(an=>an!==me):[...We,me]),{data:we,isLoading:Ee,error:Be,fetchPreviousPage:Ne,hasPreviousPage:it,isFetchingPreviousPage:Qe}=Qy(e),Xe=(we==null?void 0:we.pages.flatMap(me=>me.sessions))??[],It=we==null?void 0:we.pages[we.pages.length-1],ft=Xe[Xe.length-1],St=(ft==null?void 0:ft.status)==="running"||(ft==null?void 0:ft.status)==="starting";Qy(e,{refetchInterval:St?2e3:!1});const Kt=HF(e),Dt=kN(),cn=qF(e),de=jN(),{pendingAskUsers:xe,chatMessages:Te,respond:Ze}=xT((ft==null?void 0:ft.run_id)??"",St&&r),Je=(ee??[]).map(me=>me.name),Gt=[...new Set((se??[]).map(me=>me.name)),"none"].sort(),nn=d.trim()&&Je.length>0&&!Je.includes(d.trim())?"Runtime not found in installed agents":"",je=v.trim()&&Gt.length>0&&!Gt.includes(v.trim())?"Memory not found in installed providers":"",ot=!!nn||!!je,yt=[d,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)},[we==null?void 0:we.pages.length]),y.useEffect(()=>{U.current&&((ft==null?void 0:ft.run_id)!==Z.current&&(U.current.scrollTop=U.current.scrollHeight),Z.current=ft==null?void 0:ft.run_id)},[ft==null?void 0:ft.run_id]),y.useEffect(()=>{U.current&&(Te.length>te.current&&(U.current.scrollTop=U.current.scrollHeight),te.current=Te.length)},[Te.length]),y.useEffect(()=>{if(!B.current||!U.current)return;const me=new IntersectionObserver(([We])=>{var an;We.isIntersecting&&it&&!Qe&&(Q.current=((an=U.current)==null?void 0:an.scrollHeight)??0,Ne())},{root:U.current,threshold:.1});return me.observe(B.current),()=>me.disconnect()},[it,Qe,Ne]);const lt=me=>{me.preventDefault(),I(!0)},$n=me=>{me.preventDefault(),I(!0)},rn=me=>{me.preventDefault(),I(!1)},dr=async me=>{me.preventDefault(),I(!1);const We=Array.from(me.dataTransfer.files);if(We.length){$(!0);try{const an=await Fe.upload("/projects/0/files",We);H.invalidateQueries({queryKey:$e.projects.files(0)}),D(jt=>{const Tn=an.map(Gr=>Gr.path).filter(Gr=>!jt.includes(Gr));return[...jt,...Tn]})}catch{}finally{$(!1)}}};function Xr(me){me.preventDefault();const We=t.trim();!We||ot||Kt.mutate({task:We,role:VE,interactive:r,context_files:G.length>0?G:void 0,system_prompt:w.trim()||void 0,runtime:d.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(""),D([]),z(!1),setTimeout(()=>{var an;return(an=re.current)==null?void 0:an.focus()},0)}})}function Dr(me,We){We.trim()&&(Ze(me.request_id,We.trim()),R(""))}function ai(me){me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),Xr(me))}function Sr(){c((It==null?void 0:It.title)??""),o(!0),setTimeout(()=>{var me;return(me=ae.current)==null?void 0:me.select()},0)}function Ge(){const me=l.trim();de.mutate({conversationId:e,title:me||null}),o(!1)}if(Be)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",Be.message]})]});const qt=(It==null?void 0:It.title)??`Conversation #${e}`;return m.jsxs("div",{className:"flex h-full flex-col",children:[m.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[m.jsx("div",{className:"flex items-center gap-3",children:a?m.jsx(et,{ref:ae,value:l,onChange:me=>c(me.target.value),onBlur:Ge,onKeyDown:me=>{me.key==="Enter"&&(me.preventDefault(),Ge()),me.key==="Escape"&&o(!1)},className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${e}`}):m.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:Sr,title:"Click to rename",children:qt})}),Xe.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[Xe.length," session",Xe.length!==1?"s":""]})]}),m.jsx("div",{ref:U,className:"min-h-0 flex-1 overflow-y-auto",children:m.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[m.jsx("div",{ref:B,className:"h-1"}),Qe&&m.jsx("div",{className:"flex justify-center py-2",children:m.jsx(Tr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&Xe.length===0&&m.jsx(L4e,{onSelectPrompt:me=>{Kt.mutate({task:me,role:VE,interactive:r},{onSuccess:()=>{setTimeout(()=>{var We;return(We=re.current)==null?void 0:We.focus()},0)}})}}),Xe.map((me,We)=>{const an=We===Xe.length-1;return m.jsxs("div",{className:"space-y-4",children:[(me.user_task??me.task)&&m.jsx(R4e,{task:me.user_task??me.task}),(an&&St?Te:me.chat_messages??[]).map(jt=>m.jsx("div",{className:`flex ${jt.role==="user"?"justify-end":"justify-start"}`,children:m.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${jt.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:m.jsx(Li,{content:jt.text,className:"whitespace-pre-wrap"})})},jt.id)),m.jsx(D4e,{session:me})]},me.run_id)})]})}),(It==null?void 0:It.pending_task)&&(()=>{const me=It.pending_task.split(`

`).filter(Boolean);return m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:m.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[me.map((We,an)=>m.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[m.jsx(Tr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),m.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",me.length>1?` (${an+1}/${me.length})`:"",":"," ",m.jsx("span",{className:"text-foreground",children:We.split(`
`)[0]})]})]},an)),m.jsx("div",{className:"flex justify-end",children:m.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>cn.mutate(),disabled:cn.isPending,children:[m.jsx(lc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),xe.length>0&&m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:m.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:xe.map(me=>m.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[m.jsx(Li,{content:me.question,className:"text-sm font-medium"}),me.why&&m.jsx(Li,{content:me.why,className:"text-xs text-muted-foreground"}),me.choices&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:me.choices.map(We=>m.jsx(Se,{type:"button",size:"sm",variant:"outline",onClick:()=>Dr(me,We),children:We},We))}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(et,{value:K,onChange:We=>R(We.target.value),onKeyDown:We=>{We.key==="Enter"&&!We.shiftKey&&(We.preventDefault(),Dr(me,K))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),m.jsx(Se,{type:"button",size:"icon",disabled:!K.trim(),onClick:()=>Dr(me,K),children:m.jsx(Wy,{className:"h-4 w-4"})})]})]},me.request_id))})}),m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:m.jsxs("form",{onSubmit:Xr,className:"mx-auto max-w-2xl space-y-2",children:[m.jsxs("div",{className:"relative",onDragOver:lt,onDragEnter:$n,onDragLeave:rn,onDrop:dr,children:[m.jsx(bo,{ref:re,value:t,onChange:me=>n(me.target.value),onKeyDown:ai,placeholder:St?"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}),(L||F)&&m.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?m.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(Tr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):m.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[m.jsx($0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(fd,{children:[m.jsx(dd,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[m.jsx(yN,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),m.jsxs(hd,{align:"start",className:"w-64",onCloseAutoFocus:me=>me.preventDefault(),children:[m.jsx("div",{className:"px-2 py-1.5",children:m.jsx(et,{placeholder:"Filter files…",value:q,onChange:me=>X(me.target.value),className:"h-7 text-xs",onKeyDown:me=>me.stopPropagation()})}),m.jsx("div",{className:"max-h-48 overflow-y-auto",children:(pe.data??[]).filter(me=>me.path.toLowerCase().includes(q.toLowerCase())).map(me=>m.jsx(CN,{checked:G.includes(me.path),onCheckedChange:()=>ie(me.path),onSelect:We=>We.preventDefault(),children:m.jsx("span",{className:"font-mono text-xs",children:me.path})},me.path))})]})]}),G.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[G.length," attached"]})]}),G.length>0&&m.jsxs("div",{className:"flex flex-wrap gap-1",children:[(V?G:G.slice(0,3)).map(me=>m.jsxs(pt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[m.jsx("button",{type:"button",onClick:()=>ie(me),className:"mr-0.5 rounded-sm hover:bg-muted",children:m.jsx(lc,{className:"h-3 w-3"})}),"@",me]},me)),!V&&G.length>3&&m.jsxs("button",{type:"button",onClick:()=>z(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",G.length-3," more"]}),V&&G.length>3&&m.jsx("button",{type:"button",onClick:()=>z(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("span",{className:"text-xs text-muted-foreground px-1",children:["Role: ",VE]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(Se,{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:[m.jsx(kp,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),m.jsxs(Se,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),title:"Advanced options",children:[m.jsx(z0,{className:"h-4 w-4"}),yt>0&&m.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:yt})]}),St&&m.jsxs(Se,{type:"button",variant:"destructive",onClick:()=>ft&&Dt.mutate(ft.run_id),disabled:Dt.isPending,children:[Dt.isPending?m.jsx(Tr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(IF,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),m.jsx(Se,{type:"submit",disabled:!t.trim()||Kt.isPending||ot,variant:St?"outline":"default",title:St?"Queue task (runs after current session)":void 0,children:Kt.isPending?m.jsx(Tr,{className:"h-4 w-4 animate-spin"}):m.jsx(Wy,{className:"h-4 w-4"})})]})]})]})}),m.jsx(No,{open:f,onOpenChange:h,children:m.jsxs(Ao,{className:"max-w-lg",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Advanced Options"})}),m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Runtime"}),m.jsx(et,{list:"imu-adv-runtime",value:d,onChange:me=>g(me.target.value),placeholder:"default",className:"text-sm"}),m.jsx("datalist",{id:"imu-adv-runtime",children:Je.map(me=>m.jsx("option",{value:me},me))}),nn&&m.jsx("p",{className:"text-xs text-destructive",children:nn})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Memory"}),m.jsx(et,{list:"imu-adv-memory",value:v,onChange:me=>b(me.target.value),placeholder:"dial",className:"text-sm"}),m.jsx("datalist",{id:"imu-adv-memory",children:Gt.map(me=>m.jsx("option",{value:me},me))}),je&&m.jsx("p",{className:"text-xs text-destructive",children:je})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"System Prompt"}),m.jsx(bo,{value:w,onChange:me=>S(me.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Max Delegations"}),m.jsx(et,{type:"number",min:"0",value:j,onChange:me=>C(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Delegations"}),m.jsxs(da,{value:_||"__empty__",onValueChange:me=>N(me==="__empty__"?"":me),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{placeholder:"Default (true)"})}),m.jsxs(pa,{children:[m.jsx(An,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),m.jsx(An,{value:"true",children:"true"}),m.jsx(An,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache Max Entries"}),m.jsx(et,{type:"number",min:"0",value:O,onChange:me=>A(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{children:"Cache TTL (seconds)"}),m.jsx(et,{type:"number",min:"0",value:T,onChange:me=>P(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),m.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[m.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),N(""),A(""),P("")},children:"Reset"}),m.jsx(Se,{size:"sm",onClick:()=>h(!1),children:"Done"})]})]})})]})}function $4e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=jN();function l(f){f.stopPropagation(),i(e.title??""),n(!0),setTimeout(()=>{var h;return(h=a.current)==null?void 0:h.select()},0)}function c(f){f.stopPropagation(),o.mutate({conversationId:e.id,title:r.trim()||null}),n(!1)}return t?m.jsx(et,{ref:a,value:r,onChange:f=>i(f.target.value),onBlur:c,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),c(f)),f.key==="Escape"&&(f.stopPropagation(),n(!1))},onClick:f=>f.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:`Conversation #${e.id}`}):m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"font-medium",children:e.title??`Conversation #${e.id}`}),m.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:m.jsx(Np,{className:"h-3 w-3"})})]})}function B4e({conv:e}){const[t,n]=y.useState(!1),r=KF();return t?m.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[m.jsx(Se,{size:"sm",variant:"destructive",disabled:r.isPending,onClick:i=>{i.stopPropagation(),r.mutate(e.id,{onSuccess:()=>n(!1),onError:()=>n(!1)})},children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):m.jsx(Se,{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:m.jsx(Ya,{className:"h-3.5 w-3.5"})})}function F4e(){var d,g,v;const e=xa(),t=F0(),n=VF(),[r,i]=y.useState(1),a=GF(0,r),[o,l]=y.useState("conversations"),c=((d=a.data)==null?void 0:d.items)??[],f=((g=a.data)==null?void 0:g.total)??0,h=a.data?Math.ceil(a.data.total/a.data.per_page):0;return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-start justify-between",children:[m.jsxs("div",{children:[m.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[m.jsx(D0,{className:"h-6 w-6"}),"Bot Imu"]}),m.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."})]}),m.jsxs(Se,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?m.jsx(Tr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(kp,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),m.jsxs(Mp,{value:o,onValueChange:l,children:[m.jsxs(Dp,{children:[m.jsxs(or,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),m.jsxs(or,{value:"sessions",children:["Sessions (",f,")"]}),m.jsx(or,{value:"activity",children:"Activity"}),m.jsx(or,{value:"files",children:"Files"})]}),m.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(t.data??[]).length===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[m.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),m.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),m.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),m.jsx("th",{className:"px-4 py-2"})]})}),m.jsx("tbody",{children:(t.data??[]).map(b=>m.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>e(`/imu/${b.id}`),children:[m.jsx("td",{className:"px-4 py-2",children:m.jsx($4e,{conv:b})}),m.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:b.session_count}),m.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()}),m.jsx("td",{className:"px-4 py-2 text-right",children:m.jsx(B4e,{conv:b})})]},b.id))})]})})})}),m.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:f===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):m.jsxs(m.Fragment,{children:[m.jsx(kn,{children:m.jsx(Nn,{className:"p-0",children:m.jsx(Zy,{sessions:c})})}),m.jsx(NN,{page:r,totalPages:h,onPageChange:i})]})}),m.jsx(sr,{value:"activity",className:"mt-4",children:m.jsx(LK,{projectId:0})}),m.jsx(sr,{value:"files",className:"mt-4",children:m.jsx(cU,{projectId:0})})]})]})}function f$(){const{conversationId:e}=gp(),t=e?Number(e):null;return t!==null?m.jsx(z4e,{cid:t}):m.jsx(F4e,{})}const U4e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},H4e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function q4e(){const{resourceType:e="roles"}=gp(),{data:t,isLoading:n}=Gu(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(!1),{data:f}=sge(e,r??"",{enabled:a&&!!r}),h=H4e[e]??e;return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:h}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",h.toLowerCase()," from StrawHub"]})]}),m.jsxs(Se,{onClick:()=>c(!0),size:"sm",children:[m.jsx(I0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?m.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((d,g)=>m.jsx(hn,{className:"h-12 w-full"},g))}):!t||t.length===0?m.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",h.toLowerCase()," installed yet."]}):m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Version"}),m.jsx(qe,{children:"Description"}),m.jsx(qe,{children:"Source"}),m.jsx(qe,{className:"w-24"})]})}),m.jsx(Ha,{children:t.map(d=>{var g;return m.jsxs(Cn,{className:"cursor-pointer",onClick:()=>{i(d.name),o(!0)},children:[m.jsx(He,{className:"font-medium",children:d.name}),m.jsx(He,{className:"text-sm text-muted-foreground",children:d.version??"—"}),m.jsx(He,{className:"max-w-[300px] truncate text-sm",children:d.description||"—"}),m.jsx(He,{children:m.jsx(pt,{variant:"outline",className:"text-xs",children:d.source})}),m.jsx(He,{children:!((g=U4e[e])!=null&&g.includes(d.name))&&m.jsx(V4e,{resourceType:e,name:d.name})})]},d.name)})})]}),m.jsx(vH,{resource:f??null,resourceType:e,open:a,onOpenChange:o}),m.jsx(YN,{open:l,onOpenChange:c,defaultType:e})]})}function V4e({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?Ht.success(`Uninstalled ${t}`):Ht.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{Ht.error("Uninstall request failed"),r(!1)}})};return n?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Se,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),m.jsx(Se,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):m.jsx(Se,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:m.jsx(Ya,{className:"h-4 w-4"})})}function xX(e){return Un({queryKey:e?[...$e.schedules.all,e]:$e.schedules.all,queryFn:()=>Fe.get(e?`/schedules?type=${e}`:"/schedules")})}function K4e(e=1,t=20){return Un({queryKey:[...$e.schedules.runs,e,t],queryFn:()=>Fe.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function Y4e(){const e=gt();return Bt({mutationFn:t=>Fe.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:$e.schedules.all})}})}function X4e(){const e=gt();return Bt({mutationFn:t=>Fe.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:$e.schedules.all})}})}function G4e(){const e=gt();return Bt({mutationFn:({id:t,...n})=>Fe.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:$e.schedules.all})}})}function bX(){const e=gt();return Bt({mutationFn:t=>Fe.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:$e.schedules.all})}})}function wX(){const e=gt();return Bt({mutationFn:({id:t,enable:n})=>Fe.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:$e.schedules.all})}})}var KE={exports:{}},d$;function W4e(){return d$||(d$=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 f=c(515),h=(function(){function d(g,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return d.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},d.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},d.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},d.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 N=g[C].split("/");g[C]="".concat(N[0],"-").concat(_,"/").concat(N[1])}}},d.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)},d.prototype.validateAnyRanges=function(g){f.default.secondRange(g[0]),f.default.minuteRange(g[1]),f.default.hourRange(g[2]),f.default.dayOfMonthRange(g[3]),f.default.monthRange(g[4],this.monthStartIndexZero),f.default.dayOfWeekRange(g[5],this.dayOfWeekStartIndexZero)},d.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(),"'"))},d})();l.CronParser=h},333(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var f=c(823),h=c(949),d=(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,N=w.dayOfWeekStartIndexZero,O=N===void 0?!0:N,A=w.monthStartIndexZero,T=A===void 0?!1:A,P=w.use24HourTimeFormat,L=w.locale,I=L===void 0?null:L,F=w.logicalAndDayFields,$=F===void 0?!1:F,G={throwExceptionOnParseError:j,verbose:_,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:P,locale:I,logicalAndDayFields:$};G.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var D=new g(v,G);return D.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 h.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(),N=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+N+_+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(!f.StringUtilities.containsAny(b,g.specialCharacters)&&!f.StringUtilities.containsAny(w,g.specialCharacters)&&!f.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)&&!f.StringUtilities.containsAny(w,g.specialCharacters)){var j=b.split("-");S+=f.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&&!f.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 N=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(S+=N,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 f.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 f.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 N=_.split("-");N.length===2&&S.push({value:N[1],index:w+1}),w+=N.length});var j=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(_){var N=S.find(function(A){return A.value===_&&A.index===j}),O=N&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(_,"59",""):v.formatTime(_,"0","")},function(_){return f.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),N=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}N=O+" "+N}return N},function(S){return parseInt(S)==1?"":f.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 N=v.expressionParts[3]!="*";N?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?"":f.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():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),j.toString());b=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var _=w.match(/L-(\d{1,2})/);if(_){var N=_[1];b=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(N),N);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?f.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 f.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,N=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)_="";else if(v==="*")_=b;else if(!N&&!O&&!A)_=f.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),P="",L=0;L<T.length;L++)if(L>0&&T.length>2&&(P+=",",L<T.length-1&&(P+=" ")),L>0&&T.length>1&&(L==T.length-1||T.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),T[L].indexOf("/")>-1||T[L].indexOf("-")>-1){var I=T[L].indexOf("-")>-1&&T[L].indexOf("/")==-1,F=this.getSegmentDescription(T[L],b,w,S,I?this.i18n.commaX0ThroughX1:j,C);I&&(F=F.replace(", ","")),P+=F}else if(!N)P+=w(T[L]);else{var $=this.getSegmentDescription(T[L],b,w,S,j,C);$&&$.startsWith(", ")&&($=$.substring(2)),P+=$}N?_=P:_=f.StringUtilities.format(C(v),P)}else if(N){var T=v.split("/");if(_=f.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var G=this.generateRangeSegmentDescription(T[0],j,w);G.indexOf(", ")!=0&&(_+=", "),_+=G}else if(T[0].indexOf("*")==-1){var D=f.StringUtilities.format(C(T[0]),w(T[0]));D=D.replace(", ",""),_+=f.StringUtilities.format(this.i18n.commaStartingX0(),D)}}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),N=b(v);return S+=f.StringUtilities.format(N,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 N="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),N=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?N:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+_.toString()).substring(_.toString().length)).concat(A).concat(O?"":N)},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=d},747(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var f=c(486),h=(function(){function d(){}return d.prototype.load=function(g){g.en=new f.en},d})();l.enLocaleLoader=h},486(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(function(){function f(){}return f.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},f.prototype.atX0MinutesPastTheHourGt20=function(){return null},f.prototype.commaMonthX0ThroughMonthX1=function(){return null},f.prototype.commaYearX0ThroughYearX1=function(){return null},f.prototype.use24HourTimeFormatByDefault=function(){return!1},f.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},f.prototype.everyMinute=function(){return"every minute"},f.prototype.everyHour=function(){return"every hour"},f.prototype.atSpace=function(){return"At "},f.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},f.prototype.at=function(){return"At"},f.prototype.spaceAnd=function(){return" and"},f.prototype.everySecond=function(){return"every second"},f.prototype.everyX0Seconds=function(){return"every %s seconds"},f.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},f.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},f.prototype.everyX0Minutes=function(){return"every %s minutes"},f.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},f.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},f.prototype.everyX0Hours=function(){return"every %s hours"},f.prototype.betweenX0AndX1=function(){return"between %s and %s"},f.prototype.atX0=function(){return"at %s"},f.prototype.commaEveryDay=function(){return", every day"},f.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},f.prototype.commaX0ThroughX1=function(){return", %s through %s"},f.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},f.prototype.first=function(){return"first"},f.prototype.second=function(){return"second"},f.prototype.third=function(){return"third"},f.prototype.fourth=function(){return"fourth"},f.prototype.fifth=function(){return"fifth"},f.prototype.commaOnThe=function(){return", on the "},f.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},f.prototype.lastDay=function(){return"the last day"},f.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},f.prototype.commaOnlyOnX0=function(){return", only on %s"},f.prototype.commaAndOnX0=function(){return", and on %s"},f.prototype.commaEveryX0Months=function(){return", every %s months"},f.prototype.commaOnlyInX0=function(){return", only in %s"},f.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},f.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},f.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},f.prototype.firstWeekday=function(){return"first weekday"},f.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},f.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},f.prototype.commaEveryX0Days=function(){return", every %s days in a month"},f.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},f.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},f.prototype.commaEveryHour=function(){return", every hour"},f.prototype.commaEveryX0Years=function(){return", every %s years"},f.prototype.commaStartingX0=function(){return", starting %s"},f.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},f.prototype.atReboot=function(){return"Run once, at startup"},f.prototype.onTheHour=function(){return"on the hour"},f})();l.en=c},515(o,l){Object.defineProperty(l,"__esModule",{value:!0});function c(h,d){if(!h)throw new Error(d)}var f=(function(){function h(){}return h.secondRange=function(d){for(var g=d.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")}},h.minuteRange=function(d){for(var g=d.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")}},h.hourRange=function(d){for(var g=d.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")}},h.dayOfMonthRange=function(d){for(var g=d.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")}},h.monthRange=function(d,g){for(var v=d.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")}},h.dayOfWeekRange=function(d,g){for(var v=d.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")}},h})();l.default=f},823(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var c=(function(){function f(){}return f.format=function(h){for(var d=[],g=1;g<arguments.length;g++)d[g-1]=arguments[g];return h.replace(/%s/g,function(v){return d.shift()})},f.containsAny=function(h,d){return d.some(function(g){return h.indexOf(g)>-1})},f})();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 f=l.ExpressionDescriptor.toString;o.toString=f})(),a})())})(KE)),KE.exports}var Q4e=W4e();const Z4e=Hi(Q4e),J4e=[{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 e5e({open:e,onOpenChange:t,editing:n}){const{data:r}=Ac(),i=Y4e(),a=G4e(),[o,l]=y.useState(""),[c,f]=y.useState(""),[h,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(!0),[N,O]=y.useState(!1),A=n?n.project_id:Number(c)||0,{data:T}=$d(A),P=y.useMemo(()=>(T??[]).filter(D=>D.type==="roles").map(D=>D.name),[T]);y.useEffect(()=>{e&&n?(l(n.name),f(String(n.project_id)),d(n.task),v(n.cron_expr??""),w(n.role??""),j(n.system_prompt??""),_(n.skip_if_running)):e&&!n&&L()},[e,n]);function L(){l(""),f(""),d(""),v(""),w(""),j(""),_(!0),O(!1)}async function I(D){D.preventDefault();try{const V={name:o.trim(),task:h.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,...V}):await i.mutateAsync({...V,project_id:Number(c)}),L(),t(!1)}catch{}}const F=y.useMemo(()=>{if(!g.trim())return null;try{return Z4e.toString(g.trim())}catch{return null}},[g]),$=i.isPending||a.isPending,G=i.error||a.error;return m.jsx(No,{open:e,onOpenChange:t,children:m.jsxs(Ao,{className:"max-w-lg",children:[m.jsx(Oo,{children:m.jsx(To,{children:n?"Edit Schedule":"Create Schedule"})}),m.jsxs("form",{onSubmit:I,className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"sched-name",children:["Name ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(et,{id:"sched-name",value:o,onChange:D=>l(D.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"sched-project",children:["Project ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs(da,{value:c,onValueChange:f,required:!0,children:[m.jsx(ma,{id:"sched-project",children:m.jsx(ha,{placeholder:"Select a project"})}),m.jsx(pa,{children:(r??[]).map(D=>m.jsx(An,{value:String(D.id),children:D.display_name},D.id))})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"sched-task",children:["Task ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(bo,{id:"sched-task",value:h,onChange:D=>d(D.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs(st,{htmlFor:"sched-cron",children:["Cron Expression ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs(fd,{children:[m.jsx(dd,{asChild:!0,children:m.jsxs(Se,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",m.jsx(cd,{className:"ml-1 h-3 w-3"})]})}),m.jsx(hd,{align:"end",children:J4e.map(D=>m.jsxs(vm,{onClick:()=>v(D.value),children:[m.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:D.value}),D.label]},D.value))})]})]}),m.jsx(et,{id:"sched-cron",value:g,onChange:D=>v(D.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),F&&m.jsx("p",{className:"text-xs text-muted-foreground",children:F})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"sched-role",children:"Role"}),m.jsx(et,{id:"sched-role",value:b,onChange:D=>w(D.target.value),placeholder:P[0]??"orchestrator",list:"sched-role-list"}),m.jsx("datalist",{id:"sched-role-list",children:P.map(D=>m.jsx("option",{value:D},D))}),b.trim()&&P.length>0&&!P.includes(b.trim())&&m.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),m.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:C,onChange:D=>_(D.target.checked),className:"rounded border-input"}),m.jsx("span",{className:"text-sm",children:"Skip if already running"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),m.jsxs(Op,{open:N,onOpenChange:O,children:[m.jsx(Tp,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[m.jsx(cd,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),m.jsx(Pp,{className:"space-y-4 pt-2",children:m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"sched-prompt",children:"System Prompt"}),m.jsx(bo,{id:"sched-prompt",value:S,onChange:D=>j(D.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),G&&m.jsx("p",{className:"text-sm text-destructive",children:G.message}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.jsx(Se,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),m.jsx(Se,{type:"submit",disabled:$||!!b.trim()&&P.length>0&&!P.includes(b.trim()),children:$?"Saving...":n?"Update":"Create"})]})]})]})})}function h$(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 t5e({schedule:e}){return e.enabled?e.last_error?m.jsx(mN,{children:m.jsxs(EF,{children:[m.jsx(_F,{children:m.jsx(pt,{variant:"destructive",children:"Error"})}),m.jsx(CF,{className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:e.last_error})})]})}):m.jsx(pt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):m.jsx(pt,{variant:"secondary",children:"Disabled"})}function n5e(){const{data:e,isLoading:t,error:n}=xX("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=bX(),c=wX();if(t)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-48"}),m.jsx(hn,{className:"h-64 rounded-lg"})]});if(n)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",n.message]})]});const f=e??[];return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Recurring Schedules"}),m.jsxs(Se,{onClick:()=>{o(null),i(!0)},children:[m.jsx(sc,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),f.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[m.jsx("p",{className:"text-muted-foreground",children:"No recurring schedules yet."}),m.jsxs(Se,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[m.jsx(sc,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):m.jsx("div",{className:"rounded-lg border",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Project"}),m.jsx(qe,{children:"Cron"}),m.jsx(qe,{children:"Next Run"}),m.jsx(qe,{children:"Last Run"}),m.jsx(qe,{children:"Status"}),m.jsx(qe,{className:"w-[120px]",children:"Actions"})]})}),m.jsx(Ha,{children:f.map(h=>m.jsxs(Cn,{children:[m.jsx(He,{className:"font-medium",children:h.name}),m.jsx(He,{className:"text-muted-foreground",children:h.project_name}),m.jsx(He,{children:m.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:h.cron_expr})}),m.jsx(He,{className:"text-sm text-muted-foreground",children:h$(h.next_run_at)}),m.jsx(He,{className:"text-sm text-muted-foreground",children:h$(h.last_run_at)}),m.jsx(He,{children:m.jsx(t5e,{schedule:h})}),m.jsx(He,{children:m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(h),i(!0)},children:m.jsx(Np,{className:"h-3.5 w-3.5"})}),m.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:h.id,enable:!h.enabled}),children:h.enabled?m.jsx(MF,{className:"h-3.5 w-3.5"}):m.jsx(L0,{className:"h-3.5 w-3.5"})}),m.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${h.name}"?`)&&l.mutate(h.id)},children:m.jsx(Ya,{className:"h-3.5 w-3.5"})})]})})]},h.id))})]})}),m.jsx(e5e,{open:r,onOpenChange:i,editing:a})]})}function r5e({open:e,onOpenChange:t}){const{data:n}=Ac(),r=X4e(),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState(""),[h,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(!1),C=Number(o)||0,{data:_}=$d(C),N=y.useMemo(()=>(_??[]).filter(P=>P.type==="roles").map(P=>P.name),[_]);y.useEffect(()=>{e&&O()},[e]);function O(){a(""),l(""),f(""),d(""),v(""),w(""),j(!1)}async function A(P){P.preventDefault();try{const L=new Date(h);await r.mutateAsync({name:i.trim(),project_id:Number(o),task:c.trim(),run_at:L.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 m.jsx(No,{open:e,onOpenChange:t,children:m.jsxs(Ao,{className:"max-w-lg",children:[m.jsx(Oo,{children:m.jsx(To,{children:"Create One-Time Schedule"})}),m.jsxs("form",{onSubmit:A,className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"ot-name",children:["Name ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(et,{id:"ot-name",value:i,onChange:P=>a(P.target.value),placeholder:"e.g. deploy-tonight",required:!0,autoFocus:!0})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"ot-project",children:["Project ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs(da,{value:o,onValueChange:l,required:!0,children:[m.jsx(ma,{id:"ot-project",children:m.jsx(ha,{placeholder:"Select a project"})}),m.jsx(pa,{children:(n??[]).map(P=>m.jsx(An,{value:String(P.id),children:P.display_name},P.id))})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"ot-task",children:["Task ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(bo,{id:"ot-task",value:c,onChange:P=>f(P.target.value),placeholder:"What should the agent do?",required:!0,rows:3})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(st,{htmlFor:"ot-run-at",children:["Run At ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(et,{id:"ot-run-at",type:"datetime-local",value:h,onChange:P=>d(P.target.value),min:T,required:!0}),m.jsx("p",{className:"text-xs text-muted-foreground",children:"Schedule will fire once at this time and then auto-disable."})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"ot-role",children:"Role"}),m.jsx(et,{id:"ot-role",value:g,onChange:P=>v(P.target.value),placeholder:N[0]??"orchestrator",list:"ot-role-list"}),m.jsx("datalist",{id:"ot-role-list",children:N.map(P=>m.jsx("option",{value:P},P))}),g.trim()&&N.length>0&&!N.includes(g.trim())&&m.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),m.jsxs(Op,{open:S,onOpenChange:j,children:[m.jsx(Tp,{asChild:!0,children:m.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[m.jsx(cd,{className:`h-3 w-3 transition-transform ${S?"rotate-180":""}`}),"Advanced Options"]})}),m.jsx(Pp,{className:"space-y-4 pt-2",children:m.jsxs("div",{className:"space-y-2",children:[m.jsx(st,{htmlFor:"ot-prompt",children:"System Prompt"}),m.jsx(bo,{id:"ot-prompt",value:b,onChange:P=>w(P.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),r.error&&m.jsx("p",{className:"text-sm text-destructive",children:r.error.message}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.jsx(Se,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),m.jsx(Se,{type:"submit",disabled:r.isPending||!!g.trim()&&N.length>0&&!N.includes(g.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function m$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function i5e({schedule:e}){return!e.enabled&&e.last_run_at?m.jsx(pt,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?m.jsx(mN,{children:m.jsxs(EF,{children:[m.jsx(_F,{children:m.jsx(pt,{variant:"destructive",children:"Error"})}),m.jsx(CF,{className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:e.last_error})})]})}):m.jsx(pt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):m.jsx(pt,{variant:"secondary",children:"Disabled"})}function a5e(){const{data:e,isLoading:t,error:n}=xX("one_time"),[r,i]=y.useState(!1),a=bX(),o=wX();if(t)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-48"}),m.jsx(hn,{className:"h-64 rounded-lg"})]});if(n)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",n.message]})]});const l=e??[];return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"One-Time Schedules"}),m.jsxs(Se,{onClick:()=>i(!0),children:[m.jsx(sc,{className:"mr-2 h-4 w-4"}),"Create One-Time Schedule"]})]}),l.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[m.jsx("p",{className:"text-muted-foreground",children:"No one-time schedules yet."}),m.jsxs(Se,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[m.jsx(sc,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):m.jsx("div",{className:"rounded-lg border",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Name"}),m.jsx(qe,{children:"Project"}),m.jsx(qe,{children:"Scheduled For"}),m.jsx(qe,{children:"Last Run"}),m.jsx(qe,{children:"Status"}),m.jsx(qe,{className:"w-[100px]",children:"Actions"})]})}),m.jsx(Ha,{children:l.map(c=>m.jsxs(Cn,{children:[m.jsx(He,{className:"font-medium",children:c.name}),m.jsx(He,{className:"text-muted-foreground",children:c.project_name}),m.jsx(He,{className:"text-sm text-muted-foreground",children:m$(c.run_at)}),m.jsx(He,{className:"text-sm text-muted-foreground",children:m$(c.last_run_at)}),m.jsx(He,{children:m.jsx(i5e,{schedule:c})}),m.jsx(He,{children:m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:c.id,enable:!c.enabled}),children:c.enabled?m.jsx(MF,{className:"h-3.5 w-3.5"}):m.jsx(L0,{className:"h-3.5 w-3.5"})}),m.jsx(Se,{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:m.jsx(Ya,{className:"h-3.5 w-3.5"})})]})})]},c.id))})]})}),m.jsx(r5e,{open:r,onOpenChange:i})]})}function o5e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function s5e(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 l5e({status:e}){switch(e){case"completed":return m.jsx(pt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return m.jsx(pt,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return m.jsx(pt,{variant:"destructive",children:"Failed"});default:return m.jsx(pt,{variant:"secondary",children:e})}}function u5e({type:e}){return m.jsx(pt,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function c5e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function f5e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=K4e(e),a=xa();if(r)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(hn,{className:"h-8 w-48"}),m.jsx(hn,{className:"h-64 rounded-lg"})]});if(i)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(fa,{className:"h-4 w-4"}),m.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 m.jsxs("div",{className:"space-y-6",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),(n==null?void 0:n.total)===0?m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[m.jsx("p",{className:"text-muted-foreground",children:"No schedule runs yet."}),m.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sessions triggered by schedules will appear here."})]}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"rounded-lg border",children:m.jsxs(Fa,{children:[m.jsx(Ua,{children:m.jsxs(Cn,{children:[m.jsx(qe,{children:"Schedule"}),m.jsx(qe,{children:"Type"}),m.jsx(qe,{children:"Project"}),m.jsx(qe,{children:"Status"}),m.jsx(qe,{children:"Started"}),m.jsx(qe,{children:"Duration"}),m.jsx(qe,{className:"w-[80px]",children:"Session"})]})}),m.jsx(Ha,{children:o.map(c=>m.jsxs(Cn,{children:[m.jsx(He,{className:"font-medium",children:m.jsx(Pr,{to:c5e(c),className:"hover:underline text-foreground",children:c.schedule_name})}),m.jsx(He,{children:m.jsx(u5e,{type:c.schedule_type})}),m.jsx(He,{className:"text-muted-foreground",children:c.project_name}),m.jsx(He,{children:m.jsx(l5e,{status:c.status})}),m.jsx(He,{className:"text-sm text-muted-foreground",children:o5e(c.started_at)}),m.jsx(He,{className:"text-sm text-muted-foreground",children:s5e(c.duration_ms)}),m.jsx(He,{children:m.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(`/projects/${c.project_id}/sessions/${c.run_id}`),children:m.jsx(vN,{className:"h-3.5 w-3.5"})})})]},c.run_id))})]})}),m.jsx(NN,{page:e,totalPages:l,onPageChange:t})]})]})}function YE(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 d5e(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 h5e=["none","worktree"],m5e=["default","plan","bypassPermissions"],p5e=["auto","local","pr"],g5e=["prompt","always","never"],p$=["true","false"],XE="__empty__";function g$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(YE(e)),{data:o}=Gu("agents"),{data:l}=Gu("roles"),{data:c}=Gu("memories"),f=t?YE(t):void 0,h=JSON.stringify(e);y.useEffect(()=>{a(YE(e))},[h]);const d=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(d5e(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":"",N=!!j||!!C||!!_;return m.jsxs("div",{className:"flex flex-col gap-6",children:[m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"General"}),m.jsx(Sl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsxs(Lr,{label:"Runtime",children:[m.jsx(et,{list:"cfg-dl-runtime",value:i.runtime,onChange:O=>d("runtime")(O.target.value),placeholder:(f==null?void 0:f.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&m.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(O=>m.jsx("option",{value:O},O))}),j&&m.jsx("p",{className:"text-xs text-destructive",children:j})]}),m.jsx(Lr,{label:"Isolation",children:m.jsx(Of,{value:i.isolation,onChange:d("isolation"),options:h5e,placeholder:(f==null?void 0:f.isolation)||"none",allowEmpty:!0})}),m.jsxs(Lr,{label:"Memory",children:[m.jsx(et,{list:"cfg-dl-memory",value:i.memory,onChange:O=>d("memory")(O.target.value),placeholder:(f==null?void 0:f.memory)||"dial",className:"h-8 text-xs"}),m.jsx("datalist",{id:"cfg-dl-memory",children:S.map(O=>m.jsx("option",{value:O},O))}),_&&m.jsx("p",{className:"text-xs text-destructive",children:_})]})]})]}),m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),m.jsx(Sl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsxs(Lr,{label:"Role",children:[m.jsx(et,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:O=>d("orchestrator_role")(O.target.value),placeholder:(f==null?void 0:f.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&m.jsx("datalist",{id:"cfg-dl-role",children:b.map(O=>m.jsx("option",{value:O},O))}),C&&m.jsx("p",{className:"text-xs text-destructive",children:C})]}),m.jsx(Lr,{label:"Permission Mode",children:m.jsx(Of,{value:i.orchestrator_permission_mode,onChange:d("orchestrator_permission_mode"),options:m5e,placeholder:(f==null?void 0:f.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),m.jsx(Sl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(Lr,{label:"Max Depth",children:m.jsx(et,{type:"number",value:i.policy_max_depth,onChange:O=>d("policy_max_depth")(O.target.value),placeholder:(f==null?void 0:f.policy_max_depth)||"3",className:"h-8 text-xs"})}),m.jsx(Lr,{label:"Agent Timeout (seconds)",children:m.jsx(et,{type:"number",value:i.policy_agent_timeout,onChange:O=>d("policy_agent_timeout")(O.target.value),placeholder:(f==null?void 0:f.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),m.jsx(Lr,{label:"Max Delegate Retries",children:m.jsx(et,{type:"number",value:i.policy_max_delegate_retries,onChange:O=>d("policy_max_delegate_retries")(O.target.value),placeholder:(f==null?void 0:f.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),m.jsx(Lr,{label:"Cache Delegations",children:m.jsx(Of,{value:i.policy_cache_delegations,onChange:d("policy_cache_delegations"),options:p$,placeholder:(f==null?void 0:f.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),m.jsx(Lr,{label:"Cache Max Entries",children:m.jsx(et,{value:i.policy_cache_max_entries,onChange:O=>d("policy_cache_max_entries")(O.target.value),placeholder:(f==null?void 0:f.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),m.jsx(Lr,{label:"Cache TTL (seconds)",children:m.jsx(et,{value:i.policy_cache_ttl_seconds,onChange:O=>d("policy_cache_ttl_seconds")(O.target.value),placeholder:(f==null?void 0:f.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),m.jsx(Lr,{label:"Max Delegations",children:m.jsx(et,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:O=>d("policy_max_num_delegations")(O.target.value),placeholder:(f==null?void 0:f.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),m.jsx(Sl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(Lr,{label:"Merge Strategy",children:m.jsx(Of,{value:i.session_merge_strategy,onChange:d("session_merge_strategy"),options:p5e,placeholder:(f==null?void 0:f.session_merge_strategy)||"auto",allowEmpty:!0})}),m.jsx(Lr,{label:"Pull Before Session",children:m.jsx(Of,{value:i.session_pull_before_session,onChange:d("session_pull_before_session"),options:g5e,placeholder:(f==null?void 0:f.session_pull_before_session)||"prompt",allowEmpty:!0})}),m.jsx(Lr,{label:"PR Command",className:"sm:col-span-3",children:m.jsx(et,{value:i.session_pr_command,onChange:O=>d("session_pr_command")(O.target.value),placeholder:(f==null?void 0:f.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),m.jsx(Sl,{}),m.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:m.jsx(Lr,{label:"Enabled",children:m.jsx(Of,{value:i.trace_enabled,onChange:d("trace_enabled"),options:p$,placeholder:(f==null?void 0:f.trace_enabled)||"true",allowEmpty:!0})})})]}),m.jsxs(Se,{size:"sm",onClick:g,disabled:r||N,className:"self-start",children:[m.jsx(DF,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Lr({label:e,children:t,className:n}){return m.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[m.jsx(st,{className:"text-xs",children:e}),t]})}function Of({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return m.jsxs(da,{value:e||(i?XE:""),onValueChange:a=>t(a===XE?"":a),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{placeholder:r})}),m.jsxs(pa,{children:[i&&m.jsx(An,{value:XE,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>m.jsx(An,{value:a,children:a},a))]})]})}function v5e(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=gt(),a=sU(),o=Ac(),l=bN(n??0,{enabled:n!=null}),c=oue(),f=lU(),h=b=>{c.mutate(b,{onSuccess:()=>Ht.success("Global configuration saved"),onError:()=>Ht.error("Failed to save global configuration")})},d=b=>{n!=null&&f.mutate({projectId:n,data:b},{onSuccess:()=>Ht.success("Project configuration saved"),onError:()=>Ht.error("Failed to save project configuration")})};return y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:$e.projects.config(n)})},[e,n,i]),m.jsxs("div",{className:"space-y-6",children:[m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),m.jsxs(Mp,{value:e,onValueChange:t,children:[m.jsxs(Dp,{children:[m.jsx(or,{value:"global",children:"Global"}),m.jsx(or,{value:"project",children:"Project"})]}),m.jsx(sr,{value:"global",className:"mt-4",children:a.isLoading?m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):m.jsx(g$,{values:((g=a.data)==null?void 0:g.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:h,saving:c.isPending})}),m.jsx(sr,{value:"project",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[m.jsx(st,{className:"text-xs",children:"Project"}),m.jsxs(da,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[m.jsx(ma,{className:"h-8 text-xs",children:m.jsx(ha,{placeholder:"Select a project"})}),m.jsx(pa,{children:(o.data??[]).map(b=>m.jsx(An,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&m.jsx(g$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:d,saving:f.isPending},n)]})})]})]})}function y5e(){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[m.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),m.jsx(Se,{variant:"outline",asChild:!0,children:m.jsxs(Pr,{to:"/",children:[m.jsx(Roe,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const x5e=3,b5e=1e4,w5e=2e3;function S5e(){const e=gt(),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(h){const d=Date.now();if(d-i.current<w5e)return!1;const g=(a.current[h]??[]).filter(v=>d-v<b5e);return g.length>=x5e?!1:(g.push(d),a.current[h]=g,!0)}function c(h){const d=h.type,g=(h.run_id??"unknown").slice(0,12);l(d)&&(d==="session_started"?Ht.info(`Session ${g} started`):d==="session_completed"?Ht.success(`Session ${g} completed`):d==="session_failed"?Ht.error(`Session ${g} failed`):d==="session_stopped"&&Ht.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),h.project_id&&(e.invalidateQueries({queryKey:$e.projects.sessions(h.project_id)}),e.invalidateQueries({queryKey:$e.conversations.all(h.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}function f(){const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`,g=new WebSocket(d);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),f()},r.current)},g.onerror=()=>{g.close()}}return f(),()=>{var h;(h=t.current)==null||h.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function j5e(){return S5e(),m.jsx(LQ,{children:m.jsxs(kr,{element:m.jsx(qle,{}),children:[m.jsx(kr,{index:!0,element:m.jsx(xD,{to:"/imu",replace:!0})}),m.jsx(kr,{path:"dashboard",element:m.jsx(tue,{})}),m.jsx(kr,{path:"projects",element:m.jsx(fue,{})}),m.jsx(kr,{path:"projects/:projectId",element:m.jsx(TMe,{})}),m.jsx(kr,{path:"projects/:projectId/sessions/:runId",element:m.jsx(d4e,{})}),m.jsx(kr,{path:"projects/:projectId/conversations/:conversationId",element:m.jsx(T4e,{})}),m.jsx(kr,{path:"imu",element:m.jsx(f$,{})}),m.jsx(kr,{path:"imu/:conversationId",element:m.jsx(f$,{})}),m.jsx(kr,{path:"schedules",element:m.jsx(xD,{to:"/schedules/recurring",replace:!0})}),m.jsx(kr,{path:"schedules/recurring",element:m.jsx(n5e,{})}),m.jsx(kr,{path:"schedules/one-time",element:m.jsx(a5e,{})}),m.jsx(kr,{path:"schedules/runs",element:m.jsx(f5e,{})}),m.jsx(kr,{path:"resources/:resourceType",element:m.jsx(q4e,{})}),m.jsx(kr,{path:"settings",element:m.jsx(v5e,{})}),m.jsx(kr,{path:"*",element:m.jsx(y5e,{})})]})})}zW.createRoot(document.getElementById("root")).render(m.jsx(y.StrictMode,{children:m.jsx(eJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:m.jsx(VZ,{client:Use,children:m.jsxs(mN,{children:[m.jsx(lZ,{children:m.jsx(j5e,{})}),m.jsx(Fse,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
