var oW=Object.defineProperty;var qM=e=>{throw TypeError(e)};var sW=(e,t,n)=>t in e?oW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W1=(e,t,n)=>sW(e,typeof t!="symbol"?t+"":t,n),Q1=(e,t,n)=>t.has(e)||qM("Cannot "+n);var W=(e,t,n)=>(Q1(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?qM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(Q1(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Je=(e,t,n)=>(Q1(e,t,"access private method"),n);var jv=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return W(e,t,r)}});function lW(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 Bi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z1={exports:{}},$h={};/**
 * @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 VM;function uW(){if(VM)return $h;VM=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 $h.Fragment=t,$h.jsx=n,$h.jsxs=n,$h}var KM;function cW(){return KM||(KM=1,Z1.exports=uW()),Z1.exports}var m=cW(),J1={exports:{}},at={};/**
 * @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 YM;function fW(){if(YM)return at;YM=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 E(H,U,$){this.props=H,this.context=U,this.refs=S,this.updater=$||b}E.prototype.isReactComponent={},E.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")},E.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=E.prototype;function j(H,U,$){this.props=H,this.context=U,this.refs=S,this.updater=$||b}var A=j.prototype=new C;A.constructor=j,w(A,E.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function I(H,U,$){var Q=$.ref;return{$$typeof:e,type:H,key:U,ref:Q!==void 0?Q:null,props:$}}function z(H,U){return I(H.type,U,H.props)}function B(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function L(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function($){return U[$]})}var G=/\/+/g;function F(H,U){return typeof H=="object"&&H!==null&&H.key!=null?L(""+H.key):U.toString(36)}function K(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(O,O):(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 D(H,U,$,Q,Z){var ne=typeof H;(ne==="undefined"||ne==="boolean")&&(H=null);var te=!1;if(H===null)te=!0;else switch(ne){case"bigint":case"string":case"number":te=!0;break;case"object":switch(H.$$typeof){case e:case t:te=!0;break;case h:return te=H._init,D(te(H._payload),U,$,Q,Z)}}if(te)return Z=Z(H),te=Q===""?"."+F(H,0):Q,N(Z)?($="",te!=null&&($=te.replace(G,"$&/")+"/"),D(Z,U,$,"",function(le){return le})):Z!=null&&(B(Z)&&(Z=z(Z,$+(Z.key==null||H&&H.key===Z.key?"":(""+Z.key).replace(G,"$&/")+"/")+te)),U.push(Z)),1;te=0;var ie=Q===""?".":Q+":";if(N(H))for(var ee=0;ee<H.length;ee++)Q=H[ee],ne=ie+F(Q,ee),te+=D(Q,U,$,ne,Z);else if(ee=v(H),typeof ee=="function")for(H=ee.call(H),ee=0;!(Q=H.next()).done;)Q=Q.value,ne=ie+F(Q,ee++),te+=D(Q,U,$,ne,Z);else if(ne==="object"){if(typeof H.then=="function")return D(K(H),U,$,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 te}function q(H,U,$){if(H==null)return H;var Q=[],Z=0;return D(H,Q,"","",function(ne){return U.call($,ne,Z++)}),Q}function X(H){if(H._status===-1){var U=H._result;U=U(),U.then(function($){(H._status===0||H._status===-1)&&(H._status=1,H._result=$)},function($){(H._status===0||H._status===-1)&&(H._status=2,H._result=$)}),H._status===-1&&(H._status=0,H._result=U)}if(H._status===1)return H._result.default;throw H._result}var V=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,$){q(H,function(){U.apply(this,arguments)},$)},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(!B(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return at.Activity=d,at.Children=R,at.Component=E,at.Fragment=n,at.Profiler=i,at.PureComponent=j,at.StrictMode=r,at.Suspense=c,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,at.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},at.cache=function(H){return function(){return H.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(H,U,$){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(ne in U.key!==void 0&&(Z=""+U.key),U)!M.call(U,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&U.ref===void 0||(Q[ne]=U[ne]);var ne=arguments.length-2;if(ne===1)Q.children=$;else if(1<ne){for(var te=Array(ne),ie=0;ie<ne;ie++)te[ie]=arguments[ie+2];Q.children=te}return I(H.type,Z,Q)},at.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},at.createElement=function(H,U,$){var Q,Z={},ne=null;if(U!=null)for(Q in U.key!==void 0&&(ne=""+U.key),U)M.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=U[Q]);var te=arguments.length-2;if(te===1)Z.children=$;else if(1<te){for(var ie=Array(te),ee=0;ee<te;ee++)ie[ee]=arguments[ee+2];Z.children=ie}if(H&&H.defaultProps)for(Q in te=H.defaultProps,te)Z[Q]===void 0&&(Z[Q]=te[Q]);return I(H,ne,Z)},at.createRef=function(){return{current:null}},at.forwardRef=function(H){return{$$typeof:l,render:H}},at.isValidElement=B,at.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:X}},at.memo=function(H,U){return{$$typeof:f,type:H,compare:U===void 0?null:U}},at.startTransition=function(H){var U=T.T,$={};T.T=$;try{var Q=H(),Z=T.S;Z!==null&&Z($,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,V)}catch(ne){V(ne)}finally{U!==null&&$.types!==null&&(U.types=$.types),T.T=U}},at.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},at.use=function(H){return T.H.use(H)},at.useActionState=function(H,U,$){return T.H.useActionState(H,U,$)},at.useCallback=function(H,U){return T.H.useCallback(H,U)},at.useContext=function(H){return T.H.useContext(H)},at.useDebugValue=function(){},at.useDeferredValue=function(H,U){return T.H.useDeferredValue(H,U)},at.useEffect=function(H,U){return T.H.useEffect(H,U)},at.useEffectEvent=function(H){return T.H.useEffectEvent(H)},at.useId=function(){return T.H.useId()},at.useImperativeHandle=function(H,U,$){return T.H.useImperativeHandle(H,U,$)},at.useInsertionEffect=function(H,U){return T.H.useInsertionEffect(H,U)},at.useLayoutEffect=function(H,U){return T.H.useLayoutEffect(H,U)},at.useMemo=function(H,U){return T.H.useMemo(H,U)},at.useOptimistic=function(H,U){return T.H.useOptimistic(H,U)},at.useReducer=function(H,U,$){return T.H.useReducer(H,U,$)},at.useRef=function(H){return T.H.useRef(H)},at.useState=function(H){return T.H.useState(H)},at.useSyncExternalStore=function(H,U,$){return T.H.useSyncExternalStore(H,U,$)},at.useTransition=function(){return T.H.useTransition()},at.version="19.2.4",at}var XM;function kd(){return XM||(XM=1,J1.exports=fW()),J1.exports}var x=kd();const _e=Bi(x),XC=lW({__proto__:null,default:_e},[x]);var eS={exports:{}},Bh={},tS={exports:{}},nS={};/**
 * @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 GM;function dW(){return GM||(GM=1,(function(e){function t(D,q){var X=D.length;D.push(q);e:for(;0<X;){var V=X-1>>>1,R=D[V];if(0<i(R,q))D[V]=q,D[X]=R,X=V;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var q=D[0],X=D.pop();if(X!==q){D[0]=X;e:for(var V=0,R=D.length,H=R>>>1;V<H;){var U=2*(V+1)-1,$=D[U],Q=U+1,Z=D[Q];if(0>i($,X))Q<R&&0>i(Z,$)?(D[V]=Z,D[Q]=X,V=Q):(D[V]=$,D[U]=X,V=U);else if(Q<R&&0>i(Z,X))D[V]=Z,D[Q]=X,V=Q;else break e}}return q}function i(D,q){var X=D.sortIndex-q.sortIndex;return X!==0?X:D.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,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function A(D){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=D)r(f),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(f)}}function N(D){if(w=!1,A(D),!b)if(n(c)!==null)b=!0,O||(O=!0,L());else{var q=n(f);q!==null&&K(N,q.startTime-D)}}var O=!1,T=-1,M=5,I=-1;function z(){return S?!0:!(e.unstable_now()-I<M)}function B(){if(S=!1,O){var D=e.unstable_now();I=D;var q=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var X=g;try{t:{for(A(D),d=n(c);d!==null&&!(d.expirationTime>D&&z());){var V=d.callback;if(typeof V=="function"){d.callback=null,g=d.priorityLevel;var R=V(d.expirationTime<=D);if(D=e.unstable_now(),typeof R=="function"){d.callback=R,A(D),q=!0;break t}d===n(c)&&r(c),A(D)}else r(c);d=n(c)}if(d!==null)q=!0;else{var H=n(f);H!==null&&K(N,H.startTime-D),q=!1}}break e}finally{d=null,g=X,v=!1}q=void 0}}finally{q?L():O=!1}}}var L;if(typeof j=="function")L=function(){j(B)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,F=G.port2;G.port1.onmessage=B,L=function(){F.postMessage(null)}}else L=function(){E(B,0)};function K(D,q){T=E(function(){D(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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(D){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var X=g;g=q;try{return D()}finally{g=X}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var X=g;g=D;try{return q()}finally{g=X}},e.unstable_scheduleCallback=function(D,q,X){var V=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?V+X:V):X=V,D){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,D={id:h++,callback:q,priorityLevel:D,startTime:X,expirationTime:R,sortIndex:-1},X>V?(D.sortIndex=X,t(f,D),n(c)===null&&D===n(f)&&(w?(C(T),T=-1):w=!0,K(N,X-V))):(D.sortIndex=R,t(c,D),b||v||(b=!0,O||(O=!0,L()))),D},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(D){var q=g;return function(){var X=g;g=q;try{return D.apply(this,arguments)}finally{g=X}}}})(nS)),nS}var WM;function hW(){return WM||(WM=1,tS.exports=dW()),tS.exports}var rS={exports:{}},Or={};/**
 * @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 QM;function mW(){if(QM)return Or;QM=1;var e=kd();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 Or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Or.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)},Or.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()}},Or.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))},Or.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Or.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})}},Or.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)},Or.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})}},Or.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)},Or.requestFormReset=function(c){r.d.r(c)},Or.unstable_batchedUpdates=function(c,f){return c(f)},Or.useFormState=function(c,f,h){return o.H.useFormState(c,f,h)},Or.useFormStatus=function(){return o.H.useHostTransitionStatus()},Or.version="19.2.4",Or}var ZM;function m$(){if(ZM)return rS.exports;ZM=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(),rS.exports=mW(),rS.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 JM;function pW(){if(JM)return Bh;JM=1;var e=hW(),t=kd(),n=m$();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,y=u;;){var _=p.return;if(_===null)break;var k=_.alternate;if(k===null){if(y=_.return,y!==null){p=y;continue}break}if(_.child===k.child){for(k=_.child;k;){if(k===p)return c(_),s;if(k===y)return c(_),u;k=k.sibling}throw Error(r(188))}if(p.return!==y.return)p=_,y=k;else{for(var P=!1,Y=_.child;Y;){if(Y===p){P=!0,p=_,y=k;break}if(Y===y){P=!0,y=_,p=k;break}Y=Y.sibling}if(!P){for(Y=k.child;Y;){if(Y===p){P=!0,p=k,y=_;break}if(Y===y){P=!0,y=k,p=_;break}Y=Y.sibling}if(!P)throw Error(r(189))}}if(p.alternate!==y)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"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),j=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function L(s){return s===null||typeof s!="object"?null:(s=B&&s[B]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function F(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 E:return"Profiler";case S:return"StrictMode";case N:return"Suspense";case O:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case A: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:F(s.type)||"Memo";case M:u=s._payload,s=s._init;try{return F(s(u))}catch{}}return null}var K=Array.isArray,D=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},V=[],R=-1;function H(s){return{current:s}}function U(s){0>R||(s.current=V[R],V[R]=null,R--)}function $(s,u){R++,V[R]=s.current,s.current=u}var Q=H(null),Z=H(null),ne=H(null),te=H(null);function ie(s,u){switch($(ne,u),$(Z,s),$(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?hM(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=hM(u),s=mM(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(Q),$(Q,s)}function ee(){U(Q),U(Z),U(ne)}function le(s){s.memoizedState!==null&&$(te,s);var u=Q.current,p=mM(u,s.type);u!==p&&($(Z,s),$(Q,p))}function pe(s){Z.current===s&&(U(Q),U(Z)),te.current===s&&(U(te),Rh._currentValue=X)}var ae,be;function we(s){if(ae===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ae=u&&u[1]||"",be=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ae+s+be}var Le=!1;function Oe(s,u){if(!s||Le)return"";Le=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(u){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(me){var de=me}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(me){de=me}s.call(xe.prototype)}}else{try{throw Error()}catch(me){de=me}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(me){if(me&&de&&typeof me.stack=="string")return[me.stack,de.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=y.DetermineComponentFrameRoot(),P=k[0],Y=k[1];if(P&&Y){var J=P.split(`
`),fe=Y.split(`
`);for(_=y=0;y<J.length&&!J[y].includes("DetermineComponentFrameRoot");)y++;for(;_<fe.length&&!fe[_].includes("DetermineComponentFrameRoot");)_++;if(y===J.length||_===fe.length)for(y=J.length-1,_=fe.length-1;1<=y&&0<=_&&J[y]!==fe[_];)_--;for(;1<=y&&0<=_;y--,_--)if(J[y]!==fe[_]){if(y!==1||_!==1)do if(y--,_--,0>_||J[y]!==fe[_]){var ge=`
`+J[y].replace(" at new "," at ");return s.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",s.displayName)),ge}while(1<=y&&0<=_);break}}}finally{Le=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?we(p):""}function Xe(s,u){switch(s.tag){case 26:case 27:case 5:return we(s.type);case 16:return we("Lazy");case 13:return s.child!==u&&u!==null?we("Suspense Fallback"):we("Suspense");case 19:return we("SuspenseList");case 0:case 15:return Oe(s.type,!1);case 11:return Oe(s.type.render,!1);case 1:return Oe(s.type,!0);case 31:return we("Activity");default:return""}}function Ke(s){try{var u="",p=null;do u+=Xe(s,p),p=s,s=s.return;while(s);return u}catch(y){return`
Error generating stack: `+y.message+`
`+y.stack}}var tt=Object.prototype.hasOwnProperty,sn=e.unstable_scheduleCallback,En=e.unstable_cancelCallback,Et=e.unstable_shouldYield,vn=e.unstable_requestPaint,Pt=e.unstable_now,Jt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,yn=e.log,ln=e.unstable_setDisableYieldValue,Xt=null,Se=null;function ut(s){if(typeof yn=="function"&&ln(s),Se&&typeof Se.setStrictMode=="function")try{Se.setStrictMode(Xt,s)}catch{}}var Qe=Math.clz32?Math.clz32:$n,Dn=Math.log,xn=Math.LN2;function $n(s){return s>>>=0,s===0?32:31-(Dn(s)/xn|0)|0}var Fi=256,da=262144,Ui=4194304;function Hr(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 Ze(s,u,p){var y=s.pendingLanes;if(y===0)return 0;var _=0,k=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var Y=y&134217727;return Y!==0?(y=Y&~k,y!==0?_=Hr(y):(P&=Y,P!==0?_=Hr(P):p||(p=Y&~s,p!==0&&(_=Hr(p))))):(Y=y&~k,Y!==0?_=Hr(Y):P!==0?_=Hr(P):p||(p=y&~s,p!==0&&(_=Hr(p)))),_===0?0:u!==0&&u!==_&&(u&k)===0&&(k=_&-_,p=u&-u,k>=p||k===32&&(p&4194048)!==0)?u:_}function Ft(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function _n(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 Bn(){var s=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),s}function pi(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function Lt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ur(s,u,p,y,_,k){var P=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,fe=s.hiddenUpdates;for(p=P&~p;0<p;){var ge=31-Qe(p),xe=1<<ge;Y[ge]=0,J[ge]=-1;var de=fe[ge];if(de!==null)for(fe[ge]=null,ge=0;ge<de.length;ge++){var me=de[ge];me!==null&&(me.lane&=-536870913)}p&=~xe}y!==0&&ha(s,y,0),k!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=k&~(P&~u))}function ha(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var y=31-Qe(u);s.entangledLanes|=u,s.entanglements[y]=s.entanglements[y]|1073741824|p&261930}function Zn(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var y=31-Qe(p),_=1<<y;_&u|s[y]&u&&(s[y]|=u),p&=~_}}function cr(s,u){var p=u&-u;return p=(p&42)!==0?1:Va(p),(p&(s.suspendedLanes|u))!==0?0:p}function Va(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 Ar(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ye(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:LM(s.type))}function kt(s,u){var p=q.p;try{return q.p=s,u()}finally{q.p=p}}var Rn=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Rn,fr="__reactProps$"+Rn,gi="__reactContainer$"+Rn,Tc="__reactEvents$"+Rn,lg="__reactListeners$"+Rn,Fb="__reactHandles$"+Rn,ug="__reactResources$"+Rn,ru="__reactMarker$"+Rn;function Gd(s){delete s[Gt],delete s[fr],delete s[Tc],delete s[lg],delete s[Fb]}function Rs(s){var u=s[Gt];if(u)return u;for(var p=s.parentNode;p;){if(u=p[gi]||p[Gt]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=wM(s);s!==null;){if(p=s[Gt])return p;s=wM(s)}return u}s=p,p=s.parentNode}return null}function Is(s){if(s=s[Gt]||s[gi]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Ls(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function zs(s){var u=s[ug];return u||(u=s[ug]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Fn(s){s[ru]=!0}var cg=new Set,fg={};function jo(s,u){$s(s,u),$s(s+"Capture",u)}function $s(s,u){for(fg[s]=u,s=0;s<u.length;s++)cg.add(u[s])}var Ub=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]*$"),Wd={},dg={};function Hb(s){return tt.call(dg,s)?!0:tt.call(Wd,s)?!1:Ub.test(s)?dg[s]=!0:(Wd[s]=!0,!1)}function Pc(s,u,p){if(Hb(u))if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var y=u.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+p)}}function Mc(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 ma(s,u,p,y){if(y===null)s.removeAttribute(p);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(u,p,""+y)}}function Jr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function hg(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function qb(s,u,p){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var _=y.get,k=y.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return _.call(this)},set:function(P){p=""+P,k.call(this,P)}}),Object.defineProperty(s,u,{enumerable:y.enumerable}),{getValue:function(){return p},setValue:function(P){p=""+P},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Bs(s){if(!s._valueTracker){var u=hg(s)?"checked":"value";s._valueTracker=qb(s,u,""+s[u])}}function mg(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),y="";return s&&(y=hg(s)?s.checked?"true":"false":s.value),s=y,s!==p?(u.setValue(s),!0):!1}function iu(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 Vb=/[\n"\\]/g;function ei(s){return s.replace(Vb,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function au(s,u,p,y,_,k,P,Y){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),u!=null?P==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Jr(u)):s.value!==""+Jr(u)&&(s.value=""+Jr(u)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),u!=null?Qd(s,P,Jr(u)):p!=null?Qd(s,P,Jr(p)):y!=null&&s.removeAttribute("value"),_==null&&k!=null&&(s.defaultChecked=!!k),_!=null&&(s.checked=_&&typeof _!="function"&&typeof _!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?s.name=""+Jr(Y):s.removeAttribute("name")}function pg(s,u,p,y,_,k,P,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)){Bs(s);return}p=p!=null?""+Jr(p):"",u=u!=null?""+Jr(u):p,Y||u===s.value||(s.value=u),s.defaultValue=u}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=Y?s.checked:!!y,s.defaultChecked=!!y,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),Bs(s)}function Qd(s,u,p){u==="number"&&iu(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function Co(s,u,p,y){if(s=s.options,u){u={};for(var _=0;_<p.length;_++)u["$"+p[_]]=!0;for(p=0;p<s.length;p++)_=u.hasOwnProperty("$"+s[p].value),s[p].selected!==_&&(s[p].selected=_),_&&y&&(s[p].defaultSelected=!0)}else{for(p=""+Jr(p),u=null,_=0;_<s.length;_++){if(s[_].value===p){s[_].selected=!0,y&&(s[_].defaultSelected=!0);return}u!==null||s[_].disabled||(u=s[_])}u!==null&&(u.selected=!0)}}function lT(s,u,p){if(u!=null&&(u=""+Jr(u),u!==s.value&&(s.value=u),p==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=p!=null?""+Jr(p):""}function uT(s,u,p,y){if(u==null){if(y!=null){if(p!=null)throw Error(r(92));if(K(y)){if(1<y.length)throw Error(r(93));y=y[0]}p=y}p==null&&(p=""),u=p}p=Jr(u),s.defaultValue=p,y=s.textContent,y===p&&y!==""&&y!==null&&(s.value=y),Bs(s)}function Dc(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var tX=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 cT(s,u,p){var y=u.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?y?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":y?s.setProperty(u,p):typeof p!="number"||p===0||tX.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function fT(s,u,p){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,p!=null){for(var y in p)!p.hasOwnProperty(y)||u!=null&&u.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var _ in u)y=u[_],u.hasOwnProperty(_)&&p[_]!==y&&cT(s,_,y)}else for(var k in u)u.hasOwnProperty(k)&&cT(s,k,u[k])}function Kb(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 nX=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"]]),rX=/^[\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 gg(s){return rX.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ko(){}var Yb=null;function Xb(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Rc=null,Ic=null;function dT(s){var u=Is(s);if(u&&(s=u.stateNode)){var p=s[fr]||null;e:switch(s=u.stateNode,u.type){case"input":if(au(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="'+ei(""+u)+'"][type="radio"]'),u=0;u<p.length;u++){var y=p[u];if(y!==s&&y.form===s.form){var _=y[fr]||null;if(!_)throw Error(r(90));au(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(u=0;u<p.length;u++)y=p[u],y.form===s.form&&mg(y)}break e;case"textarea":lT(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&Co(s,!!p.multiple,u,!1)}}}var Gb=!1;function hT(s,u,p){if(Gb)return s(u,p);Gb=!0;try{var y=s(u);return y}finally{if(Gb=!1,(Rc!==null||Ic!==null)&&(rv(),Rc&&(u=Rc,s=Ic,Ic=Rc=null,dT(u),s)))for(u=0;u<s.length;u++)dT(s[u])}}function Zd(s,u){var p=s.stateNode;if(p===null)return null;var y=p[fr]||null;if(y===null)return null;p=y[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":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(p&&typeof p!="function")throw Error(r(231,u,typeof p));return p}var Ao=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wb=!1;if(Ao)try{var Jd={};Object.defineProperty(Jd,"passive",{get:function(){Wb=!0}}),window.addEventListener("test",Jd,Jd),window.removeEventListener("test",Jd,Jd)}catch{Wb=!1}var Fs=null,Qb=null,vg=null;function mT(){if(vg)return vg;var s,u=Qb,p=u.length,y,_="value"in Fs?Fs.value:Fs.textContent,k=_.length;for(s=0;s<p&&u[s]===_[s];s++);var P=p-s;for(y=1;y<=P&&u[p-y]===_[k-y];y++);return vg=_.slice(s,1<y?1-y:void 0)}function yg(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 xg(){return!0}function pT(){return!1}function ti(s){function u(p,y,_,k,P){this._reactName=p,this._targetInst=_,this.type=y,this.nativeEvent=k,this.target=P,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)?xg:pT,this.isPropagationStopped=pT,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=xg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=xg)},persist:function(){},isPersistent:xg}),u}var ou={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bg=ti(ou),eh=d({},ou,{view:0,detail:0}),iX=ti(eh),Zb,Jb,th,wg=d({},eh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tw,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!==th&&(th&&s.type==="mousemove"?(Zb=s.screenX-th.screenX,Jb=s.screenY-th.screenY):Jb=Zb=0,th=s),Zb)},movementY:function(s){return"movementY"in s?s.movementY:Jb}}),gT=ti(wg),aX=d({},wg,{dataTransfer:0}),oX=ti(aX),sX=d({},eh,{relatedTarget:0}),ew=ti(sX),lX=d({},ou,{animationName:0,elapsedTime:0,pseudoElement:0}),uX=ti(lX),cX=d({},ou,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),fX=ti(cX),dX=d({},ou,{data:0}),vT=ti(dX),hX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mX={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"},pX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gX(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=pX[s])?!!u[s]:!1}function tw(){return gX}var vX=d({},eh,{key:function(s){if(s.key){var u=hX[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=yg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?mX[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tw,charCode:function(s){return s.type==="keypress"?yg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?yg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),yX=ti(vX),xX=d({},wg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yT=ti(xX),bX=d({},eh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tw}),wX=ti(bX),SX=d({},ou,{propertyName:0,elapsedTime:0,pseudoElement:0}),EX=ti(SX),_X=d({},wg,{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}),jX=ti(_X),CX=d({},ou,{newState:0,oldState:0}),kX=ti(CX),AX=[9,13,27,32],nw=Ao&&"CompositionEvent"in window,nh=null;Ao&&"documentMode"in document&&(nh=document.documentMode);var OX=Ao&&"TextEvent"in window&&!nh,xT=Ao&&(!nw||nh&&8<nh&&11>=nh),bT=" ",wT=!1;function ST(s,u){switch(s){case"keyup":return AX.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ET(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Lc=!1;function NX(s,u){switch(s){case"compositionend":return ET(u);case"keypress":return u.which!==32?null:(wT=!0,bT);case"textInput":return s=u.data,s===bT&&wT?null:s;default:return null}}function TX(s,u){if(Lc)return s==="compositionend"||!nw&&ST(s,u)?(s=mT(),vg=Qb=Fs=null,Lc=!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 xT&&u.locale!=="ko"?null:u.data;default:return null}}var PX={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 _T(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!PX[s.type]:u==="textarea"}function jT(s,u,p,y){Rc?Ic?Ic.push(y):Ic=[y]:Rc=y,u=cv(u,"onChange"),0<u.length&&(p=new bg("onChange","change",null,p,y),s.push({event:p,listeners:u}))}var rh=null,ih=null;function MX(s){sM(s,0)}function Sg(s){var u=Ls(s);if(mg(u))return s}function CT(s,u){if(s==="change")return u}var kT=!1;if(Ao){var rw;if(Ao){var iw="oninput"in document;if(!iw){var AT=document.createElement("div");AT.setAttribute("oninput","return;"),iw=typeof AT.oninput=="function"}rw=iw}else rw=!1;kT=rw&&(!document.documentMode||9<document.documentMode)}function OT(){rh&&(rh.detachEvent("onpropertychange",NT),ih=rh=null)}function NT(s){if(s.propertyName==="value"&&Sg(ih)){var u=[];jT(u,ih,s,Xb(s)),hT(MX,u)}}function DX(s,u,p){s==="focusin"?(OT(),rh=u,ih=p,rh.attachEvent("onpropertychange",NT)):s==="focusout"&&OT()}function RX(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Sg(ih)}function IX(s,u){if(s==="click")return Sg(u)}function LX(s,u){if(s==="input"||s==="change")return Sg(u)}function zX(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var vi=typeof Object.is=="function"?Object.is:zX;function ah(s,u){if(vi(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var p=Object.keys(s),y=Object.keys(u);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var _=p[y];if(!tt.call(u,_)||!vi(s[_],u[_]))return!1}return!0}function TT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function PT(s,u){var p=TT(s);s=0;for(var y;p;){if(p.nodeType===3){if(y=s+p.textContent.length,s<=u&&y>=u)return{node:p,offset:u-s};s=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=TT(p)}}function MT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?MT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function DT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=iu(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=iu(s.document)}return u}function aw(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 $X=Ao&&"documentMode"in document&&11>=document.documentMode,zc=null,ow=null,oh=null,sw=!1;function RT(s,u,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;sw||zc==null||zc!==iu(y)||(y=zc,"selectionStart"in y&&aw(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),oh&&ah(oh,y)||(oh=y,y=cv(ow,"onSelect"),0<y.length&&(u=new bg("onSelect","select",null,u,p),s.push({event:u,listeners:y}),u.target=zc)))}function su(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var $c={animationend:su("Animation","AnimationEnd"),animationiteration:su("Animation","AnimationIteration"),animationstart:su("Animation","AnimationStart"),transitionrun:su("Transition","TransitionRun"),transitionstart:su("Transition","TransitionStart"),transitioncancel:su("Transition","TransitionCancel"),transitionend:su("Transition","TransitionEnd")},lw={},IT={};Ao&&(IT=document.createElement("div").style,"AnimationEvent"in window||(delete $c.animationend.animation,delete $c.animationiteration.animation,delete $c.animationstart.animation),"TransitionEvent"in window||delete $c.transitionend.transition);function lu(s){if(lw[s])return lw[s];if(!$c[s])return s;var u=$c[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in IT)return lw[s]=u[p];return s}var LT=lu("animationend"),zT=lu("animationiteration"),$T=lu("animationstart"),BX=lu("transitionrun"),FX=lu("transitionstart"),UX=lu("transitioncancel"),BT=lu("transitionend"),FT=new Map,uw="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(" ");uw.push("scrollEnd");function pa(s,u){FT.set(s,u),jo(u,[s])}var Eg=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)},Hi=[],Bc=0,cw=0;function _g(){for(var s=Bc,u=cw=Bc=0;u<s;){var p=Hi[u];Hi[u++]=null;var y=Hi[u];Hi[u++]=null;var _=Hi[u];Hi[u++]=null;var k=Hi[u];if(Hi[u++]=null,y!==null&&_!==null){var P=y.pending;P===null?_.next=_:(_.next=P.next,P.next=_),y.pending=_}k!==0&&UT(p,_,k)}}function jg(s,u,p,y){Hi[Bc++]=s,Hi[Bc++]=u,Hi[Bc++]=p,Hi[Bc++]=y,cw|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function fw(s,u,p,y){return jg(s,u,p,y),Cg(s)}function uu(s,u){return jg(s,null,null,u),Cg(s)}function UT(s,u,p){s.lanes|=p;var y=s.alternate;y!==null&&(y.lanes|=p);for(var _=!1,k=s.return;k!==null;)k.childLanes|=p,y=k.alternate,y!==null&&(y.childLanes|=p),k.tag===22&&(s=k.stateNode,s===null||s._visibility&1||(_=!0)),s=k,k=k.return;return s.tag===3?(k=s.stateNode,_&&u!==null&&(_=31-Qe(p),s=k.hiddenUpdates,y=s[_],y===null?s[_]=[u]:y.push(u),u.lane=p|536870912),k):null}function Cg(s){if(50<Ah)throw Ah=0,b1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Fc={};function HX(s,u,p,y){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=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(s,u,p,y){return new HX(s,u,p,y)}function dw(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Oo(s,u){var p=s.alternate;return p===null?(p=yi(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 HT(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 kg(s,u,p,y,_,k){var P=0;if(y=s,typeof s=="function")dw(s)&&(P=1);else if(typeof s=="string")P=XG(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=yi(31,p,u,_),s.elementType=I,s.lanes=k,s;case w:return cu(p.children,_,k,u);case S:P=8,_|=24;break;case E:return s=yi(12,p,u,_|2),s.elementType=E,s.lanes=k,s;case N:return s=yi(13,p,u,_),s.elementType=N,s.lanes=k,s;case O:return s=yi(19,p,u,_),s.elementType=O,s.lanes=k,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:P=10;break e;case C:P=9;break e;case A:P=11;break e;case T:P=14;break e;case M:P=16,y=null;break e}P=29,p=Error(r(130,s===null?"null":typeof s,"")),y=null}return u=yi(P,p,u,_),u.elementType=s,u.type=y,u.lanes=k,u}function cu(s,u,p,y){return s=yi(7,s,y,u),s.lanes=p,s}function hw(s,u,p){return s=yi(6,s,null,u),s.lanes=p,s}function qT(s){var u=yi(18,null,null,0);return u.stateNode=s,u}function mw(s,u,p){return u=yi(4,s.children!==null?s.children:[],s.key,u),u.lanes=p,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var VT=new WeakMap;function qi(s,u){if(typeof s=="object"&&s!==null){var p=VT.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Ke(u)},VT.set(s,u),u)}return{value:s,source:u,stack:Ke(u)}}var Uc=[],Hc=0,Ag=null,sh=0,Vi=[],Ki=0,Us=null,Ka=1,Ya="";function No(s,u){Uc[Hc++]=sh,Uc[Hc++]=Ag,Ag=s,sh=u}function KT(s,u,p){Vi[Ki++]=Ka,Vi[Ki++]=Ya,Vi[Ki++]=Us,Us=s;var y=Ka;s=Ya;var _=32-Qe(y)-1;y&=~(1<<_),p+=1;var k=32-Qe(u)+_;if(30<k){var P=_-_%5;k=(y&(1<<P)-1).toString(32),y>>=P,_-=P,Ka=1<<32-Qe(u)+_|p<<_|y,Ya=k+s}else Ka=1<<k|p<<_|y,Ya=s}function pw(s){s.return!==null&&(No(s,1),KT(s,1,0))}function gw(s){for(;s===Ag;)Ag=Uc[--Hc],Uc[Hc]=null,sh=Uc[--Hc],Uc[Hc]=null;for(;s===Us;)Us=Vi[--Ki],Vi[Ki]=null,Ya=Vi[--Ki],Vi[Ki]=null,Ka=Vi[--Ki],Vi[Ki]=null}function YT(s,u){Vi[Ki++]=Ka,Vi[Ki++]=Ya,Vi[Ki++]=Us,Ka=u.id,Ya=u.overflow,Us=s}var br=null,nn=null,xt=!1,Hs=null,Yi=!1,vw=Error(r(519));function qs(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lh(qi(u,s)),vw}function XT(s){var u=s.stateNode,p=s.type,y=s.memoizedProps;switch(u[Gt]=s,u[fr]=y,p){case"dialog":ht("cancel",u),ht("close",u);break;case"iframe":case"object":case"embed":ht("load",u);break;case"video":case"audio":for(p=0;p<Nh.length;p++)ht(Nh[p],u);break;case"source":ht("error",u);break;case"img":case"image":case"link":ht("error",u),ht("load",u);break;case"details":ht("toggle",u);break;case"input":ht("invalid",u),pg(u,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":ht("invalid",u);break;case"textarea":ht("invalid",u),uT(u,y.value,y.defaultValue,y.children)}p=y.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||u.textContent===""+p||y.suppressHydrationWarning===!0||fM(u.textContent,p)?(y.popover!=null&&(ht("beforetoggle",u),ht("toggle",u)),y.onScroll!=null&&ht("scroll",u),y.onScrollEnd!=null&&ht("scrollend",u),y.onClick!=null&&(u.onclick=ko),u=!0):u=!1,u||qs(s,!0)}function GT(s){for(br=s.return;br;)switch(br.tag){case 5:case 31:case 13:Yi=!1;return;case 27:case 3:Yi=!0;return;default:br=br.return}}function qc(s){if(s!==br)return!1;if(!xt)return GT(s),xt=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||R1(s.type,s.memoizedProps)),p=!p),p&&nn&&qs(s),GT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=bM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=bM(s)}else u===27?(u=nn,il(s.type)?(s=B1,B1=null,nn=s):nn=u):nn=br?Gi(s.stateNode.nextSibling):null;return!0}function fu(){nn=br=null,xt=!1}function yw(){var s=Hs;return s!==null&&(ai===null?ai=s:ai.push.apply(ai,s),Hs=null),s}function lh(s){Hs===null?Hs=[s]:Hs.push(s)}var xw=H(null),du=null,To=null;function Vs(s,u,p){$(xw,u._currentValue),u._currentValue=p}function Po(s){s._currentValue=xw.current,U(xw)}function bw(s,u,p){for(;s!==null;){var y=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,y!==null&&(y.childLanes|=u)):y!==null&&(y.childLanes&u)!==u&&(y.childLanes|=u),s===p)break;s=s.return}}function ww(s,u,p,y){var _=s.child;for(_!==null&&(_.return=s);_!==null;){var k=_.dependencies;if(k!==null){var P=_.child;k=k.firstContext;e:for(;k!==null;){var Y=k;k=_;for(var J=0;J<u.length;J++)if(Y.context===u[J]){k.lanes|=p,Y=k.alternate,Y!==null&&(Y.lanes|=p),bw(k.return,p,s),y||(P=null);break e}k=Y.next}}else if(_.tag===18){if(P=_.return,P===null)throw Error(r(341));P.lanes|=p,k=P.alternate,k!==null&&(k.lanes|=p),bw(P,p,s),P=null}else P=_.child;if(P!==null)P.return=_;else for(P=_;P!==null;){if(P===s){P=null;break}if(_=P.sibling,_!==null){_.return=P.return,P=_;break}P=P.return}_=P}}function Vc(s,u,p,y){s=null;for(var _=u,k=!1;_!==null;){if(!k){if((_.flags&524288)!==0)k=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var P=_.alternate;if(P===null)throw Error(r(387));if(P=P.memoizedProps,P!==null){var Y=_.type;vi(_.pendingProps.value,P.value)||(s!==null?s.push(Y):s=[Y])}}else if(_===te.current){if(P=_.alternate,P===null)throw Error(r(387));P.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(s!==null?s.push(Rh):s=[Rh])}_=_.return}s!==null&&ww(u,s,p,y),u.flags|=262144}function Og(s){for(s=s.firstContext;s!==null;){if(!vi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function hu(s){du=s,To=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function wr(s){return WT(du,s)}function Ng(s,u){return du===null&&hu(s),WT(s,u)}function WT(s,u){var p=u._currentValue;if(u={context:u,memoizedValue:p,next:null},To===null){if(s===null)throw Error(r(308));To=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else To=To.next=u;return p}var qX=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(p,y){s.push(y)}};this.abort=function(){u.aborted=!0,s.forEach(function(p){return p()})}},VX=e.unstable_scheduleCallback,KX=e.unstable_NormalPriority,Un={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sw(){return{controller:new qX,data:new Map,refCount:0}}function uh(s){s.refCount--,s.refCount===0&&VX(KX,function(){s.controller.abort()})}var ch=null,Ew=0,Kc=0,Yc=null;function YX(s,u){if(ch===null){var p=ch=[];Ew=0,Kc=C1(),Yc={status:"pending",value:void 0,then:function(y){p.push(y)}}}return Ew++,u.then(QT,QT),u}function QT(){if(--Ew===0&&ch!==null){Yc!==null&&(Yc.status="fulfilled");var s=ch;ch=null,Kc=0,Yc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function XX(s,u){var p=[],y={status:"pending",value:null,reason:null,then:function(_){p.push(_)}};return s.then(function(){y.status="fulfilled",y.value=u;for(var _=0;_<p.length;_++)(0,p[_])(u)},function(_){for(y.status="rejected",y.reason=_,_=0;_<p.length;_++)(0,p[_])(void 0)}),y}var ZT=D.S;D.S=function(s,u){RP=Pt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&YX(s,u),ZT!==null&&ZT(s,u)};var mu=H(null);function _w(){var s=mu.current;return s!==null?s:Wt.pooledCache}function Tg(s,u){u===null?$(mu,mu.current):$(mu,u.pool)}function JT(){var s=_w();return s===null?null:{parent:Un._currentValue,pool:s}}var Xc=Error(r(460)),jw=Error(r(474)),Pg=Error(r(542)),Mg={then:function(){}};function e2(s){return s=s.status,s==="fulfilled"||s==="rejected"}function t2(s,u,p){switch(p=s[p],p===void 0?s.push(u):p!==u&&(u.then(ko,ko),u=p),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,r2(s),s;default:if(typeof u.status=="string")u.then(ko,ko);else{if(s=Wt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(y){if(u.status==="pending"){var _=u;_.status="fulfilled",_.value=y}},function(y){if(u.status==="pending"){var _=u;_.status="rejected",_.reason=y}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,r2(s),s}throw gu=u,Xc}}function pu(s){try{var u=s._init;return u(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(gu=p,Xc):p}}var gu=null;function n2(){if(gu===null)throw Error(r(459));var s=gu;return gu=null,s}function r2(s){if(s===Xc||s===Pg)throw Error(r(483))}var Gc=null,fh=0;function Dg(s){var u=fh;return fh+=1,Gc===null&&(Gc=[]),t2(Gc,s,u)}function dh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Rg(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 i2(s){function u(se,re){if(s){var ce=se.deletions;ce===null?(se.deletions=[re],se.flags|=16):ce.push(re)}}function p(se,re){if(!s)return null;for(;re!==null;)u(se,re),re=re.sibling;return null}function y(se){for(var re=new Map;se!==null;)se.key!==null?re.set(se.key,se):re.set(se.index,se),se=se.sibling;return re}function _(se,re){return se=Oo(se,re),se.index=0,se.sibling=null,se}function k(se,re,ce){return se.index=ce,s?(ce=se.alternate,ce!==null?(ce=ce.index,ce<re?(se.flags|=67108866,re):ce):(se.flags|=67108866,re)):(se.flags|=1048576,re)}function P(se){return s&&se.alternate===null&&(se.flags|=67108866),se}function Y(se,re,ce,ve){return re===null||re.tag!==6?(re=hw(ce,se.mode,ve),re.return=se,re):(re=_(re,ce),re.return=se,re)}function J(se,re,ce,ve){var qe=ce.type;return qe===w?ge(se,re,ce.props.children,ve,ce.key):re!==null&&(re.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===M&&pu(qe)===re.type)?(re=_(re,ce.props),dh(re,ce),re.return=se,re):(re=kg(ce.type,ce.key,ce.props,null,se.mode,ve),dh(re,ce),re.return=se,re)}function fe(se,re,ce,ve){return re===null||re.tag!==4||re.stateNode.containerInfo!==ce.containerInfo||re.stateNode.implementation!==ce.implementation?(re=mw(ce,se.mode,ve),re.return=se,re):(re=_(re,ce.children||[]),re.return=se,re)}function ge(se,re,ce,ve,qe){return re===null||re.tag!==7?(re=cu(ce,se.mode,ve,qe),re.return=se,re):(re=_(re,ce),re.return=se,re)}function xe(se,re,ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=hw(""+re,se.mode,ce),re.return=se,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return ce=kg(re.type,re.key,re.props,null,se.mode,ce),dh(ce,re),ce.return=se,ce;case b:return re=mw(re,se.mode,ce),re.return=se,re;case M:return re=pu(re),xe(se,re,ce)}if(K(re)||L(re))return re=cu(re,se.mode,ce,null),re.return=se,re;if(typeof re.then=="function")return xe(se,Dg(re),ce);if(re.$$typeof===j)return xe(se,Ng(se,re),ce);Rg(se,re)}return null}function de(se,re,ce,ve){var qe=re!==null?re.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return qe!==null?null:Y(se,re,""+ce,ve);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return ce.key===qe?J(se,re,ce,ve):null;case b:return ce.key===qe?fe(se,re,ce,ve):null;case M:return ce=pu(ce),de(se,re,ce,ve)}if(K(ce)||L(ce))return qe!==null?null:ge(se,re,ce,ve,null);if(typeof ce.then=="function")return de(se,re,Dg(ce),ve);if(ce.$$typeof===j)return de(se,re,Ng(se,ce),ve);Rg(se,ce)}return null}function me(se,re,ce,ve,qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return se=se.get(ce)||null,Y(re,se,""+ve,qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return se=se.get(ve.key===null?ce:ve.key)||null,J(re,se,ve,qe);case b:return se=se.get(ve.key===null?ce:ve.key)||null,fe(re,se,ve,qe);case M:return ve=pu(ve),me(se,re,ce,ve,qe)}if(K(ve)||L(ve))return se=se.get(ce)||null,ge(re,se,ve,qe,null);if(typeof ve.then=="function")return me(se,re,ce,Dg(ve),qe);if(ve.$$typeof===j)return me(se,re,ce,Ng(re,ve),qe);Rg(re,ve)}return null}function De(se,re,ce,ve){for(var qe=null,At=null,$e=re,st=re=0,vt=null;$e!==null&&st<ce.length;st++){$e.index>st?(vt=$e,$e=null):vt=$e.sibling;var Ot=de(se,$e,ce[st],ve);if(Ot===null){$e===null&&($e=vt);break}s&&$e&&Ot.alternate===null&&u(se,$e),re=k(Ot,re,st),At===null?qe=Ot:At.sibling=Ot,At=Ot,$e=vt}if(st===ce.length)return p(se,$e),xt&&No(se,st),qe;if($e===null){for(;st<ce.length;st++)$e=xe(se,ce[st],ve),$e!==null&&(re=k($e,re,st),At===null?qe=$e:At.sibling=$e,At=$e);return xt&&No(se,st),qe}for($e=y($e);st<ce.length;st++)vt=me($e,se,st,ce[st],ve),vt!==null&&(s&&vt.alternate!==null&&$e.delete(vt.key===null?st:vt.key),re=k(vt,re,st),At===null?qe=vt:At.sibling=vt,At=vt);return s&&$e.forEach(function(ul){return u(se,ul)}),xt&&No(se,st),qe}function We(se,re,ce,ve){if(ce==null)throw Error(r(151));for(var qe=null,At=null,$e=re,st=re=0,vt=null,Ot=ce.next();$e!==null&&!Ot.done;st++,Ot=ce.next()){$e.index>st?(vt=$e,$e=null):vt=$e.sibling;var ul=de(se,$e,Ot.value,ve);if(ul===null){$e===null&&($e=vt);break}s&&$e&&ul.alternate===null&&u(se,$e),re=k(ul,re,st),At===null?qe=ul:At.sibling=ul,At=ul,$e=vt}if(Ot.done)return p(se,$e),xt&&No(se,st),qe;if($e===null){for(;!Ot.done;st++,Ot=ce.next())Ot=xe(se,Ot.value,ve),Ot!==null&&(re=k(Ot,re,st),At===null?qe=Ot:At.sibling=Ot,At=Ot);return xt&&No(se,st),qe}for($e=y($e);!Ot.done;st++,Ot=ce.next())Ot=me($e,se,st,Ot.value,ve),Ot!==null&&(s&&Ot.alternate!==null&&$e.delete(Ot.key===null?st:Ot.key),re=k(Ot,re,st),At===null?qe=Ot:At.sibling=Ot,At=Ot);return s&&$e.forEach(function(aW){return u(se,aW)}),xt&&No(se,st),qe}function qt(se,re,ce,ve){if(typeof ce=="object"&&ce!==null&&ce.type===w&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:e:{for(var qe=ce.key;re!==null;){if(re.key===qe){if(qe=ce.type,qe===w){if(re.tag===7){p(se,re.sibling),ve=_(re,ce.props.children),ve.return=se,se=ve;break e}}else if(re.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===M&&pu(qe)===re.type){p(se,re.sibling),ve=_(re,ce.props),dh(ve,ce),ve.return=se,se=ve;break e}p(se,re);break}else u(se,re);re=re.sibling}ce.type===w?(ve=cu(ce.props.children,se.mode,ve,ce.key),ve.return=se,se=ve):(ve=kg(ce.type,ce.key,ce.props,null,se.mode,ve),dh(ve,ce),ve.return=se,se=ve)}return P(se);case b:e:{for(qe=ce.key;re!==null;){if(re.key===qe)if(re.tag===4&&re.stateNode.containerInfo===ce.containerInfo&&re.stateNode.implementation===ce.implementation){p(se,re.sibling),ve=_(re,ce.children||[]),ve.return=se,se=ve;break e}else{p(se,re);break}else u(se,re);re=re.sibling}ve=mw(ce,se.mode,ve),ve.return=se,se=ve}return P(se);case M:return ce=pu(ce),qt(se,re,ce,ve)}if(K(ce))return De(se,re,ce,ve);if(L(ce)){if(qe=L(ce),typeof qe!="function")throw Error(r(150));return ce=qe.call(ce),We(se,re,ce,ve)}if(typeof ce.then=="function")return qt(se,re,Dg(ce),ve);if(ce.$$typeof===j)return qt(se,re,Ng(se,ce),ve);Rg(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,re!==null&&re.tag===6?(p(se,re.sibling),ve=_(re,ce),ve.return=se,se=ve):(p(se,re),ve=hw(ce,se.mode,ve),ve.return=se,se=ve),P(se)):p(se,re)}return function(se,re,ce,ve){try{fh=0;var qe=qt(se,re,ce,ve);return Gc=null,qe}catch($e){if($e===Xc||$e===Pg)throw $e;var At=yi(29,$e,null,se.mode);return At.lanes=ve,At.return=se,At}finally{}}}var vu=i2(!0),a2=i2(!1),Ks=!1;function Cw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kw(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 Ys(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Xs(s,u,p){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(Mt&2)!==0){var _=y.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),y.pending=u,u=Cg(s),UT(s,null,p),u}return jg(s,y,u,p),Cg(s)}function hh(s,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var y=u.lanes;y&=s.pendingLanes,p|=y,u.lanes=p,Zn(s,p)}}function Aw(s,u){var p=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var _=null,k=null;if(p=p.firstBaseUpdate,p!==null){do{var P={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};k===null?_=k=P:k=k.next=P,p=p.next}while(p!==null);k===null?_=k=u:k=k.next=u}else _=k=u;p={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:k,shared:y.shared,callbacks:y.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=u}var Ow=!1;function mh(){if(Ow){var s=Yc;if(s!==null)throw s}}function ph(s,u,p,y){Ow=!1;var _=s.updateQueue;Ks=!1;var k=_.firstBaseUpdate,P=_.lastBaseUpdate,Y=_.shared.pending;if(Y!==null){_.shared.pending=null;var J=Y,fe=J.next;J.next=null,P===null?k=fe:P.next=fe,P=J;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,Y=ge.lastBaseUpdate,Y!==P&&(Y===null?ge.firstBaseUpdate=fe:Y.next=fe,ge.lastBaseUpdate=J))}if(k!==null){var xe=_.baseState;P=0,ge=fe=J=null,Y=k;do{var de=Y.lane&-536870913,me=de!==Y.lane;if(me?(gt&de)===de:(y&de)===de){de!==0&&de===Kc&&(Ow=!0),ge!==null&&(ge=ge.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var De=s,We=Y;de=u;var qt=p;switch(We.tag){case 1:if(De=We.payload,typeof De=="function"){xe=De.call(qt,xe,de);break e}xe=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=We.payload,de=typeof De=="function"?De.call(qt,xe,de):De,de==null)break e;xe=d({},xe,de);break e;case 2:Ks=!0}}de=Y.callback,de!==null&&(s.flags|=64,me&&(s.flags|=8192),me=_.callbacks,me===null?_.callbacks=[de]:me.push(de))}else me={lane:de,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ge===null?(fe=ge=me,J=xe):ge=ge.next=me,P|=de;if(Y=Y.next,Y===null){if(Y=_.shared.pending,Y===null)break;me=Y,Y=me.next,me.next=null,_.lastBaseUpdate=me,_.shared.pending=null}}while(!0);ge===null&&(J=xe),_.baseState=J,_.firstBaseUpdate=fe,_.lastBaseUpdate=ge,k===null&&(_.shared.lanes=0),Js|=P,s.lanes=P,s.memoizedState=xe}}function o2(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function s2(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)o2(p[s],u)}var Wc=H(null),Ig=H(0);function l2(s,u){s=Fo,$(Ig,s),$(Wc,u),Fo=s|u.baseLanes}function Nw(){$(Ig,Fo),$(Wc,Wc.current)}function Tw(){Fo=Ig.current,U(Wc),U(Ig)}var xi=H(null),Xi=null;function Gs(s){var u=s.alternate;$(In,In.current&1),$(xi,s),Xi===null&&(u===null||Wc.current!==null||u.memoizedState!==null)&&(Xi=s)}function Pw(s){$(In,In.current),$(xi,s),Xi===null&&(Xi=s)}function u2(s){s.tag===22?($(In,In.current),$(xi,s),Xi===null&&(Xi=s)):Ws()}function Ws(){$(In,In.current),$(xi,xi.current)}function bi(s){U(xi),Xi===s&&(Xi=null),U(In)}var In=H(0);function Lg(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)||$1(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 Mo=0,ot=null,Ut=null,Hn=null,zg=!1,Qc=!1,yu=!1,$g=0,gh=0,Zc=null,GX=0;function jn(){throw Error(r(321))}function Mw(s,u){if(u===null)return!1;for(var p=0;p<u.length&&p<s.length;p++)if(!vi(s[p],u[p]))return!1;return!0}function Dw(s,u,p,y,_,k){return Mo=k,ot=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,D.H=s===null||s.memoizedState===null?K2:Gw,yu=!1,k=p(y,_),yu=!1,Qc&&(k=f2(u,p,y,_)),c2(s),k}function c2(s){D.H=xh;var u=Ut!==null&&Ut.next!==null;if(Mo=0,Hn=Ut=ot=null,zg=!1,gh=0,Zc=null,u)throw Error(r(300));s===null||qn||(s=s.dependencies,s!==null&&Og(s)&&(qn=!0))}function f2(s,u,p,y){ot=s;var _=0;do{if(Qc&&(Zc=null),gh=0,Qc=!1,25<=_)throw Error(r(301));if(_+=1,Hn=Ut=null,s.updateQueue!=null){var k=s.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}D.H=Y2,k=u(p,y)}while(Qc);return k}function WX(){var s=D.H,u=s.useState()[0];return u=typeof u.then=="function"?vh(u):u,s=s.useState()[0],(Ut!==null?Ut.memoizedState:null)!==s&&(ot.flags|=1024),u}function Rw(){var s=$g!==0;return $g=0,s}function Iw(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function Lw(s){if(zg){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}zg=!1}Mo=0,Hn=Ut=ot=null,Qc=!1,gh=$g=0,Zc=null}function qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?ot.memoizedState=Hn=s:Hn=Hn.next=s,Hn}function Ln(){if(Ut===null){var s=ot.alternate;s=s!==null?s.memoizedState:null}else s=Ut.next;var u=Hn===null?ot.memoizedState:Hn.next;if(u!==null)Hn=u,Ut=s;else{if(s===null)throw ot.alternate===null?Error(r(467)):Error(r(310));Ut=s,s={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Hn===null?ot.memoizedState=Hn=s:Hn=Hn.next=s}return Hn}function Bg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vh(s){var u=gh;return gh+=1,Zc===null&&(Zc=[]),s=t2(Zc,s,u),u=ot,(Hn===null?u.memoizedState:Hn.next)===null&&(u=u.alternate,D.H=u===null||u.memoizedState===null?K2:Gw),s}function Fg(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return vh(s);if(s.$$typeof===j)return wr(s)}throw Error(r(438,String(s)))}function zw(s){var u=null,p=ot.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var y=ot.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(u={data:y.data.map(function(_){return _.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),p===null&&(p=Bg(),ot.updateQueue=p),p.memoCache=u,p=u.data[u.index],p===void 0)for(p=u.data[u.index]=Array(s),y=0;y<s;y++)p[y]=z;return u.index++,p}function Do(s,u){return typeof u=="function"?u(s):u}function Ug(s){var u=Ln();return $w(u,Ut,s)}function $w(s,u,p){var y=s.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=p;var _=s.baseQueue,k=y.pending;if(k!==null){if(_!==null){var P=_.next;_.next=k.next,k.next=P}u.baseQueue=_=k,y.pending=null}if(k=s.baseState,_===null)s.memoizedState=k;else{u=_.next;var Y=P=null,J=null,fe=u,ge=!1;do{var xe=fe.lane&-536870913;if(xe!==fe.lane?(gt&xe)===xe:(Mo&xe)===xe){var de=fe.revertLane;if(de===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),xe===Kc&&(ge=!0);else if((Mo&de)===de){fe=fe.next,de===Kc&&(ge=!0);continue}else xe={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(Y=J=xe,P=k):J=J.next=xe,ot.lanes|=de,Js|=de;xe=fe.action,yu&&p(k,xe),k=fe.hasEagerState?fe.eagerState:p(k,xe)}else de={lane:xe,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(Y=J=de,P=k):J=J.next=de,ot.lanes|=xe,Js|=xe;fe=fe.next}while(fe!==null&&fe!==u);if(J===null?P=k:J.next=Y,!vi(k,s.memoizedState)&&(qn=!0,ge&&(p=Yc,p!==null)))throw p;s.memoizedState=k,s.baseState=P,s.baseQueue=J,y.lastRenderedState=k}return _===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function Bw(s){var u=Ln(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var y=p.dispatch,_=p.pending,k=u.memoizedState;if(_!==null){p.pending=null;var P=_=_.next;do k=s(k,P.action),P=P.next;while(P!==_);vi(k,u.memoizedState)||(qn=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),p.lastRenderedState=k}return[k,y]}function d2(s,u,p){var y=ot,_=Ln(),k=xt;if(k){if(p===void 0)throw Error(r(407));p=p()}else p=u();var P=!vi((Ut||_).memoizedState,p);if(P&&(_.memoizedState=p,qn=!0),_=_.queue,Hw(p2.bind(null,y,_,s),[s]),_.getSnapshot!==u||P||Hn!==null&&Hn.memoizedState.tag&1){if(y.flags|=2048,Jc(9,{destroy:void 0},m2.bind(null,y,_,p,u),null),Wt===null)throw Error(r(349));k||(Mo&127)!==0||h2(y,u,p)}return p}function h2(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=ot.updateQueue,u===null?(u=Bg(),ot.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function m2(s,u,p,y){u.value=p,u.getSnapshot=y,g2(u)&&v2(s)}function p2(s,u,p){return p(function(){g2(u)&&v2(s)})}function g2(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!vi(s,p)}catch{return!0}}function v2(s){var u=uu(s,2);u!==null&&oi(u,s,2)}function Fw(s){var u=qr();if(typeof s=="function"){var p=s;if(s=p(),yu){ut(!0);try{p()}finally{ut(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:s},u}function y2(s,u,p,y){return s.baseState=p,$w(s,Ut,typeof y=="function"?y:Do)}function QX(s,u,p,y,_){if(Vg(s))throw Error(r(485));if(s=u.action,s!==null){var k={payload:_,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(P){k.listeners.push(P)}};D.T!==null?p(!0):k.isTransition=!1,y(k),p=u.pending,p===null?(k.next=u.pending=k,x2(u,k)):(k.next=p.next,u.pending=p.next=k)}}function x2(s,u){var p=u.action,y=u.payload,_=s.state;if(u.isTransition){var k=D.T,P={};D.T=P;try{var Y=p(_,y),J=D.S;J!==null&&J(P,Y),b2(s,u,Y)}catch(fe){Uw(s,u,fe)}finally{k!==null&&P.types!==null&&(k.types=P.types),D.T=k}}else try{k=p(_,y),b2(s,u,k)}catch(fe){Uw(s,u,fe)}}function b2(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(y){w2(s,u,y)},function(y){return Uw(s,u,y)}):w2(s,u,p)}function w2(s,u,p){u.status="fulfilled",u.value=p,S2(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,x2(s,p)))}function Uw(s,u,p){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do u.status="rejected",u.reason=p,S2(u),u=u.next;while(u!==y)}s.action=null}function S2(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function E2(s,u){return u}function _2(s,u){if(xt){var p=Wt.formState;if(p!==null){e:{var y=ot;if(xt){if(nn){t:{for(var _=nn,k=Yi;_.nodeType!==8;){if(!k){_=null;break t}if(_=Gi(_.nextSibling),_===null){_=null;break t}}k=_.data,_=k==="F!"||k==="F"?_:null}if(_){nn=Gi(_.nextSibling),y=_.data==="F!";break e}}qs(y)}y=!1}y&&(u=p[0])}}return p=qr(),p.memoizedState=p.baseState=u,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:E2,lastRenderedState:u},p.queue=y,p=H2.bind(null,ot,y),y.dispatch=p,y=Fw(!1),k=Xw.bind(null,ot,!1,y.queue),y=qr(),_={state:u,dispatch:null,action:s,pending:null},y.queue=_,p=QX.bind(null,ot,_,k,p),_.dispatch=p,y.memoizedState=s,[u,p,!1]}function j2(s){var u=Ln();return C2(u,Ut,s)}function C2(s,u,p){if(u=$w(s,u,E2)[0],s=Ug(Do)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var y=vh(u)}catch(P){throw P===Xc?Pg:P}else y=u;u=Ln();var _=u.queue,k=_.dispatch;return p!==u.memoizedState&&(ot.flags|=2048,Jc(9,{destroy:void 0},ZX.bind(null,_,p),null)),[y,k,s]}function ZX(s,u){s.action=u}function k2(s){var u=Ln(),p=Ut;if(p!==null)return C2(u,p,s);Ln(),u=u.memoizedState,p=Ln();var y=p.queue.dispatch;return p.memoizedState=s,[u,y,!1]}function Jc(s,u,p,y){return s={tag:s,create:p,deps:y,inst:u,next:null},u=ot.updateQueue,u===null&&(u=Bg(),ot.updateQueue=u),p=u.lastEffect,p===null?u.lastEffect=s.next=s:(y=p.next,p.next=s,s.next=y,u.lastEffect=s),s}function A2(){return Ln().memoizedState}function Hg(s,u,p,y){var _=qr();ot.flags|=s,_.memoizedState=Jc(1|u,{destroy:void 0},p,y===void 0?null:y)}function qg(s,u,p,y){var _=Ln();y=y===void 0?null:y;var k=_.memoizedState.inst;Ut!==null&&y!==null&&Mw(y,Ut.memoizedState.deps)?_.memoizedState=Jc(u,k,p,y):(ot.flags|=s,_.memoizedState=Jc(1|u,k,p,y))}function O2(s,u){Hg(8390656,8,s,u)}function Hw(s,u){qg(2048,8,s,u)}function JX(s){ot.flags|=4;var u=ot.updateQueue;if(u===null)u=Bg(),ot.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function N2(s){var u=Ln().memoizedState;return JX({ref:u,nextImpl:s}),function(){if((Mt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function T2(s,u){return qg(4,2,s,u)}function P2(s,u){return qg(4,4,s,u)}function M2(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 D2(s,u,p){p=p!=null?p.concat([s]):null,qg(4,4,M2.bind(null,u,s),p)}function qw(){}function R2(s,u){var p=Ln();u=u===void 0?null:u;var y=p.memoizedState;return u!==null&&Mw(u,y[1])?y[0]:(p.memoizedState=[s,u],s)}function I2(s,u){var p=Ln();u=u===void 0?null:u;var y=p.memoizedState;if(u!==null&&Mw(u,y[1]))return y[0];if(y=s(),yu){ut(!0);try{s()}finally{ut(!1)}}return p.memoizedState=[y,u],y}function Vw(s,u,p){return p===void 0||(Mo&1073741824)!==0&&(gt&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=LP(),ot.lanes|=s,Js|=s,p)}function L2(s,u,p,y){return vi(p,u)?p:Wc.current!==null?(s=Vw(s,p,y),vi(s,u)||(qn=!0),s):(Mo&42)===0||(Mo&1073741824)!==0&&(gt&261930)===0?(qn=!0,s.memoizedState=p):(s=LP(),ot.lanes|=s,Js|=s,u)}function z2(s,u,p,y,_){var k=q.p;q.p=k!==0&&8>k?k:8;var P=D.T,Y={};D.T=Y,Xw(s,!1,u,p);try{var J=_(),fe=D.S;if(fe!==null&&fe(Y,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ge=XX(J,y);yh(s,u,ge,Ei(s))}else yh(s,u,y,Ei(s))}catch(xe){yh(s,u,{then:function(){},status:"rejected",reason:xe},Ei())}finally{q.p=k,P!==null&&Y.types!==null&&(P.types=Y.types),D.T=P}}function eG(){}function Kw(s,u,p,y){if(s.tag!==5)throw Error(r(476));var _=$2(s).queue;z2(s,_,u,X,p===null?eG:function(){return B2(s),p(y)})}function $2(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:Do,lastRenderedState:X},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function B2(s){var u=$2(s);u.next===null&&(u=s.alternate.memoizedState),yh(s,u.next.queue,{},Ei())}function Yw(){return wr(Rh)}function F2(){return Ln().memoizedState}function U2(){return Ln().memoizedState}function tG(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=Ei();s=Ys(p);var y=Xs(u,s,p);y!==null&&(oi(y,u,p),hh(y,u,p)),u={cache:Sw()},s.payload=u;return}u=u.return}}function nG(s,u,p){var y=Ei();p={lane:y,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Vg(s)?q2(u,p):(p=fw(s,u,p,y),p!==null&&(oi(p,s,y),V2(p,u,y)))}function H2(s,u,p){var y=Ei();yh(s,u,p,y)}function yh(s,u,p,y){var _={lane:y,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Vg(s))q2(u,_);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var P=u.lastRenderedState,Y=k(P,p);if(_.hasEagerState=!0,_.eagerState=Y,vi(Y,P))return jg(s,u,_,0),Wt===null&&_g(),!1}catch{}finally{}if(p=fw(s,u,_,y),p!==null)return oi(p,s,y),V2(p,u,y),!0}return!1}function Xw(s,u,p,y){if(y={lane:2,revertLane:C1(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Vg(s)){if(u)throw Error(r(479))}else u=fw(s,p,y,2),u!==null&&oi(u,s,2)}function Vg(s){var u=s.alternate;return s===ot||u!==null&&u===ot}function q2(s,u){Qc=zg=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function V2(s,u,p){if((p&4194048)!==0){var y=u.lanes;y&=s.pendingLanes,p|=y,u.lanes=p,Zn(s,p)}}var xh={readContext:wr,use:Fg,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useLayoutEffect:jn,useInsertionEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useSyncExternalStore:jn,useId:jn,useHostTransitionStatus:jn,useFormState:jn,useActionState:jn,useOptimistic:jn,useMemoCache:jn,useCacheRefresh:jn};xh.useEffectEvent=jn;var K2={readContext:wr,use:Fg,useCallback:function(s,u){return qr().memoizedState=[s,u===void 0?null:u],s},useContext:wr,useEffect:O2,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,Hg(4194308,4,M2.bind(null,u,s),p)},useLayoutEffect:function(s,u){return Hg(4194308,4,s,u)},useInsertionEffect:function(s,u){Hg(4,2,s,u)},useMemo:function(s,u){var p=qr();u=u===void 0?null:u;var y=s();if(yu){ut(!0);try{s()}finally{ut(!1)}}return p.memoizedState=[y,u],y},useReducer:function(s,u,p){var y=qr();if(p!==void 0){var _=p(u);if(yu){ut(!0);try{p(u)}finally{ut(!1)}}}else _=u;return y.memoizedState=y.baseState=_,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:_},y.queue=s,s=s.dispatch=nG.bind(null,ot,s),[y.memoizedState,s]},useRef:function(s){var u=qr();return s={current:s},u.memoizedState=s},useState:function(s){s=Fw(s);var u=s.queue,p=H2.bind(null,ot,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:qw,useDeferredValue:function(s,u){var p=qr();return Vw(p,s,u)},useTransition:function(){var s=Fw(!1);return s=z2.bind(null,ot,s.queue,!0,!1),qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var y=ot,_=qr();if(xt){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),Wt===null)throw Error(r(349));(gt&127)!==0||h2(y,u,p)}_.memoizedState=p;var k={value:p,getSnapshot:u};return _.queue=k,O2(p2.bind(null,y,k,s),[s]),y.flags|=2048,Jc(9,{destroy:void 0},m2.bind(null,y,k,p,u),null),p},useId:function(){var s=qr(),u=Wt.identifierPrefix;if(xt){var p=Ya,y=Ka;p=(y&~(1<<32-Qe(y)-1)).toString(32)+p,u="_"+u+"R_"+p,p=$g++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=GX++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Yw,useFormState:_2,useActionState:_2,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=Xw.bind(null,ot,!0,p),p.dispatch=u,[s,u]},useMemoCache:zw,useCacheRefresh:function(){return qr().memoizedState=tG.bind(null,ot)},useEffectEvent:function(s){var u=qr(),p={impl:s};return u.memoizedState=p,function(){if((Mt&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},Gw={readContext:wr,use:Fg,useCallback:R2,useContext:wr,useEffect:Hw,useImperativeHandle:D2,useInsertionEffect:T2,useLayoutEffect:P2,useMemo:I2,useReducer:Ug,useRef:A2,useState:function(){return Ug(Do)},useDebugValue:qw,useDeferredValue:function(s,u){var p=Ln();return L2(p,Ut.memoizedState,s,u)},useTransition:function(){var s=Ug(Do)[0],u=Ln().memoizedState;return[typeof s=="boolean"?s:vh(s),u]},useSyncExternalStore:d2,useId:F2,useHostTransitionStatus:Yw,useFormState:j2,useActionState:j2,useOptimistic:function(s,u){var p=Ln();return y2(p,Ut,s,u)},useMemoCache:zw,useCacheRefresh:U2};Gw.useEffectEvent=N2;var Y2={readContext:wr,use:Fg,useCallback:R2,useContext:wr,useEffect:Hw,useImperativeHandle:D2,useInsertionEffect:T2,useLayoutEffect:P2,useMemo:I2,useReducer:Bw,useRef:A2,useState:function(){return Bw(Do)},useDebugValue:qw,useDeferredValue:function(s,u){var p=Ln();return Ut===null?Vw(p,s,u):L2(p,Ut.memoizedState,s,u)},useTransition:function(){var s=Bw(Do)[0],u=Ln().memoizedState;return[typeof s=="boolean"?s:vh(s),u]},useSyncExternalStore:d2,useId:F2,useHostTransitionStatus:Yw,useFormState:k2,useActionState:k2,useOptimistic:function(s,u){var p=Ln();return Ut!==null?y2(p,Ut,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:zw,useCacheRefresh:U2};Y2.useEffectEvent=N2;function Ww(s,u,p,y){u=s.memoizedState,p=p(y,u),p=p==null?u:d({},u,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var Qw={enqueueSetState:function(s,u,p){s=s._reactInternals;var y=Ei(),_=Ys(y);_.payload=u,p!=null&&(_.callback=p),u=Xs(s,_,y),u!==null&&(oi(u,s,y),hh(u,s,y))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var y=Ei(),_=Ys(y);_.tag=1,_.payload=u,p!=null&&(_.callback=p),u=Xs(s,_,y),u!==null&&(oi(u,s,y),hh(u,s,y))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=Ei(),y=Ys(p);y.tag=2,u!=null&&(y.callback=u),u=Xs(s,y,p),u!==null&&(oi(u,s,p),hh(u,s,p))}};function X2(s,u,p,y,_,k,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,k,P):u.prototype&&u.prototype.isPureReactComponent?!ah(p,y)||!ah(_,k):!0}function G2(s,u,p,y){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,y),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,y),u.state!==s&&Qw.enqueueReplaceState(u,u.state,null)}function xu(s,u){var p=u;if("ref"in u){p={};for(var y in u)y!=="ref"&&(p[y]=u[y])}if(s=s.defaultProps){p===u&&(p=d({},p));for(var _ in s)p[_]===void 0&&(p[_]=s[_])}return p}function W2(s){Eg(s)}function Q2(s){console.error(s)}function Z2(s){Eg(s)}function Kg(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(y){setTimeout(function(){throw y})}}function J2(s,u,p){try{var y=s.onCaughtError;y(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Zw(s,u,p){return p=Ys(p),p.tag=3,p.payload={element:null},p.callback=function(){Kg(s,u)},p}function eP(s){return s=Ys(s),s.tag=3,s}function tP(s,u,p,y){var _=p.type.getDerivedStateFromError;if(typeof _=="function"){var k=y.value;s.payload=function(){return _(k)},s.callback=function(){J2(u,p,y)}}var P=p.stateNode;P!==null&&typeof P.componentDidCatch=="function"&&(s.callback=function(){J2(u,p,y),typeof _!="function"&&(el===null?el=new Set([this]):el.add(this));var Y=y.stack;this.componentDidCatch(y.value,{componentStack:Y!==null?Y:""})})}function rG(s,u,p,y,_){if(p.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(u=p.alternate,u!==null&&Vc(u,p,_,!0),p=xi.current,p!==null){switch(p.tag){case 31:case 13:return Xi===null?iv():p.alternate===null&&Cn===0&&(Cn=3),p.flags&=-257,p.flags|=65536,p.lanes=_,y===Mg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([y]):u.add(y),E1(s,y,_)),!1;case 22:return p.flags|=65536,y===Mg?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([y])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([y]):p.add(y)),E1(s,y,_)),!1}throw Error(r(435,p.tag))}return E1(s,y,_),iv(),!1}if(xt)return u=xi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=_,y!==vw&&(s=Error(r(422),{cause:y}),lh(qi(s,p)))):(y!==vw&&(u=Error(r(423),{cause:y}),lh(qi(u,p))),s=s.current.alternate,s.flags|=65536,_&=-_,s.lanes|=_,y=qi(y,p),_=Zw(s.stateNode,y,_),Aw(s,_),Cn!==4&&(Cn=2)),!1;var k=Error(r(520),{cause:y});if(k=qi(k,p),kh===null?kh=[k]:kh.push(k),Cn!==4&&(Cn=2),u===null)return!0;y=qi(y,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,s=_&-_,p.lanes|=s,s=Zw(p.stateNode,y,s),Aw(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"&&(el===null||!el.has(k))))return p.flags|=65536,_&=-_,p.lanes|=_,_=eP(_),tP(_,s,p,y),Aw(p,_),!1}p=p.return}while(p!==null);return!1}var Jw=Error(r(461)),qn=!1;function Sr(s,u,p,y){u.child=s===null?a2(u,null,p,y):vu(u,s.child,p,y)}function nP(s,u,p,y,_){p=p.render;var k=u.ref;if("ref"in y){var P={};for(var Y in y)Y!=="ref"&&(P[Y]=y[Y])}else P=y;return hu(u),y=Dw(s,u,p,P,k,_),Y=Rw(),s!==null&&!qn?(Iw(s,u,_),Ro(s,u,_)):(xt&&Y&&pw(u),u.flags|=1,Sr(s,u,y,_),u.child)}function rP(s,u,p,y,_){if(s===null){var k=p.type;return typeof k=="function"&&!dw(k)&&k.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=k,iP(s,u,k,y,_)):(s=kg(p.type,null,y,u,u.mode,_),s.ref=u.ref,s.return=u,u.child=s)}if(k=s.child,!s1(s,_)){var P=k.memoizedProps;if(p=p.compare,p=p!==null?p:ah,p(P,y)&&s.ref===u.ref)return Ro(s,u,_)}return u.flags|=1,s=Oo(k,y),s.ref=u.ref,s.return=u,u.child=s}function iP(s,u,p,y,_){if(s!==null){var k=s.memoizedProps;if(ah(k,y)&&s.ref===u.ref)if(qn=!1,u.pendingProps=y=k,s1(s,_))(s.flags&131072)!==0&&(qn=!0);else return u.lanes=s.lanes,Ro(s,u,_)}return e1(s,u,p,y,_)}function aP(s,u,p,y){var _=y.children,k=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((u.flags&128)!==0){if(k=k!==null?k.baseLanes|p:p,s!==null){for(y=u.child=s.child,_=0;y!==null;)_=_|y.lanes|y.childLanes,y=y.sibling;y=_&~k}else y=0,u.child=null;return oP(s,u,k,p,y)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Tg(u,k!==null?k.cachePool:null),k!==null?l2(u,k):Nw(),u2(u);else return y=u.lanes=536870912,oP(s,u,k!==null?k.baseLanes|p:p,p,y)}else k!==null?(Tg(u,k.cachePool),l2(u,k),Ws(),u.memoizedState=null):(s!==null&&Tg(u,null),Nw(),Ws());return Sr(s,u,_,p),u.child}function bh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function oP(s,u,p,y,_){var k=_w();return k=k===null?null:{parent:Un._currentValue,pool:k},u.memoizedState={baseLanes:p,cachePool:k},s!==null&&Tg(u,null),Nw(),u2(u),s!==null&&Vc(s,u,y,!0),u.childLanes=_,null}function Yg(s,u){return u=Gg({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function sP(s,u,p){return vu(u,s.child,null,p),s=Yg(u,u.pendingProps),s.flags|=2,bi(u),u.memoizedState=null,s}function iG(s,u,p){var y=u.pendingProps,_=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(xt){if(y.mode==="hidden")return s=Yg(u,y),u.lanes=536870912,bh(null,s);if(Pw(u),(s=nn)?(s=xM(s,Yi),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Us!==null?{id:Ka,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},p=qT(s),p.return=u,u.child=p,br=u,nn=null)):s=null,s===null)throw qs(u);return u.lanes=536870912,null}return Yg(u,y)}var k=s.memoizedState;if(k!==null){var P=k.dehydrated;if(Pw(u),_)if(u.flags&256)u.flags&=-257,u=sP(s,u,p);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(qn||Vc(s,u,p,!1),_=(p&s.childLanes)!==0,qn||_){if(y=Wt,y!==null&&(P=cr(y,p),P!==0&&P!==k.retryLane))throw k.retryLane=P,uu(s,P),oi(y,s,P),Jw;iv(),u=sP(s,u,p)}else s=k.treeContext,nn=Gi(P.nextSibling),br=u,xt=!0,Hs=null,Yi=!1,s!==null&&YT(u,s),u=Yg(u,y),u.flags|=4096;return u}return s=Oo(s.child,{mode:y.mode,children:y.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Xg(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 e1(s,u,p,y,_){return hu(u),p=Dw(s,u,p,y,void 0,_),y=Rw(),s!==null&&!qn?(Iw(s,u,_),Ro(s,u,_)):(xt&&y&&pw(u),u.flags|=1,Sr(s,u,p,_),u.child)}function lP(s,u,p,y,_,k){return hu(u),u.updateQueue=null,p=f2(u,y,p,_),c2(s),y=Rw(),s!==null&&!qn?(Iw(s,u,k),Ro(s,u,k)):(xt&&y&&pw(u),u.flags|=1,Sr(s,u,p,k),u.child)}function uP(s,u,p,y,_){if(hu(u),u.stateNode===null){var k=Fc,P=p.contextType;typeof P=="object"&&P!==null&&(k=wr(P)),k=new p(y,k),u.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Qw,u.stateNode=k,k._reactInternals=u,k=u.stateNode,k.props=y,k.state=u.memoizedState,k.refs={},Cw(u),P=p.contextType,k.context=typeof P=="object"&&P!==null?wr(P):Fc,k.state=u.memoizedState,P=p.getDerivedStateFromProps,typeof P=="function"&&(Ww(u,p,P,y),k.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(P=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),P!==k.state&&Qw.enqueueReplaceState(k,k.state,null),ph(u,y,k,_),mh(),k.state=u.memoizedState),typeof k.componentDidMount=="function"&&(u.flags|=4194308),y=!0}else if(s===null){k=u.stateNode;var Y=u.memoizedProps,J=xu(p,Y);k.props=J;var fe=k.context,ge=p.contextType;P=Fc,typeof ge=="object"&&ge!==null&&(P=wr(ge));var xe=p.getDerivedStateFromProps;ge=typeof xe=="function"||typeof k.getSnapshotBeforeUpdate=="function",Y=u.pendingProps!==Y,ge||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(Y||fe!==P)&&G2(u,k,y,P),Ks=!1;var de=u.memoizedState;k.state=de,ph(u,y,k,_),mh(),fe=u.memoizedState,Y||de!==fe||Ks?(typeof xe=="function"&&(Ww(u,p,xe,y),fe=u.memoizedState),(J=Ks||X2(u,p,J,y,de,fe,P))?(ge||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=y,u.memoizedState=fe),k.props=y,k.state=fe,k.context=P,y=J):(typeof k.componentDidMount=="function"&&(u.flags|=4194308),y=!1)}else{k=u.stateNode,kw(s,u),P=u.memoizedProps,ge=xu(p,P),k.props=ge,xe=u.pendingProps,de=k.context,fe=p.contextType,J=Fc,typeof fe=="object"&&fe!==null&&(J=wr(fe)),Y=p.getDerivedStateFromProps,(fe=typeof Y=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==xe||de!==J)&&G2(u,k,y,J),Ks=!1,de=u.memoizedState,k.state=de,ph(u,y,k,_),mh();var me=u.memoizedState;P!==xe||de!==me||Ks||s!==null&&s.dependencies!==null&&Og(s.dependencies)?(typeof Y=="function"&&(Ww(u,p,Y,y),me=u.memoizedState),(ge=Ks||X2(u,p,ge,y,de,me,J)||s!==null&&s.dependencies!==null&&Og(s.dependencies))?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(y,me,J),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(y,me,J)),typeof k.componentDidUpdate=="function"&&(u.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof k.componentDidUpdate!="function"||P===s.memoizedProps&&de===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&de===s.memoizedState||(u.flags|=1024),u.memoizedProps=y,u.memoizedState=me),k.props=y,k.state=me,k.context=J,y=ge):(typeof k.componentDidUpdate!="function"||P===s.memoizedProps&&de===s.memoizedState||(u.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&de===s.memoizedState||(u.flags|=1024),y=!1)}return k=y,Xg(s,u),y=(u.flags&128)!==0,k||y?(k=u.stateNode,p=y&&typeof p.getDerivedStateFromError!="function"?null:k.render(),u.flags|=1,s!==null&&y?(u.child=vu(u,s.child,null,_),u.child=vu(u,null,p,_)):Sr(s,u,p,_),u.memoizedState=k.state,s=u.child):s=Ro(s,u,_),s}function cP(s,u,p,y){return fu(),u.flags|=256,Sr(s,u,p,y),u.child}var t1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function n1(s){return{baseLanes:s,cachePool:JT()}}function r1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=Si),s}function fP(s,u,p){var y=u.pendingProps,_=!1,k=(u.flags&128)!==0,P;if((P=k)||(P=s!==null&&s.memoizedState===null?!1:(In.current&2)!==0),P&&(_=!0,u.flags&=-129),P=(u.flags&32)!==0,u.flags&=-33,s===null){if(xt){if(_?Gs(u):Ws(),(s=nn)?(s=xM(s,Yi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Us!==null?{id:Ka,overflow:Ya}:null,retryLane:536870912,hydrationErrors:null},p=qT(s),p.return=u,u.child=p,br=u,nn=null)):s=null,s===null)throw qs(u);return $1(s)?u.lanes=32:u.lanes=536870912,null}var Y=y.children;return y=y.fallback,_?(Ws(),_=u.mode,Y=Gg({mode:"hidden",children:Y},_),y=cu(y,_,p,null),Y.return=u,y.return=u,Y.sibling=y,u.child=Y,y=u.child,y.memoizedState=n1(p),y.childLanes=r1(s,P,p),u.memoizedState=t1,bh(null,y)):(Gs(u),i1(u,Y))}var J=s.memoizedState;if(J!==null&&(Y=J.dehydrated,Y!==null)){if(k)u.flags&256?(Gs(u),u.flags&=-257,u=a1(s,u,p)):u.memoizedState!==null?(Ws(),u.child=s.child,u.flags|=128,u=null):(Ws(),Y=y.fallback,_=u.mode,y=Gg({mode:"visible",children:y.children},_),Y=cu(Y,_,p,null),Y.flags|=2,y.return=u,Y.return=u,y.sibling=Y,u.child=y,vu(u,s.child,null,p),y=u.child,y.memoizedState=n1(p),y.childLanes=r1(s,P,p),u.memoizedState=t1,u=bh(null,y));else if(Gs(u),$1(Y)){if(P=Y.nextSibling&&Y.nextSibling.dataset,P)var fe=P.dgst;P=fe,y=Error(r(419)),y.stack="",y.digest=P,lh({value:y,source:null,stack:null}),u=a1(s,u,p)}else if(qn||Vc(s,u,p,!1),P=(p&s.childLanes)!==0,qn||P){if(P=Wt,P!==null&&(y=cr(P,p),y!==0&&y!==J.retryLane))throw J.retryLane=y,uu(s,y),oi(P,s,y),Jw;z1(Y)||iv(),u=a1(s,u,p)}else z1(Y)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,nn=Gi(Y.nextSibling),br=u,xt=!0,Hs=null,Yi=!1,s!==null&&YT(u,s),u=i1(u,y.children),u.flags|=4096);return u}return _?(Ws(),Y=y.fallback,_=u.mode,J=s.child,fe=J.sibling,y=Oo(J,{mode:"hidden",children:y.children}),y.subtreeFlags=J.subtreeFlags&65011712,fe!==null?Y=Oo(fe,Y):(Y=cu(Y,_,p,null),Y.flags|=2),Y.return=u,y.return=u,y.sibling=Y,u.child=y,bh(null,y),y=u.child,Y=s.child.memoizedState,Y===null?Y=n1(p):(_=Y.cachePool,_!==null?(J=Un._currentValue,_=_.parent!==J?{parent:J,pool:J}:_):_=JT(),Y={baseLanes:Y.baseLanes|p,cachePool:_}),y.memoizedState=Y,y.childLanes=r1(s,P,p),u.memoizedState=t1,bh(s.child,y)):(Gs(u),p=s.child,s=p.sibling,p=Oo(p,{mode:"visible",children:y.children}),p.return=u,p.sibling=null,s!==null&&(P=u.deletions,P===null?(u.deletions=[s],u.flags|=16):P.push(s)),u.child=p,u.memoizedState=null,p)}function i1(s,u){return u=Gg({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Gg(s,u){return s=yi(22,s,null,u),s.lanes=0,s}function a1(s,u,p){return vu(u,s.child,null,p),s=i1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function dP(s,u,p){s.lanes|=u;var y=s.alternate;y!==null&&(y.lanes|=u),bw(s.return,u,p)}function o1(s,u,p,y,_,k){var P=s.memoizedState;P===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:_,treeForkCount:k}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=p,P.tailMode=_,P.treeForkCount=k)}function hP(s,u,p){var y=u.pendingProps,_=y.revealOrder,k=y.tail;y=y.children;var P=In.current,Y=(P&2)!==0;if(Y?(P=P&1|2,u.flags|=128):P&=1,$(In,P),Sr(s,u,y,p),y=xt?sh:0,!Y&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&dP(s,p,u);else if(s.tag===19)dP(s,p,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(_){case"forwards":for(p=u.child,_=null;p!==null;)s=p.alternate,s!==null&&Lg(s)===null&&(_=p),p=p.sibling;p=_,p===null?(_=u.child,u.child=null):(_=p.sibling,p.sibling=null),o1(u,!1,_,p,k,y);break;case"backwards":case"unstable_legacy-backwards":for(p=null,_=u.child,u.child=null;_!==null;){if(s=_.alternate,s!==null&&Lg(s)===null){u.child=_;break}s=_.sibling,_.sibling=p,p=_,_=s}o1(u,!0,p,null,k,y);break;case"together":o1(u,!1,null,null,void 0,y);break;default:u.memoizedState=null}return u.child}function Ro(s,u,p){if(s!==null&&(u.dependencies=s.dependencies),Js|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(Vc(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=Oo(s,s.pendingProps),u.child=p,p.return=u;s.sibling!==null;)s=s.sibling,p=p.sibling=Oo(s,s.pendingProps),p.return=u;p.sibling=null}return u.child}function s1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Og(s)))}function aG(s,u,p){switch(u.tag){case 3:ie(u,u.stateNode.containerInfo),Vs(u,Un,s.memoizedState.cache),fu();break;case 27:case 5:le(u);break;case 4:ie(u,u.stateNode.containerInfo);break;case 10:Vs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Pw(u),null;break;case 13:var y=u.memoizedState;if(y!==null)return y.dehydrated!==null?(Gs(u),u.flags|=128,null):(p&u.child.childLanes)!==0?fP(s,u,p):(Gs(u),s=Ro(s,u,p),s!==null?s.sibling:null);Gs(u);break;case 19:var _=(s.flags&128)!==0;if(y=(p&u.childLanes)!==0,y||(Vc(s,u,p,!1),y=(p&u.childLanes)!==0),_){if(y)return hP(s,u,p);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),$(In,In.current),y)break;return null;case 22:return u.lanes=0,aP(s,u,p,u.pendingProps);case 24:Vs(u,Un,s.memoizedState.cache)}return Ro(s,u,p)}function mP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)qn=!0;else{if(!s1(s,p)&&(u.flags&128)===0)return qn=!1,aG(s,u,p);qn=(s.flags&131072)!==0}else qn=!1,xt&&(u.flags&1048576)!==0&&KT(u,sh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var y=u.pendingProps;if(s=pu(u.elementType),u.type=s,typeof s=="function")dw(s)?(y=xu(s,y),u.tag=1,u=uP(null,u,s,y,p)):(u.tag=0,u=e1(null,u,s,y,p));else{if(s!=null){var _=s.$$typeof;if(_===A){u.tag=11,u=nP(null,u,s,y,p);break e}else if(_===T){u.tag=14,u=rP(null,u,s,y,p);break e}}throw u=F(s)||s,Error(r(306,u,""))}}return u;case 0:return e1(s,u,u.type,u.pendingProps,p);case 1:return y=u.type,_=xu(y,u.pendingProps),uP(s,u,y,_,p);case 3:e:{if(ie(u,u.stateNode.containerInfo),s===null)throw Error(r(387));y=u.pendingProps;var k=u.memoizedState;_=k.element,kw(s,u),ph(u,y,null,p);var P=u.memoizedState;if(y=P.cache,Vs(u,Un,y),y!==k.cache&&ww(u,[Un],p,!0),mh(),y=P.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:P.cache},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){u=cP(s,u,y,p);break e}else if(y!==_){_=qi(Error(r(424)),u),lh(_),u=cP(s,u,y,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(nn=Gi(s.firstChild),br=u,xt=!0,Hs=null,Yi=!0,p=a2(u,null,y,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(fu(),y===_){u=Ro(s,u,p);break e}Sr(s,u,y,p)}u=u.child}return u;case 26:return Xg(s,u),s===null?(p=jM(u.type,null,u.pendingProps,null))?u.memoizedState=p:xt||(p=u.type,s=u.pendingProps,y=fv(ne.current).createElement(p),y[Gt]=u,y[fr]=s,Er(y,p,s),Fn(y),u.stateNode=y):u.memoizedState=jM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return le(u),s===null&&xt&&(y=u.stateNode=SM(u.type,u.pendingProps,ne.current),br=u,Yi=!0,_=nn,il(u.type)?(B1=_,nn=Gi(y.firstChild)):nn=_),Sr(s,u,u.pendingProps.children,p),Xg(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&xt&&((_=y=nn)&&(y=RG(y,u.type,u.pendingProps,Yi),y!==null?(u.stateNode=y,br=u,nn=Gi(y.firstChild),Yi=!1,_=!0):_=!1),_||qs(u)),le(u),_=u.type,k=u.pendingProps,P=s!==null?s.memoizedProps:null,y=k.children,R1(_,k)?y=null:P!==null&&R1(_,P)&&(u.flags|=32),u.memoizedState!==null&&(_=Dw(s,u,WX,null,null,p),Rh._currentValue=_),Xg(s,u),Sr(s,u,y,p),u.child;case 6:return s===null&&xt&&((s=p=nn)&&(p=IG(p,u.pendingProps,Yi),p!==null?(u.stateNode=p,br=u,nn=null,s=!0):s=!1),s||qs(u)),null;case 13:return fP(s,u,p);case 4:return ie(u,u.stateNode.containerInfo),y=u.pendingProps,s===null?u.child=vu(u,null,y,p):Sr(s,u,y,p),u.child;case 11:return nP(s,u,u.type,u.pendingProps,p);case 7:return Sr(s,u,u.pendingProps,p),u.child;case 8:return Sr(s,u,u.pendingProps.children,p),u.child;case 12:return Sr(s,u,u.pendingProps.children,p),u.child;case 10:return y=u.pendingProps,Vs(u,u.type,y.value),Sr(s,u,y.children,p),u.child;case 9:return _=u.type._context,y=u.pendingProps.children,hu(u),_=wr(_),y=y(_),u.flags|=1,Sr(s,u,y,p),u.child;case 14:return rP(s,u,u.type,u.pendingProps,p);case 15:return iP(s,u,u.type,u.pendingProps,p);case 19:return hP(s,u,p);case 31:return iG(s,u,p);case 22:return aP(s,u,p,u.pendingProps);case 24:return hu(u),y=wr(Un),s===null?(_=_w(),_===null&&(_=Wt,k=Sw(),_.pooledCache=k,k.refCount++,k!==null&&(_.pooledCacheLanes|=p),_=k),u.memoizedState={parent:y,cache:_},Cw(u),Vs(u,Un,_)):((s.lanes&p)!==0&&(kw(s,u),ph(u,null,null,p),mh()),_=s.memoizedState,k=u.memoizedState,_.parent!==y?(_={parent:y,cache:y},u.memoizedState=_,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=_),Vs(u,Un,y)):(y=k.cache,Vs(u,Un,y),y!==_.cache&&ww(u,[Un],p,!0))),Sr(s,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Io(s){s.flags|=4}function l1(s,u,p,y,_){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(_&335544128)===_)if(s.stateNode.complete)s.flags|=8192;else if(FP())s.flags|=8192;else throw gu=Mg,jw}else s.flags&=-16777217}function pP(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!NM(u))if(FP())s.flags|=8192;else throw gu=Mg,jw}function Wg(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Bn():536870912,s.lanes|=u,rf|=u)}function wh(s,u){if(!xt)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 y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function rn(s){var u=s.alternate!==null&&s.alternate.child===s.child,p=0,y=0;if(u)for(var _=s.child;_!==null;)p|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)p|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=y,s.childLanes=p,u}function oG(s,u,p){var y=u.pendingProps;switch(gw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(u),null;case 1:return rn(u),null;case 3:return p=u.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),u.memoizedState.cache!==y&&(u.flags|=2048),Po(Un),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(qc(u)?Io(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,yw())),rn(u),null;case 26:var _=u.type,k=u.memoizedState;return s===null?(Io(u),k!==null?(rn(u),pP(u,k)):(rn(u),l1(u,_,null,y,p))):k?k!==s.memoizedState?(Io(u),rn(u),pP(u,k)):(rn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==y&&Io(u),rn(u),l1(u,_,s,y,p)),null;case 27:if(pe(u),p=ne.current,_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&Io(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return rn(u),null}s=Q.current,qc(u)?XT(u):(s=SM(_,y,p),u.stateNode=s,Io(u))}return rn(u),null;case 5:if(pe(u),_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&Io(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return rn(u),null}if(k=Q.current,qc(u))XT(u);else{var P=fv(ne.current);switch(k){case 1:k=P.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:k=P.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":k=P.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":k=P.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":k=P.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof y.is=="string"?P.createElement("select",{is:y.is}):P.createElement("select"),y.multiple?k.multiple=!0:y.size&&(k.size=y.size);break;default:k=typeof y.is=="string"?P.createElement(_,{is:y.is}):P.createElement(_)}}k[Gt]=u,k[fr]=y;e:for(P=u.child;P!==null;){if(P.tag===5||P.tag===6)k.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===u)break e;for(;P.sibling===null;){if(P.return===null||P.return===u)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}u.stateNode=k;e:switch(Er(k,_,y),_){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Io(u)}}return rn(u),l1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==y&&Io(u);else{if(typeof y!="string"&&u.stateNode===null)throw Error(r(166));if(s=ne.current,qc(u)){if(s=u.stateNode,p=u.memoizedProps,y=null,_=br,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}s[Gt]=u,s=!!(s.nodeValue===p||y!==null&&y.suppressHydrationWarning===!0||fM(s.nodeValue,p)),s||qs(u,!0)}else s=fv(s).createTextNode(y),s[Gt]=u,u.stateNode=s}return rn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(y=qc(u),p!==null){if(s===null){if(!y)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Gt]=u}else fu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),s=!1}else p=yw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(bi(u),u):(bi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return rn(u),null;case 13:if(y=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(_=qc(u),y!==null&&y.dehydrated!==null){if(s===null){if(!_)throw Error(r(318));if(_=u.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Gt]=u}else fu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),_=!1}else _=yw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=_),_=!0;if(!_)return u.flags&256?(bi(u),u):(bi(u),null)}return bi(u),(u.flags&128)!==0?(u.lanes=p,u):(p=y!==null,s=s!==null&&s.memoizedState!==null,p&&(y=u.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool),k=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(k=y.memoizedState.cachePool.pool),k!==_&&(y.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),Wg(u,u.updateQueue),rn(u),null);case 4:return ee(),s===null&&N1(u.stateNode.containerInfo),rn(u),null;case 10:return Po(u.type),rn(u),null;case 19:if(U(In),y=u.memoizedState,y===null)return rn(u),null;if(_=(u.flags&128)!==0,k=y.rendering,k===null)if(_)wh(y,!1);else{if(Cn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(k=Lg(s),k!==null){for(u.flags|=128,wh(y,!1),s=k.updateQueue,u.updateQueue=s,Wg(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)HT(p,s),p=p.sibling;return $(In,In.current&1|2),xt&&No(u,y.treeForkCount),u.child}s=s.sibling}y.tail!==null&&Pt()>tv&&(u.flags|=128,_=!0,wh(y,!1),u.lanes=4194304)}else{if(!_)if(s=Lg(k),s!==null){if(u.flags|=128,_=!0,s=s.updateQueue,u.updateQueue=s,Wg(u,s),wh(y,!0),y.tail===null&&y.tailMode==="hidden"&&!k.alternate&&!xt)return rn(u),null}else 2*Pt()-y.renderingStartTime>tv&&p!==536870912&&(u.flags|=128,_=!0,wh(y,!1),u.lanes=4194304);y.isBackwards?(k.sibling=u.child,u.child=k):(s=y.last,s!==null?s.sibling=k:u.child=k,y.last=k)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=Pt(),s.sibling=null,p=In.current,$(In,_?p&1|2:p&1),xt&&No(u,y.treeForkCount),s):(rn(u),null);case 22:case 23:return bi(u),Tw(),y=u.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(u.flags|=8192):y&&(u.flags|=8192),y?(p&536870912)!==0&&(u.flags&128)===0&&(rn(u),u.subtreeFlags&6&&(u.flags|=8192)):rn(u),p=u.updateQueue,p!==null&&Wg(u,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==p&&(u.flags|=2048),s!==null&&U(mu),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),Po(Un),rn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function sG(s,u){switch(gw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Po(Un),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(bi(u),u.alternate===null)throw Error(r(340));fu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(bi(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));fu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(In),null;case 4:return ee(),null;case 10:return Po(u.type),null;case 22:case 23:return bi(u),Tw(),s!==null&&U(mu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Po(Un),null;case 25:return null;default:return null}}function gP(s,u){switch(gw(u),u.tag){case 3:Po(Un),ee();break;case 26:case 27:case 5:pe(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&bi(u);break;case 13:bi(u);break;case 19:U(In);break;case 10:Po(u.type);break;case 22:case 23:bi(u),Tw(),s!==null&&U(mu);break;case 24:Po(Un)}}function Sh(s,u){try{var p=u.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var _=y.next;p=_;do{if((p.tag&s)===s){y=void 0;var k=p.create,P=p.inst;y=k(),P.destroy=y}p=p.next}while(p!==_)}}catch(Y){$t(u,u.return,Y)}}function Qs(s,u,p){try{var y=u.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var k=_.next;y=k;do{if((y.tag&s)===s){var P=y.inst,Y=P.destroy;if(Y!==void 0){P.destroy=void 0,_=u;var J=p,fe=Y;try{fe()}catch(ge){$t(_,J,ge)}}}y=y.next}while(y!==k)}}catch(ge){$t(u,u.return,ge)}}function vP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{s2(u,p)}catch(y){$t(s,s.return,y)}}}function yP(s,u,p){p.props=xu(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(y){$t(s,u,y)}}function Eh(s,u){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof p=="function"?s.refCleanup=p(y):p.current=y}}catch(_){$t(s,u,_)}}function Xa(s,u){var p=s.ref,y=s.refCleanup;if(p!==null)if(typeof y=="function")try{y()}catch(_){$t(s,u,_)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(_){$t(s,u,_)}else p.current=null}function xP(s){var u=s.type,p=s.memoizedProps,y=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&y.focus();break e;case"img":p.src?y.src=p.src:p.srcSet&&(y.srcset=p.srcSet)}}catch(_){$t(s,s.return,_)}}function u1(s,u,p){try{var y=s.stateNode;OG(y,s.type,p,u),y[fr]=u}catch(_){$t(s,s.return,_)}}function bP(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&il(s.type)||s.tag===4}function c1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||bP(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&&il(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 f1(s,u,p){var y=s.tag;if(y===5||y===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=ko));else if(y!==4&&(y===27&&il(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(f1(s,u,p),s=s.sibling;s!==null;)f1(s,u,p),s=s.sibling}function Qg(s,u,p){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?p.insertBefore(s,u):p.appendChild(s);else if(y!==4&&(y===27&&il(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(Qg(s,u,p),s=s.sibling;s!==null;)Qg(s,u,p),s=s.sibling}function wP(s){var u=s.stateNode,p=s.memoizedProps;try{for(var y=s.type,_=u.attributes;_.length;)u.removeAttributeNode(_[0]);Er(u,y,p),u[Gt]=s,u[fr]=p}catch(k){$t(s,s.return,k)}}var Lo=!1,Vn=!1,d1=!1,SP=typeof WeakSet=="function"?WeakSet:Set,dr=null;function lG(s,u){if(s=s.containerInfo,M1=yv,s=DT(s),aw(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var _=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{p.nodeType,k.nodeType}catch{p=null;break e}var P=0,Y=-1,J=-1,fe=0,ge=0,xe=s,de=null;t:for(;;){for(var me;xe!==p||_!==0&&xe.nodeType!==3||(Y=P+_),xe!==k||y!==0&&xe.nodeType!==3||(J=P+y),xe.nodeType===3&&(P+=xe.nodeValue.length),(me=xe.firstChild)!==null;)de=xe,xe=me;for(;;){if(xe===s)break t;if(de===p&&++fe===_&&(Y=P),de===k&&++ge===y&&(J=P),(me=xe.nextSibling)!==null)break;xe=de,de=xe.parentNode}xe=me}p=Y===-1||J===-1?null:{start:Y,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(D1={focusedElem:s,selectionRange:p},yv=!1,dr=u;dr!==null;)if(u=dr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,dr=s;else for(;dr!==null;){switch(u=dr,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++)_=s[p],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&k!==null){s=void 0,p=u,_=k.memoizedProps,k=k.memoizedState,y=p.stateNode;try{var De=xu(p.type,_);s=y.getSnapshotBeforeUpdate(De,k),y.__reactInternalSnapshotBeforeUpdate=s}catch(We){$t(p,p.return,We)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,p=s.nodeType,p===9)L1(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":L1(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,dr=s;break}dr=u.return}}function EP(s,u,p){var y=p.flags;switch(p.tag){case 0:case 11:case 15:$o(s,p),y&4&&Sh(5,p);break;case 1:if($o(s,p),y&4)if(s=p.stateNode,u===null)try{s.componentDidMount()}catch(P){$t(p,p.return,P)}else{var _=xu(p.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(_,u,s.__reactInternalSnapshotBeforeUpdate)}catch(P){$t(p,p.return,P)}}y&64&&vP(p),y&512&&Eh(p,p.return);break;case 3:if($o(s,p),y&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{s2(s,u)}catch(P){$t(p,p.return,P)}}break;case 27:u===null&&y&4&&wP(p);case 26:case 5:$o(s,p),u===null&&y&4&&xP(p),y&512&&Eh(p,p.return);break;case 12:$o(s,p);break;case 31:$o(s,p),y&4&&CP(s,p);break;case 13:$o(s,p),y&4&&kP(s,p),y&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=vG.bind(null,p),LG(s,p))));break;case 22:if(y=p.memoizedState!==null||Lo,!y){u=u!==null&&u.memoizedState!==null||Vn,_=Lo;var k=Vn;Lo=y,(Vn=u)&&!k?Bo(s,p,(p.subtreeFlags&8772)!==0):$o(s,p),Lo=_,Vn=k}break;case 30:break;default:$o(s,p)}}function _P(s){var u=s.alternate;u!==null&&(s.alternate=null,_P(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Gd(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 un=null,ni=!1;function zo(s,u,p){for(p=p.child;p!==null;)jP(s,u,p),p=p.sibling}function jP(s,u,p){if(Se&&typeof Se.onCommitFiberUnmount=="function")try{Se.onCommitFiberUnmount(Xt,p)}catch{}switch(p.tag){case 26:Vn||Xa(p,u),zo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Vn||Xa(p,u);var y=un,_=ni;il(p.type)&&(un=p.stateNode,ni=!1),zo(s,u,p),Ph(p.stateNode),un=y,ni=_;break;case 5:Vn||Xa(p,u);case 6:if(y=un,_=ni,un=null,zo(s,u,p),un=y,ni=_,un!==null)if(ni)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(p.stateNode)}catch(k){$t(p,u,k)}else try{un.removeChild(p.stateNode)}catch(k){$t(p,u,k)}break;case 18:un!==null&&(ni?(s=un,vM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),df(s)):vM(un,p.stateNode));break;case 4:y=un,_=ni,un=p.stateNode.containerInfo,ni=!0,zo(s,u,p),un=y,ni=_;break;case 0:case 11:case 14:case 15:Qs(2,p,u),Vn||Qs(4,p,u),zo(s,u,p);break;case 1:Vn||(Xa(p,u),y=p.stateNode,typeof y.componentWillUnmount=="function"&&yP(p,u,y)),zo(s,u,p);break;case 21:zo(s,u,p);break;case 22:Vn=(y=Vn)||p.memoizedState!==null,zo(s,u,p),Vn=y;break;default:zo(s,u,p)}}function CP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{df(s)}catch(p){$t(u,u.return,p)}}}function kP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{df(s)}catch(p){$t(u,u.return,p)}}function uG(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new SP),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new SP),u;default:throw Error(r(435,s.tag))}}function Zg(s,u){var p=uG(s);u.forEach(function(y){if(!p.has(y)){p.add(y);var _=yG.bind(null,s,y);y.then(_,_)}})}function ri(s,u){var p=u.deletions;if(p!==null)for(var y=0;y<p.length;y++){var _=p[y],k=s,P=u,Y=P;e:for(;Y!==null;){switch(Y.tag){case 27:if(il(Y.type)){un=Y.stateNode,ni=!1;break e}break;case 5:un=Y.stateNode,ni=!1;break e;case 3:case 4:un=Y.stateNode.containerInfo,ni=!0;break e}Y=Y.return}if(un===null)throw Error(r(160));jP(k,P,_),un=null,ni=!1,k=_.alternate,k!==null&&(k.return=null),_.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)AP(u,s),u=u.sibling}var ga=null;function AP(s,u){var p=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ri(u,s),ii(s),y&4&&(Qs(3,s,s.return),Sh(3,s),Qs(5,s,s.return));break;case 1:ri(u,s),ii(s),y&512&&(Vn||p===null||Xa(p,p.return)),y&64&&Lo&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?y:p.concat(y))));break;case 26:var _=ga;if(ri(u,s),ii(s),y&512&&(Vn||p===null||Xa(p,p.return)),y&4){var k=p!==null?p.memoizedState:null;if(y=s.memoizedState,p===null)if(y===null)if(s.stateNode===null){e:{y=s.type,p=s.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":k=_.getElementsByTagName("title")[0],(!k||k[ru]||k[Gt]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=_.createElement(y),_.head.insertBefore(k,_.querySelector("head > title"))),Er(k,y,p),k[Gt]=s,Fn(k),y=k;break e;case"link":var P=AM("link","href",_).get(y+(p.href||""));if(P){for(var Y=0;Y<P.length;Y++)if(k=P[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)){P.splice(Y,1);break t}}k=_.createElement(y),Er(k,y,p),_.head.appendChild(k);break;case"meta":if(P=AM("meta","content",_).get(y+(p.content||""))){for(Y=0;Y<P.length;Y++)if(k=P[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)){P.splice(Y,1);break t}}k=_.createElement(y),Er(k,y,p),_.head.appendChild(k);break;default:throw Error(r(468,y))}k[Gt]=s,Fn(k),y=k}s.stateNode=y}else OM(_,s.type,s.stateNode);else s.stateNode=kM(_,y,s.memoizedProps);else k!==y?(k===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):k.count--,y===null?OM(_,s.type,s.stateNode):kM(_,y,s.memoizedProps)):y===null&&s.stateNode!==null&&u1(s,s.memoizedProps,p.memoizedProps)}break;case 27:ri(u,s),ii(s),y&512&&(Vn||p===null||Xa(p,p.return)),p!==null&&y&4&&u1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ri(u,s),ii(s),y&512&&(Vn||p===null||Xa(p,p.return)),s.flags&32){_=s.stateNode;try{Dc(_,"")}catch(De){$t(s,s.return,De)}}y&4&&s.stateNode!=null&&(_=s.memoizedProps,u1(s,_,p!==null?p.memoizedProps:_)),y&1024&&(d1=!0);break;case 6:if(ri(u,s),ii(s),y&4){if(s.stateNode===null)throw Error(r(162));y=s.memoizedProps,p=s.stateNode;try{p.nodeValue=y}catch(De){$t(s,s.return,De)}}break;case 3:if(mv=null,_=ga,ga=dv(u.containerInfo),ri(u,s),ga=_,ii(s),y&4&&p!==null&&p.memoizedState.isDehydrated)try{df(u.containerInfo)}catch(De){$t(s,s.return,De)}d1&&(d1=!1,OP(s));break;case 4:y=ga,ga=dv(s.stateNode.containerInfo),ri(u,s),ii(s),ga=y;break;case 12:ri(u,s),ii(s);break;case 31:ri(u,s),ii(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Zg(s,y)));break;case 13:ri(u,s),ii(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(ev=Pt()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Zg(s,y)));break;case 22:_=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,fe=Lo,ge=Vn;if(Lo=fe||_,Vn=ge||J,ri(u,s),Vn=ge,Lo=fe,ii(s),y&8192)e:for(u=s.stateNode,u._visibility=_?u._visibility&-2:u._visibility|1,_&&(p===null||J||Lo||Vn||bu(s)),p=null,u=s;;){if(u.tag===5||u.tag===26){if(p===null){J=p=u;try{if(k=J.stateNode,_)P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none";else{Y=J.stateNode;var xe=J.memoizedProps.style,de=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;Y.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(De){$t(J,J.return,De)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=_?"":J.memoizedProps}catch(De){$t(J,J.return,De)}}}else if(u.tag===18){if(p===null){J=u;try{var me=J.stateNode;_?yM(me,!0):yM(J.stateNode,!1)}catch(De){$t(J,J.return,De)}}}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}y&4&&(y=s.updateQueue,y!==null&&(p=y.retryQueue,p!==null&&(y.retryQueue=null,Zg(s,p))));break;case 19:ri(u,s),ii(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Zg(s,y)));break;case 30:break;case 21:break;default:ri(u,s),ii(s)}}function ii(s){var u=s.flags;if(u&2){try{for(var p,y=s.return;y!==null;){if(bP(y)){p=y;break}y=y.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var _=p.stateNode,k=c1(s);Qg(s,k,_);break;case 5:var P=p.stateNode;p.flags&32&&(Dc(P,""),p.flags&=-33);var Y=c1(s);Qg(s,Y,P);break;case 3:case 4:var J=p.stateNode.containerInfo,fe=c1(s);f1(s,fe,J);break;default:throw Error(r(161))}}catch(ge){$t(s,s.return,ge)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function OP(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;OP(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function $o(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)EP(s,u.alternate,u),u=u.sibling}function bu(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Qs(4,u,u.return),bu(u);break;case 1:Xa(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&yP(u,u.return,p),bu(u);break;case 27:Ph(u.stateNode);case 26:case 5:Xa(u,u.return),bu(u);break;case 22:u.memoizedState===null&&bu(u);break;case 30:bu(u);break;default:bu(u)}s=s.sibling}}function Bo(s,u,p){for(p=p&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var y=u.alternate,_=s,k=u,P=k.flags;switch(k.tag){case 0:case 11:case 15:Bo(_,k,p),Sh(4,k);break;case 1:if(Bo(_,k,p),y=k,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(fe){$t(y,y.return,fe)}if(y=k,_=y.updateQueue,_!==null){var Y=y.stateNode;try{var J=_.shared.hiddenCallbacks;if(J!==null)for(_.shared.hiddenCallbacks=null,_=0;_<J.length;_++)o2(J[_],Y)}catch(fe){$t(y,y.return,fe)}}p&&P&64&&vP(k),Eh(k,k.return);break;case 27:wP(k);case 26:case 5:Bo(_,k,p),p&&y===null&&P&4&&xP(k),Eh(k,k.return);break;case 12:Bo(_,k,p);break;case 31:Bo(_,k,p),p&&P&4&&CP(_,k);break;case 13:Bo(_,k,p),p&&P&4&&kP(_,k);break;case 22:k.memoizedState===null&&Bo(_,k,p),Eh(k,k.return);break;case 30:break;default:Bo(_,k,p)}u=u.sibling}}function h1(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&&uh(p))}function m1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&uh(s))}function va(s,u,p,y){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)NP(s,u,p,y),u=u.sibling}function NP(s,u,p,y){var _=u.flags;switch(u.tag){case 0:case 11:case 15:va(s,u,p,y),_&2048&&Sh(9,u);break;case 1:va(s,u,p,y);break;case 3:va(s,u,p,y),_&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&uh(s)));break;case 12:if(_&2048){va(s,u,p,y),s=u.stateNode;try{var k=u.memoizedProps,P=k.id,Y=k.onPostCommit;typeof Y=="function"&&Y(P,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){$t(u,u.return,J)}}else va(s,u,p,y);break;case 31:va(s,u,p,y);break;case 13:va(s,u,p,y);break;case 23:break;case 22:k=u.stateNode,P=u.alternate,u.memoizedState!==null?k._visibility&2?va(s,u,p,y):_h(s,u):k._visibility&2?va(s,u,p,y):(k._visibility|=2,ef(s,u,p,y,(u.subtreeFlags&10256)!==0||!1)),_&2048&&h1(P,u);break;case 24:va(s,u,p,y),_&2048&&m1(u.alternate,u);break;default:va(s,u,p,y)}}function ef(s,u,p,y,_){for(_=_&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var k=s,P=u,Y=p,J=y,fe=P.flags;switch(P.tag){case 0:case 11:case 15:ef(k,P,Y,J,_),Sh(8,P);break;case 23:break;case 22:var ge=P.stateNode;P.memoizedState!==null?ge._visibility&2?ef(k,P,Y,J,_):_h(k,P):(ge._visibility|=2,ef(k,P,Y,J,_)),_&&fe&2048&&h1(P.alternate,P);break;case 24:ef(k,P,Y,J,_),_&&fe&2048&&m1(P.alternate,P);break;default:ef(k,P,Y,J,_)}u=u.sibling}}function _h(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var p=s,y=u,_=y.flags;switch(y.tag){case 22:_h(p,y),_&2048&&h1(y.alternate,y);break;case 24:_h(p,y),_&2048&&m1(y.alternate,y);break;default:_h(p,y)}u=u.sibling}}var jh=8192;function tf(s,u,p){if(s.subtreeFlags&jh)for(s=s.child;s!==null;)TP(s,u,p),s=s.sibling}function TP(s,u,p){switch(s.tag){case 26:tf(s,u,p),s.flags&jh&&s.memoizedState!==null&&GG(p,ga,s.memoizedState,s.memoizedProps);break;case 5:tf(s,u,p);break;case 3:case 4:var y=ga;ga=dv(s.stateNode.containerInfo),tf(s,u,p),ga=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=jh,jh=16777216,tf(s,u,p),jh=y):tf(s,u,p));break;default:tf(s,u,p)}}function PP(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 Ch(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];dr=y,DP(y,s)}PP(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)MP(s),s=s.sibling}function MP(s){switch(s.tag){case 0:case 11:case 15:Ch(s),s.flags&2048&&Qs(9,s,s.return);break;case 3:Ch(s);break;case 12:Ch(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Jg(s)):Ch(s);break;default:Ch(s)}}function Jg(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var y=u[p];dr=y,DP(y,s)}PP(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Qs(8,u,u.return),Jg(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,Jg(u));break;default:Jg(u)}s=s.sibling}}function DP(s,u){for(;dr!==null;){var p=dr;switch(p.tag){case 0:case 11:case 15:Qs(8,p,u);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var y=p.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:uh(p.memoizedState.cache)}if(y=p.child,y!==null)y.return=p,dr=y;else e:for(p=s;dr!==null;){y=dr;var _=y.sibling,k=y.return;if(_P(y),y===p){dr=null;break e}if(_!==null){_.return=k,dr=_;break e}dr=k}}}var cG={getCacheForType:function(s){var u=wr(Un),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return wr(Un).controller.signal}},fG=typeof WeakMap=="function"?WeakMap:Map,Mt=0,Wt=null,dt=null,gt=0,zt=0,wi=null,Zs=!1,nf=!1,p1=!1,Fo=0,Cn=0,Js=0,wu=0,g1=0,Si=0,rf=0,kh=null,ai=null,v1=!1,ev=0,RP=0,tv=1/0,nv=null,el=null,Jn=0,tl=null,af=null,Uo=0,y1=0,x1=null,IP=null,Ah=0,b1=null;function Ei(){return(Mt&2)!==0&&gt!==0?gt&-gt:D.T!==null?C1():ye()}function LP(){if(Si===0)if((gt&536870912)===0||xt){var s=da;da<<=1,(da&3932160)===0&&(da=262144),Si=s}else Si=536870912;return s=xi.current,s!==null&&(s.flags|=32),Si}function oi(s,u,p){(s===Wt&&(zt===2||zt===9)||s.cancelPendingCommit!==null)&&(of(s,0),nl(s,gt,Si,!1)),Lt(s,p),((Mt&2)===0||s!==Wt)&&(s===Wt&&((Mt&2)===0&&(wu|=p),Cn===4&&nl(s,gt,Si,!1)),Ga(s))}function zP(s,u,p){if((Mt&6)!==0)throw Error(r(327));var y=!p&&(u&127)===0&&(u&s.expiredLanes)===0||Ft(s,u),_=y?mG(s,u):S1(s,u,!0),k=y;do{if(_===0){nf&&!y&&nl(s,u,0,!1);break}else{if(p=s.current.alternate,k&&!dG(p)){_=S1(s,u,!1),k=!1;continue}if(_===2){if(k=u,s.errorRecoveryDisabledLanes&k)var P=0;else P=s.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){u=P;e:{var Y=s;_=kh;var J=Y.current.memoizedState.isDehydrated;if(J&&(of(Y,P).flags|=256),P=S1(Y,P,!1),P!==2){if(p1&&!J){Y.errorRecoveryDisabledLanes|=k,wu|=k,_=4;break e}k=ai,ai=_,k!==null&&(ai===null?ai=k:ai.push.apply(ai,k))}_=P}if(k=!1,_!==2)continue}}if(_===1){of(s,0),nl(s,u,0,!0);break}e:{switch(y=s,k=_,k){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:nl(y,u,Si,!Zs);break e;case 2:ai=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(_=ev+300-Pt(),10<_)){if(nl(y,u,Si,!Zs),Ze(y,0,!0)!==0)break e;Uo=u,y.timeoutHandle=pM($P.bind(null,y,p,ai,nv,v1,u,Si,wu,rf,Zs,k,"Throttled",-0,0),_);break e}$P(y,p,ai,nv,v1,u,Si,wu,rf,Zs,k,null,-0,0)}}break}while(!0);Ga(s)}function $P(s,u,p,y,_,k,P,Y,J,fe,ge,xe,de,me){if(s.timeoutHandle=-1,xe=u.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ko},TP(u,k,xe);var De=(k&62914560)===k?ev-Pt():(k&4194048)===k?RP-Pt():0;if(De=WG(xe,De),De!==null){Uo=k,s.cancelPendingCommit=De(YP.bind(null,s,u,k,p,y,_,P,Y,J,ge,xe,null,de,me)),nl(s,k,P,!fe);return}}YP(s,u,k,p,y,_,P,Y,J)}function dG(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 y=0;y<p.length;y++){var _=p[y],k=_.getSnapshot;_=_.value;try{if(!vi(k(),_))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 nl(s,u,p,y){u&=~g1,u&=~wu,s.suspendedLanes|=u,s.pingedLanes&=~u,y&&(s.warmLanes|=u),y=s.expirationTimes;for(var _=u;0<_;){var k=31-Qe(_),P=1<<k;y[k]=-1,_&=~P}p!==0&&ha(s,p,u)}function rv(){return(Mt&6)===0?(Oh(0),!1):!0}function w1(){if(dt!==null){if(zt===0)var s=dt.return;else s=dt,To=du=null,Lw(s),Gc=null,fh=0,s=dt;for(;s!==null;)gP(s.alternate,s),s=s.return;dt=null}}function of(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,PG(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Uo=0,w1(),Wt=s,dt=p=Oo(s.current,null),gt=u,zt=0,wi=null,Zs=!1,nf=Ft(s,u),p1=!1,rf=Si=g1=wu=Js=Cn=0,ai=kh=null,v1=!1,(u&8)!==0&&(u|=u&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=u;0<y;){var _=31-Qe(y),k=1<<_;u|=s[_],y&=~k}return Fo=u,_g(),p}function BP(s,u){ot=null,D.H=xh,u===Xc||u===Pg?(u=n2(),zt=3):u===jw?(u=n2(),zt=4):zt=u===Jw?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,wi=u,dt===null&&(Cn=1,Kg(s,qi(u,s.current)))}function FP(){var s=xi.current;return s===null?!0:(gt&4194048)===gt?Xi===null:(gt&62914560)===gt||(gt&536870912)!==0?s===Xi:!1}function UP(){var s=D.H;return D.H=xh,s===null?xh:s}function HP(){var s=D.A;return D.A=cG,s}function iv(){Cn=4,Zs||(gt&4194048)!==gt&&xi.current!==null||(nf=!0),(Js&134217727)===0&&(wu&134217727)===0||Wt===null||nl(Wt,gt,Si,!1)}function S1(s,u,p){var y=Mt;Mt|=2;var _=UP(),k=HP();(Wt!==s||gt!==u)&&(nv=null,of(s,u)),u=!1;var P=Cn;e:do try{if(zt!==0&&dt!==null){var Y=dt,J=wi;switch(zt){case 8:w1(),P=6;break e;case 3:case 2:case 9:case 6:xi.current===null&&(u=!0);var fe=zt;if(zt=0,wi=null,sf(s,Y,J,fe),p&&nf){P=0;break e}break;default:fe=zt,zt=0,wi=null,sf(s,Y,J,fe)}}hG(),P=Cn;break}catch(ge){BP(s,ge)}while(!0);return u&&s.shellSuspendCounter++,To=du=null,Mt=y,D.H=_,D.A=k,dt===null&&(Wt=null,gt=0,_g()),P}function hG(){for(;dt!==null;)qP(dt)}function mG(s,u){var p=Mt;Mt|=2;var y=UP(),_=HP();Wt!==s||gt!==u?(nv=null,tv=Pt()+500,of(s,u)):nf=Ft(s,u);e:do try{if(zt!==0&&dt!==null){u=dt;var k=wi;t:switch(zt){case 1:zt=0,wi=null,sf(s,u,k,1);break;case 2:case 9:if(e2(k)){zt=0,wi=null,VP(u);break}u=function(){zt!==2&&zt!==9||Wt!==s||(zt=7),Ga(s)},k.then(u,u);break e;case 3:zt=7;break e;case 4:zt=5;break e;case 7:e2(k)?(zt=0,wi=null,VP(u)):(zt=0,wi=null,sf(s,u,k,7));break;case 5:var P=null;switch(dt.tag){case 26:P=dt.memoizedState;case 5:case 27:var Y=dt;if(P?NM(P):Y.stateNode.complete){zt=0,wi=null;var J=Y.sibling;if(J!==null)dt=J;else{var fe=Y.return;fe!==null?(dt=fe,av(fe)):dt=null}break t}}zt=0,wi=null,sf(s,u,k,5);break;case 6:zt=0,wi=null,sf(s,u,k,6);break;case 8:w1(),Cn=6;break e;default:throw Error(r(462))}}pG();break}catch(ge){BP(s,ge)}while(!0);return To=du=null,D.H=y,D.A=_,Mt=p,dt!==null?0:(Wt=null,gt=0,_g(),Cn)}function pG(){for(;dt!==null&&!Et();)qP(dt)}function qP(s){var u=mP(s.alternate,s,Fo);s.memoizedProps=s.pendingProps,u===null?av(s):dt=u}function VP(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=lP(p,u,u.pendingProps,u.type,void 0,gt);break;case 11:u=lP(p,u,u.pendingProps,u.type.render,u.ref,gt);break;case 5:Lw(u);default:gP(p,u),u=dt=HT(u,Fo),u=mP(p,u,Fo)}s.memoizedProps=s.pendingProps,u===null?av(s):dt=u}function sf(s,u,p,y){To=du=null,Lw(u),Gc=null,fh=0;var _=u.return;try{if(rG(s,_,u,p,gt)){Cn=1,Kg(s,qi(p,s.current)),dt=null;return}}catch(k){if(_!==null)throw dt=_,k;Cn=1,Kg(s,qi(p,s.current)),dt=null;return}u.flags&32768?(xt||y===1?s=!0:nf||(gt&536870912)!==0?s=!1:(Zs=s=!0,(y===2||y===9||y===3||y===6)&&(y=xi.current,y!==null&&y.tag===13&&(y.flags|=16384))),KP(u,s)):av(u)}function av(s){var u=s;do{if((u.flags&32768)!==0){KP(u,Zs);return}s=u.return;var p=oG(u.alternate,u,Fo);if(p!==null){dt=p;return}if(u=u.sibling,u!==null){dt=u;return}dt=u=s}while(u!==null);Cn===0&&(Cn=5)}function KP(s,u){do{var p=sG(s.alternate,s);if(p!==null){p.flags&=32767,dt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){dt=s;return}dt=s=p}while(s!==null);Cn=6,dt=null}function YP(s,u,p,y,_,k,P,Y,J){s.cancelPendingCommit=null;do ov();while(Jn!==0);if((Mt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(k=u.lanes|u.childLanes,k|=cw,ur(s,p,k,P,Y,J),s===Wt&&(dt=Wt=null,gt=0),af=u,tl=s,Uo=p,y1=k,x1=_,IP=y,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,xG(ke,function(){return ZP(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||y){y=D.T,D.T=null,_=q.p,q.p=2,P=Mt,Mt|=4;try{lG(s,u,p)}finally{Mt=P,q.p=_,D.T=y}}Jn=1,XP(),GP(),WP()}}function XP(){if(Jn===1){Jn=0;var s=tl,u=af,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=D.T,D.T=null;var y=q.p;q.p=2;var _=Mt;Mt|=4;try{AP(u,s);var k=D1,P=DT(s.containerInfo),Y=k.focusedElem,J=k.selectionRange;if(P!==Y&&Y&&Y.ownerDocument&&MT(Y.ownerDocument.documentElement,Y)){if(J!==null&&aw(Y)){var fe=J.start,ge=J.end;if(ge===void 0&&(ge=fe),"selectionStart"in Y)Y.selectionStart=fe,Y.selectionEnd=Math.min(ge,Y.value.length);else{var xe=Y.ownerDocument||document,de=xe&&xe.defaultView||window;if(de.getSelection){var me=de.getSelection(),De=Y.textContent.length,We=Math.min(J.start,De),qt=J.end===void 0?We:Math.min(J.end,De);!me.extend&&We>qt&&(P=qt,qt=We,We=P);var se=PT(Y,We),re=PT(Y,qt);if(se&&re&&(me.rangeCount!==1||me.anchorNode!==se.node||me.anchorOffset!==se.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ce=xe.createRange();ce.setStart(se.node,se.offset),me.removeAllRanges(),We>qt?(me.addRange(ce),me.extend(re.node,re.offset)):(ce.setEnd(re.node,re.offset),me.addRange(ce))}}}}for(xe=[],me=Y;me=me.parentNode;)me.nodeType===1&&xe.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<xe.length;Y++){var ve=xe[Y];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}yv=!!M1,D1=M1=null}finally{Mt=_,q.p=y,D.T=p}}s.current=u,Jn=2}}function GP(){if(Jn===2){Jn=0;var s=tl,u=af,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=D.T,D.T=null;var y=q.p;q.p=2;var _=Mt;Mt|=4;try{EP(s,u.alternate,u)}finally{Mt=_,q.p=y,D.T=p}}Jn=3}}function WP(){if(Jn===4||Jn===3){Jn=0,vn();var s=tl,u=af,p=Uo,y=IP;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Jn=5:(Jn=0,af=tl=null,QP(s,s.pendingLanes));var _=s.pendingLanes;if(_===0&&(el=null),Ar(p),u=u.stateNode,Se&&typeof Se.onCommitFiberRoot=="function")try{Se.onCommitFiberRoot(Xt,u,void 0,(u.current.flags&128)===128)}catch{}if(y!==null){u=D.T,_=q.p,q.p=2,D.T=null;try{for(var k=s.onRecoverableError,P=0;P<y.length;P++){var Y=y[P];k(Y.value,{componentStack:Y.stack})}}finally{D.T=u,q.p=_}}(Uo&3)!==0&&ov(),Ga(s),_=s.pendingLanes,(p&261930)!==0&&(_&42)!==0?s===b1?Ah++:(Ah=0,b1=s):Ah=0,Oh(0)}}function QP(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,uh(u)))}function ov(){return XP(),GP(),WP(),ZP()}function ZP(){if(Jn!==5)return!1;var s=tl,u=y1;y1=0;var p=Ar(Uo),y=D.T,_=q.p;try{q.p=32>p?32:p,D.T=null,p=x1,x1=null;var k=tl,P=Uo;if(Jn=0,af=tl=null,Uo=0,(Mt&6)!==0)throw Error(r(331));var Y=Mt;if(Mt|=4,MP(k.current),NP(k,k.current,P,p),Mt=Y,Oh(0,!1),Se&&typeof Se.onPostCommitFiberRoot=="function")try{Se.onPostCommitFiberRoot(Xt,k)}catch{}return!0}finally{q.p=_,D.T=y,QP(s,u)}}function JP(s,u,p){u=qi(p,u),u=Zw(s.stateNode,u,2),s=Xs(s,u,2),s!==null&&(Lt(s,2),Ga(s))}function $t(s,u,p){if(s.tag===3)JP(s,s,p);else for(;u!==null;){if(u.tag===3){JP(u,s,p);break}else if(u.tag===1){var y=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(el===null||!el.has(y))){s=qi(p,s),p=eP(2),y=Xs(u,p,2),y!==null&&(tP(p,y,u,s),Lt(y,2),Ga(y));break}}u=u.return}}function E1(s,u,p){var y=s.pingCache;if(y===null){y=s.pingCache=new fG;var _=new Set;y.set(u,_)}else _=y.get(u),_===void 0&&(_=new Set,y.set(u,_));_.has(p)||(p1=!0,_.add(p),s=gG.bind(null,s,u,p),u.then(s,s))}function gG(s,u,p){var y=s.pingCache;y!==null&&y.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,Wt===s&&(gt&p)===p&&(Cn===4||Cn===3&&(gt&62914560)===gt&&300>Pt()-ev?(Mt&2)===0&&of(s,0):g1|=p,rf===gt&&(rf=0)),Ga(s)}function eM(s,u){u===0&&(u=Bn()),s=uu(s,u),s!==null&&(Lt(s,u),Ga(s))}function vG(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),eM(s,p)}function yG(s,u){var p=0;switch(s.tag){case 31:case 13:var y=s.stateNode,_=s.memoizedState;_!==null&&(p=_.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(u),eM(s,p)}function xG(s,u){return sn(s,u)}var sv=null,lf=null,_1=!1,lv=!1,j1=!1,rl=0;function Ga(s){s!==lf&&s.next===null&&(lf===null?sv=lf=s:lf=lf.next=s),lv=!0,_1||(_1=!0,wG())}function Oh(s,u){if(!j1&&lv){j1=!0;do for(var p=!1,y=sv;y!==null;){if(s!==0){var _=y.pendingLanes;if(_===0)var k=0;else{var P=y.suspendedLanes,Y=y.pingedLanes;k=(1<<31-Qe(42|s)+1)-1,k&=_&~(P&~Y),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(p=!0,iM(y,k))}else k=gt,k=Ze(y,y===Wt?k:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(k&3)===0||Ft(y,k)||(p=!0,iM(y,k));y=y.next}while(p);j1=!1}}function bG(){tM()}function tM(){lv=_1=!1;var s=0;rl!==0&&TG()&&(s=rl);for(var u=Pt(),p=null,y=sv;y!==null;){var _=y.next,k=nM(y,u);k===0?(y.next=null,p===null?sv=_:p.next=_,_===null&&(lf=p)):(p=y,(s!==0||(k&3)!==0)&&(lv=!0)),y=_}Jn!==0&&Jn!==5||Oh(s),rl!==0&&(rl=0)}function nM(s,u){for(var p=s.suspendedLanes,y=s.pingedLanes,_=s.expirationTimes,k=s.pendingLanes&-62914561;0<k;){var P=31-Qe(k),Y=1<<P,J=_[P];J===-1?((Y&p)===0||(Y&y)!==0)&&(_[P]=_n(Y,u)):J<=u&&(s.expiredLanes|=Y),k&=~Y}if(u=Wt,p=gt,p=Ze(s,s===u?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,p===0||s===u&&(zt===2||zt===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&En(y),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||Ft(s,p)){if(u=p&-p,u===s.callbackPriority)return u;switch(y!==null&&En(y),Ar(p)){case 2:case 8:p=oe;break;case 32:p=ke;break;case 268435456:p=Ye;break;default:p=ke}return y=rM.bind(null,s),p=sn(p,y),s.callbackPriority=u,s.callbackNode=p,u}return y!==null&&y!==null&&En(y),s.callbackPriority=2,s.callbackNode=null,2}function rM(s,u){if(Jn!==0&&Jn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(ov()&&s.callbackNode!==p)return null;var y=gt;return y=Ze(s,s===Wt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:(zP(s,y,u),nM(s,Pt()),s.callbackNode!=null&&s.callbackNode===p?rM.bind(null,s):null)}function iM(s,u){if(ov())return null;zP(s,u,!0)}function wG(){MG(function(){(Mt&6)!==0?sn(he,bG):tM()})}function C1(){if(rl===0){var s=Kc;s===0&&(s=Fi,Fi<<=1,(Fi&261888)===0&&(Fi=256)),rl=s}return rl}function aM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:gg(""+s)}function oM(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 SG(s,u,p,y,_){if(u==="submit"&&p&&p.stateNode===_){var k=aM((_[fr]||null).action),P=y.submitter;P&&(u=(u=P[fr]||null)?aM(u.formAction):P.getAttribute("formAction"),u!==null&&(k=u,P=null));var Y=new bg("action","action",null,y,_);s.push({event:Y,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(rl!==0){var J=P?oM(_,P):new FormData(_);Kw(p,{pending:!0,data:J,method:_.method,action:k},null,J)}}else typeof k=="function"&&(Y.preventDefault(),J=P?oM(_,P):new FormData(_),Kw(p,{pending:!0,data:J,method:_.method,action:k},k,J))},currentTarget:_}]})}}for(var k1=0;k1<uw.length;k1++){var A1=uw[k1],EG=A1.toLowerCase(),_G=A1[0].toUpperCase()+A1.slice(1);pa(EG,"on"+_G)}pa(LT,"onAnimationEnd"),pa(zT,"onAnimationIteration"),pa($T,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(BX,"onTransitionRun"),pa(FX,"onTransitionStart"),pa(UX,"onTransitionCancel"),pa(BT,"onTransitionEnd"),$s("onMouseEnter",["mouseout","mouseover"]),$s("onMouseLeave",["mouseout","mouseover"]),$s("onPointerEnter",["pointerout","pointerover"]),$s("onPointerLeave",["pointerout","pointerover"]),jo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jo("onBeforeInput",["compositionend","keypress","textInput","paste"]),jo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nh="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(" "),jG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nh));function sM(s,u){u=(u&4)!==0;for(var p=0;p<s.length;p++){var y=s[p],_=y.event;y=y.listeners;e:{var k=void 0;if(u)for(var P=y.length-1;0<=P;P--){var Y=y[P],J=Y.instance,fe=Y.currentTarget;if(Y=Y.listener,J!==k&&_.isPropagationStopped())break e;k=Y,_.currentTarget=fe;try{k(_)}catch(ge){Eg(ge)}_.currentTarget=null,k=J}else for(P=0;P<y.length;P++){if(Y=y[P],J=Y.instance,fe=Y.currentTarget,Y=Y.listener,J!==k&&_.isPropagationStopped())break e;k=Y,_.currentTarget=fe;try{k(_)}catch(ge){Eg(ge)}_.currentTarget=null,k=J}}}}function ht(s,u){var p=u[Tc];p===void 0&&(p=u[Tc]=new Set);var y=s+"__bubble";p.has(y)||(lM(u,s,2,!1),p.add(y))}function O1(s,u,p){var y=0;u&&(y|=4),lM(p,s,y,u)}var uv="_reactListening"+Math.random().toString(36).slice(2);function N1(s){if(!s[uv]){s[uv]=!0,cg.forEach(function(p){p!=="selectionchange"&&(jG.has(p)||O1(p,!1,s),O1(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[uv]||(u[uv]=!0,O1("selectionchange",!1,u))}}function lM(s,u,p,y){switch(LM(u)){case 2:var _=JG;break;case 8:_=eW;break;default:_=V1}p=_.bind(null,u,p,s),_=void 0,!Wb||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),y?_!==void 0?s.addEventListener(u,p,{capture:!0,passive:_}):s.addEventListener(u,p,!0):_!==void 0?s.addEventListener(u,p,{passive:_}):s.addEventListener(u,p,!1)}function T1(s,u,p,y,_){var k=y;if((u&1)===0&&(u&2)===0&&y!==null)e:for(;;){if(y===null)return;var P=y.tag;if(P===3||P===4){var Y=y.stateNode.containerInfo;if(Y===_)break;if(P===4)for(P=y.return;P!==null;){var J=P.tag;if((J===3||J===4)&&P.stateNode.containerInfo===_)return;P=P.return}for(;Y!==null;){if(P=Rs(Y),P===null)return;if(J=P.tag,J===5||J===6||J===26||J===27){y=k=P;continue e}Y=Y.parentNode}}y=y.return}hT(function(){var fe=k,ge=Xb(p),xe=[];e:{var de=FT.get(s);if(de!==void 0){var me=bg,De=s;switch(s){case"keypress":if(yg(p)===0)break e;case"keydown":case"keyup":me=yX;break;case"focusin":De="focus",me=ew;break;case"focusout":De="blur",me=ew;break;case"beforeblur":case"afterblur":me=ew;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=gT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=oX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=wX;break;case LT:case zT:case $T:me=uX;break;case BT:me=EX;break;case"scroll":case"scrollend":me=iX;break;case"wheel":me=jX;break;case"copy":case"cut":case"paste":me=fX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=yT;break;case"toggle":case"beforetoggle":me=kX}var We=(u&4)!==0,qt=!We&&(s==="scroll"||s==="scrollend"),se=We?de!==null?de+"Capture":null:de;We=[];for(var re=fe,ce;re!==null;){var ve=re;if(ce=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ce===null||se===null||(ve=Zd(re,se),ve!=null&&We.push(Th(re,ve,ce))),qt)break;re=re.return}0<We.length&&(de=new me(de,De,null,p,ge),xe.push({event:de,listeners:We}))}}if((u&7)===0){e:{if(de=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",de&&p!==Yb&&(De=p.relatedTarget||p.fromElement)&&(Rs(De)||De[gi]))break e;if((me||de)&&(de=ge.window===ge?ge:(de=ge.ownerDocument)?de.defaultView||de.parentWindow:window,me?(De=p.relatedTarget||p.toElement,me=fe,De=De?Rs(De):null,De!==null&&(qt=a(De),We=De.tag,De!==qt||We!==5&&We!==27&&We!==6)&&(De=null)):(me=null,De=fe),me!==De)){if(We=gT,ve="onMouseLeave",se="onMouseEnter",re="mouse",(s==="pointerout"||s==="pointerover")&&(We=yT,ve="onPointerLeave",se="onPointerEnter",re="pointer"),qt=me==null?de:Ls(me),ce=De==null?de:Ls(De),de=new We(ve,re+"leave",me,p,ge),de.target=qt,de.relatedTarget=ce,ve=null,Rs(ge)===fe&&(We=new We(se,re+"enter",De,p,ge),We.target=ce,We.relatedTarget=qt,ve=We),qt=ve,me&&De)t:{for(We=CG,se=me,re=De,ce=0,ve=se;ve;ve=We(ve))ce++;ve=0;for(var qe=re;qe;qe=We(qe))ve++;for(;0<ce-ve;)se=We(se),ce--;for(;0<ve-ce;)re=We(re),ve--;for(;ce--;){if(se===re||re!==null&&se===re.alternate){We=se;break t}se=We(se),re=We(re)}We=null}else We=null;me!==null&&uM(xe,de,me,We,!1),De!==null&&qt!==null&&uM(xe,qt,De,We,!0)}}e:{if(de=fe?Ls(fe):window,me=de.nodeName&&de.nodeName.toLowerCase(),me==="select"||me==="input"&&de.type==="file")var At=CT;else if(_T(de))if(kT)At=LX;else{At=RX;var $e=DX}else me=de.nodeName,!me||me.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?fe&&Kb(fe.elementType)&&(At=CT):At=IX;if(At&&(At=At(s,fe))){jT(xe,At,p,ge);break e}$e&&$e(s,de,fe),s==="focusout"&&fe&&de.type==="number"&&fe.memoizedProps.value!=null&&Qd(de,"number",de.value)}switch($e=fe?Ls(fe):window,s){case"focusin":(_T($e)||$e.contentEditable==="true")&&(zc=$e,ow=fe,oh=null);break;case"focusout":oh=ow=zc=null;break;case"mousedown":sw=!0;break;case"contextmenu":case"mouseup":case"dragend":sw=!1,RT(xe,p,ge);break;case"selectionchange":if($X)break;case"keydown":case"keyup":RT(xe,p,ge)}var st;if(nw)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Lc?ST(s,p)&&(vt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(vt="onCompositionStart");vt&&(xT&&p.locale!=="ko"&&(Lc||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Lc&&(st=mT()):(Fs=ge,Qb="value"in Fs?Fs.value:Fs.textContent,Lc=!0)),$e=cv(fe,vt),0<$e.length&&(vt=new vT(vt,s,null,p,ge),xe.push({event:vt,listeners:$e}),st?vt.data=st:(st=ET(p),st!==null&&(vt.data=st)))),(st=OX?NX(s,p):TX(s,p))&&(vt=cv(fe,"onBeforeInput"),0<vt.length&&($e=new vT("onBeforeInput","beforeinput",null,p,ge),xe.push({event:$e,listeners:vt}),$e.data=st)),SG(xe,s,fe,p,ge)}sM(xe,u)})}function Th(s,u,p){return{instance:s,listener:u,currentTarget:p}}function cv(s,u){for(var p=u+"Capture",y=[];s!==null;){var _=s,k=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||k===null||(_=Zd(s,p),_!=null&&y.unshift(Th(s,_,k)),_=Zd(s,u),_!=null&&y.push(Th(s,_,k))),s.tag===3)return y;s=s.return}return[]}function CG(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function uM(s,u,p,y,_){for(var k=u._reactName,P=[];p!==null&&p!==y;){var Y=p,J=Y.alternate,fe=Y.stateNode;if(Y=Y.tag,J!==null&&J===y)break;Y!==5&&Y!==26&&Y!==27||fe===null||(J=fe,_?(fe=Zd(p,k),fe!=null&&P.unshift(Th(p,fe,J))):_||(fe=Zd(p,k),fe!=null&&P.push(Th(p,fe,J)))),p=p.return}P.length!==0&&s.push({event:u,listeners:P})}var kG=/\r\n?/g,AG=/\u0000|\uFFFD/g;function cM(s){return(typeof s=="string"?s:""+s).replace(kG,`
`).replace(AG,"")}function fM(s,u){return u=cM(u),cM(s)===u}function Ht(s,u,p,y,_,k){switch(p){case"children":typeof y=="string"?u==="body"||u==="textarea"&&y===""||Dc(s,y):(typeof y=="number"||typeof y=="bigint")&&u!=="body"&&Dc(s,""+y);break;case"className":Mc(s,"class",y);break;case"tabIndex":Mc(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Mc(s,p,y);break;case"style":fT(s,y,k);break;case"data":if(u!=="object"){Mc(s,"data",y);break}case"src":case"href":if(y===""&&(u!=="a"||p!=="href")){s.removeAttribute(p);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(p);break}y=gg(""+y),s.setAttribute(p,y);break;case"action":case"formAction":if(typeof y=="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"&&Ht(s,u,"name",_.name,_,null),Ht(s,u,"formEncType",_.formEncType,_,null),Ht(s,u,"formMethod",_.formMethod,_,null),Ht(s,u,"formTarget",_.formTarget,_,null)):(Ht(s,u,"encType",_.encType,_,null),Ht(s,u,"method",_.method,_,null),Ht(s,u,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(p);break}y=gg(""+y),s.setAttribute(p,y);break;case"onClick":y!=null&&(s.onclick=ko);break;case"onScroll":y!=null&&ht("scroll",s);break;case"onScrollEnd":y!=null&&ht("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(p=y.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}p=gg(""+y),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":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(p,""+y):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":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(p,""):s.removeAttribute(p);break;case"capture":case"download":y===!0?s.setAttribute(p,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(p,y):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(p,y):s.removeAttribute(p);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(p):s.setAttribute(p,y);break;case"popover":ht("beforetoggle",s),ht("toggle",s),Pc(s,"popover",y);break;case"xlinkActuate":ma(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":ma(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":ma(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":ma(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":ma(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":ma(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":ma(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":ma(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":ma(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Pc(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=nX.get(p)||p,Pc(s,p,y))}}function P1(s,u,p,y,_,k){switch(p){case"style":fT(s,y,k);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(p=y.__html,p!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof y=="string"?Dc(s,y):(typeof y=="number"||typeof y=="bigint")&&Dc(s,""+y);break;case"onScroll":y!=null&&ht("scroll",s);break;case"onScrollEnd":y!=null&&ht("scrollend",s);break;case"onClick":y!=null&&(s.onclick=ko);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(_=p.endsWith("Capture"),u=p.slice(2,_?p.length-7:void 0),k=s[fr]||null,k=k!=null?k[p]:null,typeof k=="function"&&s.removeEventListener(u,k,_),typeof y=="function")){typeof k!="function"&&k!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(u,y,_);break e}p in s?s[p]=y:y===!0?s.setAttribute(p,""):Pc(s,p,y)}}}function Er(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",s),ht("load",s);var y=!1,_=!1,k;for(k in p)if(p.hasOwnProperty(k)){var P=p[k];if(P!=null)switch(k){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,k,P,p,null)}}_&&Ht(s,u,"srcSet",p.srcSet,p,null),y&&Ht(s,u,"src",p.src,p,null);return;case"input":ht("invalid",s);var Y=k=P=_=null,J=null,fe=null;for(y in p)if(p.hasOwnProperty(y)){var ge=p[y];if(ge!=null)switch(y){case"name":_=ge;break;case"type":P=ge;break;case"checked":J=ge;break;case"defaultChecked":fe=ge;break;case"value":k=ge;break;case"defaultValue":Y=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,u));break;default:Ht(s,u,y,ge,p,null)}}pg(s,k,Y,J,fe,P,_,!1);return;case"select":ht("invalid",s),y=P=k=null;for(_ in p)if(p.hasOwnProperty(_)&&(Y=p[_],Y!=null))switch(_){case"value":k=Y;break;case"defaultValue":P=Y;break;case"multiple":y=Y;default:Ht(s,u,_,Y,p,null)}u=k,p=P,s.multiple=!!y,u!=null?Co(s,!!y,u,!1):p!=null&&Co(s,!!y,p,!0);return;case"textarea":ht("invalid",s),k=_=y=null;for(P in p)if(p.hasOwnProperty(P)&&(Y=p[P],Y!=null))switch(P){case"value":y=Y;break;case"defaultValue":_=Y;break;case"children":k=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:Ht(s,u,P,Y,p,null)}uT(s,y,_,k);return;case"option":for(J in p)if(p.hasOwnProperty(J)&&(y=p[J],y!=null))switch(J){case"selected":s.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Ht(s,u,J,y,p,null)}return;case"dialog":ht("beforetoggle",s),ht("toggle",s),ht("cancel",s),ht("close",s);break;case"iframe":case"object":ht("load",s);break;case"video":case"audio":for(y=0;y<Nh.length;y++)ht(Nh[y],s);break;case"image":ht("error",s),ht("load",s);break;case"details":ht("toggle",s);break;case"embed":case"source":case"link":ht("error",s),ht("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(fe in p)if(p.hasOwnProperty(fe)&&(y=p[fe],y!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ht(s,u,fe,y,p,null)}return;default:if(Kb(u)){for(ge in p)p.hasOwnProperty(ge)&&(y=p[ge],y!==void 0&&P1(s,u,ge,y,p,void 0));return}}for(Y in p)p.hasOwnProperty(Y)&&(y=p[Y],y!=null&&Ht(s,u,Y,y,p,null))}function OG(s,u,p,y){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,k=null,P=null,Y=null,J=null,fe=null,ge=null;for(me in p){var xe=p[me];if(p.hasOwnProperty(me)&&xe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":J=xe;default:y.hasOwnProperty(me)||Ht(s,u,me,null,y,xe)}}for(var de in y){var me=y[de];if(xe=p[de],y.hasOwnProperty(de)&&(me!=null||xe!=null))switch(de){case"type":k=me;break;case"name":_=me;break;case"checked":fe=me;break;case"defaultChecked":ge=me;break;case"value":P=me;break;case"defaultValue":Y=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:me!==xe&&Ht(s,u,de,me,y,xe)}}au(s,P,Y,J,fe,ge,k,_);return;case"select":me=P=Y=de=null;for(k in p)if(J=p[k],p.hasOwnProperty(k)&&J!=null)switch(k){case"value":break;case"multiple":me=J;default:y.hasOwnProperty(k)||Ht(s,u,k,null,y,J)}for(_ in y)if(k=y[_],J=p[_],y.hasOwnProperty(_)&&(k!=null||J!=null))switch(_){case"value":de=k;break;case"defaultValue":Y=k;break;case"multiple":P=k;default:k!==J&&Ht(s,u,_,k,y,J)}u=Y,p=P,y=me,de!=null?Co(s,!!p,de,!1):!!y!=!!p&&(u!=null?Co(s,!!p,u,!0):Co(s,!!p,p?[]:"",!1));return;case"textarea":me=de=null;for(Y in p)if(_=p[Y],p.hasOwnProperty(Y)&&_!=null&&!y.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:Ht(s,u,Y,null,y,_)}for(P in y)if(_=y[P],k=p[P],y.hasOwnProperty(P)&&(_!=null||k!=null))switch(P){case"value":de=_;break;case"defaultValue":me=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==k&&Ht(s,u,P,_,y,k)}lT(s,de,me);return;case"option":for(var De in p)if(de=p[De],p.hasOwnProperty(De)&&de!=null&&!y.hasOwnProperty(De))switch(De){case"selected":s.selected=!1;break;default:Ht(s,u,De,null,y,de)}for(J in y)if(de=y[J],me=p[J],y.hasOwnProperty(J)&&de!==me&&(de!=null||me!=null))switch(J){case"selected":s.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Ht(s,u,J,de,y,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in p)de=p[We],p.hasOwnProperty(We)&&de!=null&&!y.hasOwnProperty(We)&&Ht(s,u,We,null,y,de);for(fe in y)if(de=y[fe],me=p[fe],y.hasOwnProperty(fe)&&de!==me&&(de!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,u));break;default:Ht(s,u,fe,de,y,me)}return;default:if(Kb(u)){for(var qt in p)de=p[qt],p.hasOwnProperty(qt)&&de!==void 0&&!y.hasOwnProperty(qt)&&P1(s,u,qt,void 0,y,de);for(ge in y)de=y[ge],me=p[ge],!y.hasOwnProperty(ge)||de===me||de===void 0&&me===void 0||P1(s,u,ge,de,y,me);return}}for(var se in p)de=p[se],p.hasOwnProperty(se)&&de!=null&&!y.hasOwnProperty(se)&&Ht(s,u,se,null,y,de);for(xe in y)de=y[xe],me=p[xe],!y.hasOwnProperty(xe)||de===me||de==null&&me==null||Ht(s,u,xe,de,y,me)}function dM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function NG(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,p=performance.getEntriesByType("resource"),y=0;y<p.length;y++){var _=p[y],k=_.transferSize,P=_.initiatorType,Y=_.duration;if(k&&Y&&dM(P)){for(P=0,Y=_.responseEnd,y+=1;y<p.length;y++){var J=p[y],fe=J.startTime;if(fe>Y)break;var ge=J.transferSize,xe=J.initiatorType;ge&&dM(xe)&&(J=J.responseEnd,P+=ge*(J<Y?1:(Y-fe)/(J-fe)))}if(--y,u+=8*(k+P)/(_.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 M1=null,D1=null;function fv(s){return s.nodeType===9?s:s.ownerDocument}function hM(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 mM(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 R1(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 I1=null;function TG(){var s=window.event;return s&&s.type==="popstate"?s===I1?!1:(I1=s,!0):(I1=null,!1)}var pM=typeof setTimeout=="function"?setTimeout:void 0,PG=typeof clearTimeout=="function"?clearTimeout:void 0,gM=typeof Promise=="function"?Promise:void 0,MG=typeof queueMicrotask=="function"?queueMicrotask:typeof gM<"u"?function(s){return gM.resolve(null).then(s).catch(DG)}:pM;function DG(s){setTimeout(function(){throw s})}function il(s){return s==="head"}function vM(s,u){var p=u,y=0;do{var _=p.nextSibling;if(s.removeChild(p),_&&_.nodeType===8)if(p=_.data,p==="/$"||p==="/&"){if(y===0){s.removeChild(_),df(u);return}y--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")y++;else if(p==="html")Ph(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Ph(p);for(var k=p.firstChild;k;){var P=k.nextSibling,Y=k.nodeName;k[ru]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&k.rel.toLowerCase()==="stylesheet"||p.removeChild(k),k=P}}else p==="body"&&Ph(s.ownerDocument.body);p=_}while(p);df(u)}function yM(s,u){var p=s;s=0;do{var y=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||""),y&&y.nodeType===8)if(p=y.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=y}while(p)}function L1(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":L1(p),Gd(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function RG(s,u,p,y){for(;s.nodeType===1;){var _=p;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[ru])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!==_.rel||s.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||s.getAttribute("title")!==(_.title==null?null:_.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(k=s.getAttribute("src"),(k!==(_.src==null?null:_.src)||s.getAttribute("type")!==(_.type==null?null:_.type)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&k&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var k=_.name==null?null:""+_.name;if(_.type==="hidden"&&s.getAttribute("name")===k)return s}else return s;if(s=Gi(s.nextSibling),s===null)break}return null}function IG(s,u,p){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=Gi(s.nextSibling),s===null))return null;return s}function xM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Gi(s.nextSibling),s===null))return null;return s}function z1(s){return s.data==="$?"||s.data==="$~"}function $1(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function LG(s,u){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||p.readyState!=="loading")u();else{var y=function(){u(),p.removeEventListener("DOMContentLoaded",y)};p.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function Gi(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 B1=null;function bM(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(u===0)return Gi(s.nextSibling);u--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||u++}s=s.nextSibling}return null}function wM(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 SM(s,u,p){switch(u=fv(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 Ph(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Gd(s)}var Wi=new Map,EM=new Set;function dv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ho=q.d;q.d={f:zG,r:$G,D:BG,C:FG,L:UG,m:HG,X:VG,S:qG,M:KG};function zG(){var s=Ho.f(),u=rv();return s||u}function $G(s){var u=Is(s);u!==null&&u.tag===5&&u.type==="form"?B2(u):Ho.r(s)}var uf=typeof document>"u"?null:document;function _M(s,u,p){var y=uf;if(y&&typeof u=="string"&&u){var _=ei(u);_='link[rel="'+s+'"][href="'+_+'"]',typeof p=="string"&&(_+='[crossorigin="'+p+'"]'),EM.has(_)||(EM.add(_),s={rel:s,crossOrigin:p,href:u},y.querySelector(_)===null&&(u=y.createElement("link"),Er(u,"link",s),Fn(u),y.head.appendChild(u)))}}function BG(s){Ho.D(s),_M("dns-prefetch",s,null)}function FG(s,u){Ho.C(s,u),_M("preconnect",s,u)}function UG(s,u,p){Ho.L(s,u,p);var y=uf;if(y&&s&&u){var _='link[rel="preload"][as="'+ei(u)+'"]';u==="image"&&p&&p.imageSrcSet?(_+='[imagesrcset="'+ei(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(_+='[imagesizes="'+ei(p.imageSizes)+'"]')):_+='[href="'+ei(s)+'"]';var k=_;switch(u){case"style":k=cf(s);break;case"script":k=ff(s)}Wi.has(k)||(s=d({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),Wi.set(k,s),y.querySelector(_)!==null||u==="style"&&y.querySelector(Mh(k))||u==="script"&&y.querySelector(Dh(k))||(u=y.createElement("link"),Er(u,"link",s),Fn(u),y.head.appendChild(u)))}}function HG(s,u){Ho.m(s,u);var p=uf;if(p&&s){var y=u&&typeof u.as=="string"?u.as:"script",_='link[rel="modulepreload"][as="'+ei(y)+'"][href="'+ei(s)+'"]',k=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=ff(s)}if(!Wi.has(k)&&(s=d({rel:"modulepreload",href:s},u),Wi.set(k,s),p.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Dh(k)))return}y=p.createElement("link"),Er(y,"link",s),Fn(y),p.head.appendChild(y)}}}function qG(s,u,p){Ho.S(s,u,p);var y=uf;if(y&&s){var _=zs(y).hoistableStyles,k=cf(s);u=u||"default";var P=_.get(k);if(!P){var Y={loading:0,preload:null};if(P=y.querySelector(Mh(k)))Y.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":u},p),(p=Wi.get(k))&&F1(s,p);var J=P=y.createElement("link");Fn(J),Er(J,"link",s),J._p=new Promise(function(fe,ge){J.onload=fe,J.onerror=ge}),J.addEventListener("load",function(){Y.loading|=1}),J.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,hv(P,u,y)}P={type:"stylesheet",instance:P,count:1,state:Y},_.set(k,P)}}}function VG(s,u){Ho.X(s,u);var p=uf;if(p&&s){var y=zs(p).hoistableScripts,_=ff(s),k=y.get(_);k||(k=p.querySelector(Dh(_)),k||(s=d({src:s,async:!0},u),(u=Wi.get(_))&&U1(s,u),k=p.createElement("script"),Fn(k),Er(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(_,k))}}function KG(s,u){Ho.M(s,u);var p=uf;if(p&&s){var y=zs(p).hoistableScripts,_=ff(s),k=y.get(_);k||(k=p.querySelector(Dh(_)),k||(s=d({src:s,async:!0,type:"module"},u),(u=Wi.get(_))&&U1(s,u),k=p.createElement("script"),Fn(k),Er(k,"link",s),p.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},y.set(_,k))}}function jM(s,u,p,y){var _=(_=ne.current)?dv(_):null;if(!_)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=cf(p.href),p=zs(_).hoistableStyles,y=p.get(u),y||(y={type:"style",instance:null,count:0,state:null},p.set(u,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=cf(p.href);var k=zs(_).hoistableStyles,P=k.get(s);if(P||(_=_.ownerDocument||_,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(s,P),(k=_.querySelector(Mh(s)))&&!k._p&&(P.instance=k,P.state.loading=5),Wi.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},Wi.set(s,p),k||YG(_,s,p,P.state))),u&&y===null)throw Error(r(528,""));return P}if(u&&y!==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=ff(p),p=zs(_).hoistableScripts,y=p.get(u),y||(y={type:"script",instance:null,count:0,state:null},p.set(u,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function cf(s){return'href="'+ei(s)+'"'}function Mh(s){return'link[rel="stylesheet"]['+s+"]"}function CM(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function YG(s,u,p,y){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?y.loading=1:(u=s.createElement("link"),y.preload=u,u.addEventListener("load",function(){return y.loading|=1}),u.addEventListener("error",function(){return y.loading|=2}),Er(u,"link",p),Fn(u),s.head.appendChild(u))}function ff(s){return'[src="'+ei(s)+'"]'}function Dh(s){return"script[async]"+s}function kM(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var y=s.querySelector('style[data-href~="'+ei(p.href)+'"]');if(y)return u.instance=y,Fn(y),y;var _=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),Fn(y),Er(y,"style",_),hv(y,p.precedence,s),u.instance=y;case"stylesheet":_=cf(p.href);var k=s.querySelector(Mh(_));if(k)return u.state.loading|=4,u.instance=k,Fn(k),k;y=CM(p),(_=Wi.get(_))&&F1(y,_),k=(s.ownerDocument||s).createElement("link"),Fn(k);var P=k;return P._p=new Promise(function(Y,J){P.onload=Y,P.onerror=J}),Er(k,"link",y),u.state.loading|=4,hv(k,p.precedence,s),u.instance=k;case"script":return k=ff(p.src),(_=s.querySelector(Dh(k)))?(u.instance=_,Fn(_),_):(y=p,(_=Wi.get(k))&&(y=d({},p),U1(y,_)),s=s.ownerDocument||s,_=s.createElement("script"),Fn(_),Er(_,"link",y),s.head.appendChild(_),u.instance=_);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(y=u.instance,u.state.loading|=4,hv(y,p.precedence,s));return u.instance}function hv(s,u,p){for(var y=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,k=_,P=0;P<y.length;P++){var Y=y[P];if(Y.dataset.precedence===u)k=Y;else if(k!==_)break}k?k.parentNode.insertBefore(s,k.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function F1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function U1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var mv=null;function AM(s,u,p){if(mv===null){var y=new Map,_=mv=new Map;_.set(p,y)}else _=mv,y=_.get(p),y||(y=new Map,_.set(p,y));if(y.has(s))return y;for(y.set(s,null),p=p.getElementsByTagName(s),_=0;_<p.length;_++){var k=p[_];if(!(k[ru]||k[Gt]||s==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var P=k.getAttribute(u)||"";P=s+P;var Y=y.get(P);Y?Y.push(k):y.set(P,[k])}}return y}function OM(s,u,p){s=s.ownerDocument||s,s.head.insertBefore(p,u==="title"?s.querySelector("head > title"):null)}function XG(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 NM(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function GG(s,u,p,y){if(p.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var _=cf(y.href),k=u.querySelector(Mh(_));if(k){u=k._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=pv.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=k,Fn(k);return}k=u.ownerDocument||u,y=CM(y),(_=Wi.get(_))&&F1(y,_),k=k.createElement("link"),Fn(k);var P=k;P._p=new Promise(function(Y,J){P.onload=Y,P.onerror=J}),Er(k,"link",y),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=pv.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var H1=0;function WG(s,u){return s.stylesheets&&s.count===0&&vv(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var y=setTimeout(function(){if(s.stylesheets&&vv(s,s.stylesheets),s.unsuspend){var k=s.unsuspend;s.unsuspend=null,k()}},6e4+u);0<s.imgBytes&&H1===0&&(H1=62500*NG());var _=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&vv(s,s.stylesheets),s.unsuspend)){var k=s.unsuspend;s.unsuspend=null,k()}},(s.imgBytes>H1?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(_)}}:null}function pv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var gv=null;function vv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,gv=new Map,u.forEach(QG,s),gv=null,pv.call(s))}function QG(s,u){if(!(u.state.loading&4)){var p=gv.get(s);if(p)var y=p.get(null);else{p=new Map,gv.set(s,p);for(var _=s.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<_.length;k++){var P=_[k];(P.nodeName==="LINK"||P.getAttribute("media")!=="not all")&&(p.set(P.dataset.precedence,P),y=P)}y&&p.set(null,y)}_=u.instance,P=_.getAttribute("data-precedence"),k=p.get(P)||y,k===y&&p.set(null,_),p.set(P,_),this.count++,y=pv.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),k?k.parentNode.insertBefore(_,k.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(_,s.firstChild)),u.state.loading|=4}}var Rh={$$typeof:j,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function ZG(s,u,p,y,_,k,P,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=pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.hiddenUpdates=pi(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=k,this.onRecoverableError=P,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function TM(s,u,p,y,_,k,P,Y,J,fe,ge,xe){return s=new ZG(s,u,p,P,J,fe,ge,xe,Y),u=1,k===!0&&(u|=24),k=yi(3,null,null,u),s.current=k,k.stateNode=s,u=Sw(),u.refCount++,s.pooledCache=u,u.refCount++,k.memoizedState={element:y,isDehydrated:p,cache:u},Cw(k),s}function PM(s){return s?(s=Fc,s):Fc}function MM(s,u,p,y,_,k){_=PM(_),y.context===null?y.context=_:y.pendingContext=_,y=Ys(u),y.payload={element:p},k=k===void 0?null:k,k!==null&&(y.callback=k),p=Xs(s,y,u),p!==null&&(oi(p,s,u),hh(p,s,u))}function DM(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function q1(s,u){DM(s,u),(s=s.alternate)&&DM(s,u)}function RM(s){if(s.tag===13||s.tag===31){var u=uu(s,67108864);u!==null&&oi(u,s,67108864),q1(s,67108864)}}function IM(s){if(s.tag===13||s.tag===31){var u=Ei();u=Va(u);var p=uu(s,u);p!==null&&oi(p,s,u),q1(s,u)}}var yv=!0;function JG(s,u,p,y){var _=D.T;D.T=null;var k=q.p;try{q.p=2,V1(s,u,p,y)}finally{q.p=k,D.T=_}}function eW(s,u,p,y){var _=D.T;D.T=null;var k=q.p;try{q.p=8,V1(s,u,p,y)}finally{q.p=k,D.T=_}}function V1(s,u,p,y){if(yv){var _=K1(y);if(_===null)T1(s,u,y,xv,p),zM(s,y);else if(nW(_,s,u,p,y))y.stopPropagation();else if(zM(s,y),u&4&&-1<tW.indexOf(s)){for(;_!==null;){var k=Is(_);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var P=Hr(k.pendingLanes);if(P!==0){var Y=k;for(Y.pendingLanes|=2,Y.entangledLanes|=2;P;){var J=1<<31-Qe(P);Y.entanglements[1]|=J,P&=~J}Ga(k),(Mt&6)===0&&(tv=Pt()+500,Oh(0))}}break;case 31:case 13:Y=uu(k,2),Y!==null&&oi(Y,k,2),rv(),q1(k,2)}if(k=K1(y),k===null&&T1(s,u,y,xv,p),k===_)break;_=k}_!==null&&y.stopPropagation()}else T1(s,u,y,null,p)}}function K1(s){return s=Xb(s),Y1(s)}var xv=null;function Y1(s){if(xv=null,s=Rs(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 xv=s,null}function LM(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(Jt()){case he:return 2;case oe:return 8;case ke:case Ue:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var X1=!1,al=null,ol=null,sl=null,Ih=new Map,Lh=new Map,ll=[],tW="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 zM(s,u){switch(s){case"focusin":case"focusout":al=null;break;case"dragenter":case"dragleave":ol=null;break;case"mouseover":case"mouseout":sl=null;break;case"pointerover":case"pointerout":Ih.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lh.delete(u.pointerId)}}function zh(s,u,p,y,_,k){return s===null||s.nativeEvent!==k?(s={blockedOn:u,domEventName:p,eventSystemFlags:y,nativeEvent:k,targetContainers:[_]},u!==null&&(u=Is(u),u!==null&&RM(u)),s):(s.eventSystemFlags|=y,u=s.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),s)}function nW(s,u,p,y,_){switch(u){case"focusin":return al=zh(al,s,u,p,y,_),!0;case"dragenter":return ol=zh(ol,s,u,p,y,_),!0;case"mouseover":return sl=zh(sl,s,u,p,y,_),!0;case"pointerover":var k=_.pointerId;return Ih.set(k,zh(Ih.get(k)||null,s,u,p,y,_)),!0;case"gotpointercapture":return k=_.pointerId,Lh.set(k,zh(Lh.get(k)||null,s,u,p,y,_)),!0}return!1}function $M(s){var u=Rs(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,kt(s.priority,function(){IM(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,kt(s.priority,function(){IM(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 bv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=K1(s.nativeEvent);if(p===null){p=s.nativeEvent;var y=new p.constructor(p.type,p);Yb=y,p.target.dispatchEvent(y),Yb=null}else return u=Is(p),u!==null&&RM(u),s.blockedOn=p,!1;u.shift()}return!0}function BM(s,u,p){bv(s)&&p.delete(u)}function rW(){X1=!1,al!==null&&bv(al)&&(al=null),ol!==null&&bv(ol)&&(ol=null),sl!==null&&bv(sl)&&(sl=null),Ih.forEach(BM),Lh.forEach(BM)}function wv(s,u){s.blockedOn===u&&(s.blockedOn=null,X1||(X1=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rW)))}var Sv=null;function FM(s){Sv!==s&&(Sv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Sv===s&&(Sv=null);for(var u=0;u<s.length;u+=3){var p=s[u],y=s[u+1],_=s[u+2];if(typeof y!="function"){if(Y1(y||p)===null)continue;break}var k=Is(p);k!==null&&(s.splice(u,3),u-=3,Kw(k,{pending:!0,data:_,method:p.method,action:y},y,_))}}))}function df(s){function u(J){return wv(J,s)}al!==null&&wv(al,s),ol!==null&&wv(ol,s),sl!==null&&wv(sl,s),Ih.forEach(u),Lh.forEach(u);for(var p=0;p<ll.length;p++){var y=ll[p];y.blockedOn===s&&(y.blockedOn=null)}for(;0<ll.length&&(p=ll[0],p.blockedOn===null);)$M(p),p.blockedOn===null&&ll.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(y=0;y<p.length;y+=3){var _=p[y],k=p[y+1],P=_[fr]||null;if(typeof k=="function")P||FM(p);else if(P){var Y=null;if(k&&k.hasAttribute("formAction")){if(_=k,P=k[fr]||null)Y=P.formAction;else if(Y1(_)!==null)continue}else Y=P.action;typeof Y=="function"?p[y+1]=Y:(p.splice(y,3),y-=3),FM(p)}}}function UM(){function s(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(P){return _=P})},focusReset:"manual",scroll:"manual"})}function u(){_!==null&&(_(),_=null),y||setTimeout(p,20)}function p(){if(!y&&!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 y=!1,_=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(p,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),_!==null&&(_(),_=null)}}}function G1(s){this._internalRoot=s}Ev.prototype.render=G1.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,y=Ei();MM(p,y,s,u,null,null)},Ev.prototype.unmount=G1.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;MM(s.current,2,null,s,null,null),rv(),u[gi]=null}};function Ev(s){this._internalRoot=s}Ev.prototype.unstable_scheduleHydration=function(s){if(s){var u=ye();s={blockedOn:null,target:s,priority:u};for(var p=0;p<ll.length&&u!==0&&u<ll[p].priority;p++);ll.splice(p,0,s),p===0&&$M(s)}};var HM=t.version;if(HM!=="19.2.4")throw Error(r(527,HM,"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 iW={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_v.isDisabled&&_v.supportsFiber)try{Xt=_v.inject(iW),Se=_v}catch{}}return Bh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,y="",_=W2,k=Q2,P=Z2;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(_=u.onUncaughtError),u.onCaughtError!==void 0&&(k=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),u=TM(s,1,!1,null,null,p,y,null,_,k,P,UM),s[gi]=u.current,N1(s),new G1(u)},Bh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var y=!1,_="",k=W2,P=Q2,Y=Z2,J=null;return p!=null&&(p.unstable_strictMode===!0&&(y=!0),p.identifierPrefix!==void 0&&(_=p.identifierPrefix),p.onUncaughtError!==void 0&&(k=p.onUncaughtError),p.onCaughtError!==void 0&&(P=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=TM(s,1,!0,u,p??null,y,_,J,k,P,Y,UM),u.context=PM(null),p=u.current,y=Ei(),y=Va(y),_=Ys(y),_.callback=null,Xs(p,_,y),p=y,u.current.lanes=p,Lt(u,p),Ga(u),s[gi]=u.current,N1(s),new Ev(u)},Bh.version="19.2.4",Bh}var eD;function gW(){if(eD)return eS.exports;eD=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(),eS.exports=pW(),eS.exports}var vW=gW();/**
 * 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 tD="popstate";function nD(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function yW(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 T_("",{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:jm(i)}return bW(t,n,null,e)}function hn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ta(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xW(){return Math.random().toString(36).substring(2,10)}function rD(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 T_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ad(t):t,state:n,key:t&&t.key||r||xW(),unstable_mask:i}}function jm({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 Ad(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 bW(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(),E=S==null?null:S-f;f=S,c&&c({action:l,location:w.location,delta:E})}function g(S,E){l="PUSH";let C=nD(S)?S:T_(w.location,S,E);f=h()+1;let j=rD(C,f),A=w.createHref(C.unstable_mask||C);try{o.pushState(j,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(A)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,E){l="REPLACE";let C=nD(S)?S:T_(w.location,S,E);f=h();let j=rD(C,f),A=w.createHref(C.unstable_mask||C);o.replaceState(j,"",A),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return wW(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(tD,d),c=S,()=>{i.removeEventListener(tD,d),c=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let E=b(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:g,replace:v,go(S){return o.go(S)}};return w}function wW(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),hn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:jm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function p$(e,t,n="/"){return SW(e,t,n,!1)}function SW(e,t,n,r){let i=typeof t=="string"?Ad(t):t,a=os(i.pathname||"/",n);if(a==null)return null;let o=g$(e);EW(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let f=y$(a);l=PW(o[c],f,r)}return l}function g$(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;hn(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=uo([r,h.relativePath]),g=n.concat(h);o.children&&o.children.length>0&&(hn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),g$(o.children,t,g,d,c)),!(o.path==null&&!o.index)&&t.push({path:d,score:NW(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 v$(o.path))a(o,l,!0,f)}),t}function v$(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=v$(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function EW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:TW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var _W=/^:[\w-]+$/,jW=3,CW=2,kW=1,AW=10,OW=-2,iD=e=>e==="*";function NW(e,t){let n=e.split("/"),r=n.length;return n.some(iD)&&(r+=OW),t&&(r+=CW),n.filter(i=>!iD(i)).reduce((i,a)=>i+(_W.test(a)?jW:a===""?kW:AW),r)}function TW(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 PW(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=Cm({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},h),g=c.route;if(!d&&f&&n&&!r[r.length-1].route.index&&(d=Cm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:uo([a,d.pathname]),pathnameBase:LW(uo([a,d.pathnameBase])),route:g}),d.pathnameBase!=="/"&&(a=uo([a,d.pathnameBase]))}return o}function Cm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=MW(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 MW(e,t=!1,n=!0){Ta(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 y$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ta(!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 os(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 DW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function RW(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ad(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=aD(n.substring(1),"/"):a=aD(n,t)):a=t,{pathname:a,search:zW(r),hash:$W(i)}}function aD(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 iS(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 IW(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function x$(e){let t=IW(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function GC(e,t,n,r=!1){let i;typeof e=="string"?i=Ad(e):(i={...e},hn(!i.pathname||!i.pathname.includes("?"),iS("?","pathname","search",i)),hn(!i.pathname||!i.pathname.includes("#"),iS("#","pathname","hash",i)),hn(!i.search||!i.search.includes("#"),iS("#","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=RW(i,l),f=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||h)&&(c.pathname+="/"),c}var uo=e=>e.join("/").replace(/\/\/+/g,"/"),LW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$W=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,BW=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 FW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function UW(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var b$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function w$(e,t){let n=e;if(typeof n!="string"||!DW.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(b$)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=os(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{Ta(!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 S$=["POST","PUT","PATCH","DELETE"];new Set(S$);var HW=["GET",...S$];new Set(HW);var Od=x.createContext(null);Od.displayName="DataRouter";var t0=x.createContext(null);t0.displayName="DataRouterState";var qW=x.createContext(!1),E$=x.createContext({isTransitioning:!1});E$.displayName="ViewTransition";var VW=x.createContext(new Map);VW.displayName="Fetchers";var KW=x.createContext(null);KW.displayName="Await";var ua=x.createContext(null);ua.displayName="Navigation";var vp=x.createContext(null);vp.displayName="Location";var $a=x.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var WC=x.createContext(null);WC.displayName="RouteError";var _$="REACT_ROUTER_ERROR",YW="REDIRECT",XW="ROUTE_ERROR_RESPONSE";function GW(e){if(e.startsWith(`${_$}:${YW}:{`))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 WW(e){if(e.startsWith(`${_$}:${XW}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new BW(t.status,t.statusText,t.data)}catch{}}function QW(e,{relative:t}={}){hn(Nd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(ua),{hash:i,pathname:a,search:o}=xp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:uo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function Nd(){return x.useContext(vp)!=null}function Ba(){return hn(Nd(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(vp).location}function oD(e){hn(Nd(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Ba();return x.useMemo(()=>Cm(e,y$(t)),[t,e])}var j$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function C$(e){x.useContext(ua).static||x.useLayoutEffect(e)}function bo(){let{isDataRoute:e}=x.useContext($a);return e?dQ():ZW()}function ZW(){hn(Nd(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Od),{basename:t,navigator:n}=x.useContext(ua),{matches:r}=x.useContext($a),{pathname:i}=Ba(),a=JSON.stringify(x$(r)),o=x.useRef(!1);return C$(()=>{o.current=!0}),x.useCallback((c,f={})=>{if(Ta(o.current,j$),!o.current)return;if(typeof c=="number"){n.go(c);return}let h=GC(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:uo([t,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[t,n,a,i,e])}var JW=x.createContext(null);function eQ(e){let t=x.useContext($a).outlet;return x.useMemo(()=>t&&x.createElement(JW.Provider,{value:e},t),[t,e])}function yp(){let{matches:e}=x.useContext($a),t=e[e.length-1];return t?t.params:{}}function xp(e,{relative:t}={}){let{matches:n}=x.useContext($a),{pathname:r}=Ba(),i=JSON.stringify(x$(n));return x.useMemo(()=>GC(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function tQ(e,t){return k$(e,t)}function k$(e,t,n){var S;hn(Nd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(ua),{matches:i}=x.useContext($a),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let E=f&&f.path||"";O$(l,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let h=Ba(),d;if(t){let E=typeof t=="string"?Ad(t):t;hn(c==="/"||((S=E.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 "${E.pathname}" was given in the \`location\` prop.`),d=E}else d=h;let g=d.pathname||"/",v=g;if(c!=="/"){let E=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=p$(e,{pathname:v});Ta(f||b!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ta(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=oQ(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},o,E.params),pathname:uo([c,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?c:uo([c,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,n);return t&&w?x.createElement(vp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},w):w}function nQ(){let e=fQ(),t=FW(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=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:a},"ErrorBoundary")," or"," ",x.createElement("code",{style:a},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,o)}var rQ=x.createElement(nQ,null),A$=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=WW(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement($a.Provider,{value:this.props.routeContext},x.createElement(WC.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(iQ,{error:e},t):t}};A$.contextType=qW;var aS=new WeakMap;function iQ({children:e,error:t}){let{basename:n}=x.useContext(ua);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=GW(t.digest);if(r){let i=aS.get(t);if(i)throw i;let a=w$(r.location,n);if(b$&&!aS.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 aS.set(t,o),o}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function aQ({routeContext:e,match:t,children:n}){let r=x.useContext(Od);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement($a.Provider,{value:e},n)}function oQ(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);hn(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:UW(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||rQ,o&&(l<0&&g===0?(O$("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 E=t.concat(i.slice(0,g+1)),C=()=>{let j;return v?j=w:b?j=S:d.route.Component?j=x.createElement(d.route.Component,null):d.route.element?j=d.route.element:j=h,x.createElement(aQ,{match:d,routeContext:{outlet:h,matches:E,isDataRoute:r!=null},children:j})};return r&&(d.route.ErrorBoundary||d.route.errorElement||g===0)?x.createElement(A$,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):C()},null)}function QC(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function sQ(e){let t=x.useContext(Od);return hn(t,QC(e)),t}function lQ(e){let t=x.useContext(t0);return hn(t,QC(e)),t}function uQ(e){let t=x.useContext($a);return hn(t,QC(e)),t}function ZC(e){let t=uQ(e),n=t.matches[t.matches.length-1];return hn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function cQ(){return ZC("useRouteId")}function fQ(){var r;let e=x.useContext(WC),t=lQ("useRouteError"),n=ZC("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function dQ(){let{router:e}=sQ("useNavigate"),t=ZC("useNavigate"),n=x.useRef(!1);return C$(()=>{n.current=!0}),x.useCallback(async(i,a={})=>{Ta(n.current,j$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var sD={};function O$(e,t,n){!t&&!sD[e]&&(sD[e]=!0,Ta(!1,n))}x.memo(hQ);function hQ({routes:e,future:t,state:n,isStatic:r,onError:i}){return k$(e,void 0,{state:n,isStatic:r,onError:i})}function mQ(e){return eQ(e.context)}function _i(e){hn(!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 pQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){hn(!Nd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:l,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[l,i,a,o]);typeof n=="string"&&(n=Ad(n));let{pathname:f="/",search:h="",hash:d="",state:g=null,key:v="default",unstable_mask:b}=n,w=x.useMemo(()=>{let S=os(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 Ta(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:x.createElement(ua.Provider,{value:c},x.createElement(vp.Provider,{children:t,value:w}))}function gQ({children:e,location:t}){return tQ(P_(e),t)}function P_(e,t=[]){let n=[];return x.Children.forEach(e,(r,i)=>{if(!x.isValidElement(r))return;let a=[...t,i];if(r.type===x.Fragment){n.push.apply(n,P_(r.props.children,a));return}hn(r.type===_i,`[${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>`),hn(!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=P_(r.props.children,a)),n.push(o)}),n}var fy="get",dy="application/x-www-form-urlencoded";function n0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vQ(e){return n0(e)&&e.tagName.toLowerCase()==="button"}function yQ(e){return n0(e)&&e.tagName.toLowerCase()==="form"}function xQ(e){return n0(e)&&e.tagName.toLowerCase()==="input"}function bQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wQ(e,t){return e.button===0&&(!t||t==="_self")&&!bQ(e)}function M_(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 SQ(e,t){let n=M_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Cv=null;function EQ(){if(Cv===null)try{new FormData(document.createElement("form"),0),Cv=!1}catch{Cv=!0}return Cv}var _Q=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function oS(e){return e!=null&&!_Q.has(e)?(Ta(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dy}"`),null):e}function jQ(e,t){let n,r,i,a,o;if(yQ(e)){let l=e.getAttribute("action");r=l?os(l,t):null,n=e.getAttribute("method")||fy,i=oS(e.getAttribute("enctype"))||dy,a=new FormData(e)}else if(vQ(e)||xQ(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?os(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||fy,i=oS(e.getAttribute("formenctype"))||oS(l.getAttribute("enctype"))||dy,a=new FormData(l,e),!EQ()){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(n0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fy,r=null,i=dy,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 JC(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function CQ(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&&os(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function kQ(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 AQ(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 OQ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await kQ(a,n);return o.links?o.links():[]}return[]}));return MQ(r.flat(1).filter(AQ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function lD(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 NQ(e,t,{includeHydrateFallback:n}={}){return TQ(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 TQ(e){return[...new Set(e)]}function PQ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function MQ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(PQ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function N$(){let e=x.useContext(Od);return JC(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DQ(){let e=x.useContext(t0);return JC(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ek=x.createContext(void 0);ek.displayName="FrameworkContext";function T$(){let e=x.useContext(ek);return JC(e,"You must render this element inside a <HydratedRouter> element"),e}function RQ(e,t){let n=x.useContext(ek),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:f,onMouseLeave:h,onTouchStart:d}=t,g=x.useRef(null);x.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=E=>{E.forEach(C=>{o(C.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return g.current&&S.observe(g.current),()=>{S.disconnect()}}},[e]),x.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:Fh(l,v),onBlur:Fh(c,b),onMouseEnter:Fh(f,v),onMouseLeave:Fh(h,b),onTouchStart:Fh(d,v)}]:[!1,g,{}]}function Fh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function IQ({page:e,...t}){let{router:n}=N$(),r=x.useMemo(()=>p$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(zQ,{page:e,matches:r,...t}):null}function LQ(e){let{manifest:t,routeModules:n}=T$(),[r,i]=x.useState([]);return x.useEffect(()=>{let a=!1;return OQ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function zQ({page:e,matches:t,...n}){let r=Ba(),{future:i,manifest:a,routeModules:o}=T$(),{basename:l}=N$(),{loaderData:c,matches:f}=DQ(),h=x.useMemo(()=>lD(e,t,f,a,r,"data"),[e,t,f,a,r]),d=x.useMemo(()=>lD(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(C=>{var A;let j=a.routes[C.route.id];!j||!j.hasLoader||(!h.some(N=>N.route.id===C.route.id)&&C.route.id in c&&((A=o[C.route.id])!=null&&A.shouldRevalidate)||j.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let E=CQ(e,l,i.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&E.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[E.pathname+E.search]},[l,i.unstable_trailingSlashAwareDataRequests,c,r,a,h,t,e,o]),v=x.useMemo(()=>NQ(d,a),[d,a]),b=LQ(d);return x.createElement(x.Fragment,null,g.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>x.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function $Q(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var BQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BQ&&(window.__reactRouterVersion="7.13.1")}catch{}function FQ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=x.useRef();i.current==null&&(i.current=yW({window:r,v5Compat:!0}));let a=i.current,[o,l]=x.useState({action:a.action,location:a.location}),c=x.useCallback(f=>{n===!1?l(f):x.startTransition(()=>l(f))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(pQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var P$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ir=x.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:E,unstable_useTransitions:C}=x.useContext(ua),j=typeof h=="string"&&P$.test(h),A=w$(h,S);h=A.to;let N=QW(h,{relative:i}),O=Ba(),T=null;if(l){let K=GC(l,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);S!=="/"&&(K.pathname=K.pathname==="/"?S:uo([S,K.pathname])),T=E.createHref(K)}let[M,I,z]=RQ(r,b),B=qQ(h,{replace:o,unstable_mask:l,state:c,target:f,preventScrollReset:d,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function L(K){t&&t(K),K.defaultPrevented||B(K)}let G=!(A.isExternal||a),F=x.createElement("a",{...b,...z,href:(G?T:void 0)||A.absoluteURL||N,onClick:G?L:t,ref:$Q(w,I),target:f,"data-discover":!j&&n==="render"?"true":void 0});return M&&!j?x.createElement(x.Fragment,null,F,x.createElement(IQ,{page:N})):F});Ir.displayName="Link";var D_=x.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=xp(o,{relative:f.relative}),g=Ba(),v=x.useContext(t0),{navigator:b,basename:w}=x.useContext(ua),S=v!=null&&WQ(d)&&l===!0,E=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,C=g.pathname,j=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),j=j?j.toLowerCase():null,E=E.toLowerCase()),j&&w&&(j=os(j,w)||j);const A=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let N=C===E||!i&&C.startsWith(E)&&C.charAt(A)==="/",O=j!=null&&(j===E||!i&&j.startsWith(E)&&j.charAt(E.length)==="/"),T={isActive:N,isPending:O,isTransitioning:S},M=N?t:void 0,I;typeof r=="function"?I=r(T):I=[r,N?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(T):a;return x.createElement(Ir,{...f,"aria-current":M,className:I,ref:h,style:z,to:o,viewTransition:l},typeof c=="function"?c(T):c)});D_.displayName="NavLink";var UQ=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=fy,action:l,onSubmit:c,relative:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=x.useContext(ua),S=XQ(),E=GQ(l,{relative:f}),C=o.toLowerCase()==="get"?"get":"post",j=typeof l=="string"&&P$.test(l),A=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let O=N.nativeEvent.submitter,T=(O==null?void 0:O.getAttribute("formmethod"))||o,M=()=>S(O||N.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:g});w&&n!==!1?x.startTransition(()=>M()):M()};return x.createElement("form",{ref:b,method:C,action:E,onSubmit:r?c:A,...v,"data-discover":!j&&e==="render"?"true":void 0})});UQ.displayName="Form";function HQ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function M$(e){let t=x.useContext(Od);return hn(t,HQ(e)),t}function qQ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let h=bo(),d=Ba(),g=xp(e,{relative:o});return x.useCallback(v=>{if(wQ(v,t)){v.preventDefault();let b=n!==void 0?n:jm(d)===jm(g),w=()=>h(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?x.startTransition(()=>w()):w()}},[d,h,g,n,r,i,t,e,a,o,l,c,f])}function VQ(e){Ta(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(M_(e)),n=x.useRef(!1),r=Ba(),i=x.useMemo(()=>SQ(r.search,n.current?null:t.current),[r.search]),a=bo(),o=x.useCallback((l,c)=>{const f=M_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+f,c)},[a,i]);return[i,o]}var KQ=0,YQ=()=>`__${String(++KQ)}__`;function XQ(){let{router:e}=M$("useSubmit"),{basename:t}=x.useContext(ua),n=cQ(),r=e.fetch,i=e.navigate;return x.useCallback(async(a,o={})=>{let{action:l,method:c,encType:f,formData:h,body:d}=jQ(a,t);if(o.navigate===!1){let g=o.fetcherKey||YQ();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 GQ(e,{relative:t}={}){let{basename:n}=x.useContext(ua),r=x.useContext($a);hn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...xp(e||".",{relative:t})},o=Ba();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:uo([n,a.pathname])),jm(a)}function WQ(e,{relative:t}={}){let n=x.useContext(E$);hn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=M$("useViewTransitionState"),i=xp(e,{relative:t});if(!n.isTransitioning)return!1;let a=os(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=os(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Cm(i.pathname,o)!=null||Cm(i.pathname,a)!=null}var Xl=m$();const D$=Bi(Xl);var wc=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(){}},QQ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},El,YC,n$,ZQ=(n$=class{constructor(){Te(this,El,QQ);Te(this,YC,!1)}setTimeoutProvider(e){Ce(this,El,e)}setTimeout(e,t){return W(this,El).setTimeout(e,t)}clearTimeout(e){W(this,El).clearTimeout(e)}setInterval(e,t){return W(this,El).setInterval(e,t)}clearInterval(e){W(this,El).clearInterval(e)}},El=new WeakMap,YC=new WeakMap,n$),Du=new ZQ;function JQ(e){setTimeout(e,0)}var Ju=typeof window>"u"||"Deno"in globalThis;function Dr(){}function eZ(e,t){return typeof e=="function"?e(t):e}function R_(e){return typeof e=="number"&&e>=0&&e!==1/0}function R$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dl(e,t){return typeof e=="function"?e(t):e}function ra(e,t){return typeof e=="function"?e(t):e}function uD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==tk(o,t.options))return!1}else if(!km(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 cD(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ec(t.options.mutationKey)!==ec(a))return!1}else if(!km(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function tk(e,t){return((t==null?void 0:t.queryKeyHashFn)||ec)(e)}function ec(e){return JSON.stringify(e,(t,n)=>I_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function km(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>km(e[n],t[n])):!1}var tZ=Object.prototype.hasOwnProperty;function nk(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=fD(e)&&fD(t);if(!r&&!(I_(e)&&I_(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:tZ.call(e,d))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[d]=v;continue}const b=nk(g,v,n+1);c[d]=b,b===g&&f++}return a===l&&f===a?e:c}function Am(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 fD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function I_(e){if(!dD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dD(e){return Object.prototype.toString.call(e)==="[object Object]"}function nZ(e){return new Promise(t=>{Du.setTimeout(t,e)})}function L_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nk(e,t):t}function rZ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function iZ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rk=Symbol();function I$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ik(e,t){return typeof e=="function"?e(...t):!!e}function aZ(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 $u,_l,Vf,r$,oZ=(r$=class extends wc{constructor(){super();Te(this,$u);Te(this,_l);Te(this,Vf);Ce(this,Vf,t=>{if(!Ju&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,_l)||this.setEventListener(W(this,Vf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,_l))==null||t.call(this),Ce(this,_l,void 0))}setEventListener(t){var n;Ce(this,Vf,t),(n=W(this,_l))==null||n.call(this),Ce(this,_l,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,$u)!==t&&(Ce(this,$u,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,$u)=="boolean"?W(this,$u):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$u=new WeakMap,_l=new WeakMap,Vf=new WeakMap,r$),ak=new oZ;function z_(){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 sZ=JQ;function lZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=sZ;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 Nn=lZ(),Kf,jl,Yf,i$,uZ=(i$=class extends wc{constructor(){super();Te(this,Kf,!0);Te(this,jl);Te(this,Yf);Ce(this,Yf,t=>{if(!Ju&&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,jl)||this.setEventListener(W(this,Yf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,jl))==null||t.call(this),Ce(this,jl,void 0))}setEventListener(t){var n;Ce(this,Yf,t),(n=W(this,jl))==null||n.call(this),Ce(this,jl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Kf)!==t&&(Ce(this,Kf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Kf)}},Kf=new WeakMap,jl=new WeakMap,Yf=new WeakMap,i$),Ty=new uZ;function cZ(e){return Math.min(1e3*2**e,3e4)}function L$(e){return(e??"online")==="online"?Ty.isOnline():!0}var $_=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=z_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const E=new $_(w);g(E),(S=e.onCancel)==null||S.call(e,E)}},l=()=>{t=!0},c=()=>{t=!1},f=()=>ak.isFocused()&&(e.networkMode==="always"||Ty.isOnline())&&e.canRun(),h=()=>L$(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=E=>{(a()||f())&&w(E)},(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(E){w=Promise.reject(E)}Promise.resolve(w).then(d).catch(E=>{var O;if(a())return;const C=e.retry??(Ju?0:3),j=e.retryDelay??cZ,A=typeof j=="function"?j(n,E):j,N=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(t||!N){g(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),nZ(A).then(()=>f()?void 0:v()).then(()=>{t?g(E):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 Bu,a$,$$=(a$=class{constructor(){Te(this,Bu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R_(this.gcTime)&&Ce(this,Bu,Du.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ju?1/0:300*1e3))}clearGcTimeout(){W(this,Bu)&&(Du.clearTimeout(W(this,Bu)),Ce(this,Bu,void 0))}},Bu=new WeakMap,a$),Fu,Xf,ta,Uu,hr,lp,Hu,ba,Ko,o$,fZ=(o$=class extends $${constructor(t){super();Te(this,ba);Te(this,Fu);Te(this,Xf);Te(this,ta);Te(this,Uu);Te(this,hr);Te(this,lp);Te(this,Hu);Ce(this,Hu,!1),Ce(this,lp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,Uu,t.client),Ce(this,ta,W(this,Uu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,Fu,mD(this.options)),this.state=t.state??W(this,Fu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,hr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,lp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=mD(this.options);n.data!==void 0&&(this.setState(hD(n.data,n.dataUpdatedAt)),Ce(this,Fu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ta).remove(this)}setData(t,n){const r=L_(this.state.data,t,this.options);return Je(this,ba,Ko).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Je(this,ba,Ko).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,hr))==null?void 0:r.promise;return(i=W(this,hr))==null||i.cancel(t),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Fu))}isActive(){return this.observers.some(t=>ra(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Dl(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:!R$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,hr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,hr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ta).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,hr)&&(W(this,Hu)?W(this,hr).cancel({revert:!0}):W(this,hr).cancelRetry()),this.scheduleGc()),W(this,ta).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,ba,Ko).call(this,{type:"invalidate"})}async fetch(t,n){var c,f,h,d,g,v,b,w,S,E,C,j;if(this.state.fetchStatus!=="idle"&&((c=W(this,hr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,hr))return W(this,hr).continueRetry(),W(this,hr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(N=>N.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,i=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ce(this,Hu,!0),r.signal)})},a=()=>{const A=I$(this.options,n),O=(()=>{const T={client:W(this,Uu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ce(this,Hu,!1),this.options.persister?this.options.persister(A,O,this):A(O)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Uu),state:this.state,fetchFn:a};return i(A),A})();(f=this.options.behavior)==null||f.onFetch(l,this),Ce(this,Xf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&Je(this,ba,Ko).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Ce(this,hr,z$({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof $_&&A.revert&&this.setState({...W(this,Xf),fetchStatus:"idle"}),r.abort()},onFail:(A,N)=>{Je(this,ba,Ko).call(this,{type:"failed",failureCount:A,error:N})},onPause:()=>{Je(this,ba,Ko).call(this,{type:"pause"})},onContinue:()=>{Je(this,ba,Ko).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const A=await W(this,hr).start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(v=(g=W(this,ta).config).onSuccess)==null||v.call(g,A,this),(w=(b=W(this,ta).config).onSettled)==null||w.call(b,A,this.state.error,this),A}catch(A){if(A instanceof $_){if(A.silent)return W(this,hr).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw Je(this,ba,Ko).call(this,{type:"error",error:A}),(E=(S=W(this,ta).config).onError)==null||E.call(S,A,this),(j=(C=W(this,ta).config).onSettled)==null||j.call(C,this.state.data,A,this),A}finally{this.scheduleGc()}}},Fu=new WeakMap,Xf=new WeakMap,ta=new WeakMap,Uu=new WeakMap,hr=new WeakMap,lp=new WeakMap,Hu=new WeakMap,ba=new WeakSet,Ko=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,...B$(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...hD(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Xf,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),Nn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ta).notify({query:this,type:"updated",action:t})})},o$);function B$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mD(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 li,bt,up,Vr,qu,Gf,Xo,Cl,cp,Wf,Qf,Vu,Ku,kl,Zf,Rt,fm,B_,F_,U_,H_,q_,V_,K_,F$,s$,r0=(s$=class extends wc{constructor(t,n){super();Te(this,Rt);Te(this,li);Te(this,bt);Te(this,up);Te(this,Vr);Te(this,qu);Te(this,Gf);Te(this,Xo);Te(this,Cl);Te(this,cp);Te(this,Wf);Te(this,Qf);Te(this,Vu);Te(this,Ku);Te(this,kl);Te(this,Zf,new Set);this.options=n,Ce(this,li,t),Ce(this,Cl,null),Ce(this,Xo,z_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,bt).addObserver(this),pD(W(this,bt),this.options)?Je(this,Rt,fm).call(this):this.updateResult(),Je(this,Rt,H_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y_(W(this,bt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y_(W(this,bt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,Rt,q_).call(this),Je(this,Rt,V_).call(this),W(this,bt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,bt);if(this.options=W(this,li).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ra(this.options.enabled,W(this,bt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,Rt,K_).call(this),W(this,bt).setOptions(this.options),n._defaulted&&!Am(this.options,n)&&W(this,li).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,bt),observer:this});const i=this.hasListeners();i&&gD(W(this,bt),r,this.options,n)&&Je(this,Rt,fm).call(this),this.updateResult(),i&&(W(this,bt)!==r||ra(this.options.enabled,W(this,bt))!==ra(n.enabled,W(this,bt))||Dl(this.options.staleTime,W(this,bt))!==Dl(n.staleTime,W(this,bt)))&&Je(this,Rt,B_).call(this);const a=Je(this,Rt,F_).call(this);i&&(W(this,bt)!==r||ra(this.options.enabled,W(this,bt))!==ra(n.enabled,W(this,bt))||a!==W(this,kl))&&Je(this,Rt,U_).call(this,a)}getOptimisticResult(t){const n=W(this,li).getQueryCache().build(W(this,li),t),r=this.createResult(n,t);return hZ(this,r)&&(Ce(this,Vr,r),Ce(this,Gf,this.options),Ce(this,qu,W(this,bt).state)),r}getCurrentResult(){return W(this,Vr)}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,Xo).status==="pending"&&W(this,Xo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Zf).add(t)}getCurrentQuery(){return W(this,bt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,li).defaultQueryOptions(t),r=W(this,li).getQueryCache().build(W(this,li),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Je(this,Rt,fm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Vr)))}createResult(t,n){var I;const r=W(this,bt),i=this.options,a=W(this,Vr),o=W(this,qu),l=W(this,Gf),f=t!==r?t.state:W(this,up),{state:h}=t;let d={...h},g=!1,v;if(n._optimisticResults){const z=this.hasListeners(),B=!z&&pD(t,n),L=z&&gD(t,r,n,i);(B||L)&&(d={...d,...B$(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=d;v=d.data;let E=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let z;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(z=a.data,E=!0):z=typeof n.placeholderData=="function"?n.placeholderData((I=W(this,Qf))==null?void 0:I.state.data,W(this,Qf)):n.placeholderData,z!==void 0&&(S="success",v=L_(a==null?void 0:a.data,z,n),g=!0)}if(n.select&&v!==void 0&&!E)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,cp))v=W(this,Wf);else try{Ce(this,cp,n.select),v=n.select(v),v=L_(a==null?void 0:a.data,v,n),Ce(this,Wf,v),Ce(this,Cl,null)}catch(z){Ce(this,Cl,z)}W(this,Cl)&&(b=W(this,Cl),v=W(this,Wf),w=Date.now(),S="error");const C=d.fetchStatus==="fetching",j=S==="pending",A=S==="error",N=j&&C,O=v!==void 0,M={status:S,fetchStatus:d.fetchStatus,isPending:j,isSuccess:S==="success",isError:A,isInitialLoading:N,isLoading:N,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&&!j,isLoadingError:A&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&O,isStale:ok(t,n),refetch:this.refetch,promise:W(this,Xo),isEnabled:ra(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=M.data!==void 0,B=M.status==="error"&&!z,L=K=>{B?K.reject(M.error):z&&K.resolve(M.data)},G=()=>{const K=Ce(this,Xo,M.promise=z_());L(K)},F=W(this,Xo);switch(F.status){case"pending":t.queryHash===r.queryHash&&L(F);break;case"fulfilled":(B||M.data!==F.value)&&G();break;case"rejected":(!B||M.error!==F.reason)&&G();break}}return M}updateResult(){const t=W(this,Vr),n=this.createResult(W(this,bt),this.options);if(Ce(this,qu,W(this,bt).state),Ce(this,Gf,this.options),W(this,qu).data!==void 0&&Ce(this,Qf,W(this,bt)),Am(n,t))return;Ce(this,Vr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,Zf).size)return!0;const o=new Set(a??W(this,Zf));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Vr)).some(l=>{const c=l;return W(this,Vr)[c]!==t[c]&&o.has(c)})};Je(this,Rt,F$).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,Rt,H_).call(this)}},li=new WeakMap,bt=new WeakMap,up=new WeakMap,Vr=new WeakMap,qu=new WeakMap,Gf=new WeakMap,Xo=new WeakMap,Cl=new WeakMap,cp=new WeakMap,Wf=new WeakMap,Qf=new WeakMap,Vu=new WeakMap,Ku=new WeakMap,kl=new WeakMap,Zf=new WeakMap,Rt=new WeakSet,fm=function(t){Je(this,Rt,K_).call(this);let n=W(this,bt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Dr)),n},B_=function(){Je(this,Rt,q_).call(this);const t=Dl(this.options.staleTime,W(this,bt));if(Ju||W(this,Vr).isStale||!R_(t))return;const r=R$(W(this,Vr).dataUpdatedAt,t)+1;Ce(this,Vu,Du.setTimeout(()=>{W(this,Vr).isStale||this.updateResult()},r))},F_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,bt)):this.options.refetchInterval)??!1},U_=function(t){Je(this,Rt,V_).call(this),Ce(this,kl,t),!(Ju||ra(this.options.enabled,W(this,bt))===!1||!R_(W(this,kl))||W(this,kl)===0)&&Ce(this,Ku,Du.setInterval(()=>{(this.options.refetchIntervalInBackground||ak.isFocused())&&Je(this,Rt,fm).call(this)},W(this,kl)))},H_=function(){Je(this,Rt,B_).call(this),Je(this,Rt,U_).call(this,Je(this,Rt,F_).call(this))},q_=function(){W(this,Vu)&&(Du.clearTimeout(W(this,Vu)),Ce(this,Vu,void 0))},V_=function(){W(this,Ku)&&(Du.clearInterval(W(this,Ku)),Ce(this,Ku,void 0))},K_=function(){const t=W(this,li).getQueryCache().build(W(this,li),this.options);if(t===W(this,bt))return;const n=W(this,bt);Ce(this,bt,t),Ce(this,up,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},F$=function(t){Nn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Vr))}),W(this,li).getQueryCache().notify({query:W(this,bt),type:"observerResultsUpdated"})})},s$);function dZ(e,t){return ra(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function pD(e,t){return dZ(e,t)||e.state.data!==void 0&&Y_(e,t,t.refetchOnMount)}function Y_(e,t,n){if(ra(t.enabled,e)!==!1&&Dl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ok(e,t)}return!1}function gD(e,t,n,r){return(e!==t||ra(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ok(e,n)}function ok(e,t){return ra(t.enabled,e)!==!1&&e.isStaleByTime(Dl(t.staleTime,e))}function hZ(e,t){return!Am(e.getCurrentResult(),t)}function Py(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=j=>{aZ(j,()=>t.signal,()=>w=!0)},E=I$(t.options,t.fetchOptions),C=async(j,A,N)=>{if(w)return Promise.reject();if(A==null&&j.pages.length)return Promise.resolve(j);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:A,direction:N?"backward":"forward",meta:t.options.meta};return S(B),B})(),M=await E(T),{maxPages:I}=t.options,z=N?iZ:rZ;return{pages:z(j.pages,M,I),pageParams:z(j.pageParams,A,I)}};if(i&&a.length){const j=i==="backward",A=j?U$:X_,N={pages:a,pageParams:o},O=A(r,N);l=await C(N,O,j)}else{const j=e??a.length;do{const A=c===0?o[0]??r.initialPageParam:X_(r,l);if(c>0&&A==null)break;l=await C(l,A),c++}while(c<j)}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 X_(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 U$(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 mZ(e,t){return t?X_(e,t)!=null:!1}function pZ(e,t){return!t||!e.getPreviousPageParam?!1:U$(e,t)!=null}var gZ=class extends r0{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:Py()})}getOptimisticResult(e){return e.behavior=Py(),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:mZ(t,n.data),hasPreviousPage:pZ(t,n.data),isFetchNextPageError:f,isFetchingNextPage:h,isFetchPreviousPageError:d,isFetchingPreviousPage:g,isRefetchError:l&&!f&&!d,isRefetching:a&&!h&&!g}}},fp,to,Pr,Yu,no,gl,l$,vZ=(l$=class extends $${constructor(t){super();Te(this,no);Te(this,fp);Te(this,to);Te(this,Pr);Te(this,Yu);Ce(this,fp,t.client),this.mutationId=t.mutationId,Ce(this,Pr,t.mutationCache),Ce(this,to,[]),this.state=t.state||H$(),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,to).includes(t)||(W(this,to).push(t),this.clearGcTimeout(),W(this,Pr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,to,W(this,to).filter(n=>n!==t)),this.scheduleGc(),W(this,Pr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,to).length||(this.state.status==="pending"?this.scheduleGc():W(this,Pr).remove(this))}continue(){var t;return((t=W(this,Yu))==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,E,C,j,A,N,O,T;const n=()=>{Je(this,no,gl).call(this,{type:"continue"})},r={client:W(this,fp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ce(this,Yu,z$({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{Je(this,no,gl).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{Je(this,no,gl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Pr).canRun(this)}));const i=this.state.status==="pending",a=!W(this,Yu).canStart();try{if(i)n();else{Je(this,no,gl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,Pr).config.onMutate&&await W(this,Pr).config.onMutate(t,this,r);const I=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));I!==this.state.context&&Je(this,no,gl).call(this,{type:"pending",context:I,variables:t,isPaused:a})}const M=await W(this,Yu).start();return await((f=(c=W(this,Pr).config).onSuccess)==null?void 0:f.call(c,M,t,this.state.context,this,r)),await((d=(h=this.options).onSuccess)==null?void 0:d.call(h,M,t,this.state.context,r)),await((v=(g=W(this,Pr).config).onSettled)==null?void 0:v.call(g,M,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,M,null,t,this.state.context,r)),Je(this,no,gl).call(this,{type:"success",data:M}),M}catch(M){try{await((E=(S=W(this,Pr).config).onError)==null?void 0:E.call(S,M,t,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((j=(C=this.options).onError)==null?void 0:j.call(C,M,t,this.state.context,r))}catch(I){Promise.reject(I)}try{await((N=(A=W(this,Pr).config).onSettled)==null?void 0:N.call(A,void 0,M,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,M,t,this.state.context,r))}catch(I){Promise.reject(I)}throw Je(this,no,gl).call(this,{type:"error",error:M}),M}finally{W(this,Pr).runNext(this)}}},fp=new WeakMap,to=new WeakMap,Pr=new WeakMap,Yu=new WeakMap,no=new WeakSet,gl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Nn.batch(()=>{W(this,to).forEach(r=>{r.onMutationUpdate(t)}),W(this,Pr).notify({mutation:this,type:"updated",action:t})})},l$);function H$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Go,wa,dp,u$,yZ=(u$=class extends wc{constructor(t={}){super();Te(this,Go);Te(this,wa);Te(this,dp);this.config=t,Ce(this,Go,new Set),Ce(this,wa,new Map),Ce(this,dp,0)}build(t,n,r){const i=new vZ({client:t,mutationCache:this,mutationId:++jv(this,dp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,Go).add(t);const n=kv(t);if(typeof n=="string"){const r=W(this,wa).get(n);r?r.push(t):W(this,wa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Go).delete(t)){const n=kv(t);if(typeof n=="string"){const r=W(this,wa).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,wa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=kv(t);if(typeof n=="string"){const r=W(this,wa).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=kv(t);if(typeof n=="string"){const i=(r=W(this,wa).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(){Nn.batch(()=>{W(this,Go).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Go).clear(),W(this,wa).clear()})}getAll(){return Array.from(W(this,Go))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cD(n,r))}findAll(t={}){return this.getAll().filter(n=>cD(t,n))}notify(t){Nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Nn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dr))))}},Go=new WeakMap,wa=new WeakMap,dp=new WeakMap,u$);function kv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Wo,Al,ui,Qo,as,hy,G_,c$,xZ=(c$=class extends wc{constructor(n,r){super();Te(this,as);Te(this,Wo);Te(this,Al);Te(this,ui);Te(this,Qo);Ce(this,Wo,n),this.setOptions(r),this.bindMethods(),Je(this,as,hy).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,Wo).defaultMutationOptions(n),Am(this.options,r)||W(this,Wo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,ui),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ec(r.mutationKey)!==ec(this.options.mutationKey)?this.reset():((i=W(this,ui))==null?void 0:i.state.status)==="pending"&&W(this,ui).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,ui))==null||n.removeObserver(this)}onMutationUpdate(n){Je(this,as,hy).call(this),Je(this,as,G_).call(this,n)}getCurrentResult(){return W(this,Al)}reset(){var n;(n=W(this,ui))==null||n.removeObserver(this),Ce(this,ui,void 0),Je(this,as,hy).call(this),Je(this,as,G_).call(this)}mutate(n,r){var i;return Ce(this,Qo,r),(i=W(this,ui))==null||i.removeObserver(this),Ce(this,ui,W(this,Wo).getMutationCache().build(W(this,Wo),this.options)),W(this,ui).addObserver(this),W(this,ui).execute(n)}},Wo=new WeakMap,Al=new WeakMap,ui=new WeakMap,Qo=new WeakMap,as=new WeakSet,hy=function(){var r;const n=((r=W(this,ui))==null?void 0:r.state)??H$();Ce(this,Al,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},G_=function(n){Nn.batch(()=>{var r,i,a,o,l,c,f,h;if(W(this,Qo)&&this.hasListeners()){const d=W(this,Al).variables,g=W(this,Al).context,v={client:W(this,Wo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,Qo)).onSuccess)==null||i.call(r,n.data,d,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,Qo)).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,Qo)).onError)==null||c.call(l,n.error,d,g,v)}catch(b){Promise.reject(b)}try{(h=(f=W(this,Qo)).onSettled)==null||h.call(f,void 0,n.error,d,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(W(this,Al))})})},c$);function vD(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function bZ(e,t,n){const r=e.slice(0);return r[t]=n,r}var Jf,Ci,ed,td,na,Ol,hp,mp,pp,gp,kr,W_,Q_,Z_,J_,ej,f$,wZ=(f$=class extends wc{constructor(t,n,r){super();Te(this,kr);Te(this,Jf);Te(this,Ci);Te(this,ed);Te(this,td);Te(this,na);Te(this,Ol);Te(this,hp);Te(this,mp);Te(this,pp);Te(this,gp,[]);Ce(this,Jf,t),Ce(this,td,r),Ce(this,ed,[]),Ce(this,na,[]),Ce(this,Ci,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,na).forEach(t=>{t.subscribe(n=>{Je(this,kr,J_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,na).forEach(t=>{t.destroy()})}setQueries(t,n){Ce(this,ed,t),Ce(this,td,n),Nn.batch(()=>{const r=W(this,na),i=Je(this,kr,Z_).call(this,W(this,ed));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,Ci)[g];return!v||!Am(d,v)});!f&&!h||(f&&(Ce(this,gp,i),Ce(this,na,a)),Ce(this,Ci,o),this.hasListeners()&&(f&&(vD(r,a).forEach(d=>{d.destroy()}),vD(a,r).forEach(d=>{d.subscribe(g=>{Je(this,kr,J_).call(this,d,g)})})),Je(this,kr,ej).call(this)))})}getCurrentResult(){return W(this,Ci)}getQueries(){return W(this,na).map(t=>t.getCurrentQuery())}getObservers(){return W(this,na)}getOptimisticResult(t,n){const r=Je(this,kr,Z_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>Je(this,kr,Q_).call(this,o??i,n,a),()=>Je(this,kr,W_).call(this,i,r)]}},Jf=new WeakMap,Ci=new WeakMap,ed=new WeakMap,td=new WeakMap,na=new WeakMap,Ol=new WeakMap,hp=new WeakMap,mp=new WeakMap,pp=new WeakMap,gp=new WeakMap,kr=new WeakSet,W_=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)})})})},Q_=function(t,n,r){if(n){const i=W(this,pp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Ol)||W(this,Ci)!==W(this,mp)||a||n!==W(this,hp))&&(Ce(this,hp,n),Ce(this,mp,W(this,Ci)),r!==void 0&&Ce(this,pp,r),Ce(this,Ol,nk(W(this,Ol),n(t)))),W(this,Ol)}return t},Z_=function(t){const n=new Map;W(this,na).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,Jf).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new r0(W(this,Jf),a);r.push({defaultedQueryOptions:a,observer:l})}),r},J_=function(t,n){const r=W(this,na).indexOf(t);r!==-1&&(Ce(this,Ci,bZ(W(this,Ci),r,n)),Je(this,kr,ej).call(this))},ej=function(){var t;if(this.hasListeners()){const n=W(this,Ol),r=Je(this,kr,W_).call(this,W(this,Ci),W(this,gp)),i=Je(this,kr,Q_).call(this,r,(t=W(this,td))==null?void 0:t.combine);n!==i&&Nn.batch(()=>{this.listeners.forEach(a=>{a(W(this,Ci))})})}},f$),ro,d$,SZ=(d$=class extends wc{constructor(t={}){super();Te(this,ro);this.config=t,Ce(this,ro,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??tk(i,n);let o=this.get(a);return o||(o=new fZ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,ro).has(t.queryHash)||(W(this,ro).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,ro).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,ro).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Nn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,ro).get(t)}getAll(){return[...W(this,ro).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uD(t,r)):n}notify(t){Nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Nn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Nn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ro=new WeakMap,d$),kn,Nl,Tl,nd,rd,Pl,id,ad,h$,EZ=(h$=class{constructor(e={}){Te(this,kn);Te(this,Nl);Te(this,Tl);Te(this,nd);Te(this,rd);Te(this,Pl);Te(this,id);Te(this,ad);Ce(this,kn,e.queryCache||new SZ),Ce(this,Nl,e.mutationCache||new yZ),Ce(this,Tl,e.defaultOptions||{}),Ce(this,nd,new Map),Ce(this,rd,new Map),Ce(this,Pl,0)}mount(){jv(this,Pl)._++,W(this,Pl)===1&&(Ce(this,id,ak.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,kn).onFocus())})),Ce(this,ad,Ty.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,kn).onOnline())})))}unmount(){var e,t;jv(this,Pl)._--,W(this,Pl)===0&&((e=W(this,id))==null||e.call(this),Ce(this,id,void 0),(t=W(this,ad))==null||t.call(this),Ce(this,ad,void 0))}isFetching(e){return W(this,kn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Nl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,kn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,kn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Dl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,kn).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,kn).get(r.queryHash),a=i==null?void 0:i.state.data,o=eZ(t,a);if(o!==void 0)return W(this,kn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Nn.batch(()=>W(this,kn).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,kn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,kn);Nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,kn);return Nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Nn.batch(()=>W(this,kn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Dr).catch(Dr)}invalidateQueries(e,t={}){return Nn.batch(()=>(W(this,kn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Nn.batch(()=>W(this,kn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Dr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Dr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,kn).build(this,t);return n.isStaleByTime(Dl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dr).catch(Dr)}fetchInfiniteQuery(e){return e.behavior=Py(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dr).catch(Dr)}ensureInfiniteQueryData(e){return e.behavior=Py(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ty.isOnline()?W(this,Nl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,kn)}getMutationCache(){return W(this,Nl)}getDefaultOptions(){return W(this,Tl)}setDefaultOptions(e){Ce(this,Tl,e)}setQueryDefaults(e,t){W(this,nd).set(ec(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,nd).values()],n={};return t.forEach(r=>{km(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,rd).set(ec(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,rd).values()],n={};return t.forEach(r=>{km(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Tl).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tk(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===rk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Tl).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,kn).clear(),W(this,Nl).clear()}},kn=new WeakMap,Nl=new WeakMap,Tl=new WeakMap,nd=new WeakMap,rd=new WeakMap,Pl=new WeakMap,id=new WeakMap,ad=new WeakMap,h$),q$=x.createContext(void 0),pt=e=>{const t=x.useContext(q$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_Z=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(q$.Provider,{value:e,children:t})),V$=x.createContext(!1),K$=()=>x.useContext(V$);V$.Provider;function jZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var CZ=x.createContext(jZ()),Y$=()=>x.useContext(CZ),X$=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ik(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},G$=e=>{x.useEffect(()=>{e.clearReset()},[e])},W$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ik(n,[e.error,r])),Q$=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))}},kZ=(e,t)=>e.isLoading&&e.isFetching&&!t,tj=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nj=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function AZ({queries:e,...t},n){const r=pt(),i=K$(),a=Y$(),o=x.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{Q$(w);const S=r.getQueryCache().get(w.queryHash);X$(w,a,S)}),G$(a);const[l]=x.useState(()=>new wZ(r,o,t)),[c,f,h]=l.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>d?l.subscribe(Nn.batchCalls(w)):Dr,[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>tj(o[S],w))?c.flatMap((w,S)=>{const E=o[S];if(E&&tj(E,w)){const C=new r0(r,E);return nj(E,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const E=o[S];return E&&W$({result:w,errorResetBoundary:a,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(b!=null&&b.error)throw b.error;return f(h())}function Z$(e,t,n){var g,v,b,w;const r=K$(),i=Y$(),a=pt(),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",Q$(o),X$(o,i,l),G$(i);const c=!a.getQueryCache().get(o.queryHash),[f]=x.useState(()=>new t(a,o)),h=f.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(S=>{const E=d?f.subscribe(Nn.batchCalls(S)):Dr;return f.updateResult(),E},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),tj(o,h))throw nj(o,f,i);if(W$({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&&!Ju&&kZ(h,r)){const S=c?nj(o,f,i):l==null?void 0:l.promise;S==null||S.catch(Dr).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?h:f.trackResult(h)}function zn(e,t){return Z$(e,r0)}function It(e,t){const n=pt(),[r]=x.useState(()=>new xZ(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(Nn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,l)=>{r.mutate(o,l).catch(Dr)},[r]);if(i.error&&ik(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function OZ(e,t){return Z$(e,gZ)}var NZ=(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(E=>a[E]||E):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{}},yD=["light","dark"],J$="(prefers-color-scheme: dark)",TZ=typeof window>"u",sk=x.createContext(void 0),PZ={setTheme:e=>{},themes:[]},lk=()=>{var e;return(e=x.useContext(sk))!=null?e:PZ},MZ=e=>x.useContext(sk)?x.createElement(x.Fragment,null,e.children):x.createElement(RZ,{...e}),DZ=["light","dark"],RZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=DZ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:f,nonce:h,scriptProps:d})=>{let[g,v]=x.useState(()=>LZ(i,o)),[b,w]=x.useState(()=>g==="system"?sS():g),S=c?Object.values(c):a,E=x.useCallback(N=>{let O=N;if(!O)return;N==="system"&&n&&(O=sS());let T=c?c[O]:O,M=t?zZ(h):null,I=document.documentElement,z=B=>{B==="class"?(I.classList.remove(...S),T&&I.classList.add(T)):B.startsWith("data-")&&(T?I.setAttribute(B,T):I.removeAttribute(B))};if(Array.isArray(l)?l.forEach(z):z(l),r){let B=yD.includes(o)?o:null,L=yD.includes(O)?O:B;I.style.colorScheme=L}M==null||M()},[h]),C=x.useCallback(N=>{let O=typeof N=="function"?N(g):N;v(O);try{localStorage.setItem(i,O)}catch{}},[g]),j=x.useCallback(N=>{let O=sS(N);w(O),g==="system"&&n&&!e&&E("system")},[g,e]);x.useEffect(()=>{let N=window.matchMedia(J$);return N.addListener(j),j(N),()=>N.removeListener(j)},[j]),x.useEffect(()=>{let N=O=>{O.key===i&&(O.newValue?v(O.newValue):C(o))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[C]),x.useEffect(()=>{E(e??g)},[e,g]);let A=x.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 x.createElement(sk.Provider,{value:A},x.createElement(IZ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:h,scriptProps:d}),f)},IZ=x.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 x.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${NZ.toString()})(${h})`}})}),LZ=(e,t)=>{if(TZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},zZ=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(J$)),e.matches?"dark":"light");function xD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ss(...e){return t=>{let n=!1;const r=e.map(i=>{const a=xD(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():xD(e[i],null)}}}}function yt(...e){return x.useCallback(ss(...e),e)}function tc(e){const t=$Z(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,l=x.Children.toArray(a),c=l.find(FZ);if(c){const f=c.props.children,h=l.map(d=>d===c?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:d);return m.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,h):null})}return m.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var uk=tc("Slot");function $Z(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=HZ(i),l=UZ(a,i.props);return i.type!==x.Fragment&&(l.ref=r?ss(r,o):o),x.cloneElement(i,l)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eB=Symbol("radix.slottable");function BZ(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eB,t}function FZ(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eB}function UZ(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 HZ(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 qZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=qZ.reduce((e,t)=>{const n=tc(`Primitive.${t}`),r=x.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 tB(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}var nB=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"}),VZ="VisuallyHidden",rB=x.forwardRef((e,t)=>m.jsx(Fe.span,{...e,ref:t,style:{...nB,...e.style}}));rB.displayName=VZ;var KZ=rB;function YZ(e,t){const n=x.createContext(t),r=a=>{const{children:o,...l}=a,c=x.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=x.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 Fa(e,t=[]){let n=[];function r(a,o){const l=x.createContext(o),c=n.length;n=[...n,o];const f=d=>{var E;const{scope:g,children:v,...b}=d,w=((E=g==null?void 0:g[e])==null?void 0:E[c])||l,S=x.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=x.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=>x.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,XZ(i,...t)]}function XZ(...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 x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function ck(e){const t=e+"CollectionProvider",[n,r]=Fa(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:E}=w,C=_e.useRef(null),j=_e.useRef(new Map).current;return m.jsx(i,{scope:S,itemMap:j,collectionRef:C,children:E})};o.displayName=t;const l=e+"CollectionSlot",c=tc(l),f=_e.forwardRef((w,S)=>{const{scope:E,children:C}=w,j=a(l,E),A=yt(S,j.collectionRef);return m.jsx(c,{ref:A,children:C})});f.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",g=tc(h),v=_e.forwardRef((w,S)=>{const{scope:E,children:C,...j}=w,A=_e.useRef(null),N=yt(S,A),O=a(h,E);return _e.useEffect(()=>(O.itemMap.set(A,{ref:A,...j}),()=>void O.itemMap.delete(A))),m.jsx(g,{[d]:"",ref:N,children:C})});v.displayName=h;function b(w){const S=a(e+"CollectionConsumer",w);return _e.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const j=Array.from(C.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((O,T)=>j.indexOf(O.ref.current)-j.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 vr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},GZ=XC[" useInsertionEffect ".trim().toString()]||vr;function zl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=WZ({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const h=x.useRef(e!==void 0);x.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=x.useCallback(h=>{var d;if(l){const g=QZ(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 WZ({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return GZ(()=>{a.current=t},[t]),x.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function QZ(e){return typeof e=="function"}function ZZ(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=JZ(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=yt(r.ref,eJ(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};$r.displayName="Presence";function JZ(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[l,c]=ZZ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Av(r.current);a.current=l==="mounted"?f:"none"},[l]),vr(()=>{const f=r.current,h=i.current;if(h!==e){const g=a.current,v=Av(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]),vr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,d=v=>{const w=Av(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=Av(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:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Av(e){return(e==null?void 0:e.animationName)||"none"}function eJ(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 tJ=XC[" useId ".trim().toString()]||(()=>{}),nJ=0;function gr(e){const[t,n]=x.useState(tJ());return vr(()=>{n(r=>r??String(nJ++))},[e]),e||(t?`radix-${t}`:"")}var i0="Collapsible",[rJ]=Fa(i0),[iJ,fk]=rJ(i0),iB=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,f]=zl({prop:r,defaultProp:i??!1,onChange:o,caller:i0});return m.jsx(iJ,{scope:n,disabled:a,contentId:gr(),open:c,onOpenToggle:x.useCallback(()=>f(h=>!h),[f]),children:m.jsx(Fe.div,{"data-state":hk(c),"data-disabled":a?"":void 0,...l,ref:t})})});iB.displayName=i0;var aB="CollapsibleTrigger",oB=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=fk(aB,n);return m.jsx(Fe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":hk(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ae(e.onClick,i.onOpenToggle)})});oB.displayName=aB;var dk="CollapsibleContent",sB=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fk(dk,e.__scopeCollapsible);return m.jsx($r,{present:n||i.open,children:({present:a})=>m.jsx(aJ,{...r,ref:t,present:a})})});sB.displayName=dk;var aJ=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=fk(dk,n),[l,c]=x.useState(r),f=x.useRef(null),h=yt(t,f),d=x.useRef(0),g=d.current,v=x.useRef(0),b=v.current,w=o.open||l,S=x.useRef(w),E=x.useRef(void 0);return x.useEffect(()=>{const C=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(C)},[]),vr(()=>{const C=f.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const j=C.getBoundingClientRect();d.current=j.height,v.current=j.width,S.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),c(r)}},[o.open,r]),m.jsx(Fe.div,{"data-state":hk(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 hk(e){return e?"open":"closed"}var oJ=iB,sJ=x.createContext(void 0);function bp(e){const t=x.useContext(sJ);return e||t||"ltr"}function Cr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lJ(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e);x.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 uJ="DismissableLayer",rj="dismissableLayer.update",cJ="dismissableLayer.pointerDownOutside",fJ="dismissableLayer.focusOutside",bD,lB=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wp=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,f=x.useContext(lB),[h,d]=x.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=x.useState({}),b=yt(t,T=>d(T)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),C=h?w.indexOf(h):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,A=C>=E,N=mJ(T=>{const M=T.target,I=[...f.branches].some(z=>z.contains(M));!A||I||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),O=pJ(T=>{const M=T.target;[...f.branches].some(z=>z.contains(M))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return lJ(T=>{C===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),x.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(bD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),wD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=bD)}},[h,g,n,f]),x.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),wD())},[h,f]),x.useEffect(()=>{const T=()=>v({});return document.addEventListener(rj,T),()=>document.removeEventListener(rj,T)},[]),m.jsx(Fe.div,{...c,ref:b,style:{pointerEvents:j?A?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,N.onPointerDownCapture)})});wp.displayName=uJ;var dJ="DismissableLayerBranch",hJ=x.forwardRef((e,t)=>{const n=x.useContext(lB),r=x.useRef(null),i=yt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(Fe.div,{...e,ref:i})});hJ.displayName=dJ;function mJ(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){uB(cJ,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 pJ(e,t=globalThis==null?void 0:globalThis.document){const n=Cr(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&uB(fJ,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 wD(){const e=new CustomEvent(rj);document.dispatchEvent(e)}function uB(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?tB(i,a):i.dispatchEvent(a)}var lS="focusScope.autoFocusOnMount",uS="focusScope.autoFocusOnUnmount",SD={bubbles:!1,cancelable:!0},gJ="FocusScope",a0=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=x.useState(null),f=Cr(i),h=Cr(a),d=x.useRef(null),g=yt(t,w=>c(w)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(j){if(v.paused||!l)return;const A=j.target;l.contains(A)?d.current=A:vl(d.current,{select:!0})},S=function(j){if(v.paused||!l)return;const A=j.relatedTarget;A!==null&&(l.contains(A)||vl(d.current,{select:!0}))},E=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&vl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const C=new MutationObserver(E);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),C.disconnect()}}},[r,l,v.paused]),x.useEffect(()=>{if(l){_D.add(v);const w=document.activeElement;if(!l.contains(w)){const E=new CustomEvent(lS,SD);l.addEventListener(lS,f),l.dispatchEvent(E),E.defaultPrevented||(vJ(SJ(cB(l)),{select:!0}),document.activeElement===w&&vl(l))}return()=>{l.removeEventListener(lS,f),setTimeout(()=>{const E=new CustomEvent(uS,SD);l.addEventListener(uS,h),l.dispatchEvent(E),E.defaultPrevented||vl(w??document.body,{select:!0}),l.removeEventListener(uS,h),_D.remove(v)},0)}}},[l,f,h,v]);const b=x.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(S&&E){const C=w.currentTarget,[j,A]=yJ(C);j&&A?!w.shiftKey&&E===A?(w.preventDefault(),n&&vl(j,{select:!0})):w.shiftKey&&E===j&&(w.preventDefault(),n&&vl(A,{select:!0})):E===C&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Fe.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});a0.displayName=gJ;function vJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vl(r,{select:t}),document.activeElement!==n)return}function yJ(e){const t=cB(e),n=ED(t,e),r=ED(t.reverse(),e);return[n,r]}function cB(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 ED(e,t){for(const n of e)if(!xJ(n,{upTo:t}))return n}function xJ(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 bJ(e){return e instanceof HTMLInputElement&&"select"in e}function vl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bJ(e)&&t&&e.select()}}var _D=wJ();function wJ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jD(e,t),e.unshift(t)},remove(t){var n;e=jD(e,t),(n=e[0])==null||n.resume()}}}function jD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function SJ(e){return e.filter(t=>t.tagName!=="A")}var EJ="Portal",Sp=x.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=x.useState(!1);vr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?D$.createPortal(m.jsx(Fe.div,{...r,ref:t}),o):null});Sp.displayName=EJ;var cS=0;function mk(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??CD()),document.body.insertAdjacentElement("beforeend",e[1]??CD()),cS++,()=>{cS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cS--}},[])}function CD(){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 ao=function(){return ao=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},ao.apply(this,arguments)};function fB(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 _J(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 my="right-scroll-bar-position",py="width-before-scroll-bar",jJ="with-scroll-bars-hidden",CJ="--removed-body-scroll-bar-size";function fS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kJ(e,t){var n=x.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 AJ=typeof window<"u"?x.useLayoutEffect:x.useEffect,kD=new WeakMap;function OJ(e,t){var n=kJ(null,function(r){return e.forEach(function(i){return fS(i,r)})});return AJ(function(){var r=kD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||fS(l,null)}),a.forEach(function(l){i.has(l)||fS(l,o)})}kD.set(n,e)},[e]),n}function NJ(e){return e}function TJ(e,t){t===void 0&&(t=NJ);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 PJ(e){e===void 0&&(e={});var t=TJ(null);return t.options=ao({async:!0,ssr:!1},e),t}var dB=function(e){var t=e.sideCar,n=fB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ao({},n))};dB.isSideCarExport=!0;function MJ(e,t){return e.useMedium(t),dB}var hB=PJ(),dS=function(){},o0=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:dS,onWheelCapture:dS,onTouchMoveCapture:dS}),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,E=e.as,C=E===void 0?"div":E,j=e.gapMode,A=fB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=g,O=OJ([n,t]),T=ao(ao({},A),i);return x.createElement(x.Fragment,null,h&&x.createElement(N,{sideCar:hB,removeScrollBar:f,shards:d,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:j}),o?x.cloneElement(x.Children.only(l),ao(ao({},T),{ref:O})):x.createElement(C,ao({},T,{className:c,ref:O}),l))});o0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};o0.classNames={fullWidth:py,zeroRight:my};var DJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RJ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DJ();return t&&e.setAttribute("nonce",t),e}function IJ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function LJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=RJ())&&(IJ(t,n),LJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$J=function(){var e=zJ();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mB=function(){var e=$J(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},BJ={left:0,top:0,right:0,gap:0},hS=function(e){return parseInt(e||"",10)||0},FJ=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[hS(n),hS(r),hS(i)]},UJ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BJ;var t=FJ(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])}},HJ=mB(),Rf="data-scroll-locked",qJ=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(jJ,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Rf,`] {
    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(my,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(py,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(my," .").concat(my,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(py," .").concat(py,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Rf,`] {
    `).concat(CJ,": ").concat(l,`px;
  }
`)},AD=function(){var e=parseInt(document.body.getAttribute(Rf)||"0",10);return isFinite(e)?e:0},VJ=function(){x.useEffect(function(){return document.body.setAttribute(Rf,(AD()+1).toString()),function(){var e=AD()-1;e<=0?document.body.removeAttribute(Rf):document.body.setAttribute(Rf,e.toString())}},[])},KJ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;VJ();var a=x.useMemo(function(){return UJ(i)},[i]);return x.createElement(HJ,{styles:qJ(a,!t,i,n?"":"!important")})},ij=!1;if(typeof window<"u")try{var Ov=Object.defineProperty({},"passive",{get:function(){return ij=!0,!0}});window.addEventListener("test",Ov,Ov),window.removeEventListener("test",Ov,Ov)}catch{ij=!1}var hf=ij?{passive:!1}:!1,YJ=function(e){return e.tagName==="TEXTAREA"},pB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YJ(e)&&n[t]==="visible")},XJ=function(e){return pB(e,"overflowY")},GJ=function(e){return pB(e,"overflowX")},OD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gB(e,r);if(i){var a=vB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WJ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},QJ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gB=function(e,t){return e==="v"?XJ(t):GJ(t)},vB=function(e,t){return e==="v"?WJ(t):QJ(t)},ZJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},JJ=function(e,t,n,r,i){var a=ZJ(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=vB(e,l),b=v[0],w=v[1],S=v[2],E=w-S-a*b;(b||E)&&gB(e,l)&&(d+=E,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},Nv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ND=function(e){return[e.deltaX,e.deltaY]},TD=function(e){return e&&"current"in e?e.current:e},eee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tee=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},nee=0,mf=[];function ree(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(nee++)[0],a=x.useState(mB)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=_J([e.lockRef.current],(e.shards||[]).map(TD),!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=x.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var E=Nv(w),C=n.current,j="deltaX"in w?w.deltaX:C[0]-E[0],A="deltaY"in w?w.deltaY:C[1]-E[1],N,O=w.target,T=Math.abs(j)>Math.abs(A)?"h":"v";if("touches"in w&&T==="h"&&O.type==="range")return!1;var M=window.getSelection(),I=M&&M.anchorNode,z=I?I===O||I.contains(O):!1;if(z)return!1;var B=OD(T,O);if(!B)return!0;if(B?N=T:(N=T==="v"?"h":"v",B=OD(T,O)),!B)return!1;if(!r.current&&"changedTouches"in w&&(j||A)&&(r.current=N),!N)return!0;var L=r.current||N;return JJ(L,S,w,L==="h"?j:A)},[]),c=x.useCallback(function(w){var S=w;if(!(!mf.length||mf[mf.length-1]!==a)){var E="deltaY"in S?ND(S):Nv(S),C=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&eee(N.delta,E)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var j=(o.current.shards||[]).map(TD).filter(Boolean).filter(function(N){return N.contains(S.target)}),A=j.length>0?l(S,j[0]):!o.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),f=x.useCallback(function(w,S,E,C){var j={name:w,delta:S,target:E,should:C,shadowParent:iee(E)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(A){return A!==j})},1)},[]),h=x.useCallback(function(w){n.current=Nv(w),r.current=void 0},[]),d=x.useCallback(function(w){f(w.type,ND(w),w.target,l(w,e.lockRef.current))},[]),g=x.useCallback(function(w){f(w.type,Nv(w),w.target,l(w,e.lockRef.current))},[]);x.useEffect(function(){return mf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",c,hf),document.addEventListener("touchmove",c,hf),document.addEventListener("touchstart",h,hf),function(){mf=mf.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,hf),document.removeEventListener("touchmove",c,hf),document.removeEventListener("touchstart",h,hf)}},[]);var v=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(a,{styles:tee(i)}):null,v?x.createElement(KJ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aee=MJ(hB,ree);var s0=x.forwardRef(function(e,t){return x.createElement(o0,ao({},e,{ref:t,sideCar:aee}))});s0.classNames=o0.classNames;var oee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pf=new WeakMap,Tv=new WeakMap,Pv={},mS=0,yB=function(e){return e&&(e.host||yB(e.parentNode))},see=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yB(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})},lee=function(e,t,n,r){var i=see(t,Array.isArray(e)?e:[e]);Pv[n]||(Pv[n]=new WeakMap);var a=Pv[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=(pf.get(g)||0)+1,S=(a.get(g)||0)+1;pf.set(g,w),a.set(g,S),o.push(g),w===1&&b&&Tv.set(g,!0),S===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return h(t),l.clear(),mS++,function(){o.forEach(function(d){var g=pf.get(d)-1,v=a.get(d)-1;pf.set(d,g),a.set(d,v),g||(Tv.has(d)||d.removeAttribute(r),Tv.delete(d)),v||d.removeAttribute(n)}),mS--,mS||(pf=new WeakMap,pf=new WeakMap,Tv=new WeakMap,Pv={})}},pk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=oee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),lee(r,i,n,"aria-hidden")):function(){return null}},l0="Dialog",[xB]=Fa(l0),[uee,Ua]=xB(l0),bB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=x.useRef(null),c=x.useRef(null),[f,h]=zl({prop:r,defaultProp:i??!1,onChange:a,caller:l0});return m.jsx(uee,{scope:t,triggerRef:l,contentRef:c,contentId:gr(),titleId:gr(),descriptionId:gr(),open:f,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};bB.displayName=l0;var wB="DialogTrigger",cee=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(wB,n),a=yt(t,i.triggerRef);return m.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":yk(i.open),...r,ref:a,onClick:Ae(e.onClick,i.onOpenToggle)})});cee.displayName=wB;var gk="DialogPortal",[fee,SB]=xB(gk,{forceMount:void 0}),EB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ua(gk,t);return m.jsx(fee,{scope:t,forceMount:n,children:x.Children.map(r,o=>m.jsx($r,{present:n||a.open,children:m.jsx(Sp,{asChild:!0,container:i,children:o})}))})};EB.displayName=gk;var My="DialogOverlay",_B=x.forwardRef((e,t)=>{const n=SB(My,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ua(My,e.__scopeDialog);return a.modal?m.jsx($r,{present:r||a.open,children:m.jsx(hee,{...i,ref:t})}):null});_B.displayName=My;var dee=tc("DialogOverlay.RemoveScroll"),hee=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(My,n);return m.jsx(s0,{as:dee,allowPinchZoom:!0,shards:[i.contentRef],children:m.jsx(Fe.div,{"data-state":yk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),nc="DialogContent",jB=x.forwardRef((e,t)=>{const n=SB(nc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ua(nc,e.__scopeDialog);return m.jsx($r,{present:r||a.open,children:a.modal?m.jsx(mee,{...i,ref:t}):m.jsx(pee,{...i,ref:t})})});jB.displayName=nc;var mee=x.forwardRef((e,t)=>{const n=Ua(nc,e.__scopeDialog),r=x.useRef(null),i=yt(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return pk(a)},[]),m.jsx(CB,{...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())})}),pee=x.forwardRef((e,t)=>{const n=Ua(nc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return m.jsx(CB,{...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()}})}),CB=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Ua(nc,n),c=x.useRef(null),f=yt(t,c);return mk(),m.jsxs(m.Fragment,{children:[m.jsx(a0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(wp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yk(l.open),...o,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(gee,{titleId:l.titleId}),m.jsx(yee,{contentRef:c,descriptionId:l.descriptionId})]})]})}),vk="DialogTitle",kB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(vk,n);return m.jsx(Fe.h2,{id:i.titleId,...r,ref:t})});kB.displayName=vk;var AB="DialogDescription",OB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(AB,n);return m.jsx(Fe.p,{id:i.descriptionId,...r,ref:t})});OB.displayName=AB;var NB="DialogClose",TB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(NB,n);return m.jsx(Fe.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>i.onOpenChange(!1))})});TB.displayName=NB;function yk(e){return e?"open":"closed"}var PB="DialogTitleWarning",[Z4e,MB]=YZ(PB,{contentName:nc,titleName:vk,docsSlug:"dialog"}),gee=({titleId:e})=>{const t=MB(PB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

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

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vee="DialogDescriptionWarning",yee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MB(vee).contentName}}.`;return x.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},xk=bB,bk=EB,wk=_B,Sk=jB,DB=kB,RB=OB,Ek=TB,pS={exports:{}},gS={};/**
 * @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 PD;function xee(){if(PD)return gS;PD=1;var e=kd();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 gS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,gS}var MD;function bee(){return MD||(MD=1,pS.exports=xee()),pS.exports}function wee(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function See(e){const[t,n]=x.useState(void 0);return vr(()=>{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 Eee=["top","right","bottom","left"],$l=Math.min,ki=Math.max,Dy=Math.round,Mv=Math.floor,co=e=>({x:e,y:e}),_ee={left:"right",right:"left",bottom:"top",top:"bottom"};function aj(e,t,n){return ki(e,$l(t,n))}function ls(e,t){return typeof e=="function"?e(t):e}function us(e){return e.split("-")[0]}function Td(e){return e.split("-")[1]}function _k(e){return e==="x"?"y":"x"}function jk(e){return e==="y"?"height":"width"}function oo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ck(e){return _k(oo(e))}function jee(e,t,n){n===void 0&&(n=!1);const r=Td(e),i=Ck(e),a=jk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Ry(o)),[o,Ry(o)]}function Cee(e){const t=Ry(e);return[oj(e),t,oj(t)]}function oj(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const DD=["left","right"],RD=["right","left"],kee=["top","bottom"],Aee=["bottom","top"];function Oee(e,t,n){switch(e){case"top":case"bottom":return n?t?RD:DD:t?DD:RD;case"left":case"right":return t?kee:Aee;default:return[]}}function Nee(e,t,n,r){const i=Td(e);let a=Oee(us(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(oj)))),a}function Ry(e){const t=us(e);return _ee[t]+e.slice(t.length)}function Tee(e){return{top:0,right:0,bottom:0,left:0,...e}}function IB(e){return typeof e!="number"?Tee(e):{top:e,right:e,bottom:e,left:e}}function Iy(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 ID(e,t,n){let{reference:r,floating:i}=e;const a=oo(t),o=Ck(t),l=jk(o),c=us(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(Td(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 Pee(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}=ls(t,e),b=IB(v),S=l[g?d==="floating"?"reference":"floating":d],E=Iy(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,j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),A=await(a.isElement==null?void 0:a.isElement(j))?await(a.getScale==null?void 0:a.getScale(j))||{x:1,y:1}:{x:1,y:1},N=Iy(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:j,strategy:c}):C);return{top:(E.top-N.top+b.top)/A.y,bottom:(N.bottom-E.bottom+b.bottom)/A.y,left:(E.left-N.left+b.left)/A.x,right:(N.right-E.right+b.right)/A.x}}const Mee=50,Dee=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Pee},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}=ID(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:E,fn:C}=S,{x:j,y:A,data:N,reset:O}=await C({x:h,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:f,platform:l,elements:{reference:e,floating:t}});h=j??h,d=A??d,b[E]={...b[E],...N},O&&v<Mee&&(v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:h,y:d}=ID(f,g,c)),w=-1)}return{x:h,y:d,placement:g,strategy:i,middlewareData:b}},Ree=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}=ls(e,t)||{};if(f==null)return{};const d=IB(h),g={x:n,y:r},v=Ck(i),b=jk(v),w=await o.getDimensions(f),S=v==="y",E=S?"top":"left",C=S?"bottom":"right",j=S?"clientHeight":"clientWidth",A=a.reference[b]+a.reference[v]-g[v]-a.floating[b],N=g[v]-a.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=O?O[j]:0;(!T||!await(o.isElement==null?void 0:o.isElement(O)))&&(T=l.floating[j]||a.floating[b]);const M=A/2-N/2,I=T/2-w[b]/2-1,z=$l(d[E],I),B=$l(d[C],I),L=z,G=T-w[b]-B,F=T/2-w[b]/2+M,K=aj(L,F,G),D=!c.arrow&&Td(i)!=null&&F!==K&&a.reference[b]/2-(F<L?z:B)-w[b]/2<0,q=D?F<L?F-L:F-G:0;return{[v]:g[v]+q,data:{[v]:K,centerOffset:F-K-q,...D&&{alignmentOffset:q}},reset:D}}}),Iee=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}=ls(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const E=us(i),C=oo(l),j=us(l)===l,A=await(c.isRTL==null?void 0:c.isRTL(f.floating)),N=g||(j||!w?[Ry(l)]:Cee(l)),O=b!=="none";!g&&O&&N.push(...Nee(l,w,b,A));const T=[l,...N],M=await c.detectOverflow(t,S),I=[];let z=((r=a.flip)==null?void 0:r.overflows)||[];if(h&&I.push(M[E]),d){const F=jee(i,o,A);I.push(M[F[0]],M[F[1]])}if(z=[...z,{placement:i,overflows:I}],!I.every(F=>F<=0)){var B,L;const F=(((B=a.flip)==null?void 0:B.index)||0)+1,K=T[F];if(K&&(!(d==="alignment"?C!==oo(K):!1)||z.every(X=>oo(X.placement)===C?X.overflows[0]>0:!0)))return{data:{index:F,overflows:z},reset:{placement:K}};let D=(L=z.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:L.placement;if(!D)switch(v){case"bestFit":{var G;const q=(G=z.filter(X=>{if(O){const V=oo(X.placement);return V===C||V==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(V=>V>0).reduce((V,R)=>V+R,0)]).sort((X,V)=>X[1]-V[1])[0])==null?void 0:G[0];q&&(D=q);break}case"initialPlacement":D=l;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function LD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zD(e){return Eee.some(t=>e[t]>=0)}const Lee=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=ls(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=LD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:zD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=LD(o,n.floating);return{data:{escapedOffsets:l,escaped:zD(l)}}}default:return{}}}}},LB=new Set(["left","top"]);async function zee(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=us(n),l=Td(n),c=oo(n)==="y",f=LB.has(o)?-1:1,h=a&&c?-1:1,d=ls(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 $ee=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 zee(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}}}}},Bee=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:E=>{let{x:C,y:j}=E;return{x:C,y:j}}},...f}=ls(e,t),h={x:n,y:r},d=await a.detectOverflow(t,f),g=oo(us(i)),v=_k(g);let b=h[v],w=h[g];if(o){const E=v==="y"?"top":"left",C=v==="y"?"bottom":"right",j=b+d[E],A=b-d[C];b=aj(j,b,A)}if(l){const E=g==="y"?"top":"left",C=g==="y"?"bottom":"right",j=w+d[E],A=w-d[C];w=aj(j,w,A)}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}}}}}},Fee=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}=ls(e,t),h={x:n,y:r},d=oo(i),g=_k(d);let v=h[g],b=h[d];const w=ls(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const j=g==="y"?"height":"width",A=a.reference[g]-a.floating[j]+S.mainAxis,N=a.reference[g]+a.reference[j]-S.mainAxis;v<A?v=A:v>N&&(v=N)}if(f){var E,C;const j=g==="y"?"width":"height",A=LB.has(us(i)),N=a.reference[d]-a.floating[j]+(A&&((E=o.offset)==null?void 0:E[d])||0)+(A?0:S.crossAxis),O=a.reference[d]+a.reference[j]+(A?0:((C=o.offset)==null?void 0:C[d])||0)-(A?S.crossAxis:0);b<N?b=N:b>O&&(b=O)}return{[g]:v,[d]:b}}}},Uee=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}=ls(e,t),h=await o.detectOverflow(t,f),d=us(i),g=Td(i),v=oo(i)==="y",{width:b,height:w}=a.floating;let S,E;d==="top"||d==="bottom"?(S=d,E=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(E=d,S=g==="end"?"top":"bottom");const C=w-h.top-h.bottom,j=b-h.left-h.right,A=$l(w-h[S],C),N=$l(b-h[E],j),O=!t.middlewareData.shift;let T=A,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),O&&!g){const z=ki(h.left,0),B=ki(h.right,0),L=ki(h.top,0),G=ki(h.bottom,0);v?M=b-2*(z!==0||B!==0?z+B:ki(h.left,h.right)):T=w-2*(L!==0||G!==0?L+G:ki(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:T});const I=await o.getDimensions(l.floating);return b!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};function u0(){return typeof window<"u"}function Pd(e){return zB(e)?(e.nodeName||"").toLowerCase():"#document"}function Mi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wo(e){var t;return(t=(zB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zB(e){return u0()?e instanceof Node||e instanceof Mi(e).Node:!1}function Pa(e){return u0()?e instanceof Element||e instanceof Mi(e).Element:!1}function xs(e){return u0()?e instanceof HTMLElement||e instanceof Mi(e).HTMLElement:!1}function $D(e){return!u0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mi(e).ShadowRoot}function Ep(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ma(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Hee(e){return/^(table|td|th)$/.test(Pd(e))}function c0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const qee=/transform|translate|scale|rotate|perspective|filter/,Vee=/paint|layout|strict|content/,Su=e=>!!e&&e!=="none";let vS;function kk(e){const t=Pa(e)?Ma(e):e;return Su(t.transform)||Su(t.translate)||Su(t.scale)||Su(t.rotate)||Su(t.perspective)||!Ak()&&(Su(t.backdropFilter)||Su(t.filter))||qee.test(t.willChange||"")||Vee.test(t.contain||"")}function Kee(e){let t=Bl(e);for(;xs(t)&&!od(t);){if(kk(t))return t;if(c0(t))return null;t=Bl(t)}return null}function Ak(){return vS==null&&(vS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vS}function od(e){return/^(html|body|#document)$/.test(Pd(e))}function Ma(e){return Mi(e).getComputedStyle(e)}function f0(e){return Pa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bl(e){if(Pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$D(e)&&e.host||wo(e);return $D(t)?t.host:t}function $B(e){const t=Bl(e);return od(t)?e.ownerDocument?e.ownerDocument.body:e.body:xs(t)&&Ep(t)?t:$B(t)}function Om(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$B(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Mi(i);if(a){const l=sj(o);return t.concat(o,o.visualViewport||[],Ep(i)?i:[],l&&n?Om(l):[])}else return t.concat(i,Om(i,[],n))}function sj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BB(e){const t=Ma(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Dy(n)!==a||Dy(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Ok(e){return Pa(e)?e:e.contextElement}function If(e){const t=Ok(e);if(!xs(t))return co(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=BB(t);let o=(a?Dy(n.width):n.width)/r,l=(a?Dy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Yee=co(0);function FB(e){const t=Mi(e);return!Ak()||!t.visualViewport?Yee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mi(e)?!1:t}function rc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Ok(e);let o=co(1);t&&(r?Pa(r)&&(o=If(r)):o=If(e));const l=Xee(a,n,r)?FB(a):co(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=Mi(a),v=r&&Pa(r)?Mi(r):r;let b=g,w=sj(b);for(;w&&r&&v!==b;){const S=If(w),E=w.getBoundingClientRect(),C=Ma(w),j=E.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,A=E.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,f*=S.y,h*=S.x,d*=S.y,c+=j,f+=A,b=Mi(w),w=sj(b)}}return Iy({width:h,height:d,x:c,y:f})}function d0(e,t){const n=f0(e).scrollLeft;return t?t.left+n:rc(wo(e)).left+n}function UB(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-d0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Gee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=wo(r),l=t?c0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},f=co(1);const h=co(0),d=xs(r);if((d||!d&&!a)&&((Pd(r)!=="body"||Ep(o))&&(c=f0(r)),d)){const v=rc(r);f=If(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const g=o&&!d&&!a?UB(o,c):co(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 Wee(e){return Array.from(e.getClientRects())}function Qee(e){const t=wo(e),n=f0(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+d0(e);const l=-n.scrollTop;return Ma(r).direction==="rtl"&&(o+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const BD=25;function Zee(e,t){const n=Mi(e),r=wo(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=Ak();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const f=d0(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<=BD&&(a-=b)}else f<=BD&&(a+=f);return{width:a,height:o,x:l,y:c}}function Jee(e,t){const n=rc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xs(e)?If(e):co(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 FD(e,t,n){let r;if(t==="viewport")r=Zee(e,n);else if(t==="document")r=Qee(wo(e));else if(Pa(t))r=Jee(t,n);else{const i=FB(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Iy(r)}function HB(e,t){const n=Bl(e);return n===t||!Pa(n)||od(n)?!1:Ma(n).position==="fixed"||HB(n,t)}function ete(e,t){const n=t.get(e);if(n)return n;let r=Om(e,[],!1).filter(l=>Pa(l)&&Pd(l)!=="body"),i=null;const a=Ma(e).position==="fixed";let o=a?Bl(e):e;for(;Pa(o)&&!od(o);){const l=Ma(o),c=kk(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Ep(o)&&!c&&HB(e,o))?r=r.filter(h=>h!==o):i=l,o=Bl(o)}return t.set(e,r),r}function tte(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?c0(t)?[]:ete(t,this._c):[].concat(n),r],l=FD(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=FD(t,o[g],i);c=ki(v.top,c),f=$l(v.right,f),h=$l(v.bottom,h),d=ki(v.left,d)}return{width:f-d,height:h-c,x:d,y:c}}function nte(e){const{width:t,height:n}=BB(e);return{width:t,height:n}}function rte(e,t,n){const r=xs(t),i=wo(t),a=n==="fixed",o=rc(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=co(0);function f(){c.x=d0(i)}if(r||!r&&!a)if((Pd(t)!=="body"||Ep(i))&&(l=f0(t)),r){const v=rc(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?UB(i,l):co(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 yS(e){return Ma(e).position==="static"}function UD(e,t){if(!xs(e)||Ma(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wo(e)===n&&(n=n.ownerDocument.body),n}function qB(e,t){const n=Mi(e);if(c0(e))return n;if(!xs(e)){let i=Bl(e);for(;i&&!od(i);){if(Pa(i)&&!yS(i))return i;i=Bl(i)}return n}let r=UD(e,t);for(;r&&Hee(r)&&yS(r);)r=UD(r,t);return r&&od(r)&&yS(r)&&!kk(r)?n:r||Kee(e)||n}const ite=async function(e){const t=this.getOffsetParent||qB,n=this.getDimensions,r=await n(e.floating);return{reference:rte(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ate(e){return Ma(e).direction==="rtl"}const ote={convertOffsetParentRelativeRectToViewportRelativeRect:Gee,getDocumentElement:wo,getClippingRect:tte,getOffsetParent:qB,getElementRects:ite,getClientRects:Wee,getDimensions:nte,getScale:If,isElement:Pa,isRTL:ate};function VB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ste(e,t){let n=null,r;const i=wo(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=Mv(d),w=Mv(i.clientWidth-(h+g)),S=Mv(i.clientHeight-(d+v)),E=Mv(h),j={rootMargin:-b+"px "+-w+"px "+-S+"px "+-E+"px",threshold:ki(0,$l(1,c))||1};let A=!0;function N(O){const T=O[0].intersectionRatio;if(T!==c){if(!A)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!VB(f,e.getBoundingClientRect())&&o(),A=!1}try{n=new IntersectionObserver(N,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,j)}n.observe(e)}return o(!0),a}function lte(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=Ok(e),h=i||a?[...f?Om(f):[],...t?Om(t):[]]:[];h.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),a&&E.addEventListener("resize",n)});const d=f&&l?ste(f,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(E=>{let[C]=E;C&&C.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var j;(j=v)==null||j.observe(t)})),n()}),f&&!c&&v.observe(f),t&&v.observe(t));let b,w=c?rc(e):null;c&&S();function S(){const E=rc(e);w&&!VB(w,E)&&n(),w=E,b=requestAnimationFrame(S)}return n(),()=>{var E;h.forEach(C=>{i&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),d==null||d(),(E=v)==null||E.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const ute=$ee,cte=Bee,fte=Iee,dte=Uee,hte=Lee,HD=Ree,mte=Fee,pte=(e,t,n)=>{const r=new Map,i={platform:ote,...n},a={...i.platform,_c:r};return Dee(e,t,{...i,platform:a})};var gte=typeof document<"u",vte=function(){},gy=gte?x.useLayoutEffect:vte;function Ly(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(!Ly(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)&&!Ly(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function KB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qD(e,t){const n=KB(e);return Math.round(t*n)/n}function xS(e){const t=x.useRef(e);return gy(()=>{t.current=e}),t}function yte(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]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=x.useState(r);Ly(g,r)||v(r);const[b,w]=x.useState(null),[S,E]=x.useState(null),C=x.useCallback(X=>{X!==O.current&&(O.current=X,w(X))},[]),j=x.useCallback(X=>{X!==T.current&&(T.current=X,E(X))},[]),A=a||b,N=o||S,O=x.useRef(null),T=x.useRef(null),M=x.useRef(h),I=c!=null,z=xS(c),B=xS(i),L=xS(f),G=x.useCallback(()=>{if(!O.current||!T.current)return;const X={placement:t,strategy:n,middleware:g};B.current&&(X.platform=B.current),pte(O.current,T.current,X).then(V=>{const R={...V,isPositioned:L.current!==!1};F.current&&!Ly(M.current,R)&&(M.current=R,Xl.flushSync(()=>{d(R)}))})},[g,t,n,B,L]);gy(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(X=>({...X,isPositioned:!1})))},[f]);const F=x.useRef(!1);gy(()=>(F.current=!0,()=>{F.current=!1}),[]),gy(()=>{if(A&&(O.current=A),N&&(T.current=N),A&&N){if(z.current)return z.current(A,N,G);G()}},[A,N,G,z,I]);const K=x.useMemo(()=>({reference:O,floating:T,setReference:C,setFloating:j}),[C,j]),D=x.useMemo(()=>({reference:A,floating:N}),[A,N]),q=x.useMemo(()=>{const X={position:n,left:0,top:0};if(!D.floating)return X;const V=qD(D.floating,h.x),R=qD(D.floating,h.y);return l?{...X,transform:"translate("+V+"px, "+R+"px)",...KB(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:R}},[n,l,D.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:G,refs:K,elements:D,floatingStyles:q}),[h,G,K,D,q])}const xte=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?HD({element:r.current,padding:i}).fn(n):{}:r?HD({element:r,padding:i}).fn(n):{}}}},bte=(e,t)=>{const n=ute(e);return{name:n.name,fn:n.fn,options:[e,t]}},wte=(e,t)=>{const n=cte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ste=(e,t)=>({fn:mte(e).fn,options:[e,t]}),Ete=(e,t)=>{const n=fte(e);return{name:n.name,fn:n.fn,options:[e,t]}},_te=(e,t)=>{const n=dte(e);return{name:n.name,fn:n.fn,options:[e,t]}},jte=(e,t)=>{const n=hte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cte=(e,t)=>{const n=xte(e);return{name:n.name,fn:n.fn,options:[e,t]}};var kte="Arrow",YB=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return m.jsx(Fe.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"})})});YB.displayName=kte;var Ate=YB,Nk="Popper",[XB,Md]=Fa(Nk),[Ote,GB]=XB(Nk),WB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return m.jsx(Ote,{scope:t,anchor:r,onAnchorChange:i,children:n})};WB.displayName=Nk;var QB="PopperAnchor",ZB=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=GB(QB,n),o=x.useRef(null),l=yt(t,o),c=x.useRef(null);return x.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(Fe.div,{...i,ref:l})});ZB.displayName=QB;var Tk="PopperContent",[Nte,Tte]=XB(Tk),JB=x.forwardRef((e,t)=>{var te,ie,ee,le,pe,ae;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=GB(Tk,n),[E,C]=x.useState(null),j=yt(t,be=>C(be)),[A,N]=x.useState(null),O=See(A),T=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,I=r+(a!=="center"?"-"+a:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(f)?f:[f],L=B.length>0,G={padding:z,boundary:B.filter(Mte),altBoundary:L},{refs:F,floatingStyles:K,placement:D,isPositioned:q,middlewareData:X}=yte({strategy:"fixed",placement:I,whileElementsMounted:(...be)=>lte(...be,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[bte({mainAxis:i+M,alignmentAxis:o}),c&&wte({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ste():void 0,...G}),c&&Ete({...G}),_te({...G,apply:({elements:be,rects:we,availableWidth:Le,availableHeight:Oe})=>{const{width:Xe,height:Ke}=we.reference,tt=be.floating.style;tt.setProperty("--radix-popper-available-width",`${Le}px`),tt.setProperty("--radix-popper-available-height",`${Oe}px`),tt.setProperty("--radix-popper-anchor-width",`${Xe}px`),tt.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),A&&Cte({element:A,padding:l}),Dte({arrowWidth:T,arrowHeight:M}),g&&jte({strategy:"referenceHidden",...G})]}),[V,R]=n6(D),H=Cr(b);vr(()=>{q&&(H==null||H())},[q,H]);const U=(te=X.arrow)==null?void 0:te.x,$=(ie=X.arrow)==null?void 0:ie.y,Q=((ee=X.arrow)==null?void 0:ee.centerOffset)!==0,[Z,ne]=x.useState();return vr(()=>{E&&ne(window.getComputedStyle(E).zIndex)},[E]),m.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(le=X.transformOrigin)==null?void 0:le.x,(pe=X.transformOrigin)==null?void 0:pe.y].join(" "),...((ae=X.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Nte,{scope:n,placedSide:V,onArrowChange:N,arrowX:U,arrowY:$,shouldHideArrow:Q,children:m.jsx(Fe.div,{"data-side":V,"data-align":R,...w,ref:j,style:{...w.style,animation:q?void 0:"none"}})})})});JB.displayName=Tk;var e6="PopperArrow",Pte={top:"bottom",right:"left",bottom:"top",left:"right"},t6=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=Tte(e6,r),o=Pte[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(Ate,{...i,ref:n,style:{...i.style,display:"block"}})})});t6.displayName=e6;function Mte(e){return e!==null}var Dte=e=>({name:"transformOrigin",options:e,fn(t){var S,E,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]=n6(n),d={start:"0%",center:"50%",end:"100%"}[h],g=(((E=i.arrow)==null?void 0:E.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 n6(e){const[t,n="center"]=e.split("-");return[t,n]}var Pk=WB,Mk=ZB,Dk=JB,Rk=t6,bS="rovingFocusGroup.onEntryFocus",Rte={bubbles:!1,cancelable:!0},_p="RovingFocusGroup",[lj,r6,Ite]=ck(_p),[Lte,h0]=Fa(_p,[Ite]),[zte,$te]=Lte(_p),i6=x.forwardRef((e,t)=>m.jsx(lj.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(lj.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Bte,{...e,ref:t})})}));i6.displayName=_p;var Bte=x.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=x.useRef(null),v=yt(t,g),b=bp(a),[w,S]=zl({prop:o,defaultProp:l??null,onChange:c,caller:_p}),[E,C]=x.useState(!1),j=Cr(f),A=r6(n),N=x.useRef(!1),[O,T]=x.useState(0);return x.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(bS,j),()=>M.removeEventListener(bS,j)},[j]),m.jsx(zte,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:x.useCallback(M=>S(M),[S]),onItemShiftTab:x.useCallback(()=>C(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:x.useCallback(()=>T(M=>M-1),[]),children:m.jsx(Fe.div,{tabIndex:E||O===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{N.current=!0}),onFocus:Ae(e.onFocus,M=>{const I=!N.current;if(M.target===M.currentTarget&&I&&!E){const z=new CustomEvent(bS,Rte);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const B=A().filter(D=>D.focusable),L=B.find(D=>D.active),G=B.find(D=>D.id===w),K=[L,G,...B].filter(Boolean).map(D=>D.ref.current);s6(K,h)}}N.current=!1}),onBlur:Ae(e.onBlur,()=>C(!1))})})}),a6="RovingFocusGroupItem",o6=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=gr(),f=a||c,h=$te(a6,n),d=h.currentTabStopId===f,g=r6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=h;return x.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),m.jsx(lj.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:m.jsx(Fe.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 E=Hte(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let j=g().filter(A=>A.focusable).map(A=>A.ref.current);if(E==="last")j.reverse();else if(E==="prev"||E==="next"){E==="prev"&&j.reverse();const A=j.indexOf(S.currentTarget);j=h.loop?qte(j,A+1):j.slice(A+1)}setTimeout(()=>s6(j))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:w!=null}):o})})});o6.displayName=a6;var Fte={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ute(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hte(e,t,n){const r=Ute(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Fte[r]}function s6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var l6=i6,u6=o6,uj=["Enter"," "],Vte=["ArrowDown","PageUp","Home"],c6=["ArrowUp","PageDown","End"],Kte=[...Vte,...c6],Yte={ltr:[...uj,"ArrowRight"],rtl:[...uj,"ArrowLeft"]},Xte={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jp="Menu",[Nm,Gte,Wte]=ck(jp),[Sc,f6]=Fa(jp,[Wte,Md,h0]),m0=Md(),d6=h0(),[Qte,Ec]=Sc(jp),[Zte,Cp]=Sc(jp),h6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=m0(t),[c,f]=x.useState(null),h=x.useRef(!1),d=Cr(a),g=bp(i);return x.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(Pk,{...l,children:m.jsx(Qte,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:f,children:m.jsx(Zte,{scope:t,onClose:x.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:g,modal:o,children:r})})})};h6.displayName=jp;var Jte="MenuAnchor",Ik=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=m0(n);return m.jsx(Mk,{...i,...r,ref:t})});Ik.displayName=Jte;var Lk="MenuPortal",[ene,m6]=Sc(Lk,{forceMount:void 0}),p6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ec(Lk,t);return m.jsx(ene,{scope:t,forceMount:n,children:m.jsx($r,{present:n||a.open,children:m.jsx(Sp,{asChild:!0,container:i,children:r})})})};p6.displayName=Lk;var sa="MenuContent",[tne,zk]=Sc(sa),g6=x.forwardRef((e,t)=>{const n=m6(sa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ec(sa,e.__scopeMenu),o=Cp(sa,e.__scopeMenu);return m.jsx(Nm.Provider,{scope:e.__scopeMenu,children:m.jsx($r,{present:r||a.open,children:m.jsx(Nm.Slot,{scope:e.__scopeMenu,children:o.modal?m.jsx(nne,{...i,ref:t}):m.jsx(rne,{...i,ref:t})})})})}),nne=x.forwardRef((e,t)=>{const n=Ec(sa,e.__scopeMenu),r=x.useRef(null),i=yt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return pk(a)},[]),m.jsx($k,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rne=x.forwardRef((e,t)=>{const n=Ec(sa,e.__scopeMenu);return m.jsx($k,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ine=tc("MenuContent.ScrollLock"),$k=x.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=Ec(sa,n),E=Cp(sa,n),C=m0(n),j=d6(n),A=Gte(n),[N,O]=x.useState(null),T=x.useRef(null),M=yt(t,T,S.onContentChange),I=x.useRef(0),z=x.useRef(""),B=x.useRef(0),L=x.useRef(null),G=x.useRef("right"),F=x.useRef(0),K=b?s0:x.Fragment,D=b?{as:ine,allowPinchZoom:!0}:void 0,q=V=>{var te,ie;const R=z.current+V,H=A().filter(ee=>!ee.disabled),U=document.activeElement,$=(te=H.find(ee=>ee.ref.current===U))==null?void 0:te.textValue,Q=H.map(ee=>ee.textValue),Z=gne(Q,R,$),ne=(ie=H.find(ee=>ee.textValue===Z))==null?void 0:ie.ref.current;(function ee(le){z.current=le,window.clearTimeout(I.current),le!==""&&(I.current=window.setTimeout(()=>ee(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};x.useEffect(()=>()=>window.clearTimeout(I.current),[]),mk();const X=x.useCallback(V=>{var H,U;return G.current===((H=L.current)==null?void 0:H.side)&&yne(V,(U=L.current)==null?void 0:U.area)},[]);return m.jsx(tne,{scope:n,searchRef:z,onItemEnter:x.useCallback(V=>{X(V)&&V.preventDefault()},[X]),onItemLeave:x.useCallback(V=>{var R;X(V)||((R=T.current)==null||R.focus(),O(null))},[X]),onTriggerLeave:x.useCallback(V=>{X(V)&&V.preventDefault()},[X]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(V=>{L.current=V},[]),children:m.jsx(K,{...D,children:m.jsx(a0,{asChild:!0,trapped:i,onMountAutoFocus:Ae(a,V=>{var R;V.preventDefault(),(R=T.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:m.jsx(wp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:g,onDismiss:v,children:m.jsx(l6,{asChild:!0,...j,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:O,onEntryFocus:Ae(c,V=>{E.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Dk,{role:"menu","aria-orientation":"vertical","data-state":P6(S.open),"data-radix-menu-content":"",dir:E.dir,...C,...w,ref:M,style:{outline:"none",...w.style},onKeyDown:Ae(w.onKeyDown,V=>{const H=V.target.closest("[data-radix-menu-content]")===V.currentTarget,U=V.ctrlKey||V.altKey||V.metaKey,$=V.key.length===1;H&&(V.key==="Tab"&&V.preventDefault(),!U&&$&&q(V.key));const Q=T.current;if(V.target!==Q||!Kte.includes(V.key))return;V.preventDefault();const ne=A().filter(te=>!te.disabled).map(te=>te.ref.current);c6.includes(V.key)&&ne.reverse(),mne(ne)}),onBlur:Ae(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(I.current),z.current="")}),onPointerMove:Ae(e.onPointerMove,Tm(V=>{const R=V.target,H=F.current!==V.clientX;if(V.currentTarget.contains(R)&&H){const U=V.clientX>F.current?"right":"left";G.current=U,F.current=V.clientX}}))})})})})})})});g6.displayName=sa;var ane="MenuGroup",Bk=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Fe.div,{role:"group",...r,ref:t})});Bk.displayName=ane;var one="MenuLabel",v6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Fe.div,{...r,ref:t})});v6.displayName=one;var zy="MenuItem",VD="menu.itemSelect",p0=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=x.useRef(null),o=Cp(zy,e.__scopeMenu),l=zk(zy,e.__scopeMenu),c=yt(t,a),f=x.useRef(!1),h=()=>{const d=a.current;if(!n&&d){const g=new CustomEvent(VD,{bubbles:!0,cancelable:!0});d.addEventListener(VD,v=>r==null?void 0:r(v),{once:!0}),tB(d,g),g.defaultPrevented?f.current=!1:o.onClose()}};return m.jsx(y6,{...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===" "||uj.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});p0.displayName=zy;var y6=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=zk(zy,n),l=d6(n),c=x.useRef(null),f=yt(t,c),[h,d]=x.useState(!1),[g,v]=x.useState("");return x.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),m.jsx(Nm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:m.jsx(u6,{asChild:!0,...l,focusable:!r,children:m.jsx(Fe.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,Tm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,Tm(b=>o.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>d(!0)),onBlur:Ae(e.onBlur,()=>d(!1))})})})}),sne="MenuCheckboxItem",x6=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.jsx(_6,{scope:e.__scopeMenu,checked:n,children:m.jsx(p0,{role:"menuitemcheckbox","aria-checked":$y(n)?"mixed":n,...i,ref:t,"data-state":Uk(n),onSelect:Ae(i.onSelect,()=>r==null?void 0:r($y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});x6.displayName=sne;var b6="MenuRadioGroup",[lne,une]=Sc(b6,{value:void 0,onValueChange:()=>{}}),w6=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Cr(r);return m.jsx(lne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:m.jsx(Bk,{...i,ref:t})})});w6.displayName=b6;var S6="MenuRadioItem",E6=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=une(S6,e.__scopeMenu),a=n===i.value;return m.jsx(_6,{scope:e.__scopeMenu,checked:a,children:m.jsx(p0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Uk(a),onSelect:Ae(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});E6.displayName=S6;var Fk="MenuItemIndicator",[_6,cne]=Sc(Fk,{checked:!1}),j6=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=cne(Fk,n);return m.jsx($r,{present:r||$y(a.checked)||a.checked===!0,children:m.jsx(Fe.span,{...i,ref:t,"data-state":Uk(a.checked)})})});j6.displayName=Fk;var fne="MenuSeparator",C6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});C6.displayName=fne;var dne="MenuArrow",k6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=m0(n);return m.jsx(Rk,{...i,...r,ref:t})});k6.displayName=dne;var hne="MenuSub",[J4e,A6]=Sc(hne),dm="MenuSubTrigger",O6=x.forwardRef((e,t)=>{const n=Ec(dm,e.__scopeMenu),r=Cp(dm,e.__scopeMenu),i=A6(dm,e.__scopeMenu),a=zk(dm,e.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,f={__scopeMenu:e.__scopeMenu},h=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>h,[h]),x.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),m.jsx(Ik,{asChild:!0,...f,children:m.jsx(y6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":P6(n.open),...e,ref:ss(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,Tm(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,Tm(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",E=S?-5:5,C=g[S?"left":"right"],j=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+E,y:d.clientY},{x:C,y:g.top},{x:j,y:g.top},{x:j,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===" "||Yte[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});O6.displayName=dm;var N6="MenuSubContent",T6=x.forwardRef((e,t)=>{const n=m6(sa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ec(sa,e.__scopeMenu),o=Cp(sa,e.__scopeMenu),l=A6(N6,e.__scopeMenu),c=x.useRef(null),f=yt(t,c);return m.jsx(Nm.Provider,{scope:e.__scopeMenu,children:m.jsx($r,{present:r||a.open,children:m.jsx(Nm.Slot,{scope:e.__scopeMenu,children:m.jsx($k,{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=Xte[o.dir].includes(h.key);d&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),h.preventDefault())})})})})})});T6.displayName=N6;function P6(e){return e?"open":"closed"}function $y(e){return e==="indeterminate"}function Uk(e){return $y(e)?"indeterminate":e?"checked":"unchecked"}function mne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function gne(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=pne(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 vne(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 yne(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return vne(n,t)}function Tm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xne=h6,bne=Ik,wne=p6,Sne=g6,Ene=Bk,_ne=v6,jne=p0,Cne=x6,kne=w6,Ane=E6,One=j6,Nne=C6,Tne=k6,Pne=O6,Mne=T6,g0="DropdownMenu",[Dne]=Fa(g0,[f6]),Zr=f6(),[Rne,M6]=Dne(g0),D6=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Zr(t),f=x.useRef(null),[h,d]=zl({prop:i,defaultProp:a??!1,onChange:o,caller:g0});return m.jsx(Rne,{scope:t,triggerId:gr(),triggerRef:f,contentId:gr(),open:h,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(g=>!g),[d]),modal:l,children:m.jsx(xne,{...c,open:h,onOpenChange:d,dir:r,modal:l,children:n})})};D6.displayName=g0;var R6="DropdownMenuTrigger",I6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=M6(R6,n),o=Zr(n);return m.jsx(bne,{asChild:!0,...o,children:m.jsx(Fe.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:ss(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())})})})});I6.displayName=R6;var Ine="DropdownMenuPortal",L6=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Zr(t);return m.jsx(wne,{...r,...n})};L6.displayName=Ine;var z6="DropdownMenuContent",$6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=M6(z6,n),a=Zr(n),o=x.useRef(!1);return m.jsx(Sne,{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)"}})});$6.displayName=z6;var Lne="DropdownMenuGroup",zne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Ene,{...i,...r,ref:t})});zne.displayName=Lne;var $ne="DropdownMenuLabel",Bne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(_ne,{...i,...r,ref:t})});Bne.displayName=$ne;var Fne="DropdownMenuItem",B6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(jne,{...i,...r,ref:t})});B6.displayName=Fne;var Une="DropdownMenuCheckboxItem",F6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Cne,{...i,...r,ref:t})});F6.displayName=Une;var Hne="DropdownMenuRadioGroup",qne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(kne,{...i,...r,ref:t})});qne.displayName=Hne;var Vne="DropdownMenuRadioItem",Kne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Ane,{...i,...r,ref:t})});Kne.displayName=Vne;var Yne="DropdownMenuItemIndicator",U6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(One,{...i,...r,ref:t})});U6.displayName=Yne;var Xne="DropdownMenuSeparator",Gne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Nne,{...i,...r,ref:t})});Gne.displayName=Xne;var Wne="DropdownMenuArrow",Qne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Tne,{...i,...r,ref:t})});Qne.displayName=Wne;var Zne="DropdownMenuSubTrigger",Jne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Pne,{...i,...r,ref:t})});Jne.displayName=Zne;var ere="DropdownMenuSubContent",tre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zr(n);return m.jsx(Mne,{...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)"}})});tre.displayName=ere;var nre=D6,rre=I6,ire=L6,are=$6,ore=B6,sre=F6,lre=U6,ure="Label",H6=x.forwardRef((e,t)=>m.jsx(Fe.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())}}));H6.displayName=ure;var cre=H6;function cj(e,[t,n]){return Math.min(n,Math.max(t,e))}function fre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Hk="ScrollArea",[q6]=Fa(Hk),[dre,ca]=q6(Hk),V6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=x.useState(null),[f,h]=x.useState(null),[d,g]=x.useState(null),[v,b]=x.useState(null),[w,S]=x.useState(null),[E,C]=x.useState(0),[j,A]=x.useState(0),[N,O]=x.useState(!1),[T,M]=x.useState(!1),I=yt(t,B=>c(B)),z=bp(i);return m.jsx(dre,{scope:n,type:r,dir:z,scrollHideDelay:a,scrollArea:l,viewport:f,onViewportChange:h,content:d,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:N,onScrollbarXEnabledChange:O,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:M,onCornerWidthChange:C,onCornerHeightChange:A,children:m.jsx(Fe.div,{dir:z,...o,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});V6.displayName=Hk;var K6="ScrollAreaViewport",Y6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=ca(K6,n),l=x.useRef(null),c=yt(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(Fe.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})})]})});Y6.displayName=K6;var So="ScrollAreaScrollbar",X6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ca(So,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return x.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?m.jsx(hre,{...r,ref:t,forceMount:n}):i.type==="scroll"?m.jsx(mre,{...r,ref:t,forceMount:n}):i.type==="auto"?m.jsx(G6,{...r,ref:t,forceMount:n}):i.type==="always"?m.jsx(qk,{...r,ref:t}):null});X6.displayName=So;var hre=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ca(So,e.__scopeScrollArea),[a,o]=x.useState(!1);return x.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($r,{present:n||a,children:m.jsx(G6,{"data-state":a?"visible":"hidden",...r,ref:t})})}),mre=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ca(So,e.__scopeScrollArea),a=e.orientation==="horizontal",o=y0(()=>c("SCROLL_END"),100),[l,c]=fre("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,c]),x.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($r,{present:n||l!=="hidden",children:m.jsx(qk,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),G6=x.forwardRef((e,t)=>{const n=ca(So,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=x.useState(!1),l=e.orientation==="horizontal",c=y0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?f:h)}},10);return sd(n.viewport,c),sd(n.content,c),m.jsx($r,{present:r||a,children:m.jsx(qk,{"data-state":a?"visible":"hidden",...i,ref:t})})}),qk=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ca(So,e.__scopeScrollArea),a=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=e8(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 bre(g,o.current,l,v)}return n==="horizontal"?m.jsx(pre,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=KD(g,l,i.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=d(g,i.dir))}}):n==="vertical"?m.jsx(gre,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=KD(g,l);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=d(g))}}):null}),pre=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ca(So,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),f=yt(t,c,a.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),m.jsx(Q6,{"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":v0(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),n8(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:Fy(o.paddingLeft),paddingEnd:Fy(o.paddingRight)}})}})}),gre=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ca(So,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),f=yt(t,c,a.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),m.jsx(Q6,{"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":v0(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),n8(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:Fy(o.paddingTop),paddingEnd:Fy(o.paddingBottom)}})}})}),[vre,W6]=q6(So),Q6=x.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=ca(So,n),[b,w]=x.useState(null),S=yt(t,I=>w(I)),E=x.useRef(null),C=x.useRef(""),j=v.viewport,A=r.content-r.viewport,N=Cr(h),O=Cr(c),T=y0(d,10);function M(I){if(E.current){const z=I.clientX-E.current.left,B=I.clientY-E.current.top;f({x:z,y:B})}}return x.useEffect(()=>{const I=z=>{const B=z.target;(b==null?void 0:b.contains(B))&&N(z,A)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[j,b,A,N]),x.useEffect(O,[r,O]),sd(b,T),sd(v.content,T),m.jsx(vre,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Cr(a),onThumbPointerUp:Cr(o),onThumbPositionChange:O,onThumbPointerDown:Cr(l),children:m.jsx(Fe.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Ae(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),E.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(I))}),onPointerMove:Ae(e.onPointerMove,M),onPointerUp:Ae(e.onPointerUp,I=>{const z=I.target;z.hasPointerCapture(I.pointerId)&&z.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),E.current=null})})})}),By="ScrollAreaThumb",Z6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=W6(By,e.__scopeScrollArea);return m.jsx($r,{present:n||i.hasThumb,children:m.jsx(yre,{ref:t,...r})})}),yre=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=ca(By,n),o=W6(By,n),{onThumbPositionChange:l}=o,c=yt(t,d=>o.onThumbChange(d)),f=x.useRef(void 0),h=y0(()=>{f.current&&(f.current(),f.current=void 0)},100);return x.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(h(),!f.current){const v=wre(d,l);f.current=v,l()}};return l(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,h,l]),m.jsx(Fe.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)})});Z6.displayName=By;var Vk="ScrollAreaCorner",J6=x.forwardRef((e,t)=>{const n=ca(Vk,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(xre,{...e,ref:t}):null});J6.displayName=Vk;var xre=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ca(Vk,n),[a,o]=x.useState(0),[l,c]=x.useState(0),f=!!(a&&l);return sd(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),c(h)}),sd(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),o(h)}),f?m.jsx(Fe.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 Fy(e){return e?parseInt(e,10):0}function e8(e,t){const n=e/t;return isNaN(n)?0:n}function v0(e){const t=e8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function bre(e,t,n,r="ltr"){const i=v0(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 t8([c,f],d)(e)}function KD(e,t,n="ltr"){const r=v0(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=cj(e,c);return t8([0,o],[0,l])(f)}function t8(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 n8(e,t){return e>0&&e<t}var wre=(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 y0(e,t){const n=Cr(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function sd(e,t){const n=Cr(t);vr(()=>{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 Sre=V6,Ere=Y6,_re=J6,jre=[" ","Enter","ArrowUp","ArrowDown"],Cre=[" ","Enter"],ic="Select",[x0,b0,kre]=ck(ic),[Dd]=Fa(ic,[kre,Md]),w0=Md(),[Are,Gl]=Dd(ic),[Ore,Nre]=Dd(ic),r8=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=w0(t),[S,E]=x.useState(null),[C,j]=x.useState(null),[A,N]=x.useState(!1),O=bp(f),[T,M]=zl({prop:r,defaultProp:i??!1,onChange:a,caller:ic}),[I,z]=zl({prop:o,defaultProp:l,onChange:c,caller:ic}),B=x.useRef(null),L=S?b||!!S.closest("form"):!0,[G,F]=x.useState(new Set),K=Array.from(G).map(D=>D.props.value).join(";");return m.jsx(Pk,{...w,children:m.jsxs(Are,{required:v,scope:t,trigger:S,onTriggerChange:E,valueNode:C,onValueNodeChange:j,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:gr(),value:I,onValueChange:z,open:T,onOpenChange:M,dir:O,triggerPointerDownPosRef:B,disabled:g,children:[m.jsx(x0.Provider,{scope:t,children:m.jsx(Ore,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(D=>{F(q=>new Set(q).add(D))},[]),onNativeOptionRemove:x.useCallback(D=>{F(q=>{const X=new Set(q);return X.delete(D),X})},[]),children:n})}),L?m.jsxs(j8,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:d,value:I,onChange:D=>z(D.target.value),disabled:g,form:b,children:[I===void 0?m.jsx("option",{value:""}):null,Array.from(G)]},K):null]})})};r8.displayName=ic;var i8="SelectTrigger",a8=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=w0(n),o=Gl(i8,n),l=o.disabled||r,c=yt(t,o.onTriggerChange),f=b0(n),h=x.useRef("touch"),[d,g,v]=k8(w=>{const S=f().filter(j=>!j.disabled),E=S.find(j=>j.value===o.value),C=A8(S,w,E);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(Mk,{asChild:!0,...a,children:m.jsx(Fe.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":C8(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===" ")&&jre.includes(w.key)&&(b(),w.preventDefault())})})})});a8.displayName=i8;var o8="SelectValue",s8=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Gl(o8,n),{onValueNodeHasChildrenChange:f}=c,h=a!==void 0,d=yt(t,c.onValueNodeChange);return vr(()=>{f(h)},[f,h]),m.jsx(Fe.span,{...l,ref:d,style:{pointerEvents:"none"},children:C8(c.value)?m.jsx(m.Fragment,{children:o}):a})});s8.displayName=o8;var Tre="SelectIcon",l8=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.jsx(Fe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});l8.displayName=Tre;var Pre="SelectPortal",u8=e=>m.jsx(Sp,{asChild:!0,...e});u8.displayName=Pre;var ac="SelectContent",c8=x.forwardRef((e,t)=>{const n=Gl(ac,e.__scopeSelect),[r,i]=x.useState();if(vr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Xl.createPortal(m.jsx(f8,{scope:e.__scopeSelect,children:m.jsx(x0.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),a):null}return m.jsx(d8,{...e,ref:t})});c8.displayName=ac;var xa=10,[f8,Wl]=Dd(ac),Mre="SelectContentImpl",Dre=tc("SelectContent.RemoveScroll"),d8=x.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,...E}=e,C=Gl(ac,n),[j,A]=x.useState(null),[N,O]=x.useState(null),T=yt(t,te=>A(te)),[M,I]=x.useState(null),[z,B]=x.useState(null),L=b0(n),[G,F]=x.useState(!1),K=x.useRef(!1);x.useEffect(()=>{if(j)return pk(j)},[j]),mk();const D=x.useCallback(te=>{const[ie,...ee]=L().map(ae=>ae.ref.current),[le]=ee.slice(-1),pe=document.activeElement;for(const ae of te)if(ae===pe||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===ie&&N&&(N.scrollTop=0),ae===le&&N&&(N.scrollTop=N.scrollHeight),ae==null||ae.focus(),document.activeElement!==pe))return},[L,N]),q=x.useCallback(()=>D([M,j]),[D,M,j]);x.useEffect(()=>{G&&q()},[G,q]);const{onOpenChange:X,triggerPointerDownPosRef:V}=C;x.useEffect(()=>{if(j){let te={x:0,y:0};const ie=le=>{var pe,ae;te={x:Math.abs(Math.round(le.pageX)-(((pe=V.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(le.pageY)-(((ae=V.current)==null?void 0:ae.y)??0))}},ee=le=>{te.x<=10&&te.y<=10?le.preventDefault():j.contains(le.target)||X(!1),document.removeEventListener("pointermove",ie),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ee,{capture:!0})}}},[j,X,V]),x.useEffect(()=>{const te=()=>X(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[X]);const[R,H]=k8(te=>{const ie=L().filter(pe=>!pe.disabled),ee=ie.find(pe=>pe.ref.current===document.activeElement),le=A8(ie,te,ee);le&&setTimeout(()=>le.ref.current.focus())}),U=x.useCallback((te,ie,ee)=>{const le=!K.current&&!ee;(C.value!==void 0&&C.value===ie||le)&&(I(te),le&&(K.current=!0))},[C.value]),$=x.useCallback(()=>j==null?void 0:j.focus(),[j]),Q=x.useCallback((te,ie,ee)=>{const le=!K.current&&!ee;(C.value!==void 0&&C.value===ie||le)&&B(te)},[C.value]),Z=r==="popper"?fj:h8,ne=Z===fj?{side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return m.jsx(f8,{scope:n,content:j,viewport:N,onViewportChange:O,itemRefCallback:U,selectedItem:M,onItemLeave:$,itemTextRefCallback:Q,focusSelectedItem:q,selectedItemText:z,position:r,isPositioned:G,searchRef:R,children:m.jsx(s0,{as:Dre,allowPinchZoom:!0,children:m.jsx(a0,{asChild:!0,trapped:C.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:Ae(i,te=>{var ie;(ie=C.trigger)==null||ie.focus({preventScroll:!0}),te.preventDefault()}),children:m.jsx(wp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:m.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:te=>te.preventDefault(),...E,...ne,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Ae(E.onKeyDown,te=>{const ie=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ie&&te.key.length===1&&H(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let le=L().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(te.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const pe=te.target,ae=le.indexOf(pe);le=le.slice(ae+1)}setTimeout(()=>D(le)),te.preventDefault()}})})})})})})});d8.displayName=Mre;var Rre="SelectItemAlignedPosition",h8=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Gl(ac,n),o=Wl(ac,n),[l,c]=x.useState(null),[f,h]=x.useState(null),d=yt(t,T=>h(T)),g=b0(n),v=x.useRef(!1),b=x.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:E,focusSelectedItem:C}=o,j=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&w&&S&&E){const T=a.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),I=a.valueNode.getBoundingClientRect(),z=E.getBoundingClientRect();if(a.dir!=="rtl"){const pe=z.left-M.left,ae=I.left-pe,be=T.left-ae,we=T.width+be,Le=Math.max(we,M.width),Oe=window.innerWidth-xa,Xe=cj(ae,[xa,Math.max(xa,Oe-Le)]);l.style.minWidth=we+"px",l.style.left=Xe+"px"}else{const pe=M.right-z.right,ae=window.innerWidth-I.right-pe,be=window.innerWidth-T.right-ae,we=T.width+be,Le=Math.max(we,M.width),Oe=window.innerWidth-xa,Xe=cj(ae,[xa,Math.max(xa,Oe-Le)]);l.style.minWidth=we+"px",l.style.right=Xe+"px"}const B=g(),L=window.innerHeight-xa*2,G=w.scrollHeight,F=window.getComputedStyle(f),K=parseInt(F.borderTopWidth,10),D=parseInt(F.paddingTop,10),q=parseInt(F.borderBottomWidth,10),X=parseInt(F.paddingBottom,10),V=K+D+G+X+q,R=Math.min(S.offsetHeight*5,V),H=window.getComputedStyle(w),U=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),Q=T.top+T.height/2-xa,Z=L-Q,ne=S.offsetHeight/2,te=S.offsetTop+ne,ie=K+D+te,ee=V-ie;if(ie<=Q){const pe=B.length>0&&S===B[B.length-1].ref.current;l.style.bottom="0px";const ae=f.clientHeight-w.offsetTop-w.offsetHeight,be=Math.max(Z,ne+(pe?$:0)+ae+q),we=ie+be;l.style.height=we+"px"}else{const pe=B.length>0&&S===B[0].ref.current;l.style.top="0px";const be=Math.max(Q,K+w.offsetTop+(pe?U:0)+ne)+ee;l.style.height=be+"px",w.scrollTop=ie-Q+w.offsetTop}l.style.margin=`${xa}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,f,w,S,E,a.dir,r]);vr(()=>j(),[j]);const[A,N]=x.useState();vr(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const O=x.useCallback(T=>{T&&b.current===!0&&(j(),C==null||C(),b.current=!1)},[j,C]);return m.jsx(Lre,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:m.jsx(Fe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h8.displayName=Rre;var Ire="SelectPopperPosition",fj=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=xa,...a}=e,o=w0(n);return m.jsx(Dk,{...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)"}})});fj.displayName=Ire;var[Lre,Kk]=Dd(ac,{}),dj="SelectViewport",m8=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Wl(dj,n),o=Kk(dj,n),l=yt(t,a.onViewportChange),c=x.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(x0.Slot,{scope:n,children:m.jsx(Fe.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-xa*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),E=Math.max(w,S);if(E<b){const C=E+v,j=Math.min(b,C),A=C-j;d.style.height=j+"px",d.style.bottom==="0px"&&(h.scrollTop=A>0?A:0,d.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});m8.displayName=dj;var p8="SelectGroup",[zre,$re]=Dd(p8),Bre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gr();return m.jsx(zre,{scope:n,id:i,children:m.jsx(Fe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Bre.displayName=p8;var g8="SelectLabel",Fre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$re(g8,n);return m.jsx(Fe.div,{id:i.id,...r,ref:t})});Fre.displayName=g8;var Uy="SelectItem",[Ure,v8]=Dd(Uy),y8=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Gl(Uy,n),c=Wl(Uy,n),f=l.value===r,[h,d]=x.useState(a??""),[g,v]=x.useState(!1),b=yt(t,C=>{var j;return(j=c.itemRefCallback)==null?void 0:j.call(c,C,r,i)}),w=gr(),S=x.useRef("touch"),E=()=>{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(Ure,{scope:n,value:r,disabled:i,textId:w,isSelected:f,onItemTextChange:x.useCallback(C=>{d(j=>j||((C==null?void 0:C.textContent)??"").trim())},[]),children:m.jsx(x0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:m.jsx(Fe.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"&&E()}),onPointerUp:Ae(o.onPointerUp,()=>{S.current==="mouse"&&E()}),onPointerDown:Ae(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ae(o.onPointerMove,C=>{var j;S.current=C.pointerType,i?(j=c.onItemLeave)==null||j.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,C=>{var j;C.currentTarget===document.activeElement&&((j=c.onItemLeave)==null||j.call(c))}),onKeyDown:Ae(o.onKeyDown,C=>{var A;((A=c.searchRef)==null?void 0:A.current)!==""&&C.key===" "||(Cre.includes(C.key)&&E(),C.key===" "&&C.preventDefault())})})})})});y8.displayName=Uy;var hm="SelectItemText",x8=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Gl(hm,n),l=Wl(hm,n),c=v8(hm,n),f=Nre(hm,n),[h,d]=x.useState(null),g=yt(t,E=>d(E),c.onItemTextChange,E=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,E,c.value,c.disabled)}),v=h==null?void 0:h.textContent,b=x.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 vr(()=>(w(b),()=>S(b)),[w,S,b]),m.jsxs(m.Fragment,{children:[m.jsx(Fe.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Xl.createPortal(a.children,o.valueNode):null]})});x8.displayName=hm;var b8="SelectItemIndicator",w8=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v8(b8,n).isSelected?m.jsx(Fe.span,{"aria-hidden":!0,...r,ref:t}):null});w8.displayName=b8;var hj="SelectScrollUpButton",S8=x.forwardRef((e,t)=>{const n=Wl(hj,e.__scopeSelect),r=Kk(hj,e.__scopeSelect),[i,a]=x.useState(!1),o=yt(t,r.onScrollButtonChange);return vr(()=>{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(_8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});S8.displayName=hj;var mj="SelectScrollDownButton",E8=x.forwardRef((e,t)=>{const n=Wl(mj,e.__scopeSelect),r=Kk(mj,e.__scopeSelect),[i,a]=x.useState(!1),o=yt(t,r.onScrollButtonChange);return vr(()=>{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(_8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});E8.displayName=mj;var _8=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Wl("SelectScrollButton",n),o=x.useRef(null),l=b0(n),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),vr(()=>{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(Fe.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()})})}),Hre="SelectSeparator",qre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(Fe.div,{"aria-hidden":!0,...r,ref:t})});qre.displayName=Hre;var pj="SelectArrow",Vre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=w0(n),a=Gl(pj,n),o=Wl(pj,n);return a.open&&o.position==="popper"?m.jsx(Rk,{...i,...r,ref:t}):null});Vre.displayName=pj;var Kre="SelectBubbleInput",j8=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=x.useRef(null),a=yt(r,i),o=wee(t);return x.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(Fe.select,{...n,style:{...nB,...n.style},ref:a,defaultValue:t})});j8.displayName=Kre;function C8(e){return e===""||e===void 0}function k8(e){const t=Cr(e),n=x.useRef(""),r=x.useRef(0),i=x.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=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function A8(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=Yre(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 Yre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xre=r8,Gre=a8,Wre=s8,Qre=l8,Zre=u8,Jre=c8,eie=m8,tie=y8,nie=x8,rie=w8,iie=S8,aie=E8,oie="Separator",YD="horizontal",sie=["horizontal","vertical"],O8=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=YD,...i}=e,a=lie(r)?r:YD,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return m.jsx(Fe.div,{"data-orientation":a,...l,...i,ref:t})});O8.displayName=oie;function lie(e){return sie.includes(e)}var uie=O8,S0="Tabs",[cie]=Fa(S0,[h0]),N8=h0(),[fie,Yk]=cie(S0),T8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...f}=e,h=bp(l),[d,g]=zl({prop:r,onChange:i,defaultProp:a??"",caller:S0});return m.jsx(fie,{scope:n,baseId:gr(),value:d,onValueChange:g,orientation:o,dir:h,activationMode:c,children:m.jsx(Fe.div,{dir:h,"data-orientation":o,...f,ref:t})})});T8.displayName=S0;var P8="TabsList",M8=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=Yk(P8,n),o=N8(n);return m.jsx(l6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:m.jsx(Fe.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});M8.displayName=P8;var D8="TabsTrigger",R8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Yk(D8,n),l=N8(n),c=z8(o.baseId,r),f=$8(o.baseId,r),h=r===o.value;return m.jsx(u6,{asChild:!0,...l,focusable:!i,active:h,children:m.jsx(Fe.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)})})})});R8.displayName=D8;var I8="TabsContent",L8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=Yk(I8,n),c=z8(l.baseId,r),f=$8(l.baseId,r),h=r===l.value,d=x.useRef(h);return x.useEffect(()=>{const g=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(g)},[]),m.jsx($r,{present:i||h,children:({present:g})=>m.jsx(Fe.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})})});L8.displayName=I8;function z8(e,t){return`${e}-trigger-${t}`}function $8(e,t){return`${e}-content-${t}`}var die=T8,hie=M8,mie=R8,pie=L8,[E0]=Fa("Tooltip",[Md]),_0=Md(),B8="TooltipProvider",gie=700,gj="tooltip.open",[vie,Xk]=E0(B8),F8=e=>{const{__scopeTooltip:t,delayDuration:n=gie,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),m.jsx(vie,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:a})};F8.displayName=B8;var Pm="Tooltip",[yie,kp]=E0(Pm),U8=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=Xk(Pm,e.__scopeTooltip),f=_0(t),[h,d]=x.useState(null),g=gr(),v=x.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=x.useRef(!1),[E,C]=zl({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(gj))):c.onClose(),a==null||a(T)},caller:Pm}),j=x.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),A=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,C(!0)},[C]),N=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),O=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,C(!0),v.current=0},w)},[w,C]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),m.jsx(Pk,{...f,children:m.jsx(yie,{scope:t,contentId:g,open:E,stateAttribute:j,trigger:h,onTriggerChange:d,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?O():A()},[c.isOpenDelayedRef,O,A]),onTriggerLeave:x.useCallback(()=>{b?N():(window.clearTimeout(v.current),v.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};U8.displayName=Pm;var vj="TooltipTrigger",H8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=kp(vj,n),a=Xk(vj,n),o=_0(n),l=x.useRef(null),c=yt(t,l,i.onTriggerChange),f=x.useRef(!1),h=x.useRef(!1),d=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(Mk,{asChild:!0,...o,children:m.jsx(Fe.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)})})});H8.displayName=vj;var Gk="TooltipPortal",[xie,bie]=E0(Gk,{forceMount:void 0}),q8=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=kp(Gk,t);return m.jsx(xie,{scope:t,forceMount:n,children:m.jsx($r,{present:n||a.open,children:m.jsx(Sp,{asChild:!0,container:i,children:r})})})};q8.displayName=Gk;var ld="TooltipContent",V8=x.forwardRef((e,t)=>{const n=bie(ld,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=kp(ld,e.__scopeTooltip);return m.jsx($r,{present:r||o.open,children:o.disableHoverableContent?m.jsx(K8,{side:i,...a,ref:t}):m.jsx(wie,{side:i,...a,ref:t})})}),wie=x.forwardRef((e,t)=>{const n=kp(ld,e.__scopeTooltip),r=Xk(ld,e.__scopeTooltip),i=x.useRef(null),a=yt(t,i),[o,l]=x.useState(null),{trigger:c,onClose:f}=n,h=i.current,{onPointerInTransitChange:d}=r,g=x.useCallback(()=>{l(null),d(!1)},[d]),v=x.useCallback((b,w)=>{const S=b.currentTarget,E={x:b.clientX,y:b.clientY},C=jie(E,S.getBoundingClientRect()),j=Cie(E,C),A=kie(w.getBoundingClientRect()),N=Oie([...j,...A]);l(N),d(!0)},[d]);return x.useEffect(()=>()=>g(),[g]),x.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]),x.useEffect(()=>{if(o){const b=w=>{const S=w.target,E={x:w.clientX,y:w.clientY},C=(c==null?void 0:c.contains(S))||(h==null?void 0:h.contains(S)),j=!Aie(E,o);C?g():j&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,h,o,f,g]),m.jsx(K8,{...e,ref:a})}),[Sie,Eie]=E0(Pm,{isInside:!1}),_ie=BZ("TooltipContent"),K8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=kp(ld,n),f=_0(n),{onClose:h}=c;return x.useEffect(()=>(document.addEventListener(gj,h),()=>document.removeEventListener(gj,h)),[h]),x.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(wp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:m.jsxs(Dk,{"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(_ie,{children:r}),m.jsx(Sie,{scope:n,isInside:!0,children:m.jsx(KZ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});V8.displayName=ld;var Y8="TooltipArrow",X8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_0(n);return Eie(Y8,n).isInside?null:m.jsx(Rk,{...i,...r,ref:t})});X8.displayName=Y8;function jie(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 Cie(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 kie(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 Aie(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 Oie(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),Nie(t)}function Nie(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 Tie=F8,Pie=U8,Mie=H8,Die=q8,Rie=V8,Iie=X8;function G8(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=G8(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=G8(e))&&(r&&(r+=" "),r+=t);return r}const Lie=(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},zie=(e,t)=>({classGroupId:e,validator:t}),W8=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Hy="-",XD=[],$ie="arbitrary..",Bie=e=>{const t=Uie(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Fie(o);const l=o.split(Hy),c=l[0]===""&&l.length>1?1:0;return Q8(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],f=n[o];return c?f?Lie(f,c):c:f||XD}return n[o]||XD}}},Q8=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=Q8(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const l=t===0?e.join(Hy):e.slice(t).join(Hy),c=o.length;for(let f=0;f<c;f++){const h=o[f];if(h.validator(l))return h.classGroupId}},Fie=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?$ie+r:void 0})(),Uie=e=>{const{theme:t,classGroups:n}=e;return Hie(n,t)},Hie=(e,t)=>{const n=W8();for(const r in e){const i=e[r];Wk(i,n,r,t)}return n},Wk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];qie(o,t,n,r)}},qie=(e,t,n,r)=>{if(typeof e=="string"){Vie(e,t,n);return}if(typeof e=="function"){Kie(e,t,n,r);return}Yie(e,t,n,r)},Vie=(e,t,n)=>{const r=e===""?t:Z8(t,e);r.classGroupId=n},Kie=(e,t,n,r)=>{if(Xie(e)){Wk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(zie(n,e))},Yie=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];Wk(c,Z8(t,l),n,r)}},Z8=(e,t)=>{let n=e;const r=t.split(Hy),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=W8(),n.nextPart.set(o,l)),n=l}return n},Xie=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gie=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)}}},yj="!",GD=":",Wie=[],WD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Qie=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===GD){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(yj)?(g=d.slice(0,-1),v=!0):d.startsWith(yj)&&(g=d.slice(1),v=!0);const b=f&&f>c?f-c:void 0;return WD(a,v,g,b)};if(t){const i=t+GD,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):WD(Wie,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Zie=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}},Jie=e=>({cache:Gie(e.cacheSize),parseClassName:Qie(e),sortModifiers:Zie(e),...Bie(e)}),eae=/\s+/,tae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(eae);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,E=r(S?b.substring(0,w):b);if(!E){if(!S){c=h+(c.length>0?" "+c:c);continue}if(E=r(b),!E){c=h+(c.length>0?" "+c:c);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),j=v?C+yj:C,A=j+E;if(o.indexOf(A)>-1)continue;o.push(A);const N=i(E,S);for(let O=0;O<N.length;++O){const T=N[O];o.push(j+T)}c=h+(c.length>0?" "+c:c)}return c},nae=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=J8(n))&&(i&&(i+=" "),i+=r);return i},J8=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=J8(e[r]))&&(n&&(n+=" "),n+=t);return n},rae=(e,...t)=>{let n,r,i,a;const o=c=>{const f=t.reduce((h,d)=>d(h),e());return n=Jie(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=tae(c,n);return i(c,h),h};return a=o,(...c)=>a(nae(...c))},iae=[],er=e=>{const t=n=>n[e]||iae;return t.isThemeGetter=!0,t},eF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sae=/\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$/,lae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cl=e=>aae.test(e),ft=e=>!!e&&!Number.isNaN(Number(e)),fl=e=>!!e&&Number.isInteger(Number(e)),wS=e=>e.endsWith("%")&&ft(e.slice(0,-1)),qo=e=>oae.test(e),nF=()=>!0,fae=e=>sae.test(e)&&!lae.test(e),Qk=()=>!1,dae=e=>uae.test(e),hae=e=>cae.test(e),mae=e=>!Ie(e)&&!ze(e),pae=e=>Ql(e,aF,Qk),Ie=e=>eF.test(e),Eu=e=>Ql(e,oF,fae),QD=e=>Ql(e,Eae,ft),gae=e=>Ql(e,lF,nF),vae=e=>Ql(e,sF,Qk),ZD=e=>Ql(e,rF,Qk),yae=e=>Ql(e,iF,hae),Dv=e=>Ql(e,uF,dae),ze=e=>tF.test(e),Uh=e=>_c(e,oF),xae=e=>_c(e,sF),JD=e=>_c(e,rF),bae=e=>_c(e,aF),wae=e=>_c(e,iF),Rv=e=>_c(e,uF,!0),Sae=e=>_c(e,lF,!0),Ql=(e,t,n)=>{const r=eF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},_c=(e,t,n=!1)=>{const r=tF.exec(e);return r?r[1]?t(r[1]):n:!1},rF=e=>e==="position"||e==="percentage",iF=e=>e==="image"||e==="url",aF=e=>e==="length"||e==="size"||e==="bg-size",oF=e=>e==="length",Eae=e=>e==="number",sF=e=>e==="family-name",lF=e=>e==="number"||e==="weight",uF=e=>e==="shadow",_ae=()=>{const e=er("color"),t=er("font"),n=er("text"),r=er("font-weight"),i=er("tracking"),a=er("leading"),o=er("breakpoint"),l=er("container"),c=er("spacing"),f=er("radius"),h=er("shadow"),d=er("inset-shadow"),g=er("text-shadow"),v=er("drop-shadow"),b=er("blur"),w=er("perspective"),S=er("aspect"),E=er("ease"),C=er("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),ze,Ie],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[ze,Ie,c],I=()=>[cl,"full","auto",...M()],z=()=>[fl,"none","subgrid",ze,Ie],B=()=>["auto",{span:["full",fl,ze,Ie]},fl,ze,Ie],L=()=>[fl,"auto",ze,Ie],G=()=>["auto","min","max","fr",ze,Ie],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...M()],q=()=>[cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],X=()=>[cl,"screen","full","dvw","lvw","svw","min","max","fit",...M()],V=()=>[cl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],R=()=>[e,ze,Ie],H=()=>[...A(),JD,ZD,{position:[ze,Ie]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",bae,pae,{size:[ze,Ie]}],Q=()=>[wS,Uh,Eu],Z=()=>["","none","full",f,ze,Ie],ne=()=>["",ft,Uh,Eu],te=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[ft,wS,JD,ZD],le=()=>["","none",b,ze,Ie],pe=()=>["none",ft,ze,Ie],ae=()=>["none",ft,ze,Ie],be=()=>[ft,ze,Ie],we=()=>[cl,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qo],breakpoint:[qo],color:[nF],container:[qo],"drop-shadow":[qo],ease:["in","out","in-out"],font:[mae],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qo],shadow:[qo],spacing:["px",ft],text:[qo],"text-shadow":[qo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cl,Ie,ze,S]}],container:["container"],columns:[{columns:[ft,Ie,ze,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[fl,"auto",ze,Ie]}],basis:[{basis:[cl,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,cl,"auto","initial","none",Ie]}],grow:[{grow:["",ft,ze,Ie]}],shrink:[{shrink:["",ft,ze,Ie]}],order:[{order:[fl,"first","last","none",ze,Ie]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"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",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],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,Uh,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Sae,gae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wS,Ie]}],"font-family":[{font:[xae,vae,t]}],"font-features":[{"font-features":[Ie]}],"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,Ie]}],"line-clamp":[{"line-clamp":[ft,"none",ze,QD]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",ze,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Ie]}],"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:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",ze,Eu]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ft,"auto",ze,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Ie]}],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,Ie]}],"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:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},fl,ze,Ie],radial:["",ze,Ie],conic:[fl,ze,Ie]},wae,yae]}],"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:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"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:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,ze,Ie]}],"outline-w":[{outline:["",ft,Uh,Eu]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",h,Rv,Dv]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Rv,Dv]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ft,Eu]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",g,Rv,Dv]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ft,ze,Ie]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[ft]}],"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,Ie]}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"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:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ze,Ie]}],filter:[{filter:["","none",ze,Ie]}],blur:[{blur:le()}],brightness:[{brightness:[ft,ze,Ie]}],contrast:[{contrast:[ft,ze,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,Rv,Dv]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ft,ze,Ie]}],"hue-rotate":[{"hue-rotate":[ft,ze,Ie]}],invert:[{invert:["",ft,ze,Ie]}],saturate:[{saturate:[ft,ze,Ie]}],sepia:[{sepia:["",ft,ze,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Ie]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ft,ze,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[ft,ze,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,ze,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,ze,Ie]}],"backdrop-invert":[{"backdrop-invert":["",ft,ze,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[ft,ze,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[ft,ze,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,ze,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",ze,Ie]}],ease:[{ease:["linear","initial",E,ze,Ie]}],delay:[{delay:[ft,ze,Ie]}],animate:[{animate:["none",C,ze,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ze,Ie]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[ze,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"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,Ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze,Ie]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ft,Uh,Eu,QD]}],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"]}},jae=rae(_ae);function Ne(...e){return jae(Ct(e))}function cF({delayDuration:e=0,...t}){return m.jsx(Tie,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Cae({...e}){return m.jsx(Pie,{"data-slot":"tooltip",...e})}function kae({...e}){return m.jsx(Mie,{"data-slot":"tooltip-trigger",...e})}function Aae({className:e,sideOffset:t=0,children:n,...r}){return m.jsx(Die,{children:m.jsxs(Rie,{"data-slot":"tooltip-content",sideOffset:t,className:Ne("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(Iie,{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 fF=(...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 Oae=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 Nae=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 eR=e=>{const t=Nae(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 Tae={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 Pae=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 Mae=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...Tae,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:fF("lucide",i),...!a&&!Pae(l)&&{"aria-hidden":"true"},...l},[...o.map(([f,h])=>x.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 et=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(Mae,{ref:a,iconNode:t,className:fF(`lucide-${Oae(eR(e))}`,`lucide-${e}`,r),...i}));return n.displayName=eR(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 Dae=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Rae=et("arrow-down",Dae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Iae=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Zk=et("arrow-left",Iae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lae=[["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"}]],Jk=et("bot-message-square",Lae);/**
 * @license lucide-react v0.577.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 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"}]],dF=et("bot",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 $ae=[["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"}]],hF=et("brain",$ae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bae=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],eA=et("check",Bae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fae=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mm=et("chevron-down",Fae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uae=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hae=et("chevron-left",Uae);/**
 * @license lucide-react v0.577.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=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xu=et("chevron-right",qae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vae=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Kae=et("chevron-up",Vae);/**
 * @license lucide-react v0.577.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=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Xae=et("chevrons-up-down",Yae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gae=[["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"}]],mo=et("circle-alert",Gae);/**
 * @license lucide-react v0.577.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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],j0=et("circle-check",Wae);/**
 * @license lucide-react v0.577.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=[["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"}]],tA=et("circle-x",Qae);/**
 * @license lucide-react v0.577.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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Jae=et("clock",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:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],qy=et("corner-down-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 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"}]],C0=et("download",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:"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"}]],roe=et("external-link",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 ioe=[["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"}]],aoe=et("eye-off",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:"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"}]],soe=et("eye",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 loe=[["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"}]],xj=et("folder-kanban",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 uoe=[["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"}]],coe=et("folder-up",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 foe=[["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"}]],doe=et("folder",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:"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"}]],moe=et("house",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"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],goe=et("info",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 voe=[["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"}]],yoe=et("key-round",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 xoe=[["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"}]],mF=et("layout-dashboard",xoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const boe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xr=et("loader-circle",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:"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"}]],k0=et("message-square",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=[["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"}]],Eoe=et("monitor",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 _oe=[["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"}]],pF=et("moon",_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 joe=[["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"}]],gF=et("octagon-x",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 Coe=[["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"}]],vF=et("paperclip",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 koe=[["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"}]],Aoe=et("pause",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 Ooe=[["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"}]],A0=et("pencil",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 Noe=[["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"}]],nA=et("play",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 Toe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ud=et("plus",Toe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Poe=[["path",{d:"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"}]],yF=et("save",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 Moe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xF=et("search",Moe);/**
 * @license lucide-react v0.577.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:"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"}]],Roe=et("send",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=[["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"}]],rA=et("settings",Ioe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Loe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],bF=et("square",Loe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zoe=[["circle",{cx:"12",cy:"12",r:"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"}]],wF=et("sun",zoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $oe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Boe=et("terminal",$oe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Foe=[["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"}]],bs=et("trash-2",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:"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"}]],Hoe=et("triangle-alert",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 qoe=[["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"}]],iA=et("upload",qoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Voe=[["path",{d:"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"}]],SF=et("users",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:"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"}]],EF=et("wrench",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],O0=et("x",Yoe);function Xoe(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 Goe=e=>{switch(e){case"success":return Zoe;case"info":return ese;case"warning":return Joe;case"error":return tse;default:return null}},Woe=Array(12).fill(0),Qoe=({visible:e,className:t})=>_e.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},_e.createElement("div",{className:"sonner-spinner"},Woe.map((n,r)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Zoe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),Joe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.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"})),ese=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),tse=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),nse=_e.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"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rse=()=>{const[e,t]=_e.useState(document.hidden);return _e.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let bj=1;class ise{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:bj++,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],_e.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(ose(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"&&!_e.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"&&!_e.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"&&!_e.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"&&!_e.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)||bj++;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 ci=new ise,ase=(e,t)=>{const n=(t==null?void 0:t.id)||bj++;return ci.addToast({title:e,...t,id:n}),n},ose=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",sse=ase,lse=()=>ci.toasts,use=()=>ci.getActiveToasts(),Dt=Object.assign(sse,{success:ci.success,info:ci.info,warning:ci.warning,error:ci.error,custom:ci.custom,message:ci.message,promise:ci.promise,dismiss:ci.dismiss,loading:ci.loading},{getHistory:lse,getToasts:use});Xoe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Iv(e){return e.label!==void 0}const cse=3,fse="24px",dse="16px",tR=4e3,hse=356,mse=14,pse=45,gse=200;function Wa(...e){return e.filter(Boolean).join(" ")}function vse(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const yse=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:E,toasts:C,expanded:j,removeToast:A,defaultRichColors:N,closeButton:O,style:T,cancelButtonStyle:M,actionButtonStyle:I,className:z="",descriptionClassName:B="",duration:L,position:G,gap:F,expandByDefault:K,classNames:D,icons:q,closeButtonAriaLabel:X="Close toast"}=e,[V,R]=_e.useState(null),[H,U]=_e.useState(null),[$,Q]=_e.useState(!1),[Z,ne]=_e.useState(!1),[te,ie]=_e.useState(!1),[ee,le]=_e.useState(!1),[pe,ae]=_e.useState(!1),[be,we]=_e.useState(0),[Le,Oe]=_e.useState(0),Xe=_e.useRef(d.duration||L||tR),Ke=_e.useRef(null),tt=_e.useRef(null),sn=E===0,En=E+1<=w,Et=d.type,vn=d.dismissible!==!1,Pt=d.className||"",Jt=d.descriptionClassName||"",he=_e.useMemo(()=>S.findIndex(Ze=>Ze.toastId===d.id)||0,[S,d.id]),oe=_e.useMemo(()=>{var Ze;return(Ze=d.closeButton)!=null?Ze:O},[d.closeButton,O]),ke=_e.useMemo(()=>d.duration||L||tR,[d.duration,L]),Ue=_e.useRef(0),Ye=_e.useRef(0),yn=_e.useRef(0),ln=_e.useRef(null),[Xt,Se]=G.split("-"),ut=_e.useMemo(()=>S.reduce((Ze,Ft,_n)=>_n>=he?Ze:Ze+Ft.height,0),[S,he]),Qe=rse(),Dn=d.invert||h,xn=Et==="loading";Ye.current=_e.useMemo(()=>he*F+ut,[he,ut]),_e.useEffect(()=>{Xe.current=ke},[ke]),_e.useEffect(()=>{Q(!0)},[]),_e.useEffect(()=>{const Ze=tt.current;if(Ze){const Ft=Ze.getBoundingClientRect().height;return Oe(Ft),b(_n=>[{toastId:d.id,height:Ft,position:d.position},..._n]),()=>b(_n=>_n.filter(Bn=>Bn.toastId!==d.id))}},[b,d.id]),_e.useLayoutEffect(()=>{if(!$)return;const Ze=tt.current,Ft=Ze.style.height;Ze.style.height="auto";const _n=Ze.getBoundingClientRect().height;Ze.style.height=Ft,Oe(_n),b(Bn=>Bn.find(Lt=>Lt.toastId===d.id)?Bn.map(Lt=>Lt.toastId===d.id?{...Lt,height:_n}:Lt):[{toastId:d.id,height:_n,position:d.position},...Bn])},[$,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const $n=_e.useCallback(()=>{ne(!0),we(Ye.current),b(Ze=>Ze.filter(Ft=>Ft.toastId!==d.id)),setTimeout(()=>{A(d)},gse)},[d,A,b,Ye]);_e.useEffect(()=>{if(d.promise&&Et==="loading"||d.duration===1/0||d.type==="loading")return;let Ze;return j||v||Qe?(()=>{if(yn.current<Ue.current){const Bn=new Date().getTime()-Ue.current;Xe.current=Xe.current-Bn}yn.current=new Date().getTime()})():(()=>{Xe.current!==1/0&&(Ue.current=new Date().getTime(),Ze=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),$n()},Xe.current))})(),()=>clearTimeout(Ze)},[j,v,d,Et,Qe,$n]),_e.useEffect(()=>{d.delete&&($n(),d.onDismiss==null||d.onDismiss.call(d,d))},[$n,d.delete]);function Fi(){var Ze;if(q!=null&&q.loading){var Ft;return _e.createElement("div",{className:Wa(D==null?void 0:D.loader,d==null||(Ft=d.classNames)==null?void 0:Ft.loader,"sonner-loader"),"data-visible":Et==="loading"},q.loading)}return _e.createElement(Qoe,{className:Wa(D==null?void 0:D.loader,d==null||(Ze=d.classNames)==null?void 0:Ze.loader),visible:Et==="loading"})}const da=d.icon||(q==null?void 0:q[Et])||Goe(Et);var Ui,Hr;return _e.createElement("li",{tabIndex:0,ref:tt,className:Wa(z,Pt,D==null?void 0:D.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Et],d==null||(n=d.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(Ui=d.richColors)!=null?Ui:N,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":$,"data-promise":!!d.promise,"data-swiped":pe,"data-removed":Z,"data-visible":En,"data-y-position":Xt,"data-x-position":Se,"data-index":E,"data-front":sn,"data-swiping":te,"data-dismissible":vn,"data-type":Et,"data-invert":Dn,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(j||K&&$),"data-testid":d.testId,style:{"--index":E,"--toasts-before":E,"--z-index":C.length-E,"--offset":`${Z?be:Ye.current}px`,"--initial-height":K?"auto":`${Le}px`,...T,...d.style},onDragEnd:()=>{ie(!1),R(null),ln.current=null},onPointerDown:Ze=>{Ze.button!==2&&(xn||!vn||(Ke.current=new Date,we(Ye.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(ie(!0),ln.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Ft,_n;if(ee||!vn)return;ln.current=null;const Bn=Number(((Ze=tt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pi=Number(((Ft=tt.current)==null?void 0:Ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Lt=new Date().getTime()-((_n=Ke.current)==null?void 0:_n.getTime()),ur=V==="x"?Bn:pi,ha=Math.abs(ur)/Lt;if(Math.abs(ur)>=pse||ha>.11){we(Ye.current),d.onDismiss==null||d.onDismiss.call(d,d),U(V==="x"?Bn>0?"right":"left":pi>0?"down":"up"),$n(),le(!0);return}else{var Zn,cr;(Zn=tt.current)==null||Zn.style.setProperty("--swipe-amount-x","0px"),(cr=tt.current)==null||cr.style.setProperty("--swipe-amount-y","0px")}ae(!1),ie(!1),R(null)},onPointerMove:Ze=>{var Ft,_n,Bn;if(!ln.current||!vn||((Ft=window.getSelection())==null?void 0:Ft.toString().length)>0)return;const Lt=Ze.clientY-ln.current.y,ur=Ze.clientX-ln.current.x;var ha;const Zn=(ha=e.swipeDirections)!=null?ha:vse(G);!V&&(Math.abs(ur)>1||Math.abs(Lt)>1)&&R(Math.abs(ur)>Math.abs(Lt)?"x":"y");let cr={x:0,y:0};const Va=Ar=>1/(1.5+Math.abs(Ar)/20);if(V==="y"){if(Zn.includes("top")||Zn.includes("bottom"))if(Zn.includes("top")&&Lt<0||Zn.includes("bottom")&&Lt>0)cr.y=Lt;else{const Ar=Lt*Va(Lt);cr.y=Math.abs(Ar)<Math.abs(Lt)?Ar:Lt}}else if(V==="x"&&(Zn.includes("left")||Zn.includes("right")))if(Zn.includes("left")&&ur<0||Zn.includes("right")&&ur>0)cr.x=ur;else{const Ar=ur*Va(ur);cr.x=Math.abs(Ar)<Math.abs(ur)?Ar:ur}(Math.abs(cr.x)>0||Math.abs(cr.y)>0)&&ae(!0),(_n=tt.current)==null||_n.style.setProperty("--swipe-amount-x",`${cr.x}px`),(Bn=tt.current)==null||Bn.style.setProperty("--swipe-amount-y",`${cr.y}px`)}},oe&&!d.jsx&&Et!=="loading"?_e.createElement("button",{"aria-label":X,"data-disabled":xn,"data-close-button":!0,onClick:xn||!vn?()=>{}:()=>{$n(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Wa(D==null?void 0:D.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Hr=q==null?void 0:q.close)!=null?Hr:nse):null,(Et||d.icon||d.promise)&&d.icon!==null&&((q==null?void 0:q[Et])!==null||d.icon)?_e.createElement("div",{"data-icon":"",className:Wa(D==null?void 0:D.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Fi():null,d.type!=="loading"?da:null):null,_e.createElement("div",{"data-content":"",className:Wa(D==null?void 0:D.content,d==null||(a=d.classNames)==null?void 0:a.content)},_e.createElement("div",{"data-title":"",className:Wa(D==null?void 0:D.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?_e.createElement("div",{"data-description":"",className:Wa(B,Jt,D==null?void 0:D.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),_e.isValidElement(d.cancel)?d.cancel:d.cancel&&Iv(d.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||M,onClick:Ze=>{Iv(d.cancel)&&vn&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ze),$n())},className:Wa(D==null?void 0:D.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,_e.isValidElement(d.action)?d.action:d.action&&Iv(d.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||I,onClick:Ze=>{Iv(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ze),!Ze.defaultPrevented&&$n())},className:Wa(D==null?void 0:D.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function nR(){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 xse(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?dse:fse;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=_e.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=cse,toastOptions:E,dir:C=nR(),gap:j=mse,icons:A,containerAriaLabel:N="Notifications"}=t,[O,T]=_e.useState([]),M=_e.useMemo(()=>r?O.filter($=>$.toasterId===r):O.filter($=>!$.toasterId),[O,r]),I=_e.useMemo(()=>Array.from(new Set([a].concat(M.filter($=>$.position).map($=>$.position)))),[M,a]),[z,B]=_e.useState([]),[L,G]=_e.useState(!1),[F,K]=_e.useState(!1),[D,q]=_e.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=_e.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=_e.useRef(null),H=_e.useRef(!1),U=_e.useCallback($=>{T(Q=>{var Z;return(Z=Q.find(ne=>ne.id===$.id))!=null&&Z.delete||ci.dismiss($.id),Q.filter(({id:ne})=>ne!==$.id)})},[]);return _e.useEffect(()=>ci.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===$.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{D$.flushSync(()=>{T(Q=>{const Z=Q.findIndex(ne=>ne.id===$.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...$},...Q.slice(Z+1)]:[$,...Q]})})})}),[O]),_e.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 $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{$.addListener(({matches:Z})=>{try{q(Z?"dark":"light")}catch(ne){console.error(ne)}})}},[g]),_e.useEffect(()=>{O.length<=1&&G(!1)},[O]),_e.useEffect(()=>{const $=Q=>{var Z;if(o.every(ie=>Q[ie]||Q.code===ie)){var te;G(!0),(te=X.current)==null||te.focus()}Q.code==="Escape"&&(document.activeElement===X.current||(Z=X.current)!=null&&Z.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[o]),_e.useEffect(()=>{if(X.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,H.current=!1)}},[X.current]),_e.createElement("section",{ref:n,"aria-label":`${N} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map(($,Q)=>{var Z;const[ne,te]=$.split("-");return M.length?_e.createElement("ol",{key:$,dir:C==="auto"?nR():C,tabIndex:-1,ref:X,className:f,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ne,"data-x-position":te,style:{"--front-toast-height":`${((Z=z[0])==null?void 0:Z.height)||0}px`,"--width":`${hse}px`,"--gap":`${j}px`,...w,...xse(h,d)},onBlur:ie=>{H.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(H.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||H.current||(H.current=!0,R.current=ie.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{F||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},M.filter(ie=>!ie.position&&Q===0||ie.position===$).map((ie,ee)=>{var le,pe;return _e.createElement(yse,{key:ie.id,icons:A,index:ee,toast:ie,defaultRichColors:v,duration:(le=E==null?void 0:E.duration)!=null?le:b,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:i,visibleToasts:S,closeButton:(pe=E==null?void 0:E.closeButton)!=null?pe:c,interacting:F,position:$,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:U,toasts:M.filter(ae=>ae.position==ie.position),heights:z.filter(ae=>ae.position==ie.position),setHeights:B,expandByDefault:l,gap:j,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),wse=({...e})=>{const{theme:t="system"}=lk();return m.jsx(bse,{theme:t,className:"toaster group",icons:{success:m.jsx(j0,{className:"size-4"}),info:m.jsx(goe,{className:"size-4"}),warning:m.jsx(Hoe,{className:"size-4"}),error:m.jsx(gF,{className:"size-4"}),loading:m.jsx(Xr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},Sse=new EZ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),_F="/api";class jF extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Hh(e,t){const n=`${_F}${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 jF(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function Ese(e,t){const n=`${_F}${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 jF(a.status,a.statusText,o)}return a.json()}const Be={get:e=>Hh(e),post:(e,t)=>Hh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Hh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Hh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Hh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),Ese(e,n)}},Ve={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],stats:(e,t)=>["projects",e,"stats",t],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,n)=>["projects",e,"resources",t,n],resourceConfig:(e,t,n)=>["projects",e,"resources",t,n,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]}};function Rd(){return zn({queryKey:Ve.projects.all,queryFn:()=>Be.get("/projects")})}function aA(e,t){return zn({queryKey:Ve.projects.detail(e),queryFn:()=>Be.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function oA(e){return zn({queryKey:Ve.projects.files(e),queryFn:()=>Be.get(`/projects/${e}/files`)})}function sA(e,t){return zn({queryKey:Ve.projects.config(e),queryFn:()=>Be.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function Vy(e,t){return OZ({queryKey:Ve.conversations.detail(e),queryFn:({pageParam:n})=>Be.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 _se(e=10){return zn({queryKey:["conversations","recent",e],queryFn:()=>Be.get(`/conversations/recent?limit=${e}`)})}function lA(){return zn({queryKey:["imu","conversations"],queryFn:()=>Be.get("/imu/conversations")})}function uA(e,t=1,n=20){return zn({queryKey:[...Ve.conversations.all(e),t,n],queryFn:()=>Be.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function CF(){const e=pt();return It({mutationFn:t=>Be.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ve.conversations.all(n.project_id)})}})}function kF(e){const t=pt();return It({mutationFn:n=>Be.post(`/conversations/${e}/tasks`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ve.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]})}})}function cA(e){const t=pt();return It({mutationFn:({conversationId:n,title:r})=>Be.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Ve.conversations.all(e)}),t.invalidateQueries({queryKey:Ve.conversations.detail(r)})}})}function AF(){const e=pt();return It({mutationFn:()=>Be.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function OF(){const e=pt();return It({mutationFn:({conversationId:t,title:n})=>Be.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Ve.conversations.detail(n)})}})}function jse(){const e=pt();return It({mutationFn:t=>Be.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)),{previous:n}},onError:(t,n,r)=>{r!=null&&r.previous&&e.setQueryData(["imu","conversations"],r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function NF(e){const t=pt();return It({mutationFn:n=>Be.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Ve.conversations.all(e)});const r=t.getQueryData(Ve.conversations.all(e));return t.setQueryData(Ve.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Ve.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Ve.conversations.all(e)})}})}function nt({className:e,type:t,...n}){return m.jsx("input",{type:t,"data-slot":"input",className:Ne("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 Cse=500;function kse({onCommandPalette:e,onShortcutsHelp:t}){const n=bo(),r=x.useRef(null),i=x.useRef(void 0);x.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},Cse);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function TF(e){const t=e?"?"+new URLSearchParams(e).toString():"";return zn({queryKey:Ve.sessions.all(e),queryFn:()=>Be.get(`/sessions${t}`)})}function fA(){return TF({status:"running",per_page:"50"})}function Ase(){return TF({per_page:"10"})}function Ose(e,t=1,n=20){return zn({queryKey:[...Ve.projects.sessions(e),t,n],queryFn:()=>Be.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function Nse(e,t,n){return zn({queryKey:Ve.sessions.detail(e,t),queryFn:()=>Be.get(`/projects/${e}/sessions/${t}`),...n})}var rR=1,Tse=.9,Pse=.8,Mse=.17,SS=.1,ES=.999,Dse=.9999,Rse=.99,Ise=/[\\\/_+.#"@\[\(\{&]/,Lse=/[\\\/_+.#"@\[\(\{&]/g,zse=/[\s-]/,PF=/[\s-]/g;function wj(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?rR:Rse;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=wj(e,t,n,r,f+1,a+1,o),d>h&&(f===i?d*=rR:Ise.test(e.charAt(f-1))?(d*=Pse,v=e.slice(i,f-1).match(Lse),v&&i>0&&(d*=Math.pow(ES,v.length))):zse.test(e.charAt(f-1))?(d*=Tse,b=e.slice(i,f-1).match(PF),b&&i>0&&(d*=Math.pow(ES,b.length))):(d*=Mse,i>0&&(d*=Math.pow(ES,f-i))),e.charAt(f)!==t.charAt(a)&&(d*=Dse)),(d<SS&&n.charAt(f-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(f-1)!==r.charAt(a))&&(g=wj(e,t,n,r,f+1,a+2,o),g*SS>d&&(d=g*SS)),d>h&&(h=d),f=n.indexOf(c,f+1);return o[l]=h,h}function iR(e){return e.toLowerCase().replace(PF," ")}function $se(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,wj(e,t,iR(e),iR(t),0,0,{})}var qh='[cmdk-group=""]',_S='[cmdk-group-items=""]',Bse='[cmdk-group-heading=""]',MF='[cmdk-item=""]',aR=`${MF}:not([aria-disabled="true"])`,Sj="cmdk-item-select",kf="data-value",Fse=(e,t,n)=>$se(e,t,n),DF=x.createContext(void 0),Ap=()=>x.useContext(DF),RF=x.createContext(void 0),dA=()=>x.useContext(RF),IF=x.createContext(void 0),LF=x.forwardRef((e,t)=>{let n=Af(()=>{var U,$;return{search:"",value:($=(U=e.value)!=null?U:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Af(()=>new Set),i=Af(()=>new Map),a=Af(()=>new Map),o=Af(()=>new Set),l=zF(e),{label:c,children:f,value:h,onValueChange:d,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...E}=e,C=gr(),j=gr(),A=gr(),N=x.useRef(null),O=Zse();oc(()=>{if(h!==void 0){let U=h.trim();n.current.value=U,T.emit()}},[h]),oc(()=>{O(6,G)},[]);let T=x.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>n.current,setState:(U,$,Q)=>{var Z,ne,te,ie;if(!Object.is(n.current[U],$)){if(n.current[U]=$,U==="search")L(),z(),O(1,B);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(A);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(O(7,()=>{var ee;n.current.selectedItemId=(ee=F())==null?void 0:ee.id,T.emit()}),Q||O(5,G),((ne=l.current)==null?void 0:ne.value)!==void 0){let ee=$??"";(ie=(te=l.current).onValueChange)==null||ie.call(te,ee);return}}T.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),M=x.useMemo(()=>({value:(U,$,Q)=>{var Z;$!==((Z=a.current.get(U))==null?void 0:Z.value)&&(a.current.set(U,{value:$,keywords:Q}),n.current.filtered.items.set(U,I($,Q)),O(2,()=>{z(),T.emit()}))},item:(U,$)=>(r.current.add(U),$&&(i.current.has($)?i.current.get($).add(U):i.current.set($,new Set([U]))),O(3,()=>{L(),z(),n.current.value||B(),T.emit()}),()=>{a.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=F();O(4,()=>{L(),(Q==null?void 0:Q.getAttribute("id"))===U&&B(),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:A,labelId:j,listInnerRef:N}),[]);function I(U,$){var Q,Z;let ne=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:Fse;return U?ne(U,n.current.search,$):0}function z(){if(!n.current.search||l.current.shouldFilter===!1)return;let U=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(Z=>{let ne=i.current.get(Z),te=0;ne.forEach(ie=>{let ee=U.get(ie);te=Math.max(ee,te)}),$.push([Z,te])});let Q=N.current;K().sort((Z,ne)=>{var te,ie;let ee=Z.getAttribute("id"),le=ne.getAttribute("id");return((te=U.get(le))!=null?te:0)-((ie=U.get(ee))!=null?ie:0)}).forEach(Z=>{let ne=Z.closest(_S);ne?ne.appendChild(Z.parentElement===ne?Z:Z.closest(`${_S} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${_S} > *`))}),$.sort((Z,ne)=>ne[1]-Z[1]).forEach(Z=>{var ne;let te=(ne=N.current)==null?void 0:ne.querySelector(`${qh}[${kf}="${encodeURIComponent(Z[0])}"]`);te==null||te.parentElement.appendChild(te)})}function B(){let U=K().find(Q=>Q.getAttribute("aria-disabled")!=="true"),$=U==null?void 0:U.getAttribute(kf);T.setState("value",$||void 0)}function L(){var U,$,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 ne=0;for(let te of r.current){let ie=($=(U=a.current.get(te))==null?void 0:U.value)!=null?$:"",ee=(Z=(Q=a.current.get(te))==null?void 0:Q.keywords)!=null?Z:[],le=I(ie,ee);n.current.filtered.items.set(te,le),le>0&&ne++}for(let[te,ie]of i.current)for(let ee of ie)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(te);break}n.current.filtered.count=ne}function G(){var U,$,Q;let Z=F();Z&&(((U=Z.parentElement)==null?void 0:U.firstChild)===Z&&((Q=($=Z.closest(qh))==null?void 0:$.querySelector(Bse))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function F(){var U;return(U=N.current)==null?void 0:U.querySelector(`${MF}[aria-selected="true"]`)}function K(){var U;return Array.from(((U=N.current)==null?void 0:U.querySelectorAll(aR))||[])}function D(U){let $=K()[U];$&&T.setState("value",$.getAttribute(kf))}function q(U){var $;let Q=F(),Z=K(),ne=Z.findIndex(ie=>ie===Q),te=Z[ne+U];($=l.current)!=null&&$.loop&&(te=ne+U<0?Z[Z.length-1]:ne+U===Z.length?Z[0]:Z[ne+U]),te&&T.setState("value",te.getAttribute(kf))}function X(U){let $=F(),Q=$==null?void 0:$.closest(qh),Z;for(;Q&&!Z;)Q=U>0?Wse(Q,qh):Qse(Q,qh),Z=Q==null?void 0:Q.querySelector(aR);Z?T.setState("value",Z.getAttribute(kf)):q(U)}let V=()=>D(K().length-1),R=U=>{U.preventDefault(),U.metaKey?V():U.altKey?X(1):q(1)},H=U=>{U.preventDefault(),U.metaKey?D(0):U.altKey?X(-1):q(-1)};return x.createElement(Fe.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:U=>{var $;($=E.onKeyDown)==null||$.call(E,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(),D(0);break}case"End":{U.preventDefault(),V();break}case"Enter":{U.preventDefault();let Z=F();if(Z){let ne=new Event(Sj);Z.dispatchEvent(ne)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:ele},c),N0(e,U=>x.createElement(RF.Provider,{value:T},x.createElement(DF.Provider,{value:M},U))))}),Use=x.forwardRef((e,t)=>{var n,r;let i=gr(),a=x.useRef(null),o=x.useContext(IF),l=Ap(),c=zF(e),f=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;oc(()=>{if(!f)return l.item(i,o==null?void 0:o.id)},[f]);let h=$F(i,a,[e.value,e.children,a],e.keywords),d=dA(),g=Fl(O=>O.value&&O.value===h.current),v=Fl(O=>f||l.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);x.useEffect(()=>{let O=a.current;if(!(!O||e.disabled))return O.addEventListener(Sj,b),()=>O.removeEventListener(Sj,b)},[v,e.onSelect,e.disabled]);function b(){var O,T;w(),(T=(O=c.current).onSelect)==null||T.call(O,h.current)}function w(){d.setState("value",h.current,!0)}if(!v)return null;let{disabled:S,value:E,onSelect:C,forceMount:j,keywords:A,...N}=e;return x.createElement(Fe.div,{ref:ss(a,t),...N,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)}),Hse=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=gr(),l=x.useRef(null),c=x.useRef(null),f=gr(),h=Ap(),d=Fl(v=>i||h.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);oc(()=>h.group(o),[]),$F(o,l,[e.value,e.heading,c]);let g=x.useMemo(()=>({id:o,forceMount:i}),[i]);return x.createElement(Fe.div,{ref:ss(l,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),N0(e,v=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},x.createElement(IF.Provider,{value:g},v))))}),qse=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=x.useRef(null),a=Fl(o=>!o.search);return!n&&!a?null:x.createElement(Fe.div,{ref:ss(i,t),...r,"cmdk-separator":"",role:"separator"})}),Vse=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=dA(),o=Fl(f=>f.search),l=Fl(f=>f.selectedItemId),c=Ap();return x.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),x.createElement(Fe.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)}})}),Kse=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=x.useRef(null),o=x.useRef(null),l=Fl(f=>f.selectedItemId),c=Ap();return x.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)}}},[]),x.createElement(Fe.div,{ref:ss(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},N0(e,f=>x.createElement("div",{ref:ss(o,c.listInnerRef),"cmdk-list-sizer":""},f)))}),Yse=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return x.createElement(xk,{open:n,onOpenChange:r},x.createElement(bk,{container:o},x.createElement(wk,{"cmdk-overlay":"",className:i}),x.createElement(Sk,{"aria-label":e.label,"cmdk-dialog":"",className:a},x.createElement(LF,{ref:t,...l}))))}),Xse=x.forwardRef((e,t)=>Fl(n=>n.filtered.count===0)?x.createElement(Fe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Gse=x.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return x.createElement(Fe.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},N0(e,o=>x.createElement("div",{"aria-hidden":!0},o)))}),Id=Object.assign(LF,{List:Kse,Item:Use,Input:Vse,Group:Hse,Separator:qse,Dialog:Yse,Empty:Xse,Loading:Gse});function Wse(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function zF(e){let t=x.useRef(e);return oc(()=>{t.current=e}),t}var oc=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Af(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Fl(e){let t=dA(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function $F(e,t,n,r=[]){let i=x.useRef(),a=Ap();return oc(()=>{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(kf,l),i.current=l}),i}var Zse=()=>{let[e,t]=x.useState(),n=Af(()=>new Map);return oc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Jse(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function N0({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(Jse(t),{ref:t.ref},n(t.props.children)):n(t)}var ele={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const oR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sR=Ct,T0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return sR(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=oR(h)||oR(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 sR(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},tle=T0("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 je({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?uk:"button";return m.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:Ne(tle({variant:t,size:n,className:e})),...i})}function ws({...e}){return m.jsx(xk,{"data-slot":"dialog",...e})}function nle({...e}){return m.jsx(bk,{"data-slot":"dialog-portal",...e})}function rle({className:e,...t}){return m.jsx(wk,{"data-slot":"dialog-overlay",className:Ne("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 Ss({className:e,children:t,showCloseButton:n=!0,...r}){return m.jsxs(nle,{"data-slot":"dialog-portal",children:[m.jsx(rle,{}),m.jsxs(Sk,{"data-slot":"dialog-content",className:Ne("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(Ek,{"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(O0,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Es({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:Ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function BF({className:e,showCloseButton:t=!1,children:n,...r}){return m.jsxs("div",{"data-slot":"dialog-footer",className:Ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&m.jsx(Ek,{asChild:!0,children:m.jsx(je,{variant:"outline",children:"Close"})})]})}function _s({className:e,...t}){return m.jsx(DB,{"data-slot":"dialog-title",className:Ne("text-lg leading-none font-semibold",e),...t})}function FF({className:e,...t}){return m.jsx(RB,{"data-slot":"dialog-description",className:Ne("text-sm text-muted-foreground",e),...t})}function ile({className:e,...t}){return m.jsx(Id,{"data-slot":"command",className:Ne("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function ale({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return m.jsxs(ws,{...a,children:[m.jsxs(Es,{className:"sr-only",children:[m.jsx(_s,{children:e}),m.jsx(FF,{children:t})]}),m.jsx(Ss,{className:Ne("overflow-hidden p-0",r),showCloseButton:i,children:m.jsx(ile,{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 ole({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(xF,{className:"size-4 shrink-0 opacity-50"}),m.jsx(Id.Input,{"data-slot":"command-input",className:Ne("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 sle({className:e,...t}){return m.jsx(Id.List,{"data-slot":"command-list",className:Ne("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function lle({...e}){return m.jsx(Id.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Vh({className:e,...t}){return m.jsx(Id.Group,{"data-slot":"command-group",className:Ne("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function ya({className:e,...t}){return m.jsx(Id.Item,{"data-slot":"command-item",className:Ne("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 lR({className:e,...t}){return m.jsx("span",{"data-slot":"command-shortcut",className:Ne("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function ule({open:e,onOpenChange:t}){var f;const n=bo(),{setTheme:r}=lk(),i=Rd(),a=fA(),o=i.data??[],l=((f=a.data)==null?void 0:f.items)??[],c=h=>{t(!1),n(h)};return m.jsxs(ale,{open:e,onOpenChange:t,showCloseButton:!1,children:[m.jsx(ole,{placeholder:"Type a command or search..."}),m.jsxs(sle,{children:[m.jsx(lle,{children:"No results found."}),m.jsxs(Vh,{heading:"Navigation",children:[m.jsxs(ya,{onSelect:()=>c("/"),children:[m.jsx(mF,{}),"Dashboard",m.jsx(lR,{children:"G D"})]}),m.jsxs(ya,{onSelect:()=>c("/projects"),children:[m.jsx(xj,{}),"Projects",m.jsx(lR,{children:"G P"})]})]}),o.length>0&&m.jsx(Vh,{heading:"Projects",children:o.map(h=>m.jsxs(ya,{onSelect:()=>c(`/projects/${h.id}`),children:[m.jsx(xj,{}),h.display_name]},h.id))}),l.length>0&&m.jsx(Vh,{heading:"Running Sessions",children:l.map(h=>m.jsxs(ya,{onSelect:()=>c(`/projects/${h.project_id}/sessions/${h.run_id}`),children:[m.jsx(nA,{}),h.role," (",h.run_id.slice(0,8),")"]},h.run_id))}),m.jsxs(Vh,{heading:"Resources",children:[m.jsxs(ya,{onSelect:()=>c("/resources/roles"),children:[m.jsx(SF,{}),"Roles"]}),m.jsxs(ya,{onSelect:()=>c("/resources/skills"),children:[m.jsx(EF,{}),"Skills"]}),m.jsxs(ya,{onSelect:()=>c("/resources/agents"),children:[m.jsx(dF,{}),"Agents"]}),m.jsxs(ya,{onSelect:()=>c("/resources/memories"),children:[m.jsx(hF,{}),"Memory"]})]}),m.jsxs(Vh,{heading:"Theme",children:[m.jsxs(ya,{onSelect:()=>{r("light"),t(!1)},children:[m.jsx(wF,{}),"Light"]}),m.jsxs(ya,{onSelect:()=>{r("dark"),t(!1)},children:[m.jsx(pF,{}),"Dark"]}),m.jsxs(ya,{onSelect:()=>{r("system"),t(!1)},children:[m.jsx(Eoe,{}),"System"]})]})]})]})}const cle=[{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 fle({open:e,onOpenChange:t}){return m.jsx(ws,{open:e,onOpenChange:t,children:m.jsxs(Ss,{className:"max-w-sm",children:[m.jsx(Es,{children:m.jsx(_s,{children:"Keyboard Shortcuts"})}),m.jsx("div",{className:"space-y-2",children:cle.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 dle({...e}){return m.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function hle({className:e,...t}){return m.jsx("ol",{"data-slot":"breadcrumb-list",className:Ne("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function mle({className:e,...t}){return m.jsx("li",{"data-slot":"breadcrumb-item",className:Ne("inline-flex items-center gap-1.5",e),...t})}function ple({asChild:e,className:t,...n}){const r=e?uk:"a";return m.jsx(r,{"data-slot":"breadcrumb-link",className:Ne("transition-colors hover:text-foreground",t),...n})}function gle({className:e,...t}){return m.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Ne("font-normal text-foreground",e),...t})}function vle({children:e,className:t,...n}){return m.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ne("[&>svg]:size-3.5",t),...n,children:e??m.jsx(Xu,{})})}function Dm({...e}){return m.jsx(nre,{"data-slot":"dropdown-menu",...e})}function Rm({...e}){return m.jsx(rre,{"data-slot":"dropdown-menu-trigger",...e})}function Im({className:e,sideOffset:t=4,...n}){return m.jsx(ire,{children:m.jsx(are,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ne("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 mm({className:e,inset:t,variant:n="default",...r}){return m.jsx(ore,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ne("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 UF({className:e,children:t,checked:n,...r}){return m.jsxs(sre,{"data-slot":"dropdown-menu-checkbox-item",className:Ne("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(lre,{children:m.jsx(eA,{className:"size-4"})})}),t]})}function bl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return m.jsx(uie,{"data-slot":"separator",decorative:n,orientation:t,className:Ne("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 yle=[{to:"/imu",label:"Bot Imu",icon:Jk},{to:"/",label:"Dashboard",icon:mF,end:!0},{to:"/projects",label:"Projects",icon:xj},{to:"/schedules",label:"Schedules",icon:Jae},{to:"/settings",label:"Settings",icon:rA}],xle=[{to:"/resources/roles",label:"Roles",icon:SF},{to:"/resources/skills",label:"Skills",icon:EF},{to:"/resources/agents",label:"Agents",icon:dF},{to:"/resources/memories",label:"Memory",icon:hF}];function ble({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=x.useState(!1),[o,l]=x.useState(!1),[c,f]=x.useState(!1),[h,d]=x.useState(""),g=x.useRef(null),v=cA(t),b=NF(t),w=E=>{E.stopPropagation(),E.preventDefault(),d(e.title??""),a(!0),setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0)},S=()=>{const E=h.trim();v.mutate({conversationId:e.id,title:E||null}),a(!1)};return i?m.jsx("div",{className:"px-1",children:m.jsx(nt,{ref:g,value:h,onChange:E=>d(E.target.value),onBlur:S,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),S()),E.key==="Escape"&&(E.stopPropagation(),a(!1))},onClick:E=>E.stopPropagation(),className:"h-7 text-xs px-2"})}):m.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:Ne("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:E=>{E.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:E=>{E.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(A0,{className:"h-3 w-3"})}),!n&&m.jsx("button",{onClick:E=>{E.stopPropagation(),f(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:m.jsx(bs,{className:"h-3 w-3"})})]})]})}function wle({conv:e,isActive:t,navigate:n}){const[r,i]=x.useState(!1),[a,o]=x.useState(!1),[l,c]=x.useState(!1),[f,h]=x.useState(""),d=x.useRef(null),g=OF(),v=jse(),b=S=>{S.stopPropagation(),S.preventDefault(),h(e.title??""),i(!0),setTimeout(()=>{var E;return(E=d.current)==null?void 0:E.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(nt,{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:Ne("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),n("/imu")},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(A0,{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(bs,{className:"h-3 w-3"})})]})]})}function Sle({conversationId:e}){const t=bo(),n=lA(),r=AF();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(Ir,{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(Jk,{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(ud,{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(wle,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function Ele({projectId:e,conversationId:t}){var o,l;const n=bo(),r=uA(e,1,50),i=CF(),a=aA(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(Ir,{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(Zk,{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(ud,{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(ble,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function _le(){var d,g;const t=Ba().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}=aA(n,{enabled:n>0}),{data:a}=uA(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}=lA(),f=((g=c==null?void 0:c.find(v=>v.id===l))==null?void 0:g.title)??null,h=[{label:"Dashboard",href:"/"}];if(t[0]==="projects"&&(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"&&h.push({label:"Scheduled Tasks"}),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 jle(){const e=_le(),t=bo(),n=Rd(),{setTheme:r}=lk(),[i,a]=x.useState(!1),[o,l]=x.useState(!1),c=oD("/projects/:projectId/conversations/:conversationId"),f=c?Number(c.params.projectId):0,h=c?Number(c.params.conversationId):0,d=oD("/imu/:conversationId"),g=d?Number(d.params.conversationId):0;return kse({onCommandPalette:()=>a(!0),onShortcutsHelp:()=>l(!0)}),m.jsxs("div",{className:"flex h-screen",children:[c?m.jsx(Ele,{projectId:f,conversationId:h}):d?m.jsx(Sle,{conversationId:g}):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(Ir,{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:[yle.map(({to:v,label:b,icon:w,end:S})=>m.jsxs(D_,{to:v,end:S,className:({isActive:E})=>Ne("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",E?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[m.jsx(w,{className:"h-4 w-4"}),b]},v)),m.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),xle.map(({to:v,label:b,icon:w})=>m.jsxs(D_,{to:v,className:({isActive:S})=>Ne("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",S?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[m.jsx(w,{className:"h-4 w-4"}),b]},v))]})]}),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(dle,{children:m.jsx(hle,{children:e.map((v,b)=>{const w=b===e.length-1;return m.jsxs(mle,{children:[b>0&&m.jsx(vle,{}),v.projectSwitcher?m.jsxs(Dm,{children:[m.jsxs(Rm,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[v.label,m.jsx(Xae,{className:"h-3 w-3 text-muted-foreground"})]}),m.jsx(Im,{align:"start",children:(n.data??[]).map(S=>m.jsxs(mm,{onClick:()=>t(`/projects/${S.id}`),children:[v.href===`/projects/${S.id}`?m.jsx(eA,{className:"mr-2 h-3.5 w-3.5"}):m.jsx("span",{className:"mr-2 inline-block w-3.5"}),S.display_name]},S.id))})]}):w?m.jsx(gle,{children:v.label}):m.jsx(ple,{href:v.href,children:v.label})]},v.label)})})}),m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("button",{onClick:()=>a(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:m.jsx("kbd",{className:"font-mono",children:"⌘K"})}),m.jsxs(Dm,{children:[m.jsx(Rm,{asChild:!0,children:m.jsxs(je,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[m.jsx(wF,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),m.jsx(pF,{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(Im,{align:"end",children:[m.jsx(mm,{onClick:()=>r("light"),children:"Light"}),m.jsx(mm,{onClick:()=>r("dark"),children:"Dark"}),m.jsx(mm,{onClick:()=>r("system"),children:"System"})]})]})]})]}),m.jsx(bl,{}),m.jsx("main",{className:"flex-1 overflow-auto p-6",children:m.jsx(mQ,{})})]}),m.jsx(ule,{open:i,onOpenChange:a}),m.jsx(fle,{open:o,onOpenChange:l})]})}function Cle(){const e=pt();return It({mutationFn:t=>Be.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ve.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function hA(){const e=pt();return It({mutationFn:t=>Be.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function kle(){const e=pt();return It({mutationFn:t=>Be.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const Ale=T0("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 Bt({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?uk:"span";return m.jsx(i,{"data-slot":"badge","data-variant":t,className:Ne(Ale({variant:t}),e),...r})}function cs({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:Ne("w-full caption-bottom text-sm",e),...t})})}function fs({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:Ne("[&_tr]:border-b",e),...t})}function ds({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:Ne("[&_tr:last-child]:border-0",e),...t})}function ir({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:Ne("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function it({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:Ne("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 rt({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:Ne("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Ej({sessions:e,projectNames:t}){return m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Run ID"}),t&&m.jsx(it,{children:"Project"}),m.jsx(it,{children:"Role"}),m.jsx(it,{children:"Status"}),m.jsx(it,{children:"Started"}),m.jsx(it,{children:"Duration"}),m.jsx(it,{children:"Task"}),m.jsx(it,{className:"w-[80px]"})]})}),m.jsx(ds,{children:e.map(n=>m.jsxs(ir,{children:[m.jsx(rt,{children:m.jsx(Ir,{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(rt,{children:m.jsx(Ir,{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(rt,{className:"text-sm",children:n.role}),m.jsx(rt,{children:m.jsx(Ole,{status:n.status})}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:Ky(n.started_at)}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:P0(n.duration_ms)}),m.jsx(rt,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),m.jsx(rt,{children:m.jsx(Nle,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function Ole({status:e}){const t=HF(e);return m.jsxs(Bt,{variant:"outline",className:Ne("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 uR=HF;function HF(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 Ky(e){try{return new Date(e).toLocaleString()}catch{return e}}function P0(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 Nle({runId:e,disabled:t}){const[n,r]=x.useState(!1),i=kle(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(je,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):m.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:m.jsx(bs,{className:"h-4 w-4"})})}function bn({className:e,...t}){return m.jsx("div",{"data-slot":"card",className:Ne("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Kh({className:e,...t}){return m.jsx("div",{"data-slot":"card-header",className:Ne("@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 Yh({className:e,...t}){return m.jsx("div",{"data-slot":"card-title",className:Ne("leading-none font-semibold",e),...t})}function wn({className:e,...t}){return m.jsx("div",{"data-slot":"card-content",className:Ne("px-6",e),...t})}const jS=1e4;function qF(e,t,n){const[r,i]=x.useState([]),[a,o]=x.useState(!1),[l,c]=x.useState(!1),f=x.useRef(null),h=x.useRef(void 0),d=x.useRef(1e3),g=x.useRef("");return x.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 E=JSON.parse(S.data);Array.isArray(E.lines)&&i(E.lines.slice(-jS))}catch{}}),w.addEventListener("append",S=>{try{const E=JSON.parse(S.data);Array.isArray(E.lines)&&E.lines.length>0&&i(C=>{const j=[...C,...E.lines];return j.length>jS?j.slice(-jS):j})}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 Tle=5e3;function Ple({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=qF(e,n,!0),c=o.slice(-4),[f,h]=x.useState("");x.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const C=Date.now()-w,j=Math.floor(C/1e3)%60,A=Math.floor(C/6e4)%60,N=Math.floor(C/36e5);h(N>0?`${N}h ${A}m`:`${A}m ${j}s`)};S();const E=setInterval(S,1e3);return()=>clearInterval(E)},[a]);const d=x.useRef(o.length),g=x.useRef(Date.now()),[v,b]=x.useState(!1);return x.useEffect(()=>{o.length!==d.current&&(d.current=o.length,g.current=Date.now(),b(!1))},[o.length]),x.useEffect(()=>{const w=setInterval(()=>{Date.now()-g.current>Tle&&b(!0)},1e3);return()=>clearInterval(w)},[]),m.jsx(bn,{className:"overflow-hidden",children:m.jsxs(wn,{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(Bt,{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(Ir,{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(Xu,{className:"h-3 w-3"})]})})]})})}const CS=8;function Mle(){var o;const t=((o=fA().data)==null?void 0:o.items)??[],n=AZ({queries:t.slice(0,CS).map(l=>({queryKey:Ve.sessions.detail(l.project_id,l.run_id),queryFn:()=>Be.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,CS),a=r.length-CS;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(Ple,{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 Tn({className:e,...t}){return m.jsx("div",{"data-slot":"skeleton",className:Ne("animate-pulse rounded-md bg-accent",e),...t})}function Dle(){return m.jsxs("div",{className:"space-y-8",children:[m.jsx(Tn,{className:"h-8 w-40"}),m.jsxs("div",{className:"space-y-3",children:[m.jsx(Tn,{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(Tn,{className:"h-28 rounded-lg"},e))})]}),m.jsxs("div",{className:"space-y-3",children:[m.jsx(Tn,{className:"h-4 w-32"}),m.jsx(Tn,{className:"h-48 rounded-lg"})]})]})}function Rle(){var d,g;const e=Rd(),t=fA(),n=Ase(),r=_se(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return m.jsx(Dle,{});if(a)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{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(Mle,{}),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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{children:"Directory"}),m.jsx(it,{children:"Status"})]})}),m.jsxs(ds,{children:[o.slice(0,10).map(v=>m.jsxs(ir,{children:[m.jsx(rt,{children:m.jsx(Ir,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),m.jsx(rt,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),m.jsx(rt,{children:m.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&m.jsx(Bt,{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(Bt,{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(ir,{children:m.jsx(rt,{colSpan:3,className:"text-center",children:m.jsxs(Ir,{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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsx(Ej,{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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Title"}),m.jsx(it,{children:"Project"}),m.jsx(it,{children:"Sessions"}),m.jsx(it,{children:"Last Activity"})]})}),m.jsx(ds,{children:(r.data??[]).map(v=>m.jsxs(ir,{children:[m.jsx(rt,{children:m.jsx(Ir,{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(rt,{children:m.jsx(Ir,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:v.session_count}),m.jsx(rt,{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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsx(Ej,{sessions:c,projectNames:f})})})]})]})}function VF(){return zn({queryKey:Ve.config.global,queryFn:()=>Be.get("/config/global")})}function Ile(){const e=pt();return It({mutationFn:t=>Be.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.projects.all})}})}function Lle(){const e=pt();return It({mutationFn:t=>Be.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.projects.all})}})}function zle(){const e=pt();return It({mutationFn:({projectId:t,files:n})=>Be.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ve.projects.files(n.projectId)})}})}function $le(){const e=pt();return It({mutationFn:({projectId:t,filePath:n})=>Be.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ve.projects.files(n.projectId)})}})}function Ble(){const e=pt();return It({mutationFn:t=>Be.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Ve.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Ve.config.global})}})}function KF(){const e=pt();return It({mutationFn:({projectId:t,data:n})=>Be.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Ve.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Ve.projects.config(n.projectId)})}})}function Op({className:e,children:t,...n}){return m.jsxs(Sre,{"data-slot":"scroll-area",className:Ne("relative",e),...n,children:[m.jsx(Ere,{"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(Fle,{}),m.jsx(_re,{})]})}function Fle({className:e,orientation:t="vertical",...n}){return m.jsx(X6,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ne("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(Z6,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Ule({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=x.useState(null),[a,o]=x.useState(!0),[l,c]=x.useState(null),[f,h]=x.useState(null),d=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Be.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 Be.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 x.useEffect(()=>{d(e||void 0)},[]),m.jsx(ws,{open:!0,onOpenChange:v=>!v&&n(),children:m.jsxs(Ss,{className:"sm:max-w-[480px]",children:[m.jsx(Es,{children:m.jsx(_s,{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(Op,{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(coe,{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(doe,{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(BF,{children:f!==null?m.jsxs("div",{className:"flex w-full gap-2",children:[m.jsx(nt,{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(je,{size:"sm",onClick:g,children:"Create"}),m.jsx(je,{size:"sm",variant:"outline",onClick:()=>h(null),children:"Cancel"})]}):m.jsxs(m.Fragment,{children:[m.jsx(je,{variant:"outline",onClick:()=>h(""),disabled:!r,children:"New Folder"}),m.jsx("div",{className:"flex-1"}),m.jsx(je,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),m.jsx(je,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function ct({className:e,...t}){return m.jsx(cre,{"data-slot":"label",className:Ne("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(Xre,{"data-slot":"select",...e})}function Ra({...e}){return m.jsx(Wre,{"data-slot":"select-value",...e})}function Ia({className:e,size:t="default",children:n,...r}){return m.jsxs(Gre,{"data-slot":"select-trigger","data-size":t,className:Ne("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(Qre,{asChild:!0,children:m.jsx(Mm,{className:"size-4 opacity-50"})})]})}function La({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return m.jsx(Zre,{children:m.jsxs(Jre,{"data-slot":"select-content",className:Ne("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(Hle,{}),m.jsx(eie,{className:Ne("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(qle,{})]})})}function Pn({className:e,children:t,...n}){return m.jsxs(tie,{"data-slot":"select-item",className:Ne("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(rie,{children:m.jsx(eA,{className:"size-4"})})}),m.jsx(nie,{children:t})]})}function Hle({className:e,...t}){return m.jsx(iie,{"data-slot":"select-scroll-up-button",className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Kae,{className:"size-4"})})}function qle({className:e,...t}){return m.jsx(aie,{"data-slot":"select-scroll-down-button",className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Mm,{className:"size-4"})})}function Vle(){const{data:e,isLoading:t,error:n}=Rd(),[r,i]=x.useState(!1);if(t)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(Tn,{className:"h-8 w-32"}),m.jsx(Tn,{className:"h-64 rounded-lg"})]});if(n)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{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(je,{onClick:()=>i(!0),children:[m.jsx(ud,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&m.jsx(Kle,{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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{children:"Directory"}),m.jsx(it,{children:"Created"}),m.jsx(it,{children:"Status"}),m.jsx(it,{className:"w-[80px]"})]})}),m.jsx(ds,{children:a.map(o=>m.jsxs(ir,{children:[m.jsx(rt,{children:m.jsx(Ir,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),m.jsx(rt,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:Xle(o.created_at)}),m.jsx(rt,{children:o.dir_exists?m.jsx(Bt,{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(Bt,{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(rt,{children:m.jsx(Yle,{projectId:o.id})})]},o.id))})]})})})]})}function Kle({onDone:e,onCancel:t}){var M,I,z;const[n,r]=x.useState(""),[i,a]=x.useState(""),[o,l]=x.useState(""),[c,f]=x.useState(""),[h,d]=x.useState(!1),[g,v]=x.useState(!1),b=Ile(),w=KF(),E=(M=VF().data)==null?void 0:M.defaults,C=(E==null?void 0:E.isolation)??"none",j=((I=E==null?void 0:E.session)==null?void 0:I.merge_strategy)??"auto",A=o||C,N=async()=>{const B=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),L={},G=c||j;L.isolation=A,L.session={merge_strategy:G},await w.mutateAsync({projectId:B.id,data:L}),e()},O=async B=>{B.preventDefault();try{if(A==="worktree"&&i.trim()&&!(await Be.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await N()}catch{}},T=async()=>{try{await Be.post("/fs/git-init",{path:i.trim()}),v(!1),await N()}catch{}};return m.jsx(bn,{children:m.jsx(wn,{className:"pt-6",children:m.jsxs("form",{onSubmit:O,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(ct,{htmlFor:"display-name",children:"Display Name"}),m.jsx(nt,{id:"display-name",value:n,onChange:B=>r(B.target.value),required:!0,autoFocus:!0})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"working-dir",children:"Working Directory"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(nt,{id:"working-dir",value:i,onChange:B=>a(B.target.value),placeholder:"/path/to/project",required:!0}),m.jsx(je,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!h),children:"Browse"})]})]})]}),h&&m.jsx(Ule,{initialPath:i||void 0,onSelect:B=>{a(B),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(ct,{htmlFor:"isolation",children:"Isolation"}),m.jsxs(Da,{value:o||C,onValueChange:l,children:[m.jsx(Ia,{id:"isolation",children:m.jsx(Ra,{})}),m.jsxs(La,{children:[m.jsx(Pn,{value:"none",children:"none"}),m.jsx(Pn,{value:"worktree",children:"worktree"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"merge-strategy",children:"Merge Strategy"}),m.jsxs(Da,{value:c||j,onValueChange:f,children:[m.jsx(Ia,{id:"merge-strategy",children:m.jsx(Ra,{})}),m.jsxs(La,{children:[m.jsx(Pn,{value:"auto",children:"auto"}),m.jsx(Pn,{value:"local",children:"local"}),m.jsx(Pn,{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(je,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),m.jsx(je,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&m.jsx("p",{className:"text-sm text-destructive",children:(z=b.error||w.error)==null?void 0:z.message}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(je,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),m.jsx(je,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function Yle({projectId:e}){const[t,n]=x.useState(!1),r=Lle(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(je,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):m.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:m.jsx(bs,{className:"h-4 w-4"})})}function Xle(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function YF(e){return zn({queryKey:Ve.projects.resources(e),queryFn:()=>Be.get(`/projects/${e}/resources`)})}function Gle(e,t,n,r){return zn({queryKey:Ve.projects.resourceDetail(e,t,n),queryFn:()=>Be.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Wle(e,t,n,r){return zn({queryKey:Ve.projects.resourceConfig(e,t,n),queryFn:()=>Be.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Qle(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 Zle({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Qle(e,t);return m.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[m.jsx(je,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:m.jsx(Hae,{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(je,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),m.jsx(je,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:m.jsx(Xu,{className:"h-4 w-4"})})]})}function mA(){return zn({queryKey:Ve.roles.all,queryFn:()=>Be.get("/roles")})}function Jle(e){return zn({queryKey:Ve.registry.validate(e??""),queryFn:()=>Be.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Oa(e,t){return zn({queryKey:Ve.registry.list(e),queryFn:()=>Be.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function eue(e,t,n){return zn({queryKey:Ve.registry.detail(e,t),queryFn:()=>Be.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}function XF(e,t,n){return zn({queryKey:Ve.registry.config(e,t),queryFn:()=>Be.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function Ul({className:e,...t}){return m.jsx("textarea",{"data-slot":"textarea",className:Ne("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 Lf({...e}){return m.jsx(oJ,{"data-slot":"collapsible",...e})}function zf({...e}){return m.jsx(oB,{"data-slot":"collapsible-trigger",...e})}function $f({...e}){return m.jsx(sB,{"data-slot":"collapsible-content",...e})}function tue({projectId:e,open:t,onOpenChange:n}){var ke,Ue,Ye,yn,ln,Xt;const r=bo(),i=sA(e),a=mA(),{data:o}=Oa("agents"),{data:l}=Oa("memories"),c=oA(e),f=Cle(),h=(ke=i.data)==null?void 0:ke.merged,d="__empty__",[g,v]=x.useState(""),[b,w]=x.useState(""),[S,E]=x.useState(""),[C,j]=x.useState(""),[A,N]=x.useState(""),[O,T]=x.useState(""),[M,I]=x.useState(""),[z,B]=x.useState(""),[L,G]=x.useState(""),[F,K]=x.useState(!1),[D,q]=x.useState([]),[X,V]=x.useState(!1),[R,H]=x.useState(""),[U,$]=x.useState(!1),[Q,Z]=x.useState(!1),ne=pt(),te=()=>{v(""),w(""),E(""),j(""),N(""),T(""),I(""),B(""),G(""),K(!1),q([]),V(!1)},ie=Se=>{Se.preventDefault(),$(!0)},ee=Se=>{Se.preventDefault(),$(!0)},le=Se=>{Se.preventDefault(),$(!1)},pe=async Se=>{Se.preventDefault(),$(!1);const ut=Array.from(Se.dataTransfer.files);if(ut.length){Z(!0);try{const Qe=await Be.upload(`/projects/${e}/files`,ut);ne.invalidateQueries({queryKey:Ve.projects.files(e)}),q(Dn=>{const xn=Qe.map($n=>$n.path).filter($n=>!Dn.includes($n));return[...Dn,...xn]})}catch{}finally{Z(!1)}}},ae=Se=>{q(ut=>ut.includes(Se)?ut.filter(Qe=>Qe!==Se):[...ut,Se])},be=async Se=>{Se.preventDefault();try{const ut={project_id:e,task:g.trim()};b.trim()&&(ut.role=b.trim());const Qe={};S.trim()&&(Qe.runtime=S.trim()),C.trim()&&(Qe.memory=C.trim()),A&&(Qe.cache_delegations=A==="true"),O.trim()&&(Qe.cache_max_entries=Number(O.trim())),M.trim()&&(Qe.cache_ttl_seconds=Number(M.trim())),z.trim()&&(Qe.max_num_delegations=Number(z.trim())),Object.keys(Qe).length>0&&(ut.overrides=Qe),D.length>0&&(ut.context_files=D),L.trim()&&(ut.system_prompt=L.trim()),F&&(ut.interactive=!0);const Dn=await f.mutateAsync(ut);te(),n(!1),r(`/projects/${e}/sessions/${Dn.run_id}`)}catch{}},we=(h==null?void 0:h.orchestrator_role)??"orchestrator",Le=(a.data??[]).filter(Se=>Se!==we),Oe=[we,...Le],Xe=(o??[]).map(Se=>Se.name),Ke=new Set((l??[]).map(Se=>Se.name));Ke.add("none");const tt=[...Ke].sort(),sn=b.trim()||we,En=XF("roles",sn,{enabled:!!sn}),Et=((Ye=(Ue=En.data)==null?void 0:Ue.params_values)==null?void 0:Ye.default_agent)??((Xt=(ln=(yn=En.data)==null?void 0:yn.params_schema)==null?void 0:ln.default_agent)==null?void 0:Xt.default)??"",vn=Et&&Xe.includes(Et)?Et:(h==null?void 0:h.runtime)??"strawpot-claude-code",Pt=b.trim()&&!Oe.includes(b.trim())?"Role not found in installed roles":"",Jt=S.trim()&&Xe.length>0&&!Xe.includes(S.trim())?"Runtime not found in installed agents":"",he=C.trim()&&!tt.includes(C.trim())?"Memory not found in installed providers":"",oe=!!Pt||!!Jt||!!he;return m.jsx(ws,{open:t,onOpenChange:n,children:m.jsxs(Ss,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[m.jsx(Es,{children:m.jsx(_s,{children:"Launch Session"})}),m.jsxs("form",{onSubmit:be,className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(ct,{htmlFor:"task",children:["Task ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs("div",{className:"relative",onDragOver:ie,onDragEnter:ee,onDragLeave:le,onDrop:pe,children:[m.jsx(Ul,{id:"task",value:g,onChange:Se=>v(Se.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(U||Q)&&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:Q?m.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(Xr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):m.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[m.jsx(iA,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(c.data??[]).length>0&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(Dm,{children:[m.jsx(Rm,{asChild:!0,children:m.jsxs(je,{type:"button",variant:"outline",size:"sm",children:[m.jsx(vF,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),m.jsxs(Im,{align:"start",className:"w-64",onCloseAutoFocus:Se=>Se.preventDefault(),children:[m.jsx("div",{className:"px-2 py-1.5",children:m.jsx(nt,{placeholder:"Filter files...",value:R,onChange:Se=>H(Se.target.value),className:"h-7 text-xs",onKeyDown:Se=>Se.stopPropagation()})}),m.jsx("div",{className:"max-h-48 overflow-y-auto",children:(c.data??[]).filter(Se=>Se.path.toLowerCase().includes(R.toLowerCase())).map(Se=>m.jsx(UF,{checked:D.includes(Se.path),onCheckedChange:()=>ae(Se.path),onSelect:ut=>ut.preventDefault(),children:m.jsx("span",{className:"font-mono text-xs",children:Se.path})},Se.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:[(X?D:D.slice(0,3)).map(Se=>m.jsxs(Bt,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[m.jsx("button",{type:"button",onClick:()=>ae(Se),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:m.jsx(O0,{className:"h-3 w-3"})}),m.jsxs("span",{className:"truncate",children:["@",Se]})]},Se)),!X&&D.length>3&&m.jsxs("button",{type:"button",onClick:()=>V(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",D.length-3," more"]}),X&&D.length>3&&m.jsx("button",{type:"button",onClick:()=>V(!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(ct,{htmlFor:"role",children:"Role"}),m.jsx(nt,{id:"role",list:"datalist-role",value:b,onChange:Se=>w(Se.target.value),placeholder:we}),m.jsxs("datalist",{id:"datalist-role",children:[m.jsx("option",{value:we}),Le.map(Se=>m.jsx("option",{value:Se},Se))]}),Pt&&m.jsx("p",{className:"text-xs text-destructive",children:Pt})]}),m.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:F,onChange:Se=>K(Se.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(Lf,{children:[m.jsx(zf,{asChild:!0,children:m.jsxs(je,{type:"button",variant:"ghost",size:"sm",children:[m.jsx(Mm,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),m.jsxs($f,{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(ct,{htmlFor:"runtime",children:"Runtime"}),m.jsx(nt,{id:"runtime",list:"datalist-runtime",value:S,onChange:Se=>E(Se.target.value),placeholder:vn}),o&&m.jsx("datalist",{id:"datalist-runtime",children:o.map(Se=>m.jsx("option",{value:Se.name},Se.name))}),Jt&&m.jsx("p",{className:"text-xs text-destructive",children:Jt})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"memory",children:"Memory"}),m.jsx(nt,{id:"memory",list:"datalist-memory",value:C,onChange:Se=>j(Se.target.value),placeholder:(h==null?void 0:h.memory)||"dial"}),m.jsx("datalist",{id:"datalist-memory",children:tt.map(Se=>m.jsx("option",{value:Se},Se))}),he&&m.jsx("p",{className:"text-xs text-destructive",children:he})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"system-prompt",children:"System Prompt"}),m.jsx(Ul,{id:"system-prompt",value:L,onChange:Se=>G(Se.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(ct,{children:"Max Delegations"}),m.jsx(nt,{type:"number",min:"0",value:z,onChange:Se=>B(Se.target.value),placeholder:h!=null&&h.max_num_delegations?String(h.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Delegations"}),m.jsxs(Da,{value:A||d,onValueChange:Se=>N(Se===d?"":Se),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{placeholder:(h==null?void 0:h.cache_delegations)!==!1?"true":"false"})}),m.jsxs(La,{children:[m.jsxs(Pn,{value:d,className:"text-muted-foreground",children:["Default (",(h==null?void 0:h.cache_delegations)!==!1?"true":"false",")"]}),m.jsx(Pn,{value:"true",children:"true"}),m.jsx(Pn,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Max Entries"}),m.jsx(nt,{type:"number",min:"0",value:O,onChange:Se=>T(Se.target.value),placeholder:h!=null&&h.cache_max_entries?String(h.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache TTL (seconds)"}),m.jsx(nt,{type:"number",min:"0",value:M,onChange:Se=>I(Se.target.value),placeholder:h!=null&&h.cache_ttl_seconds?String(h.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),f.error&&m.jsx("p",{className:"text-sm text-destructive",children:f.error.message}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(je,{type:"submit",disabled:f.isPending||oe,children:f.isPending?"Launching...":"Launch"}),m.jsx(je,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function nue(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rue({projectId:e}){const t=oA(e),n=zle(),r=$le(),i=x.useRef(null),[a,o]=x.useState(!1),[l,c]=x.useState(null),f=x.useCallback(E=>{const C=Array.from(E);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>Dt.success(`Uploaded ${C.length} file(s)`),onError:()=>Dt.error("Upload failed")})},[e,n]),h=x.useCallback(E=>{E.preventDefault(),o(!1),f(E.dataTransfer.files)},[f]),d=x.useCallback(E=>{E.preventDefault(),o(!0)},[]),g=x.useCallback(E=>{E.preventDefault(),o(!1)},[]),v=x.useCallback(()=>{var E;(E=i.current)==null||E.click()},[]),b=x.useCallback(E=>{E.target.files&&(f(E.target.files),E.target.value="")},[f]),w=x.useCallback(E=>{r.mutate({projectId:e,filePath:E},{onSuccess:()=>{Dt.success("File deleted"),c(null)},onError:()=>{Dt.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(iA,{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(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{className:"w-24",children:"Size"}),m.jsx(it,{className:"w-44",children:"Modified"}),m.jsx(it,{className:"w-28"})]})}),m.jsx(ds,{children:S.map(E=>m.jsxs(ir,{children:[m.jsx(rt,{className:"font-mono text-xs",children:E.path}),m.jsx(rt,{className:"text-xs text-muted-foreground",children:nue(E.size)}),m.jsx(rt,{className:"text-xs text-muted-foreground",children:new Date(E.modified_at).toLocaleString()}),m.jsx(rt,{children:l===E.path?m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:()=>w(E.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(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(E.path),disabled:r.isPending,children:m.jsx(bs,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},E.path))})]})})})]})}function iue(){const e=pt();return It({mutationFn:t=>Be.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function GF(){const e=pt();return It({mutationFn:({type:t,name:n})=>Be.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function aue(){const e=pt();return It({mutationFn:t=>Be.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function oue(){const e=pt();return It({mutationFn:t=>Be.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function sue(){const e=pt();return It({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Be.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Ve.registry.config(n.type,n.name)})}})}function lue(e){const t=pt();return It({mutationFn:n=>Be.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ve.projects.resources(e)})}})}function WF(e){const t=pt();return It({mutationFn:({type:n,name:r})=>Be.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ve.projects.resources(e)})}})}function uue(e){const t=pt();return It({mutationFn:n=>Be.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ve.projects.resources(e)})}})}function cue(e){const t=pt();return It({mutationFn:n=>Be.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ve.projects.resources(e)})}})}function fue(e){const t=pt();return It({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Be.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Ve.projects.resourceConfig(e,r.type,r.name)})}})}function due({...e}){return m.jsx(xk,{"data-slot":"sheet",...e})}function hue({...e}){return m.jsx(bk,{"data-slot":"sheet-portal",...e})}function mue({className:e,...t}){return m.jsx(wk,{"data-slot":"sheet-overlay",className:Ne("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 pue({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return m.jsxs(hue,{children:[m.jsx(mue,{}),m.jsxs(Sk,{"data-slot":"sheet-content",className:Ne("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(Ek,{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(O0,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gue({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:Ne("flex flex-col gap-1.5 p-4",e),...t})}function vue({className:e,...t}){return m.jsx(DB,{"data-slot":"sheet-title",className:Ne("font-semibold text-foreground",e),...t})}function yue({className:e,...t}){return m.jsx(RB,{"data-slot":"sheet-description",className:Ne("text-sm text-muted-foreground",e),...t})}const xue=T0("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 vy({className:e,variant:t,...n}){return m.jsx("div",{"data-slot":"alert",role:"alert",className:Ne(xue({variant:t}),e),...n})}function yy({className:e,...t}){return m.jsx("div",{"data-slot":"alert-title",className:Ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function xy({className:e,...t}){return m.jsx("div",{"data-slot":"alert-description",className:Ne("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function bue({agentName:e}){const{data:t}=Jle(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(vy,{variant:"destructive",children:[m.jsx(mo,{className:"h-4 w-4"}),m.jsx(yy,{children:"Missing Prerequisites"}),m.jsx(xy,{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(vy,{children:[m.jsx(Boe,{className:"h-4 w-4"}),m.jsx(yy,{children:"Setup"}),m.jsxs(xy,{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(vy,{children:[m.jsx(yoe,{className:"h-4 w-4"}),m.jsx(yy,{children:"API Key Required"}),m.jsx(xy,{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 wue({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=XF(e,t,{enabled:n&&!r}),a=Wle(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=sue(),f=fue(r??0),h=r?f:c,{data:d}=Oa("agents",{enabled:n&&e==="roles"}),[g,v]=x.useState({}),[b,w]=x.useState({}),[S,E]=x.useState(new Set);if(x.useEffect(()=>{o&&(v({...o.env_values}),w({...o.params_values}))},[o]),l||!o)return null;const C=Object.keys(o.env_schema),j=Object.keys(o.params_schema);if(C.length===0&&j.length===0)return null;const A=I=>E(z=>{const B=new Set(z);return B.has(I)?B.delete(I):B.add(I),B}),N=(d??[]).map(I=>I.name),O=String(b.default_agent??"").trim(),T=e==="roles"&&O&&N.length>0&&!N.includes(O)?"Agent not found in installed agents":"",M=()=>{h.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:j.length>0?b:void 0},{onSuccess:()=>Dt.success("Configuration saved"),onError:()=>Dt.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(bl,{}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(I=>{const z=o.env_schema[I],B=S.has(I);return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ct,{className:"text-xs font-mono",children:I}),z.required&&m.jsx(Bt,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),z.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:z.description}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx(nt,{type:B?"text":"password",value:g[I]??"",onChange:L=>v(G=>({...G,[I]:L.target.value})),placeholder:I,className:"h-8 text-xs font-mono"}),m.jsx(je,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",onClick:()=>A(I),children:B?m.jsx(aoe,{className:"h-3.5 w-3.5"}):m.jsx(soe,{className:"h-3.5 w-3.5"})})]})]},I)})]})]}),j.length>0&&m.jsxs(m.Fragment,{children:[m.jsx(bl,{}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),j.map(I=>{const z=o.params_schema[I],B=b[I],L=z.default;if(z.type==="boolean")return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx(ct,{className:"text-xs font-mono",children:I}),z.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:z.description}),m.jsxs(Da,{value:B!=null?String(B):L!=null?String(L):"",onValueChange:q=>w(X=>({...X,[I]:q==="true"})),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{})}),m.jsxs(La,{children:[m.jsx(Pn,{value:"true",children:"true"}),m.jsx(Pn,{value:"false",children:"false"})]})]})]},I);const G=z.type==="int"||z.type==="float"?"number":"text",F=z.type==="float"?"any":void 0,K=I==="default_agent"&&d?d.map(q=>q.name):void 0,D=K?`datalist-${I}`:void 0;return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx(ct,{className:"text-xs font-mono",children:I}),z.description&&m.jsx("p",{className:"text-xs text-muted-foreground",children:z.description}),m.jsx(nt,{type:G,step:F,list:D,value:B!=null?String(B):"",onChange:q=>w(X=>({...X,[I]:G==="number"&&q.target.value!==""?Number(q.target.value):q.target.value})),placeholder:L!=null?String(L):void 0,className:"h-8 text-xs font-mono"}),K&&m.jsx("datalist",{id:D,children:K.map(q=>m.jsx("option",{value:q},q))}),I==="default_agent"&&T&&m.jsx("p",{className:"text-xs text-destructive",children:T})]},I)})]})]}),m.jsxs(je,{size:"sm",onClick:M,disabled:h.isPending||!!T,className:"self-start",children:[m.jsx(yF,{className:"mr-2 h-3.5 w-3.5"}),h.isPending?"Saving...":"Save Configuration"]})]})}function QF({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var T,M;const a=GF(),o=aue(),l=oue(),c=WF(i??0),f=uue(i??0),h=cue(i??0),d=i?c:a,g=i?f:o,v=i?h:l,[b,w]=x.useState(!1),S=g.isPending||v.isPending||d.isPending;if(!e)return null;const E=()=>{if(!b){w(!0);return}d.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?(Dt.success(`Uninstalled ${e.name}`),r(!1)):Dt.error(`Uninstall failed: ${I.stderr||I.stdout}`),w(!1)},onError:()=>{Dt.error("Uninstall request failed"),w(!1)}})},C=()=>{g.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?Dt.success(`Updated ${e.name}`):Dt.error(`Update failed: ${I.stderr||I.stdout}`)},onError:()=>Dt.error("Update request failed")})},j=()=>{v.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?Dt.success(`Reinstalled ${e.name}`):Dt.error(`Reinstall failed: ${I.stderr||I.stdout}`)},onError:()=>Dt.error("Reinstall request failed")})},N=!i&&((T={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:T.includes(e.name)),O=(M=e.frontmatter)==null?void 0:M.metadata;return m.jsx(due,{open:n,onOpenChange:I=>{r(I),w(!1)},children:m.jsxs(pue,{side:"right",className:"flex h-full flex-col sm:max-w-lg",children:[m.jsxs(gue,{className:"shrink-0",children:[m.jsxs(vue,{className:"flex items-center gap-2",children:[e.name,e.version&&m.jsxs(Bt,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),m.jsx(yue,{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})]})]}),O&&Object.keys(O).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(O,null,2)})]})]}),m.jsxs(Op,{className:"min-h-0 flex-1 px-4",children:[t==="agents"&&m.jsx(bue,{agentName:e.name}),m.jsx(wue,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),m.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap mt-4",children:e.body||"No content."})]}),m.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[m.jsx(je,{size:"sm",onClick:C,disabled:S,children:g.isPending?"Updating...":"Update"}),m.jsx(je,{variant:"outline",size:"sm",onClick:j,disabled:S,children:v.isPending?"Reinstalling...":"Reinstall"}),m.jsx("div",{className:"flex-1"}),!N&&m.jsxs(m.Fragment,{children:[m.jsx(je,{variant:b?"destructive":"outline",size:"sm",onClick:E,disabled:S,children:d.isPending?"Uninstalling...":b?"Confirm Uninstall":"Uninstall"}),b&&!d.isPending&&m.jsx(je,{variant:"ghost",size:"sm",onClick:()=>w(!1),children:"Cancel"})]})]})]})})}const Sue=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function pA({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=x.useState(n??"roles"),[o,l]=x.useState(""),[c,f]=x.useState(null),[h,d]=x.useState(null);x.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=iue(),v=lue(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?(Dt.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"}),Dt.error("Install request failed")}}))},E=C=>{C||(f(null),d(null),l("")),t(C)};return m.jsx(ws,{open:e,onOpenChange:E,children:m.jsxs(Ss,{className:"sm:max-w-md",children:[m.jsxs(Es,{children:[m.jsx(_s,{children:r?"Install Resource to Project":"Install Resource"}),m.jsx(FF,{children:"Install a resource from StrawHub by name."})]}),m.jsxs("div",{className:"flex flex-col gap-4",children:[c&&m.jsxs(vy,{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(j0,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):m.jsx(tA,{className:"h-4 w-4"}),m.jsx(yy,{children:c.status==="success"?"Installed":"Error"}),m.jsx(xy,{children:c.message})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx(ct,{htmlFor:"install-type",children:"Type"}),m.jsxs(Da,{value:i,onValueChange:a,disabled:w,children:[m.jsx(Ia,{id:"install-type",children:m.jsx(Ra,{})}),m.jsx(La,{children:Sue.map(C=>m.jsx(Pn,{value:C.value,children:C.label},C.value))})]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx(ct,{htmlFor:"install-name",children:"Package Name"}),m.jsx(nt,{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(BF,{children:(c==null?void 0:c.status)==="success"?m.jsx(je,{onClick:()=>E(!1),children:"Done"}):m.jsx(je,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const Eue={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function _ue({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=YF(e),[a,o]=x.useState(null),[l,c]=x.useState(""),[f,h]=x.useState(!1),[d,g]=x.useState(!1),v=t??d,b=n??g,{data:w}=Gle(e,l,a??"",{enabled:f&&!!a&&!!l});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 installed to this project"}),m.jsxs(je,{onClick:()=>b(!0),size:"sm",children:[m.jsx(C0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?m.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((S,E)=>m.jsx(Tn,{className:"h-12 w-full"},E))}):!r||r.length===0?m.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No project resources installed yet."}):m.jsx(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{children:"Type"}),m.jsx(it,{children:"Version"}),m.jsx(it,{children:"Description"}),m.jsx(it,{className:"w-24"})]})}),m.jsx(ds,{children:r.map(S=>m.jsxs(ir,{className:"cursor-pointer",onClick:()=>{o(S.name),c(S.type),h(!0)},children:[m.jsx(rt,{className:"font-medium",children:S.name}),m.jsx(rt,{children:m.jsx(Bt,{variant:"outline",className:"text-xs",children:Eue[S.type]??S.type})}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:S.version??"—"}),m.jsx(rt,{className:"max-w-[300px] truncate text-sm",children:S.description||"—"}),m.jsx(rt,{children:m.jsx(jue,{projectId:e,resourceType:S.type,name:S.name})})]},`${S.type}-${S.name}`))})]})})}),m.jsx(QF,{resource:w??null,resourceType:l,open:f,onOpenChange:h,projectId:e}),m.jsx(pA,{open:v,onOpenChange:b,projectId:e})]})}function jue({projectId:e,resourceType:t,name:n}){const[r,i]=x.useState(!1),a=WF(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?Dt.success(`Uninstalled ${n}`):Dt.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{Dt.error("Uninstall request failed"),i(!1)}})};return r?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(je,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):m.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:m.jsx(bs,{className:"h-4 w-4"})})}function Cue(e,t="30d"){return zn({queryKey:Ve.projects.stats(e,t),queryFn:()=>Be.get(`/projects/${e}/stats?period=${t}`)})}var kue=["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 gA(e){if(typeof e!="string")return!1;var t=kue;return t.includes(e)}var Aue=["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"],Oue=new Set(Aue);function ZF(e){return typeof e!="string"?!1:Oue.has(e)}function JF(e){return typeof e=="string"&&e.startsWith("data-")}function Ii(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ZF(n)||JF(n))&&(t[n]=e[n]);return t}function sc(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ii(t)}return typeof e=="object"&&!Array.isArray(e)?Ii(e):null}function Wr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(ZF(n)||JF(n)||gA(n))&&(t[n]=e[n]);return t}function Nue(e){return e==null?null:x.isValidElement(e)?Wr(e.props):typeof e=="object"&&!Array.isArray(e)?Wr(e):null}var Tue=["children","width","height","viewBox","className","style","title","desc"];function _j(){return _j=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},_j.apply(null,arguments)}function Pue(e,t){if(e==null)return{};var n,r,i=Mue(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 Mue(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 vA=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:f}=e,h=Pue(e,Tue),d=a||{width:r,height:i,x:0,y:0},g=Ct("recharts-surface",o);return x.createElement("svg",_j({},Wr(h),{className:g,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),x.createElement("title",null,c),x.createElement("desc",null,f),n)}),Due=["children","className"];function jj(){return jj=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},jj.apply(null,arguments)}function Rue(e,t){if(e==null)return{};var n,r,i=Iue(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 Iue(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 ar=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Rue(e,Due),a=Ct("recharts-layer",r);return x.createElement("g",jj({className:a},Wr(i),{ref:t}),n)}),eU=x.createContext(null),Lue=()=>x.useContext(eU);function tn(e){return function(){return e}}const tU=Math.cos,Yy=Math.sin,Ha=Math.sqrt,Xy=Math.PI,M0=2*Xy,Cj=Math.PI,kj=2*Cj,Nu=1e-6,zue=kj-Nu;function nU(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $ue(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nU;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 Bue{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nU:$ue(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>Nu)if(!(Math.abs(d*c-f*h)>Nu)||!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,E=Math.sqrt(w),C=Math.sqrt(g),j=a*Math.tan((Cj-Math.acos((w+g-S)/(2*E*C)))/2),A=j/C,N=j/E;Math.abs(A-1)>Nu&&this._append`L${t+A*h},${n+A*d}`,this._append`A${a},${a},0,0,${+(d*v>h*b)},${this._x1=t+N*c},${this._y1=n+N*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)>Nu||Math.abs(this._y1-h)>Nu)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%kj+kj),g>zue?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>Nu&&this._append`A${r},${r},0,${+(g>=Cj)},${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 yA(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 Bue(t)}function xA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rU(e){this._context=e}rU.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 D0(e){return new rU(e)}function iU(e){return e[0]}function aU(e){return e[1]}function oU(e,t){var n=tn(!0),r=null,i=D0,a=null,o=yA(l);e=typeof e=="function"?e:e===void 0?iU:tn(e),t=typeof t=="function"?t:t===void 0?aU:tn(t);function l(c){var f,h=(c=xA(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:tn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:tn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:tn(!!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 Lv(e,t,n){var r=null,i=tn(!0),a=null,o=D0,l=null,c=yA(f);e=typeof e=="function"?e:e===void 0?iU:tn(+e),t=typeof t=="function"?t:tn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?aU:tn(+n);function f(d){var g,v,b,w=(d=xA(d)).length,S,E=!1,C,j=new Array(w),A=new Array(w);for(a==null&&(l=o(C=c())),g=0;g<=w;++g){if(!(g<w&&i(S=d[g],g,d))===E)if(E=!E)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=g-1;b>=v;--b)l.point(j[b],A[b]);l.lineEnd(),l.areaEnd()}E&&(j[g]=+e(S,g,d),A[g]=+t(S,g,d),l.point(r?+r(S,g,d):j[g],n?+n(S,g,d):A[g]))}if(C)return l=null,C+""||null}function h(){return oU().defined(i).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:tn(+d),r=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:tn(+d),f):e},f.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:tn(+d),f):r},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:tn(+d),n=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:tn(+d),f):t},f.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:tn(+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:tn(!!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 sU{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 Fue(e){return new sU(e,!0)}function Uue(e){return new sU(e,!1)}const bA={draw(e,t){const n=Ha(t/Xy);e.moveTo(n,0),e.arc(0,0,n,0,M0)}},Hue={draw(e,t){const n=Ha(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()}},lU=Ha(1/3),que=lU*2,Vue={draw(e,t){const n=Ha(t/que),r=n*lU;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Kue={draw(e,t){const n=Ha(t),r=-n/2;e.rect(r,r,n,n)}},Yue=.8908130915292852,uU=Yy(Xy/10)/Yy(7*Xy/10),Xue=Yy(M0/10)*uU,Gue=-tU(M0/10)*uU,Wue={draw(e,t){const n=Ha(t*Yue),r=Xue*n,i=Gue*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=M0*a/5,l=tU(o),c=Yy(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},kS=Ha(3),Que={draw(e,t){const n=-Ha(t/(kS*3));e.moveTo(0,n*2),e.lineTo(-kS*n,-n),e.lineTo(kS*n,-n),e.closePath()}},Qi=-.5,Zi=Ha(3)/2,Aj=1/Ha(12),Zue=(Aj/2+1)*3,Jue={draw(e,t){const n=Ha(t/Zue),r=n/2,i=n*Aj,a=r,o=n*Aj+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Qi*r-Zi*i,Zi*r+Qi*i),e.lineTo(Qi*a-Zi*o,Zi*a+Qi*o),e.lineTo(Qi*l-Zi*c,Zi*l+Qi*c),e.lineTo(Qi*r+Zi*i,Qi*i-Zi*r),e.lineTo(Qi*a+Zi*o,Qi*o-Zi*a),e.lineTo(Qi*l+Zi*c,Qi*c-Zi*l),e.closePath()}};function ece(e,t){let n=null,r=yA(i);e=typeof e=="function"?e:tn(e||bA),t=typeof t=="function"?t:tn(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:tn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:tn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Gy(){}function Wy(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 cU(e){this._context=e}cU.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:Wy(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:Wy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tce(e){return new cU(e)}function fU(e){this._context=e}fU.prototype={areaStart:Gy,areaEnd:Gy,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:Wy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nce(e){return new fU(e)}function dU(e){this._context=e}dU.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:Wy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rce(e){return new dU(e)}function hU(e){this._context=e}hU.prototype={areaStart:Gy,areaEnd:Gy,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 ice(e){return new hU(e)}function cR(e){return e<0?-1:1}function fR(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(cR(a)+cR(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function dR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function AS(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 Qy(e){this._context=e}Qy.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:AS(this,this._t0,dR(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,AS(this,dR(this,n=fR(this,e,t)),n);break;default:AS(this,this._t0,n=fR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function mU(e){this._context=new pU(e)}(mU.prototype=Object.create(Qy.prototype)).point=function(e,t){Qy.prototype.point.call(this,t,e)};function pU(e){this._context=e}pU.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 ace(e){return new Qy(e)}function oce(e){return new mU(e)}function gU(e){this._context=e}gU.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=hR(e),i=hR(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 hR(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 sce(e){return new gU(e)}function R0(e,t){this._context=e,this._t=t}R0.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 lce(e){return new R0(e,.5)}function uce(e){return new R0(e,0)}function cce(e){return new R0(e,1)}function lc(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 Oj(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function fce(e,t){return e[t]}function dce(e){const t=[];return t.key=e,t}function hce(){var e=tn([]),t=Oj,n=lc,r=fce;function i(a){var o=Array.from(e.apply(this,arguments),dce),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=xA(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:tn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:tn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Oj:typeof a=="function"?a:tn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??lc,i):n},i}function mce(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}lc(e,t)}}function pce(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}lc(e,t)}}function gce(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,E=w[r-1][1]||0;v+=S-E}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,lc(e,t)}}var OS={},NS={},mR;function vce(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(NS)),NS}var TS={},pR;function vU(){return pR||(pR=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})(TS)),TS}var PS={},gR;function wA(){return gR||(gR=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})(PS)),PS}var MS={},DS={},vR;function yce(){return vR||(vR=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})(DS)),DS}var yR;function SA(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yce(),n=wA();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})(MS)),MS}var xR;function EA(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vce(),n=vU(),r=wA(),i=SA();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})(OS)),OS}var RS,bR;function xce(){return bR||(bR=1,RS=EA().get),RS}var bce=xce();const uc=Bi(bce);var wce=4;function Ml(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wce,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function On(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+Ml(l)+a:i+a},"")}var pr=e=>e===0?0:e>0?1:-1,po=e=>typeof e=="number"&&e!=+e,cc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!po(e),go=e=>Pe(e)||typeof e=="string",Sce=0,Lm=e=>{var t=++Sce;return"".concat(e||"").concat(t)},zr=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(!Pe(t)&&typeof t!="string")return r;var a;if(cc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return po(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},yU=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 cn(e,t,n){return Pe(e)&&Pe(t)?Ml(e+n*(t-e)):t}function xU(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):uc(r,t))===n)}var mn=e=>e===null||typeof e>"u",Np=e=>mn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function fi(e){return e!=null}function Zl(){}var Ece=["type","size","sizeType"];function Nj(){return Nj=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},Nj.apply(null,arguments)}function wR(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 SR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){_ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ce(e,t,n){return(t=jce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jce(e){var t=Cce(e,"string");return typeof t=="symbol"?t:t+""}function Cce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kce(e,t){if(e==null)return{};var n,r,i=Ace(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 Ace(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 bU={symbolCircle:bA,symbolCross:Hue,symbolDiamond:Vue,symbolSquare:Kue,symbolStar:Wue,symbolTriangle:Que,symbolWye:Jue},Oce=Math.PI/180,Nce=e=>{var t="symbol".concat(Np(e));return bU[t]||bA},Tce=(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*Oce;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}},Pce=(e,t)=>{bU["symbol".concat(Np(e))]=t},_A=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=kce(e,Ece),a=SR(SR({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=Nce(o),v=ece().type(g).size(Tce(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:f,cy:h}=a,d=Wr(a);return Pe(f)&&Pe(h)&&Pe(n)?x.createElement("path",Nj({},d,{className:Ct("recharts-symbols",c),transform:"translate(".concat(f,", ").concat(h,")"),d:l()})):null};_A.registerSymbol=Pce;var wU=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,jA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{gA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Mce=(e,t,n)=>r=>(e(t,n,r),null),Tp=(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];gA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Mce(a,t,n))}),r};function ER(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 Dce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){Rce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rce(e,t,n){return(t=Ice(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ice(e){var t=Lce(e,"string");return typeof t=="symbol"?t:t+""}function Lce(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 Wn(e,t){var n=Dce({},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 Zy(){return Zy=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},Zy.apply(null,arguments)}function _R(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 SU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(r){zce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zce(e,t,n){return(t=$ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ce(e){var t=Bce(e,"string");return typeof t=="symbol"?t:t+""}function Bce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ea=32,Fce={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Uce(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Hce(e){var{data:t,iconType:n,inactiveColor:r}=e,i=ea/2,a=ea/6,o=ea/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:Uce(t.payload),x1:0,y1:i,x2:ea,y2:i,className:"recharts-legend-icon"});if(c==="line")return x.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(ea,"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 x.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(ea/8,"h").concat(ea,"v").concat(ea*3/4,"h").concat(-ea,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=SU({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(_A,{fill:l,cx:i,cy:i,size:ea,sizeType:"diameter",type:c})}function qce(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:ea,height:ea},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=Ct({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=typeof l=="object"?SU({},l):{};w.color=d.inactive?a:w.color||d.color;var S=v?v(d.value,d,g):d.value;return x.createElement("li",Zy({className:b,style:f,key:"legend-item-".concat(g)},Tp(e,d,g)),x.createElement(vA,{width:n,height:n,viewBox:c,style:h,"aria-label":"".concat(S," legend icon")},x.createElement(Hce,{data:d,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Vce=e=>{var t=Wn(e,Fce),{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 x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(qce,Zy({},t,{payload:n})))},IS={},LS={},jR;function Kce(){return jR||(jR=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})(LS)),LS}var zS={},CR;function Yce(){return CR||(CR=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})(zS)),zS}var $S={},kR;function EU(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})($S)),$S}var BS={},FS={},US={},AR;function Xce(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(US)),US}var OR;function _U(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xce();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(FS)),FS}var HS={},NR;function Gce(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(HS)),HS}var TR;function Wce(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_U(),n=Gce();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(BS)),BS}var qS={},VS={},PR;function Qce(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(VS)),VS}var KS={},YS={},XS={},GS={},MR;function jU(){return MR||(MR=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})(GS)),GS}var WS={},DR;function CU(){return DR||(DR=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})(WS)),WS}var QS={},RR;function kU(){return RR||(RR=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})(QS)),QS}var IR;function Zce(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jU(),n=CU(),r=kU();function i(h,d,g){return typeof g!="function"?i(h,d,()=>{}):a(h,d,function v(b,w,S,E,C,j){const A=g(b,w,S,E,C,j);return A!==void 0?!!A:a(b,w,v,j)},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 E=!1;for(let C=0;C<h.length;C++){if(b.has(C))continue;const j=h[C];let A=!1;if(g(j,S,w,h,d,v)&&(A=!0),A){b.add(C),E=!0;break}}if(!E)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})(XS)),XS}var LR;function AU(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zce();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(YS)),YS}var ZS={},JS={},eE={},zR;function Jce(){return zR||(zR=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})(eE)),eE}var tE={},$R;function CA(){return $R||($R=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})(tE)),tE}var nE={},BR;function OU(){return BR||(BR=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]",E="[object Uint8ClampedArray]",C="[object Uint16Array]",j="[object Uint32Array]",A="[object BigUint64Array]",N="[object Int8Array]",O="[object Int16Array]",T="[object Int32Array]",M="[object BigInt64Array]",I="[object Float32Array]",z="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=h,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=I,e.float64ArrayTag=z,e.functionTag=d,e.int16ArrayTag=O,e.int32ArrayTag=T,e.int8ArrayTag=N,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=j,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=E})(nE)),nE}var rE={},FR;function efe(){return FR||(FR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(rE)),rE}var UR;function NU(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jce(),n=CA(),r=OU(),i=CU(),a=efe();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 E=0;E<h.length;E++)S[E]=l(h[E],E,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[E,C]of h)S.set(E,l(C,E,g,v,b));return S}if(h instanceof Set){const S=new Set;v.set(h,S);for(const E of h)S.add(l(E,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 E=0;E<h.length;E++)S[E]=l(h[E],E,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 E=w[S],C=Object.getOwnPropertyDescriptor(h,E);(C==null||C.writable)&&(h[E]=l(d[E],E,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})(JS)),JS}var HR;function tfe(){return HR||(HR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NU();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(ZS)),ZS}var qR;function nfe(){return qR||(qR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AU(),n=tfe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(KS)),KS}var iE={},aE={},oE={},VR;function rfe(){return VR||(VR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NU(),n=CA(),r=OU();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})(oE)),oE}var KR;function ife(){return KR||(KR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rfe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(aE)),aE}var sE={},lE={},YR;function TU(){return YR||(YR=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})(lE)),lE}var uE={},XR;function afe(){return XR||(XR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(uE)),uE}var GR;function ofe(){return GR||(GR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vU(),n=TU(),r=afe(),i=SA();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})(sE)),sE}var WR;function sfe(){return WR||(WR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AU(),n=wA(),r=ife(),i=EA(),a=ofe();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})(iE)),iE}var QR;function lfe(){return QR||(QR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EU(),n=Qce(),r=nfe(),i=sfe();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})(qS)),qS}var ZR;function ufe(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kce(),n=Yce(),r=EU(),i=Wce(),a=lfe();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(IS)),IS}var cE,JR;function cfe(){return JR||(JR=1,cE=ufe().uniqBy),cE}var ffe=cfe();const eI=Bi(ffe);function PU(e,t,n){return t===!0?eI(e,n):typeof t=="function"?eI(e,t):e}var fE={exports:{}},dE={};/**
 * @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 tI;function dfe(){if(tI)return dE;tI=1;var e=kd(),t=bee();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 dE.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 E(O){if(!C){if(C=!0,j=O,O=g(O),v!==void 0&&w.hasValue){var T=w.value;if(v(T,O))return A=T}return A=O}if(T=A,r(j,O))return T;var M=g(O);return v!==void 0&&v(T,M)?(j=O,T):(j=O,A=M)}var C=!1,j,A,N=d===void 0?null:d;return[function(){return E(h())},N===null?void 0:function(){return E(N())}]},[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},dE}var nI;function hfe(){return nI||(nI=1,fE.exports=dfe()),fE.exports}var MU=hfe();const mfe=Bi(MU);var kA=x.createContext(null),pfe=e=>e,Yt=()=>{var e=x.useContext(kA);return e?e.store.dispatch:pfe},by=()=>{},gfe=()=>by,vfe=(e,t)=>e===t;function Re(e){var t=x.useContext(kA),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:by,[t,e]);return MU.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:gfe,t?t.store.getState:by,t?t.store.getState:by,n,vfe)}function yfe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function xfe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function bfe(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 rI=e=>Array.isArray(e)?e:[e];function wfe(e){const t=Array.isArray(e[0])?e[0]:e;return bfe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Sfe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Efe=class{constructor(e){this.value=e}deref(){return this.value}},_fe=typeof WeakRef<"u"?WeakRef:Efe,jfe=0,iI=1;function zv(){return{s:jfe,v:void 0,o:null,p:null}}function DU(e,t={}){let n=zv();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=zv(),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=zv(),w.set(b,l)):l=S}}const f=l;let h;if(l.s===iI)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 _fe(h):h}return f.s=iI,f.v=h,h}return o.clearCache=()=>{n=zv(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Cfe(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()),yfe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const h={...n,...c},{memoize:d,memoizeOptions:g=[],argsMemoize:v=DU,argsMemoizeOptions:b=[]}=h,w=rI(g),S=rI(b),E=wfe(i),C=d(function(){return a++,f.apply(null,arguments)},...w),j=v(function(){o++;const N=Sfe(E,arguments);return l=C.apply(null,N),l},...S);return Object.assign(j,{resultFunc:f,memoizedResultFunc:C,dependencies:E,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var ue=Cfe(DU),kfe=Object.assign((e,t=ue)=>{xfe(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:()=>kfe}),hE={},mE={},pE={},aI;function Afe(){return aI||(aI=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})(pE)),pE}var gE={},vE={},oI;function RU(){return oI||(oI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(vE)),vE}var sI;function Ofe(){return sI||(sI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RU(),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})(gE)),gE}var lI;function Nfe(){return lI||(lI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Afe(),n=Ofe(),r=SA();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})(mE)),mE}var yE={},uI;function Tfe(){return uI||(uI=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})(yE)),yE}var xE={},cI;function IU(){return cI||(cI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TU(),n=_U(),r=jU(),i=kU();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})(xE)),xE}var fI;function Pfe(){return fI||(fI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nfe(),n=Tfe(),r=IU();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})(hE)),hE}var bE,dI;function Mfe(){return dI||(dI=1,bE=Pfe().sortBy),bE}var Dfe=Mfe();const I0=Bi(Dfe);var LU=e=>e.legend.settings,Rfe=e=>e.legend.size,Ife=e=>e.legend.payload,Lfe=ue([Ife,LU],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?I0(r,n):r});function zfe(){return Re(Lfe)}var $v=1;function zU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(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)>$v||Math.abs(o.left-t.left)>$v||Math.abs(o.top-t.top)>$v||Math.abs(o.width-t.width)>$v)&&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 _r(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 $fe=typeof Symbol=="function"&&Symbol.observable||"@@observable",hI=$fe,wE=()=>Math.random().toString(36).substring(7).split("").join("."),Bfe={INIT:`@@redux/INIT${wE()}`,REPLACE:`@@redux/REPLACE${wE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${wE()}`},Jy=Bfe;function AA(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 $U(e,t,n){if(typeof e!="function")throw new Error(_r(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(_r(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(_r(1));return n($U)(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,E)=>{o.set(E,S)}))}function h(){if(c)throw new Error(_r(3));return i}function d(S){if(typeof S!="function")throw new Error(_r(4));if(c)throw new Error(_r(5));let E=!0;f();const C=l++;return o.set(C,S),function(){if(E){if(c)throw new Error(_r(6));E=!1,f(),o.delete(C),a=null}}}function g(S){if(!AA(S))throw new Error(_r(7));if(typeof S.type>"u")throw new Error(_r(8));if(typeof S.type!="string")throw new Error(_r(17));if(c)throw new Error(_r(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(_r(10));r=S,g({type:Jy.REPLACE})}function b(){const S=d;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(_r(11));function C(){const A=E;A.next&&A.next(h())}return C(),{unsubscribe:S(C)}},[hI](){return this}}}return g({type:Jy.INIT}),{dispatch:g,subscribe:d,getState:h,replaceReducer:v,[hI]:b}}function Ffe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Jy.INIT})>"u")throw new Error(_r(12));if(typeof n(void 0,{type:Jy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(_r(13))})}function BU(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{Ffe(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(_r(14));f[d]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?f:o}}function ex(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Ufe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(_r(15))};const o={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},l=e.map(c=>c(o));return a=ex(...l)(i.dispatch),{...i,dispatch:a}}}function FU(e){return AA(e)&&"type"in e&&typeof e.type=="string"}var UU=Symbol.for("immer-nothing"),mI=Symbol.for("immer-draftable"),Qr=Symbol.for("immer-state");function _a(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pi=Object,cd=Pi.getPrototypeOf,tx="constructor",L0="prototype",Tj="configurable",nx="enumerable",wy="writable",zm="value",hs=e=>!!e&&!!e[Qr];function za(e){var t;return e?HU(e)||$0(e)||!!e[mI]||!!((t=e[tx])!=null&&t[mI])||B0(e)||F0(e):!1}var Hfe=Pi[L0][tx].toString(),pI=new WeakMap;function HU(e){if(!e||!OA(e))return!1;const t=cd(e);if(t===null||t===Pi[L0])return!0;const n=Pi.hasOwnProperty.call(t,tx)&&t[tx];if(n===Object)return!0;if(!Of(n))return!1;let r=pI.get(n);return r===void 0&&(r=Function.toString.call(n),pI.set(n,r)),r===Hfe}function z0(e,t,n=!0){Pp(e)===0?(n?Reflect.ownKeys(e):Pi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Pp(e){const t=e[Qr];return t?t.type_:$0(e)?1:B0(e)?2:F0(e)?3:0}var gI=(e,t,n=Pp(e))=>n===2?e.has(t):Pi[L0].hasOwnProperty.call(e,t),Pj=(e,t,n=Pp(e))=>n===2?e.get(t):e[t],rx=(e,t,n,r=Pp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function qfe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var $0=Array.isArray,B0=e=>e instanceof Map,F0=e=>e instanceof Set,OA=e=>typeof e=="object",Of=e=>typeof e=="function",SE=e=>typeof e=="boolean";function Vfe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Yo=e=>e.copy_||e.base_,NA=e=>e.modified_?e.copy_:e.base_;function Mj(e,t){if(B0(e))return new Map(e);if(F0(e))return new Set(e);if($0(e))return Array[L0].slice.call(e);const n=HU(e);if(t===!0||t==="class_only"&&!n){const r=Pi.getOwnPropertyDescriptors(e);delete r[Qr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[wy]===!1&&(l[wy]=!0,l[Tj]=!0),(l.get||l.set)&&(r[o]={[Tj]:!0,[wy]:!0,[nx]:l[nx],[zm]:e[o]})}return Pi.create(cd(e),r)}else{const r=cd(e);if(r!==null&&n)return{...e};const i=Pi.create(r);return Pi.assign(i,e)}}function TA(e,t=!1){return U0(e)||hs(e)||!za(e)||(Pp(e)>1&&Pi.defineProperties(e,{set:Bv,add:Bv,clear:Bv,delete:Bv}),Pi.freeze(e),t&&z0(e,(n,r)=>{TA(r,!0)},!1)),e}function Kfe(){_a(2)}var Bv={[zm]:Kfe};function U0(e){return e===null||!OA(e)?!0:Pi.isFrozen(e)}var ix="MapSet",Dj="Patches",vI="ArrayMethods",qU={};function fc(e){const t=qU[e];return t||_a(0,e),t}var yI=e=>!!qU[e],$m,VU=()=>$m,Yfe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:yI(ix)?fc(ix):void 0,arrayMethodsPlugin_:yI(vI)?fc(vI):void 0});function xI(e,t){t&&(e.patchPlugin_=fc(Dj),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Rj(e){Ij(e),e.drafts_.forEach(Xfe),e.drafts_=null}function Ij(e){e===$m&&($m=e.parent_)}var bI=e=>$m=Yfe($m,e);function Xfe(e){const t=e[Qr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Qr].modified_&&(Rj(t),_a(4)),za(e)&&(e=SI(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Qr].base_,e,t)}else e=SI(t,n);return Gfe(t,e,!0),Rj(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==UU?e:void 0}function SI(e,t){if(U0(t))return t;const n=t[Qr];if(!n)return ax(t,e.handledSet_,e);if(!H0(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);XU(n,e)}return n.copy_}function Gfe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&TA(t,n)}function KU(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var H0=(e,t)=>e.scope_===t,Wfe=[];function YU(e,t,n,r){const i=Yo(e),a=e.type_;if(r!==void 0&&Pj(i,r,a)===t){rx(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;z0(i,(c,f)=>{if(hs(f)){const h=l.get(f)||[];h.push(c),l.set(f,h)}})}const o=e.draftLocations_.get(t)??Wfe;for(const l of o)rx(i,l,n,a)}function Qfe(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!H0(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=NA(a);YU(e,a.draft_??a,o,n),XU(a,i)})}function XU(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)}KU(e)}}function Zfe(e,t,n){const{scope_:r}=e;if(hs(n)){const i=n[Qr];H0(i,r)&&i.callbacks_.push(function(){Sy(e);const o=NA(i);YU(e,n,o,t)})}else za(n)&&e.callbacks_.push(function(){const a=Yo(e);e.type_===3?a.has(n)&&ax(n,r.handledSet_,r):Pj(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ax(Pj(e.copy_,t,e.type_),r.handledSet_,r)})}function ax(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||hs(e)||t.has(e)||!za(e)||U0(e)||(t.add(e),z0(e,(r,i)=>{if(hs(i)){const a=i[Qr];if(H0(a,n)){const o=NA(a);rx(e,r,o,e.type_),KU(a)}}else za(i)&&ax(i,t,n)})),e}function Jfe(e,t){const n=$0(e),r={type_:n?1:0,scope_:t?t.scope_:VU(),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=ox;n&&(i=[r],a=Bm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var ox={get(e,t){if(t===Qr)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=Yo(e);if(!gI(i,t,e.type_))return ede(e,i,t);const a=i[t];if(e.finalized_||!za(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Vfe(t))return a;if(a===EE(e.base_,t)){Sy(e);const o=e.type_===1?+t:t,l=zj(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in Yo(e)},ownKeys(e){return Reflect.ownKeys(Yo(e))},set(e,t,n){const r=GU(Yo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=EE(Yo(e),t),a=i==null?void 0:i[Qr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(qfe(n,i)&&(n!==void 0||gI(e.base_,t,e.type_)))return!0;Sy(e),Lj(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),Zfe(e,t,n)),!0},deleteProperty(e,t){return Sy(e),EE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Lj(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Yo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[wy]:!0,[Tj]:e.type_!==1||t!=="length",[nx]:r[nx],[zm]:n[t]}},defineProperty(){_a(11)},getPrototypeOf(e){return cd(e.base_)},setPrototypeOf(){_a(12)}},Bm={};for(let e in ox){let t=ox[e];Bm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Bm.deleteProperty=function(e,t){return Bm.set.call(this,e,t,void 0)};Bm.set=function(e,t,n){return ox.set.call(this,e[0],t,n,e[0])};function EE(e,t){const n=e[Qr];return(n?Yo(n):e)[t]}function ede(e,t,n){var i;const r=GU(t,n);return r?zm in r?r[zm]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function GU(e,t){if(!(t in e))return;let n=cd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=cd(n)}}function Lj(e){e.modified_||(e.modified_=!0,e.parent_&&Lj(e.parent_))}function Sy(e){e.copy_||(e.assigned_=new Map,e.copy_=Mj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var tde=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Of(n)&&!Of(r)){const o=r;r=n;const l=this;return function(f=o,...h){return l.produce(f,d=>r.call(this,d,...h))}}Of(r)||_a(6),i!==void 0&&!Of(i)&&_a(7);let a;if(za(n)){const o=bI(this),l=zj(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?Rj(o):Ij(o)}return xI(o,i),wI(a,o)}else if(!n||!OA(n)){if(a=r(n),a===void 0&&(a=n),a===UU&&(a=void 0),this.autoFreeze_&&TA(a,!0),i){const o=[],l=[];fc(Dj).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else _a(1,n)},this.produceWithPatches=(n,r)=>{if(Of(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]},SE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),SE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),SE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){za(t)||_a(8),hs(t)&&(t=aa(t));const n=bI(this),r=zj(n,t,void 0);return r[Qr].isManual_=!0,Ij(n),r}finishDraft(t,n){const r=t&&t[Qr];(!r||!r.isManual_)&&_a(9);const{scope_:i}=r;return xI(i,n),wI(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=fc(Dj).applyPatches_;return hs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function zj(e,t,n,r){const[i,a]=B0(t)?fc(ix).proxyMap_(t,n):F0(t)?fc(ix).proxySet_(t,n):Jfe(t,n);return((n==null?void 0:n.scope_)??VU()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?Qfe(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 aa(e){return hs(e)||_a(10,e),WU(e)}function WU(e){if(!za(e)||U0(e))return e;const t=e[Qr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Mj(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Mj(e,!0);return z0(n,(i,a)=>{rx(n,i,WU(a))},r),t&&(t.finalized_=!1),n}var nde=new tde,QU=nde.produce;function ZU(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var rde=ZU(),ide=ZU,ade=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ex:ex.apply(null,arguments)};function Li(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Di(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=>FU(r)&&r.type===e,n}var JU=class pm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,pm.prototype)}static get[Symbol.species](){return pm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new pm(...t[0].concat(this)):new pm(...t.concat(this))}};function EI(e){return za(e)?QU(e,()=>{}):e}function Fv(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function ode(e){return typeof e=="boolean"}var sde=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new JU;return n&&(ode(n)?o.push(rde):o.push(ide(n.extraArgument))),o},eH="RTK_autoBatch",an=()=>e=>({payload:e,meta:{[eH]:!0}}),_I=e=>t=>{setTimeout(t,e)},tH=(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:_I(10):e.type==="callback"?e.queueNotification:_I(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[eH]),a=!i,a&&(o||(o=!0,c(f))),r.dispatch(h)}finally{i=!0}}})},lde=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new JU(e);return r&&i.push(tH(typeof r=="object"?r:void 0)),i};function ude(e){const t=sde(),{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(AA(n))l=BU(n);else throw new Error(Di(1));let c;typeof r=="function"?c=r(t):c=t();let f=ex;i&&(f=ade({trace:!1,...typeof i=="object"&&i}));const h=Ufe(...c),d=lde(h);let g=typeof o=="function"?o(d):d();const v=f(...g);return $U(l,a,v)}function nH(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Di(28));if(l in t)throw new Error(Di(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 cde(e){return typeof e=="function"}function fde(e,t){let[n,r,i]=nH(t),a;if(cde(e))a=()=>EI(e());else{const l=EI(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(hs(h)){const v=d(h,c);return v===void 0?h:v}else{if(za(h))return QU(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 dde="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",hde=(e=21)=>{let t="",n=e;for(;n--;)t+=dde[Math.random()*64|0];return t},mde=Symbol.for("rtk-slice-createasyncthunk");function pde(e,t){return`${e}/${t}`}function gde({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[mde];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Di(11));const l=(typeof i.reducers=="function"?i.reducers(yde()):i.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(A,N){const O=typeof A=="string"?A:A.type;if(!O)throw new Error(Di(12));if(O in f.sliceCaseReducersByType)throw new Error(Di(13));return f.sliceCaseReducersByType[O]=N,h},addMatcher(A,N){return f.sliceMatchers.push({matcher:A,reducer:N}),h},exposeAction(A,N){return f.actionCreators[A]=N,h},exposeCaseReducer(A,N){return f.sliceCaseReducersByName[A]=N,h}};c.forEach(A=>{const N=l[A],O={reducerName:A,type:pde(a,A),createNotation:typeof i.reducers=="function"};bde(N)?Sde(O,N,h,t):xde(O,N,h)});function d(){const[A={},N=[],O=void 0]=typeof i.extraReducers=="function"?nH(i.extraReducers):[i.extraReducers],T={...A,...f.sliceCaseReducersByType};return fde(i.initialState,M=>{for(let I in T)M.addCase(I,T[I]);for(let I of f.sliceMatchers)M.addMatcher(I.matcher,I.reducer);for(let I of N)M.addMatcher(I.matcher,I.reducer);O&&M.addDefaultCase(O)})}const g=A=>A,v=new Map,b=new WeakMap;let w;function S(A,N){return w||(w=d()),w(A,N)}function E(){return w||(w=d()),w.getInitialState()}function C(A,N=!1){function O(M){let I=M[A];return typeof I>"u"&&N&&(I=Fv(b,O,E)),I}function T(M=g){const I=Fv(v,N,()=>new WeakMap);return Fv(I,M,()=>{const z={};for(const[B,L]of Object.entries(i.selectors??{}))z[B]=vde(L,M,()=>Fv(b,M,E),N);return z})}return{reducerPath:A,getSelectors:T,get selectors(){return T(O)},selectSlice:O}}const j={name:a,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:E,...C(o),injectInto(A,{reducerPath:N,...O}={}){const T=N??o;return A.inject({reducerPath:T,reducer:S},O),{...j,...C(T,!0)}}};return j}}function vde(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 Br=gde();function yde(){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 xde({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!wde(r))throw new Error(Di(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Li(e,o):Li(e))}function bde(e){return e._reducerDefinitionType==="asyncThunk"}function wde(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Sde({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Di(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||Uv,pending:l||Uv,rejected:c||Uv,settled:f||Uv})}function Uv(){}var Ede="task",rH="listener",iH="completed",PA="cancelled",_de=`task-${PA}`,jde=`task-${iH}`,$j=`${rH}-${PA}`,Cde=`${rH}-${iH}`,q0=class{constructor(e){W1(this,"name","TaskAbortError");W1(this,"message");this.code=e,this.message=`${Ede} ${PA} (reason: ${e})`}},MA=(e,t)=>{if(typeof e!="function")throw new TypeError(Di(32))},sx=()=>{},aH=(e,t=sx)=>(e.catch(t),e),oH=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Gu=e=>{if(e.aborted)throw new q0(e.reason)};function sH(e,t){let n=sx;return new Promise((r,i)=>{const a=()=>i(new q0(e.reason));if(e.aborted){a();return}n=oH(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=sx})}var kde=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof q0?"cancelled":"rejected",error:n}}finally{t==null||t()}},lx=e=>t=>aH(sH(e,t).then(n=>(Gu(e),n))),lH=e=>{const t=lx(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Bf}=Object,jI={},V0="listenerMiddleware",Ade=(e,t)=>{const n=r=>oH(e,()=>r.abort(e.reason));return(r,i)=>{MA(r);const a=new AbortController;n(a);const o=kde(async()=>{Gu(e),Gu(a.signal);const l=await r({pause:lx(a.signal),delay:lH(a.signal),signal:a.signal});return Gu(a.signal),l},()=>a.abort(jde));return i!=null&&i.autoJoin&&t.push(o.catch(sx)),{result:lx(e)(o),cancel(){a.abort(_de)}}}},Ode=(e,t)=>{const n=async(r,i)=>{Gu(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 sH(t,Promise.race(l));return Gu(t),c}finally{a()}};return(r,i)=>aH(n(r,i))},uH=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Li(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Di(21));return MA(a),{predicate:i,type:t,effect:a}},cH=Bf(e=>{const{type:t,predicate:n,effect:r}=uH(e);return{id:hde(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Di(22))}}},{withTypes:()=>cH}),CI=(e,t)=>{const{type:n,effect:r,predicate:i}=uH(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Bj=e=>{e.pending.forEach(t=>{t.abort($j)})},Nde=(e,t)=>()=>{for(const n of t.keys())Bj(n);e.clear()},kI=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},fH=Bf(Li(`${V0}/add`),{withTypes:()=>fH}),Tde=Li(`${V0}/removeAll`),dH=Bf(Li(`${V0}/remove`),{withTypes:()=>dH}),Pde=(...e)=>{console.error(`${V0}/error`,...e)},Mp=(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=Pde}=e;MA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&Bj(v)}),c=v=>{const b=CI(t,v)??cH(v);return l(b)};Bf(c,{withTypes:()=>c});const f=v=>{const b=CI(t,v);return b&&(b.unsubscribe(),v.cancelActive&&Bj(b)),!!b};Bf(f,{withTypes:()=>f});const h=async(v,b,w,S)=>{const E=new AbortController,C=Ode(c,E.signal),j=[];try{v.pending.add(E),r(v),await Promise.resolve(v.effect(b,Bf({},w,{getOriginalState:S,condition:(A,N)=>C(A,N).then(Boolean),take:C,delay:lH(E.signal),pause:lx(E.signal),extra:a,signal:E.signal,fork:Ade(E.signal,j),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,N,O)=>{A!==E&&(A.abort($j),O.delete(A))})},cancel:()=>{E.abort($j),v.pending.delete(E)},throwIfCancelled:()=>{Gu(E.signal)}})))}catch(A){A instanceof q0||kI(o,A,{raisedBy:"effect"})}finally{await Promise.all(j),E.abort(Cde),i(v),v.pending.delete(E)}},d=Nde(t,n);return{middleware:v=>b=>w=>{if(!FU(w))return b(w);if(fH.match(w))return c(w.payload);if(Tde.match(w)){d();return}if(dH.match(w))return f(w.payload);let S=v.getState();const E=()=>{if(S===jI)throw new Error(Di(23));return S};let C;try{if(C=b(w),t.size>0){const j=v.getState(),A=Array.from(t.values());for(const N of A){let O=!1;try{O=N.predicate(w,j,S)}catch(T){O=!1,kI(o,T,{raisedBy:"predicate"})}O&&h(N,w,v,E)}}}finally{S=jI}return C},startListening:c,stopListening:f,clearListeners:d}};function Di(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 Mde={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},hH=Br({name:"chartLayout",initialState:Mde,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:Dde,setLayout:Rde,setChartSize:Ide,setScale:Lde}=hH.actions,zde=hH.reducer;function mH(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function St(e){return Number.isFinite(e)}function vo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function AI(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 Tf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){$de(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $de(e,t,n){return(t=Bde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bde(e){var t=Fde(e,"string");return typeof t=="symbol"?t:t+""}function Fde(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 Kt(e,t,n){return mn(e)||mn(t)?n:go(t)?uc(e,t,n):typeof t=="function"?t(e):n}var Ude=(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"&&Pe(e[a]))return Tf(Tf({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Pe(e[o]))return Tf(Tf({},e),{},{[o]:e[o]+(i||0)})}return e},js=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",pH=(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},gH=(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?pr(a[0]-a[1])*2*w:w,d||g){var S=(d||g||[]).map((E,C)=>{var j=r?r.indexOf(E):E,A=o.map(j);return St(A)?{coordinate:A+w,value:E,offset:w,index:C}:null}).filter(fi);return S}return c&&f?f.map((E,C)=>{var j=o.map(E);return St(j)?{coordinate:j+w,value:E,index:C,offset:w}:null}).filter(fi):o.ticks&&h!=null?o.ticks(h).map((E,C)=>{var j=o.map(E);return St(j)?{coordinate:j+w,value:E,index:C,offset:w}:null}).filter(fi):o.domain().map((E,C)=>{var j=o.map(E);return St(j)?{coordinate:j+w,value:r?r[E]:E,index:C,offset:w}:null}).filter(fi)},Hde=(e,t)=>{if(!t||t.length!==2||!Pe(t[0])||!Pe(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(!Pe(e[0])||e[0]<n)&&(i[0]=n),(!Pe(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},qde=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=po(h)?d:h;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=o,o+=g,f[1]=o)}}}},Vde=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=po(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Kde={sign:qde,expand:mce,none:lc,silhouette:pce,wiggle:gce,positive:Vde},Yde=(e,t,n)=>{var r,i=(r=Kde[n])!==null&&r!==void 0?r:lc,a=hce().keys(t).value((l,c)=>Number(Kt(l,c,0))).order(Oj).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((f,h)=>{var d=Kt(e[h],t[c],0);Array.isArray(d)&&d.length===2&&Pe(d[0])&&Pe(d[1])&&(f[0]=d[0],f[1]=d[1])})}),o};function Xde(e){return e==null?void 0:String(e)}function OI(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!mn(i[t.dataKey])){var l=xU(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=Kt(i,mn(o)?t.dataKey:o),f=t.scale.map(c);return Pe(f)?f:null}var NI=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=Kt(a,t.dataKey,t.scale.domain()[o]);if(mn(l))return null;var c=t.scale.map(l);return Pe(c)?c-i/2+r:null},Gde=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]},Wde=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},Qde=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Zde=(e,t,n)=>{if(e!=null)return Qde(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=mH(f,t,n),d=Wde(h);return!St(d[0])||!St(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]))},TI=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fd=(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=I0(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 MI(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Tf(Tf({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Ld(e,t){if(e)return String(e);if(typeof t=="string")return t}var Jde=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},ehe=(e,t)=>t==="centric"?e.angle:e.radius,Cs=e=>e.layout.width,ks=e=>e.layout.height,the=e=>e.layout.scale,vH=e=>e.layout.margin,K0=ue(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Y0=ue(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),yH="data-recharts-item-index",xH="data-recharts-item-id",Dp=60;function DI(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 Hv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){nhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nhe(e,t,n){return(t=rhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rhe(e){var t=ihe(e,"string");return typeof t=="symbol"?t:t+""}function ihe(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 ahe=e=>e.brush.height;function ohe(e){var t=Y0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Dp;return n+i}return n},0)}function she(e){var t=Y0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Dp;return n+i}return n},0)}function lhe(e){var t=K0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function uhe(e){var t=K0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var or=ue([Cs,ks,vH,ahe,ohe,she,lhe,uhe,LU,Rfe],(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=Hv(Hv({},d),h),v=g.bottom;g.bottom+=r,g=Ude(g,c,f);var b=e-g.left-g.right,w=t-g.top-g.bottom;return Hv(Hv({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),che=ue(or,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),DA=ue(Cs,ks,(e,t)=>({x:0,y:0,width:e,height:t})),fhe=x.createContext(null),Fr=()=>x.useContext(fhe)!=null,X0=e=>e.brush,G0=ue([X0,or,vH],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Pe(e.width)?e.width:t.width})),_E={},jE={},CE={},RI;function dhe(){return RI||(RI=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()},E=function(...C){if(i!=null&&i.aborted)return;o=this,l=C;const j=g==null;v(),c&&j&&h()};return E.schedule=v,E.cancel=w,E.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),E}e.debounce=t})(CE)),CE}var II;function hhe(){return II||(II=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dhe();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})(jE)),jE}var LI;function mhe(){return LI||(LI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hhe();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})(_E)),_E}var kE,zI;function phe(){return zI||(zI=1,kE=mhe().throttle),kE}var ghe=phe();const vhe=Bi(ghe);var ux=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++]))}},so={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},bH=(e,t,n)=>{var{width:r=so.width,height:i=so.height,aspect:a,maxHeight:o}=n,l=cc(r)?e:Number(r),c=cc(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}},yhe={width:0,height:0,overflow:"visible"},xhe={width:0,overflowX:"visible"},bhe={height:0,overflowY:"visible"},whe={},She=e=>{var{width:t,height:n}=e,r=cc(t),i=cc(n);return r&&i?yhe:r?xhe:i?bhe:whe};function Ehe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=so.width,a=so.height):i===void 0?i=r&&r>0?void 0:so.width:a===void 0&&(a=r&&r>0?void 0:so.height),{width:i,height:a}}function Fj(){return Fj=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},Fj.apply(null,arguments)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){_he(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _he(e,t,n){return(t=jhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jhe(e){var t=Che(e,"string");return typeof t=="symbol"?t:t+""}function Che(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 wH=x.createContext(so.initialDimension);function khe(e){return vo(e.width)&&vo(e.height)}function SH(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return khe(i)?x.createElement(wH.Provider,{value:i},t):null}var RA=()=>x.useContext(wH),Ahe=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=so.initialDimension,width:i,height:a,minWidth:o=so.minWidth,minHeight:l,maxHeight:c,children:f,debounce:h=so.debounce,id:d,className:g,onResize:v,style:b={}}=e,w=x.useRef(null),S=x.useRef();S.current=v,x.useImperativeHandle(t,()=>w.current);var[E,C]=x.useState({containerWidth:r.width,containerHeight:r.height}),j=x.useCallback((M,I)=>{C(z=>{var B=Math.round(M),L=Math.round(I);return z.containerWidth===B&&z.containerHeight===L?z:{containerWidth:B,containerHeight:L}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Zl;var M=L=>{var G,F=L[0];if(F!=null){var{width:K,height:D}=F.contentRect;j(K,D),(G=S.current)===null||G===void 0||G.call(S,K,D)}};h>0&&(M=vhe(M,h,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),{width:z,height:B}=w.current.getBoundingClientRect();return j(z,B),I.observe(w.current),()=>{I.disconnect()}},[j,h]);var{containerWidth:A,containerHeight:N}=E;ux(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:T}=bH(A,N,{width:i,height:a,aspect:n,maxHeight:c});return ux(O!=null&&O>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.`,O,T,i,a,o,l,n),x.createElement("div",{id:d?"".concat(d):void 0,className:Ct("recharts-responsive-container",g),style:BI(BI({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},x.createElement("div",{style:She({width:i,height:a})},x.createElement(SH,{width:O,height:T},f)))}),IA=x.forwardRef((e,t)=>{var n=RA();if(vo(n.width)&&vo(n.height))return e.children;var{width:r,height:i}=Ehe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=bH(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(a)&&Pe(o)?x.createElement(SH,{width:a,height:o},e.children):x.createElement(Ahe,Fj({},e,{width:r,height:i,ref:t}))});function LA(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 W0=()=>{var e,t=Fr(),n=Re(che),r=Re(G0),i=(e=Re(X0))===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}},Ohe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},EH=()=>{var e;return(e=Re(or))!==null&&e!==void 0?e:Ohe},zA=()=>Re(Cs),$A=()=>Re(ks),Nhe=()=>Re(e=>e.layout.margin),Tt=e=>e.layout.layoutType,jc=()=>Re(Tt),_H=()=>{var e=jc();if(e==="horizontal"||e==="vertical")return e},jH=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},The=()=>{var e=jc();return e!==void 0},Rp=e=>{var t=Yt(),n=Fr(),{width:r,height:i}=e,a=RA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),x.useEffect(()=>{!n&&vo(o)&&vo(l)&&t(Ide({width:o,height:l}))},[t,n,o,l]),null},CH=Symbol.for("immer-nothing"),FI=Symbol.for("immer-draftable"),zi=Symbol.for("immer-state");function ja(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Fm=Object.getPrototypeOf;function dd(e){return!!e&&!!e[zi]}function dc(e){var t;return e?kH(e)||Array.isArray(e)||!!e[FI]||!!((t=e.constructor)!=null&&t[FI])||Ip(e)||Z0(e):!1}var Phe=Object.prototype.constructor.toString(),UI=new WeakMap;function kH(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=UI.get(n);return r===void 0&&(r=Function.toString.call(n),UI.set(n,r)),r===Phe}function cx(e,t,n=!0){Q0(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 Q0(e){const t=e[zi];return t?t.type_:Array.isArray(e)?1:Ip(e)?2:Z0(e)?3:0}function Uj(e,t){return Q0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function AH(e,t,n){const r=Q0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Mhe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ip(e){return e instanceof Map}function Z0(e){return e instanceof Set}function Tu(e){return e.copy_||e.base_}function Hj(e,t){if(Ip(e))return new Map(e);if(Z0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=kH(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[zi];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(Fm(e),r)}else{const r=Fm(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function BA(e,t=!1){return J0(e)||dd(e)||!dc(e)||(Q0(e)>1&&Object.defineProperties(e,{set:qv,add:qv,clear:qv,delete:qv}),Object.freeze(e),t&&Object.values(e).forEach(n=>BA(n,!0))),e}function Dhe(){ja(2)}var qv={value:Dhe};function J0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Rhe={};function hc(e){const t=Rhe[e];return t||ja(0,e),t}var Um;function OH(){return Um}function Ihe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function HI(e,t){t&&(hc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qj(e){Vj(e),e.drafts_.forEach(Lhe),e.drafts_=null}function Vj(e){e===Um&&(Um=e.parent_)}function qI(e){return Um=Ihe(Um,e)}function Lhe(e){const t=e[zi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function VI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[zi].modified_&&(qj(t),ja(4)),dc(e)&&(e=fx(t,e),t.parent_||dx(t,e)),t.patches_&&hc("Patches").generateReplacementPatches_(n[zi].base_,e,t.patches_,t.inversePatches_)):e=fx(t,n,[]),qj(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==CH?e:void 0}function fx(e,t,n){if(J0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[zi];if(!i)return cx(t,(a,o)=>KI(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return dx(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),cx(o,(c,f)=>KI(e,i,a,c,f,n,l),r),dx(e,a,!1),n&&e.patches_&&hc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function KI(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=J0(i);if(!(l&&!o)){if(dd(i)){const c=a&&t&&t.type_!==3&&!Uj(t.assigned_,r)?a.concat(r):void 0,f=fx(e,i,c);if(AH(n,r,f),dd(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(dc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;fx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Ip(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&dx(e,i)}}}function dx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&BA(t,n)}function zhe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:OH(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=FA;n&&(i=[r],a=Hm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var FA={get(e,t){if(t===zi)return e;const n=Tu(e);if(!Uj(n,t))return $he(e,n,t);const r=n[t];return e.finalized_||!dc(r)?r:r===AE(e.base_,t)?(OE(e),e.copy_[t]=Yj(r,e)):r},has(e,t){return t in Tu(e)},ownKeys(e){return Reflect.ownKeys(Tu(e))},set(e,t,n){const r=NH(Tu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=AE(Tu(e),t),a=i==null?void 0:i[zi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Mhe(n,i)&&(n!==void 0||Uj(e.base_,t)))return!0;OE(e),Kj(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 AE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,OE(e),Kj(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Tu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ja(11)},getPrototypeOf(e){return Fm(e.base_)},setPrototypeOf(){ja(12)}},Hm={};cx(FA,(e,t)=>{Hm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Hm.deleteProperty=function(e,t){return Hm.set.call(this,e,t,void 0)};Hm.set=function(e,t,n){return FA.set.call(this,e[0],t,n,e[0])};function AE(e,t){const n=e[zi];return(n?Tu(n):e)[t]}function $he(e,t,n){var i;const r=NH(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function NH(e,t){if(!(t in e))return;let n=Fm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Fm(n)}}function Kj(e){e.modified_||(e.modified_=!0,e.parent_&&Kj(e.parent_))}function OE(e){e.copy_||(e.copy_=Hj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bhe=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"&&ja(6),r!==void 0&&typeof r!="function"&&ja(7);let i;if(dc(t)){const a=qI(this),o=Yj(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?qj(a):Vj(a)}return HI(a,r),VI(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===CH&&(i=void 0),this.autoFreeze_&&BA(i,!0),r){const a=[],o=[];hc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else ja(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){dc(e)||ja(8),dd(e)&&(e=Fhe(e));const t=qI(this),n=Yj(e,void 0);return n[zi].isManual_=!0,Vj(t),n}finishDraft(e,t){const n=e&&e[zi];(!n||!n.isManual_)&&ja(9);const{scope_:r}=n;return HI(r,t),VI(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=hc("Patches").applyPatches_;return dd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Yj(e,t){const n=Ip(e)?hc("MapSet").proxyMap_(e,t):Z0(e)?hc("MapSet").proxySet_(e,t):zhe(e,t);return(t?t.scope_:OH()).drafts_.push(n),n}function Fhe(e){return dd(e)||ja(10,e),TH(e)}function TH(e){if(!dc(e)||J0(e))return e;const t=e[zi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Hj(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Hj(e,!0);return cx(n,(i,a)=>{AH(n,i,TH(a))},r),t&&(t.finalized_=!1),n}var Uhe=new Bhe;Uhe.produce;var Hhe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},PH=Br({name:"legend",initialState:Hhe,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:an()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=aa(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:an()},removeLegendPayload:{reducer(e,t){var n=aa(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:an()}}}),{setLegendSize:YI,setLegendSettings:qhe,addLegendPayload:MH,replaceLegendPayload:DH,removeLegendPayload:RH}=PH.actions,Vhe=PH.reducer,NE={exports:{}},TE={};/**
 * @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 XI;function Khe(){if(XI)return TE;XI=1;var e=kd();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 TE.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(N){if(!E){if(E=!0,C=N,N=d(N),g!==void 0&&b.hasValue){var O=b.value;if(g(O,N))return j=O}return j=N}if(O=j,n(C,N))return O;var T=d(N);return g!==void 0&&g(O,T)?(C=N,O):(C=N,j=T)}var E=!1,C,j,A=h===void 0?null:h;return[function(){return S(f())},A===null?void 0:function(){return S(A())}]},[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},TE}var GI;function Yhe(){return GI||(GI=1,NE.exports=Khe()),NE.exports}Yhe();function Xhe(e){e()}function Ghe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Xhe(()=>{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 WI={notify(){},get:()=>[]};function Whe(e,t){let n,r=WI,i=0,a=!1;function o(w){h();const S=r.subscribe(w);let E=!1;return()=>{E||(E=!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=Ghe())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=WI)}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 Qhe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zhe=Qhe(),Jhe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",eme=Jhe(),tme=()=>Zhe||eme?x.useLayoutEffect:x.useEffect,nme=tme();function QI(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function rme(e,t){if(QI(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])||!QI(e[n[i]],t[n[i]]))return!1;return!0}var PE=Symbol.for("react-redux-context"),ME=typeof globalThis<"u"?globalThis:{};function ime(){if(!x.createContext)return{};const e=ME[PE]??(ME[PE]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var ame=ime();function ome(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const c=Whe(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);nme(()=>{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||ame;return x.createElement(l.Provider,{value:a},t)}var sme=ome,lme=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function ume(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function zd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(lme.has(r)){if(e[r]==null&&t[r]==null)continue;if(!rme(e[r],t[r]))return!1}else if(!ume(e[r],t[r]))return!1;return!0}var cme=["contextPayload"];function Xj(){return Xj=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},Xj.apply(null,arguments)}function ZI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZI(Object(n),!0).forEach(function(r){fme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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)}function mme(e,t){if(e==null)return{};var n,r,i=pme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gme(e){return e.value}function vme(e){var{contextPayload:t}=e,n=mme(e,cme),r=PU(t,e.payloadUniqBy,gme),i=hd(hd({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Vce,i)}function yme(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}),hd(hd({},f),h)}function xme(e){var t=Yt();return x.useEffect(()=>{t(qhe(e))},[t,e]),null}function bme(e){var t=Yt();return x.useEffect(()=>(t(YI(e)),()=>{t(YI({width:0,height:0}))}),[t,e]),null}function wme(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Sme={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Eme(e){var t=Wn(e,Sme),n=zfe(),r=Lue(),i=Nhe(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[f,h]=zU([n]),d=zA(),g=$A();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=wme(t.layout,o,a,v),w=c?l:hd(hd({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},yme(l,t,i,d,g,f)),l),S=c??r;if(S==null||n==null)return null;var E=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:h},x.createElement(xme,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&x.createElement(bme,{width:f.width,height:f.height}),x.createElement(vme,Xj({},t,b,{margin:i,chartWidth:d,chartHeight:g,contextPayload:n})));return Xl.createPortal(E,S)}var IH=x.memo(Eme,zd);IH.displayName="Legend";function Gj(){return Gj=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},Gj.apply(null,arguments)}function JI(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 Xh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){_me(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _me(e,t,n){return(t=jme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jme(e){var t=Cme(e,"string");return typeof t=="symbol"?t:t+""}function Cme(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 kme(e){return Array.isArray(e)&&go(e[0])&&go(e[1])?e.join(" ~ "):e}var gf={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 Ame(e,t){return t==null?e:I0(e,t)}var Ome=e=>{var{separator:t=gf.separator,contentStyle:n,itemStyle:r,labelStyle:i=gf.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:f,label:h,labelFormatter:d,accessibilityLayer:g=gf.accessibilityLayer}=e,v=()=>{if(a&&a.length){var N={padding:0,margin:0},O=Ame(a,l),T=O.map((M,I)=>{if(M.type==="none")return null;var z=M.formatter||o||kme,{value:B,name:L}=M,G=B,F=L;if(z){var K=z(B,L,M,I,a);if(Array.isArray(K))[G,F]=K;else if(K!=null)G=K;else return null}var D=Xh(Xh({},gf.itemStyle),{},{color:M.color||gf.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:D},go(F)?x.createElement("span",{className:"recharts-tooltip-item-name"},F):null,go(F)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},G),x.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:N},T)}return null},b=Xh(Xh({},gf.contentStyle),n),w=Xh({margin:0},i),S=!mn(h),E=S?h:"",C=Ct("recharts-default-tooltip",c),j=Ct("recharts-tooltip-label",f);S&&d&&a!==void 0&&a!==null&&(E=d(h,a));var A=g?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",Gj({className:C,style:b},A),x.createElement("p",{className:j,style:w},x.isValidElement(E)?E:"".concat(E)),v())},Gh="recharts-tooltip-wrapper",Nme={visibility:"hidden"};function Tme(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ct(Gh,{["".concat(Gh,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(Gh,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(Gh,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(Gh,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function eL(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:f}=e;if(a&&Pe(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 Pme(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 Mme(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=eL({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),g=eL({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),h=Pme({translateX:d,translateY:g,useTranslate3d:c})):h=Nme,{cssProperties:h,cssClasses:Tme({translateX:d,translateY:g,coordinate:n})}}var Dme=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Lp={isSsr:Dme()};function LH(){var[e,t]=x.useState(()=>Lp.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function 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 vf(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){Rme(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 Rme(e,t,n){return(t=Ime(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ime(e){var t=Lme(e,"string");return typeof t=="symbol"?t:t+""}function Lme(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 zme(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function $me(e){var t,n,r,i,a,o,l=LH(),[c,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,E,C,j;f({dismissed:!0,dismissedAtCoordinate:{x:(S=(E=e.coordinate)===null||E===void 0?void 0:E.x)!==null&&S!==void 0?S:0,y:(C=(j=e.coordinate)===null||j===void 0?void 0:j.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(vf(vf({},c),{},{dismissed:!1}));var{cssClasses:h,cssProperties:d}=Mme({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?{}:vf(vf({transition:zme({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=vf(vf({},g),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:h,style:v,ref:e.innerRef},e.children)}var Bme=x.memo($me),zH=()=>{var e;return(e=Re(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Wj(){return Wj=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},Wj.apply(null,arguments)}function nL(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 rL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){Fme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fme(e,t,n){return(t=Ume(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ume(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 iL={curveBasisClosed:nce,curveBasisOpen:rce,curveBasis:tce,curveBumpX:Fue,curveBumpY:Uue,curveLinearClosed:ice,curveLinear:D0,curveMonotoneX:ace,curveMonotoneY:oce,curveNatural:sce,curveStep:lce,curveStepAfter:cce,curveStepBefore:uce},hx=e=>St(e.x)&&St(e.y),aL=e=>e.base!=null&&hx(e.base)&&hx(e),Wh=e=>e.x,Qh=e=>e.y,qme=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Np(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=iL["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return iL[n]||D0},oL={connectNulls:!1,type:"linear"},Vme=e=>{var{type:t=oL.type,points:n=[],baseLine:r,layout:i,connectNulls:a=oL.connectNulls}=e,o=qme(t,i),l=a?n.filter(hx):n;if(Array.isArray(r)){var c,f=n.map((b,w)=>rL(rL({},b),{},{base:r[w]}));i==="vertical"?c=Lv().y(Qh).x1(Wh).x0(b=>b.base.x):c=Lv().x(Wh).y1(Qh).y0(b=>b.base.y);var h=c.defined(aL).curve(o),d=a?f.filter(aL):f;return h(d)}var g;i==="vertical"&&Pe(r)?g=Lv().y(Qh).x1(Wh).x0(r):Pe(r)?g=Lv().x(Wh).y1(Qh).y0(r):g=oU().x(Wh).y(Qh);var v=g.defined(hx).curve(o);return v(l)},UA=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=jc();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?Vme(o):r;return x.createElement("path",Wj({},Ii(e),jA(e),{className:Ct("recharts-curve",t),d:l===null?void 0:l,ref:i}))},Kme=["x","y","top","left","width","height","className"];function Qj(){return Qj=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},Qj.apply(null,arguments)}function sL(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 Yme(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sL(Object(n),!0).forEach(function(r){Xme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xme(e,t,n){return(t=Gme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gme(e){var t=Wme(e,"string");return typeof t=="symbol"?t:t+""}function Wme(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 Qme(e,t){if(e==null)return{};var n,r,i=Zme(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 Zme(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 Jme=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),epe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=Qme(e,Kme),f=Yme({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Pe(t)||!Pe(n)||!Pe(a)||!Pe(o)||!Pe(r)||!Pe(i)?null:x.createElement("path",Qj({},Wr(f),{className:Ct("recharts-cross",l),d:Jme(t,n,a,o,r,i)}))};function tpe(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 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 uL(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){npe(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 npe(e,t,n){return(t=rpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rpe(e){var t=ipe(e,"string");return typeof t=="symbol"?t:t+""}function ipe(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 ape=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),$H=(e,t,n)=>e.map(r=>"".concat(ape(r)," ").concat(t,"ms ").concat(n)).join(","),ope=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),qm=(e,t)=>Object.keys(t).reduce((n,r)=>uL(uL({},n),{},{[r]:e(r,t[r])}),{});function cL(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 rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function spe(e,t,n){return(t=lpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lpe(e){var t=upe(e,"string");return typeof t=="symbol"?t:t+""}function upe(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 mx=(e,t,n)=>e+(t-e)*n,Zj=e=>{var{from:t,to:n}=e;return t!==n},BH=(e,t,n)=>{var r=qm((i,a)=>{if(Zj(a)){var[o,l]=e(a.from,a.to,a.velocity);return rr(rr({},a),{},{from:o,velocity:l})}return a},t);return n<1?qm((i,a)=>Zj(a)&&r[i]!=null?rr(rr({},a),{},{velocity:mx(a.velocity,r[i].velocity,n),from:mx(a.from,r[i].from,n)}):a,t):BH(e,r,n-1)};function cpe(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>rr(rr({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>qm((g,v)=>v.from,l),f=()=>!Object.values(l).filter(Zj).length,h=null,d=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=BH(n,l,b),i(rr(rr(rr({},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 fpe(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:rr(rr({},d),{},{[g]:[v,b]})},{}),f,h=d=>{f||(f=d);var g=(d-f)/r,v=qm((w,S)=>mx(...S,n(g)),c);if(a(rr(rr(rr({},e),t),v)),g<1)l=o.setTimeout(h);else{var b=qm((w,S)=>mx(...S,n(1)),c);a(rr(rr(rr({},e),t),b))}};return()=>(l=o.setTimeout(h),()=>{var d;(d=l)===null||d===void 0||d()})}const dpe=(e,t,n,r,i,a)=>{var o=ope(e,t);return n==null?()=>(i(rr(rr({},e),t)),()=>{}):n.isStepper===!0?cpe(e,t,n,o,i,a):fpe(e,t,n,r,o,i,a)};var px=1e-4,FH=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],UH=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),fL=(e,t)=>n=>{var r=FH(e,t);return UH(r,n)},hpe=(e,t)=>n=>{var r=FH(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return UH(i,n)},mpe=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]]},ppe=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=mpe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},gpe=(e,t,n,r)=>{var i=fL(e,n),a=fL(t,r),o=hpe(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)<px||b<px)return a(d);d=l(d-v/b)}return a(d)};return c.isStepper=!1,c},dL=function(){return gpe(...ppe(...arguments))},vpe=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)<px&&Math.abs(d)<px?[l,0]:[g,d]};return a.isStepper=!0,a.dt=i,a},ype=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return dL(e);case"spring":return vpe();default:if(e.split("(")[0]==="cubic-bezier")return dL(e)}return typeof e=="function"?e:null};function xpe(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 bpe{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 wpe(){return xpe(new bpe)}var Spe=x.createContext(wpe);function Epe(e,t){var n=x.useContext(Spe);return x.useMemo(()=>t??n(e),[e,t,n])}var _pe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},hL={t:0},DE={t:1};function zp(e){var t=Wn(e,_pe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:f}=t,h=LH(),d=n==="auto"?!Lp.isSsr&&!h:n,g=Epe(t.animationId,t.animationManager),[v,b]=x.useState(d?hL:DE),w=x.useRef(null);return x.useEffect(()=>{d||b(DE)},[d]),x.useEffect(()=>{if(!d||!r)return Zl;var S=dpe(hL,DE,ype(a),i,b,g.getTimeoutController()),E=()=>{w.current=S()};return g.start([c,o,E,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[d,r,i,a,o,c,l,g]),f(v.t)}function $p(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Lm(t)),r=x.useRef(e);return r.current!==e&&(n.current=Lm(t),r.current=e),n.current}var jpe=["radius"],Cpe=["radius"],mL,pL,gL,vL,yL,xL,bL,wL,SL,EL;function _L(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 jL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(n),!0).forEach(function(r){kpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kpe(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 gx(){return gx=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},gx.apply(null,arguments)}function CL(e,t){if(e==null)return{};var n,r,i=Npe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Npe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Qa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var kL=(e,t,n,r,i)=>{var a=Ml(n),o=Ml(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=On(mL||(mL=Qa(["M",",",""])),e,t+c*g[0]),g[0]>0&&(d+=On(pL||(pL=Qa(["A ",",",",0,0,",",",",",""])),g[0],g[0],h,e+f*g[0],t)),d+=On(gL||(gL=Qa(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(d+=On(vL||(vL=Qa(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],h,e+n,t+c*g[1])),d+=On(yL||(yL=Qa(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(d+=On(xL||(xL=Qa(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],h,e+n-f*g[2],t+r)),d+=On(bL||(bL=Qa(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(d+=On(wL||(wL=Qa(["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 E=Math.min(l,i);d=On(SL||(SL=Qa(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*E,E,E,h,e+f*E,t,e+n-f*E,t,E,E,h,e+n,t+c*E,e+n,t+r-c*E,E,E,h,e+n-f*E,t+r,e+f*E,t+r,E,E,h,e,t+r-c*E)}else d=On(EL||(EL=Qa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},AL={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},HH=e=>{var t=Wn(e,AL),n=x.useRef(null),[r,i]=x.useState(-1);x.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=x.useRef(l),E=x.useRef(c),C=x.useRef(a),j=x.useRef(o),A=x.useMemo(()=>({x:a,y:o,width:l,height:c,radius:f}),[a,o,l,c,f]),N=$p(A,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var O=Ct("recharts-rectangle",h);if(!w){var T=Wr(t),{radius:M}=T,I=CL(T,jpe);return x.createElement("path",gx({},I,{x:Ml(a),y:Ml(o),width:Ml(l),height:Ml(c),radius:typeof f=="number"?f:void 0,className:O,d:kL(a,o,l,c,f)}))}var z=S.current,B=E.current,L=C.current,G=j.current,F="0px ".concat(r===-1?1:r,"px"),K="".concat(r,"px ").concat(r,"px"),D=$H(["strokeDasharray"],g,typeof d=="string"?d:AL.animationEasing);return x.createElement(zp,{animationId:N,key:N,canBegin:r>0,duration:g,easing:d,isActive:w,begin:v},q=>{var X=cn(z,l,q),V=cn(B,c,q),R=cn(L,a,q),H=cn(G,o,q);n.current&&(S.current=X,E.current=V,C.current=R,j.current=H);var U;b?q>0?U={transition:D,strokeDasharray:K}:U={strokeDasharray:F}:U={strokeDasharray:K};var $=Wr(t),{radius:Q}=$,Z=CL($,Cpe);return x.createElement("path",gx({},Z,{radius:typeof f=="number"?f:void 0,className:O,d:kL(R,H,X,V,f),ref:n,style:jL(jL({},U),t.style)}))})};function OL(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 NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OL(Object(n),!0).forEach(function(r){Tpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tpe(e,t,n){return(t=Ppe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ppe(e){var t=Mpe(e,"string");return typeof t=="symbol"?t:t+""}function Mpe(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 vx=Math.PI/180,Dpe=e=>e*180/Math.PI,Yn=(e,t,n,r)=>({x:e+Math.cos(-vx*r)*n,y:t+Math.sin(-vx*r)*n}),qH=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},Rpe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Ipe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Rpe({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:Dpe(c),angleInRadian:c}},Lpe=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}},zpe=(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},$pe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Ipe({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:f}=Lpe(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?NL(NL({},t),{},{radius:i,angle:zpe(h,t)}):null};function VH(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Yn(t,n,r,i),l=Yn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var TL,PL,ML,DL,RL,IL,LL;function Jj(){return Jj=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},Jj.apply(null,arguments)}function Ru(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Bpe=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Vv=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)/vx,d=c?i:i+a*h,g=Yn(t,n,f,d),v=Yn(t,n,r,d),b=c?i-a*h:i,w=Yn(t,n,f*Math.cos(h*vx),b);return{center:g,circleTangency:v,lineTangency:w,theta:h}},KH=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=Bpe(a,o),c=a+l,f=Yn(t,n,i,a),h=Yn(t,n,i,c),d=On(TL||(TL=Ru(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),f.x,f.y,i,i,+(Math.abs(l)>180),+(a>c),h.x,h.y);if(r>0){var g=Yn(t,n,r,a),v=Yn(t,n,r,c);d+=On(PL||(PL=Ru(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else d+=On(ML||(ML=Ru(["L ",","," Z"])),t,n);return d},Fpe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:f}=e,h=pr(f-c),{circleTangency:d,lineTangency:g,theta:v}=Vv({cx:t,cy:n,radius:i,angle:c,sign:h,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=Vv({cx:t,cy:n,radius:i,angle:f,sign:-h,cornerRadius:a,cornerIsExternal:l}),E=l?Math.abs(c-f):Math.abs(c-f)-v-S;if(E<0)return o?On(DL||(DL=Ru(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):KH({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var C=On(RL||(RL=Ru(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(h<0),d.x,d.y,i,i,+(E>180),+(h<0),b.x,b.y,a,a,+(h<0),w.x,w.y);if(r>0){var{circleTangency:j,lineTangency:A,theta:N}=Vv({cx:t,cy:n,radius:r,angle:c,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:O,lineTangency:T,theta:M}=Vv({cx:t,cy:n,radius:r,angle:f,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),I=l?Math.abs(c-f):Math.abs(c-f)-N-M;if(I<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=On(IL||(IL=Ru(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(h<0),O.x,O.y,r,r,+(I>180),+(h>0),j.x,j.y,a,a,+(h<0),A.x,A.y)}else C+=On(LL||(LL=Ru(["L",",","Z"])),t,n);return C},Upe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},YH=e=>{var t=Wn(e,Upe),{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=Ct("recharts-sector",d),v=a-i,b=zr(o,v,0,!0),w;return b>0&&Math.abs(f-h)<360?w=Fpe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}):w=KH({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:h}),x.createElement("path",Jj({},Wr(t),{className:g,d:w}))};function Hpe(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(wU(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Yn(r,i,a,l),f=Yn(r,i,o,l);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return VH(t)}}var RE={},IE={},LE={},zL;function qpe(){return zL||(zL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RU();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(LE)),LE}var $L;function Vpe(){return $L||($L=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qpe();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})(IE)),IE}var BL;function Kpe(){return BL||(BL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IU(),n=Vpe();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})(RE)),RE}var zE,FL;function Ype(){return FL||(FL=1,zE=Kpe().range),zE}var Xpe=Ype();const XH=Bi(Xpe);var As=e=>e.chartData,eb=ue([As],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),HA=(e,t,n,r)=>r?eb(e):As(e),Gpe=(e,t,n)=>n?eb(e):As(e);function fo(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(St(t)&&St(n))return!0}return!1}function UL(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function GH(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(St(n))i=n;else if(typeof n=="function")return;if(St(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(fo(o))return o}}function Wpe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(fo(r))return UL(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(Pe(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"&&TI.test(i)){var c=TI.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(Pe(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"&&PI.test(a)){var h=PI.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(fo(g))return t==null?g:UL(g,t,n)}}}var $d=1e9,Qpe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},VA,dn=!0,la="[DecimalError] ",Wu=la+"Invalid argument: ",qA=la+"Exponent out of range: ",Bd=Math.floor,Pu=Math.pow,Zpe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ni,mr=1e7,on=7,WH=9007199254740991,yx=Bd(WH/on),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.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};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*on;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return ns(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Qt(ns(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return Gn(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.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(Ni))throw Error(la+"NaN");if(n.s<1)throw Error(la+(n.s?"NaN":"-Infinity"));return n.eq(Ni)?new r(0):(dn=!1,t=ns(Vm(n,a),Vm(e,a),a),dn=!0,Qt(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?JH(t,e):QH(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(la+"NaN");return n.s?(dn=!1,t=ns(n,e,0,1).times(e),dn=!0,n.minus(t)):Qt(new r(n),i)};Me.naturalExponential=Me.exp=function(){return ZH(this)};Me.naturalLogarithm=Me.ln=function(){return Vm(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?QH(t,e):JH(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wu+e);if(t=Gn(i)+1,r=i.d.length-1,n=r*on+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};Me.squareRoot=Me.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(la+"NaN")}for(e=Gn(l),dn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=lo(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Bd((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(ns(l,a,o+2)).times(.5),lo(a.d).slice(0,o)===(t=lo(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return dn=!0,Qt(r,n)};Me.times=Me.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%mr|0,t=l/mr|0;a[i]=(a[i]+t)%mr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,dn?Qt(e,d.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(yo(e,0,$d),t===void 0?t=r.rounding:yo(t,0,8),Qt(n,e+Gn(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=mc(r,!0):(yo(e,0,$d),t===void 0?t=i.rounding:yo(t,0,8),r=Qt(new i(r),e+1,t),n=mc(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?mc(i):(yo(e,0,$d),t===void 0?t=a.rounding:yo(t,0,8),r=Qt(new a(i),e+Gn(i)+1,t),n=mc(r.abs(),!1,e+Gn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),Gn(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.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(Ni);if(l=new c(l),!l.s){if(e.s<1)throw Error(la+"Infinity");return l}if(l.eq(Ni))return l;if(r=c.precision,e.eq(Ni))return Qt(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=h<0?-h:h)<=WH){for(i=new c(Ni),t=Math.ceil(r/on+4),dn=!1;n%2&&(i=i.times(l),qL(i.d,t)),n=Bd(n/2),n!==0;)l=l.times(l),qL(l.d,t);return dn=!0,e.s<0?new c(Ni).div(i):Qt(i,r)}}else if(a<0)throw Error(la+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,dn=!1,i=e.times(Vm(l,r+f)),dn=!0,i=ZH(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Gn(i),r=mc(i,n<=a.toExpNeg||n>=a.toExpPos)):(yo(e,1,$d),t===void 0?t=a.rounding:yo(t,0,8),i=Qt(new a(i),e,t),n=Gn(i),r=mc(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(yo(e,1,$d),t===void 0?t=r.rounding:yo(t,0,8)),Qt(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Gn(e),n=e.constructor;return mc(e,t<=n.toExpNeg||t>=n.toExpPos)};function QH(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)),dn?Qt(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/on),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)/mr|0,c[a]%=mr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,dn?Qt(t,d):t}function yo(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Wu+e)}function lo(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=on-r.length,n&&(a+=yl(n)),a+=r;o=e[t],r=o+"",n=on-r.length,n&&(a+=yl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ns=(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%mr|0,o=a/mr|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*mr+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,E,C,j,A,N,O,T,M,I=r.constructor,z=r.s==i.s?1:-1,B=r.d,L=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(la+"Division by zero");for(c=r.e-i.e,T=L.length,N=B.length,v=new I(z),b=v.d=[],f=0;L[f]==(B[f]||0);)++f;if(L[f]>(B[f]||0)&&--c,a==null?C=a=I.precision:o?C=a+(Gn(r)-Gn(i))+1:C=a,C<0)return new I(0);if(C=C/on+2|0,f=0,T==1)for(h=0,L=L[0],C++;(f<N||h)&&C--;f++)j=h*mr+(B[f]||0),b[f]=j/L|0,h=j%L|0;else{for(h=mr/(L[0]+1)|0,h>1&&(L=e(L,h),B=e(B,h),T=L.length,N=B.length),A=T,w=B.slice(0,T),S=w.length;S<T;)w[S++]=0;M=L.slice(),M.unshift(0),O=L[0],L[1]>=mr/2&&++O;do h=0,l=t(L,w,T,S),l<0?(E=w[0],T!=S&&(E=E*mr+(w[1]||0)),h=E/O|0,h>1?(h>=mr&&(h=mr-1),d=e(L,h),g=d.length,S=w.length,l=t(d,w,g,S),l==1&&(h--,n(d,T<g?M:L,g))):(h==0&&(l=h=1),d=L.slice()),g=d.length,g<S&&d.unshift(0),n(w,d,S),l==-1&&(S=w.length,l=t(L,w,T,S),l<1&&(h++,n(w,T<S?M:L,S))),S=w.length):l===0&&(h++,w=[0]),b[f++]=h,l&&w[0]?w[S++]=B[A]||0:(w=[B[A]],S=1);while((A++<N||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,Qt(v,o?a+Gn(v)+1:a)}})();function ZH(e,t){var n,r,i,a,o,l,c=0,f=0,h=e.constructor,d=h.precision;if(Gn(e)>16)throw Error(qA+Gn(e));if(!e.s)return new h(Ni);for(dn=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Pu(2,f))/Math.LN10*2+5|0,l+=r,n=i=a=new h(Ni),h.precision=l;;){if(i=Qt(i.times(e),l),n=n.times(++c),o=a.plus(ns(i,n,l)),lo(o.d).slice(0,l)===lo(a.d).slice(0,l)){for(;f--;)a=Qt(a.times(a),l);return h.precision=d,t==null?(dn=!0,Qt(a,d)):a}a=o}}function Gn(e){for(var t=e.e*on,n=e.d[0];n>=10;n/=10)t++;return t}function $E(e,t,n){if(t>e.LN10.sd())throw dn=!0,n&&(e.precision=n),Error(la+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function yl(e){for(var t="";e--;)t+="0";return t}function Vm(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(la+(v.s?"NaN":"-Infinity"));if(v.eq(Ni))return new w(0);if(t==null?(dn=!1,f=S):f=t,v.eq(10))return t==null&&(dn=!0),$E(w,f);if(f+=g,w.precision=f,n=lo(b),r=n.charAt(0),a=Gn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=lo(v.d),r=n.charAt(0),d++;a=Gn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=$E(w,f+2,S).times(a+""),v=Vm(new w(r+"."+n.slice(1)),f-g).plus(c),w.precision=S,t==null?(dn=!0,Qt(v,S)):v;for(l=o=v=ns(v.minus(Ni),v.plus(Ni),f),h=Qt(v.times(v),f),i=3;;){if(o=Qt(o.times(h),f),c=l.plus(ns(o,new w(i),f)),lo(c.d).slice(0,f)===lo(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus($E(w,f+2,S).times(a+""))),l=ns(l,new w(d),f),w.precision=S,t==null?(dn=!0,Qt(l,S)):l;l=c,i+=2}}function HL(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=Bd(n/on),e.d=[],r=(n+1)%on,n<0&&(r+=on),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=on;r<i;)e.d.push(+t.slice(r,r+=on));t=t.slice(r),r=on-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),dn&&(e.e>yx||e.e<-yx))throw Error(qA+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(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+=on,i=t,f=d[h=0];else{if(h=Math.ceil((r+1)/on),a=d.length,h>=a)return e;for(f=a=d[h],o=1;a>=10;a/=10)o++;r%=on,i=r-on+o}if(n!==void 0&&(a=Pu(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/Pu(10,o-i):0:d[h-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=Gn(e),d.length=1,t=t-a-1,d[0]=Pu(10,(on-t%on)%on),e.e=Bd(-t/on)||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=Pu(10,on-r),d[h]=i>0?(f/Pu(10,o-i)%Pu(10,i)|0)*a:0),c)for(;;)if(h==0){(d[0]+=a)==mr&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=mr)break;d[h--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(dn&&(e.e>yx||e.e<-yx))throw Error(qA+Gn(e));return e}function JH(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),dn?Qt(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/on),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]=mr-1;--c[a],c[i]+=mr}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,dn?Qt(t,v):t):new g(0)}function mc(e,t,n){var r,i=Gn(e),a=lo(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+yl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+yl(-i-1)+a,n&&(r=n-o)>0&&(a+=yl(r))):i>=o?(a+=yl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+yl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=yl(r))),e.s<0?"-"+a:a}function qL(e,t){if(e.length>t)return e.length=t,!0}function eq(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(Wu+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 HL(o,a.toString())}else if(typeof a!="string")throw Error(Wu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Zpe.test(a))HL(o,a);else throw Error(Wu+a)}if(i.prototype=Me,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=eq,i.config=i.set=Jpe,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 Jpe(e){if(!e||typeof e!="object")throw Error(la+"Object expected");var t,n,r,i=["precision",1,$d,"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(Bd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Wu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Wu+n+": "+r);return this}var VA=eq(Qpe);Ni=new VA(1);const wt=VA;function tq(e){var t;return e===0?t=1:t=Math.floor(new wt(e).abs().log(10).toNumber())+1,t}function nq(e,t,n){for(var r=new wt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var rq=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},KA=(e,t,n)=>{if(e.lte(0))return new wt(0);var r=tq(e.toNumber()),i=new wt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new wt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new wt(c.toNumber()):new wt(Math.ceil(c.toNumber()))},iq=(e,t,n)=>{var r;if(e.lte(0))return new wt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new wt(a).abs().log(10).toNumber()),l=new wt(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 wt(10).pow(h))}var d=(r=i[f])!==null&&r!==void 0?r:1,g=new wt(d).mul(l);return t?g:new wt(Math.ceil(g.toNumber()))},ege=(e,t,n)=>{var r=new wt(1),i=new wt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new wt(10).pow(tq(e)-1),i=new wt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new wt(Math.floor(e)))}else e===0?i=new wt(Math.floor((t-1)/2)):n||(i=new wt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new wt(c-o).mul(r)).toNumber());return l},aq=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]:KA;if(!Number.isFinite((n-t)/(r-1)))return{step:new wt(0),tickMin:new wt(0),tickMax:new wt(0)};var l=o(new wt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new wt(0):(c=new wt(t).add(n).div(2),c=c.sub(new wt(c).mod(l)));var f=Math.ceil(c.sub(t).div(l).toNumber()),h=Math.ceil(new wt(n).sub(c).div(l).toNumber()),d=f+h+1;return d>r?aq(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 wt(f).mul(l)),tickMax:c.add(new wt(h).mul(l))})},VL=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]=rq([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 ege(c,i,a);var d=o==="snap125"?iq:KA,{step:g,tickMin:v,tickMax:b}=aq(c,f,l,a,0,d),w=nq(v,b.add(new wt(.1).mul(g)),g);return n>r?w.reverse():w},KL=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]=rq([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var f=o==="snap125"?iq:KA,h=Math.max(n,2),d=f(new wt(c).sub(l).div(h-1),a,0),g=[...nq(new wt(l),new wt(c),d),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},oq=e=>e.rootProps.maxBarSize,tge=e=>e.rootProps.barGap,sq=e=>e.rootProps.barCategoryGap,nge=e=>e.rootProps.barSize,Bp=e=>e.rootProps.stackOffset,lq=e=>e.rootProps.reverseStackOrder,YA=e=>e.options.chartName,XA=e=>e.rootProps.syncId,uq=e=>e.rootProps.syncMethod,GA=e=>e.options.eventEmitter,Xn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},_u={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Za={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},tb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function nb(e,t,n){if(n!=="auto")return n;if(e!=null)return js(e,t)?"category":"number"}function YL(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 xx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YL(Object(n),!0).forEach(function(r){rge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rge(e,t,n){return(t=ige(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ige(e){var t=age(e,"string");return typeof t=="symbol"?t:t+""}function age(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 XL={allowDataOverflow:_u.allowDataOverflow,allowDecimals:_u.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:_u.angleAxisId,includeHidden:!1,name:void 0,reversed:_u.reversed,scale:_u.scale,tick:_u.tick,tickCount:void 0,ticks:void 0,type:_u.type,unit:void 0,niceTicks:"auto"},GL={allowDataOverflow:Za.allowDataOverflow,allowDecimals:Za.allowDecimals,allowDuplicatedCategory:Za.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Za.radiusAxisId,includeHidden:Za.includeHidden,name:void 0,reversed:Za.reversed,scale:Za.scale,tick:Za.tick,tickCount:Za.tickCount,ticks:void 0,type:Za.type,unit:void 0,niceTicks:"auto"},oge=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},WA=ue([oge,jH],(e,t)=>{var n;if(e!=null)return e;var r=(n=nb(t,"angleAxis",XL.type))!==null&&n!==void 0?n:"category";return xx(xx({},XL),{},{type:r})}),sge=(e,t)=>e.polarAxis.radiusAxis[t],QA=ue([sge,jH],(e,t)=>{var n;if(e!=null)return e;var r=(n=nb(t,"radiusAxis",GL.type))!==null&&n!==void 0?n:"category";return xx(xx({},GL),{},{type:r})}),rb=e=>e.polarOptions,ZA=ue([Cs,ks,or],qH),cq=ue([rb,ZA],(e,t)=>{if(e!=null)return zr(e.innerRadius,t,0)}),fq=ue([rb,ZA],(e,t)=>{if(e!=null)return zr(e.outerRadius,t,t*.8)}),lge=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},dq=ue([rb],lge);ue([WA,dq],tb);var hq=ue([ZA,cq,fq],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ue([QA,hq],tb);var mq=ue([Tt,rb,cq,fq,Cs,ks],(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:zr(o,i,i/2),cy:zr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),Sn=(e,t)=>t,Fp=(e,t,n)=>n;function JA(e){return e==null?void 0:e.id}function pq(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=JA(l);f.forEach((d,g)=>{var v=a==null||i?g:String(Kt(d,a,null)),b=Kt(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 ib(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var ab=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function ob(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function uge(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 yr=e=>{var t=Tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Fd=e=>e.tooltip.settings.axisId;function eO(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 gq=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!fo(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];St(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 Rl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function cge(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tO(e){let t,n,r;e.length!==2?(t=Rl,n=(l,c)=>Rl(e(l),c),r=(l,c)=>e(l)-c):(t=e===Rl||e===cge?e:fge,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 fge(){return 0}function vq(e){return e===null?NaN:+e}function*dge(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const hge=tO(Rl),Up=hge.right;tO(vq).center;class WL extends Map{constructor(t,n=gge){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(QL(this,t))}has(t){return super.has(QL(this,t))}set(t,n){return super.set(mge(this,t),n)}delete(t){return super.delete(pge(this,t))}}function QL({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function mge({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function pge({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function gge(e){return e!==null&&typeof e=="object"?e.valueOf():e}function vge(e=Rl){if(e===Rl)return yq;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 yq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const yge=Math.sqrt(50),xge=Math.sqrt(10),bge=Math.sqrt(2);function bx(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>=yge?10:a>=xge?5:a>=bge?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?bx(e,t,n*2):[l,c,f]}function eC(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?bx(t,e,n):bx(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 tC(e,t,n){return t=+t,e=+e,n=+n,bx(e,t,n)[2]}function nC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?tC(t,e,n):tC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ZL(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function JL(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function xq(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?yq:vge(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));xq(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(Zh(e,n,t),i(e[r],a)>0&&Zh(e,n,r);o<l;){for(Zh(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Zh(e,n,l):(++l,Zh(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Zh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function wge(e,t,n){if(e=Float64Array.from(dge(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return JL(e);if(t>=1)return ZL(e);var r,i=(r-1)*t,a=Math.floor(i),o=ZL(xq(e,a).subarray(0,a+1)),l=JL(e.subarray(a+1));return o+(l-o)*(i-a)}}function Sge(e,t,n=vq){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 Ege(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 fa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Os(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const rC=Symbol("implicit");function nO(){var e=new WL,t=[],n=[],r=rC;function i(a){let o=e.get(a);if(o===void 0){if(r!==rC)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new WL;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 nO(t,n).unknown(r)},fa.apply(i,arguments),i}function rO(){var e=nO().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=Ege(g).map(function(E){return b+a*E});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 rO(t(),[r,i]).round(l).paddingInner(c).paddingOuter(f).align(h)},fa.apply(d(),arguments)}function bq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return bq(t())},e}function _ge(){return bq(rO.apply(null,arguments).paddingInner(1))}function iO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Hp(){}var Km=.7,wx=1/Km,Ff="\\s*([+-]?\\d+)\\s*",Ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jge=/^#([0-9a-f]{3,8})$/,Cge=new RegExp(`^rgb\\(${Ff},${Ff},${Ff}\\)$`),kge=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),Age=new RegExp(`^rgba\\(${Ff},${Ff},${Ff},${Ym}\\)$`),Oge=new RegExp(`^rgba\\(${ho},${ho},${ho},${Ym}\\)$`),Nge=new RegExp(`^hsl\\(${Ym},${ho},${ho}\\)$`),Tge=new RegExp(`^hsla\\(${Ym},${ho},${ho},${Ym}\\)$`),ez={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};iO(Hp,pc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tz,formatHex:tz,formatHex8:Pge,formatHsl:Mge,formatRgb:nz,toString:nz});function tz(){return this.rgb().formatHex()}function Pge(){return this.rgb().formatHex8()}function Mge(){return Sq(this).formatHsl()}function nz(){return this.rgb().formatRgb()}function pc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jge.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rz(t):n===3?new di(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kv(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=Cge.exec(e))?new di(t[1],t[2],t[3],1):(t=kge.exec(e))?new di(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Age.exec(e))?Kv(t[1],t[2],t[3],t[4]):(t=Oge.exec(e))?Kv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Nge.exec(e))?oz(t[1],t[2]/100,t[3]/100,1):(t=Tge.exec(e))?oz(t[1],t[2]/100,t[3]/100,t[4]):ez.hasOwnProperty(e)?rz(ez[e]):e==="transparent"?new di(NaN,NaN,NaN,0):null}function rz(e){return new di(e>>16&255,e>>8&255,e&255,1)}function Kv(e,t,n,r){return r<=0&&(e=t=n=NaN),new di(e,t,n,r)}function Dge(e){return e instanceof Hp||(e=pc(e)),e?(e=e.rgb(),new di(e.r,e.g,e.b,e.opacity)):new di}function iC(e,t,n,r){return arguments.length===1?Dge(e):new di(e,t,n,r??1)}function di(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iO(di,iC,wq(Hp,{brighter(e){return e=e==null?wx:Math.pow(wx,e),new di(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Km:Math.pow(Km,e),new di(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new di(Qu(this.r),Qu(this.g),Qu(this.b),Sx(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:iz,formatHex:iz,formatHex8:Rge,formatRgb:az,toString:az}));function iz(){return`#${Iu(this.r)}${Iu(this.g)}${Iu(this.b)}`}function Rge(){return`#${Iu(this.r)}${Iu(this.g)}${Iu(this.b)}${Iu((isNaN(this.opacity)?1:this.opacity)*255)}`}function az(){const e=Sx(this.opacity);return`${e===1?"rgb(":"rgba("}${Qu(this.r)}, ${Qu(this.g)}, ${Qu(this.b)}${e===1?")":`, ${e})`}`}function Sx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Iu(e){return e=Qu(e),(e<16?"0":"")+e.toString(16)}function oz(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ca(e,t,n,r)}function Sq(e){if(e instanceof Ca)return new Ca(e.h,e.s,e.l,e.opacity);if(e instanceof Hp||(e=pc(e)),!e)return new Ca;if(e instanceof Ca)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 Ca(o,l,c,e.opacity)}function Ige(e,t,n,r){return arguments.length===1?Sq(e):new Ca(e,t,n,r??1)}function Ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iO(Ca,Ige,wq(Hp,{brighter(e){return e=e==null?wx:Math.pow(wx,e),new Ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Km:Math.pow(Km,e),new Ca(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 di(BE(e>=240?e-240:e+120,i,r),BE(e,i,r),BE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ca(sz(this.h),Yv(this.s),Yv(this.l),Sx(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=Sx(this.opacity);return`${e===1?"hsl(":"hsla("}${sz(this.h)}, ${Yv(this.s)*100}%, ${Yv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sz(e){return e=(e||0)%360,e<0?e+360:e}function Yv(e){return Math.max(0,Math.min(1,e||0))}function BE(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 aO=e=>()=>e;function Lge(e,t){return function(n){return e+n*t}}function zge(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 $ge(e){return(e=+e)==1?Eq:function(t,n){return n-t?zge(t,n,e):aO(isNaN(t)?n:t)}}function Eq(e,t){var n=t-e;return n?Lge(e,n):aO(isNaN(e)?t:e)}const Ex=(function e(t){var n=$ge(t);function r(i,a){var o=n((i=iC(i)).r,(a=iC(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),f=Eq(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 Bge(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 Fge(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uge(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]=rs(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 Hge(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ea(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function qge(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]=rs(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var aC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FE=new RegExp(aC.source,"g");function Vge(e){return function(){return e}}function Kge(e){return function(t){return e(t)+""}}function _q(e,t){var n=aC.lastIndex=FE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=aC.exec(e))&&(i=FE.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:Ea(r,i)})),n=FE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?Kge(c[0].x):Vge(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 rs(e,t){var n=typeof t,r;return t==null||n==="boolean"?aO(t):(n==="number"?Ea:n==="string"?(r=pc(t))?(t=r,Ex):_q:t instanceof pc?Ex:t instanceof Date?Hge:Fge(t)?Bge:Array.isArray(t)?Uge:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?qge:Ea)(e,t)}function oO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var lz=180/Math.PI,oC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jq(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)*lz,skewX:Math.atan(c)*lz,scaleX:o,scaleY:l}}var Xv;function Yge(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oC:jq(t.a,t.b,t.c,t.d,t.e,t.f)}function Xge(e){return e==null||(Xv||(Xv=document.createElementNS("http://www.w3.org/2000/svg","g")),Xv.setAttribute("transform",e),!(e=Xv.transform.baseVal.consolidate()))?oC:(e=e.matrix,jq(e.a,e.b,e.c,e.d,e.e,e.f))}function Cq(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:Ea(f,d)},{i:w-2,x:Ea(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:Ea(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:Ea(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:Ea(f,d)},{i:w-2,x:Ea(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 Gge=Cq(Yge,"px, ","px)","deg)"),Wge=Cq(Xge,", ",")",")"),Qge=1e-12;function uz(e){return((e=Math.exp(e))+1/e)/2}function Zge(e){return((e=Math.exp(e))-1/e)/2}function Jge(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ey=(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,E;if(w<Qge)E=Math.log(g/f)/t,S=function(T){return[l+T*v,c+T*b,f*Math.exp(t*T*E)]};else{var C=Math.sqrt(w),j=(g*g-f*f+r*w)/(2*f*n*C),A=(g*g-f*f-r*w)/(2*g*n*C),N=Math.log(Math.sqrt(j*j+1)-j),O=Math.log(Math.sqrt(A*A+1)-A);E=(O-N)/t,S=function(T){var M=T*E,I=uz(N),z=f/(n*C)*(I*Jge(t*M+N)-Zge(N));return[l+z*v,c+z*b,f*I/uz(t*M+N)]}}return S.duration=E*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 eve(e,t){t===void 0&&(t=e,e=rs);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 tve(e){return function(){return e}}function _x(e){return+e}var cz=[0,1];function Gr(e){return e}function sC(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:tve(isNaN(t)?NaN:.5)}function nve(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function rve(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=sC(i,r),a=n(o,a)):(r=sC(r,i),a=n(a,o)),function(l){return a(r(l))}}function ive(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]=sC(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=Up(e,l,1,r)-1;return a[c](i[c](l))}}function qp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function sb(){var e=cz,t=cz,n=rs,r,i,a,o=Gr,l,c,f;function h(){var g=Math.min(e.length,t.length);return o!==Gr&&(o=nve(e[0],e[g-1])),l=g>2?ive:rve,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),Ea)))(g)))},d.domain=function(g){return arguments.length?(e=Array.from(g,_x),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=oO,h()},d.clamp=function(g){return arguments.length?(o=g?!0:Gr,h()):o!==Gr},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 sO(){return sb()(Gr,Gr)}function ave(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jx(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 md(e){return e=jx(Math.abs(e)),e?e[1]:NaN}function ove(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 sve(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var lve=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xm(e){if(!(t=lve.exec(e)))throw new Error("invalid format: "+e);var t;return new lO({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]})}Xm.prototype=lO.prototype;function lO(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+""}lO.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 uve(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 Cx;function cve(e,t){var n=jx(e,t);if(!n)return Cx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Cx=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")+jx(e,Math.max(0,t+a-1))[0]}function fz(e,t){var n=jx(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 dz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ave,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)=>fz(e*100,t),r:fz,s:cve,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hz(e){return e}var mz=Array.prototype.map,pz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fve(e){var t=e.grouping===void 0||e.thousands===void 0?hz:ove(mz.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?hz:sve(mz.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=Xm(d);var v=d.fill,b=d.align,w=d.sign,S=d.symbol,E=d.zero,C=d.width,j=d.comma,A=d.precision,N=d.trim,O=d.type;O==="n"?(j=!0,O="g"):dz[O]||(A===void 0&&(A=12),N=!0,O="g"),(E||v==="0"&&b==="=")&&(E=!0,v="0",b="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),M=(S==="$"?r:/[%p]/.test(O)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),I=dz[O],z=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function B(L){var G=T,F=M,K,D,q;if(O==="c")F=I(L)+F,L="";else{L=+L;var X=L<0||1/L<0;if(L=isNaN(L)?c:I(Math.abs(L),A),N&&(L=uve(L)),X&&+L==0&&w!=="+"&&(X=!1),G=(X?w==="("?w:l:w==="-"||w==="("?"":w)+G,F=(O==="s"&&!isNaN(L)&&Cx!==void 0?pz[8+Cx/3]:"")+F+(X&&w==="("?")":""),z){for(K=-1,D=L.length;++K<D;)if(q=L.charCodeAt(K),48>q||q>57){F=(q===46?i+L.slice(K+1):L.slice(K))+F,L=L.slice(0,K);break}}}j&&!E&&(L=t(L,1/0));var V=G.length+L.length+F.length,R=V<C?new Array(C-V+1).join(v):"";switch(j&&E&&(L=t(R+L,R.length?C-F.length:1/0),R=""),b){case"<":L=G+L+F+R;break;case"=":L=G+R+L+F;break;case"^":L=R.slice(0,V=R.length>>1)+G+L+F+R.slice(V);break;default:L=R+G+L+F;break}return a(L)}return B.toString=function(){return d+""},B}function h(d,g){var v=Math.max(-8,Math.min(8,Math.floor(md(g)/3)))*3,b=Math.pow(10,-v),w=f((d=Xm(d),d.type="f",d),{suffix:pz[8+v/3]});return function(S){return w(b*S)}}return{format:f,formatPrefix:h}}var Gv,uO,kq;dve({thousands:",",grouping:[3],currency:["$",""]});function dve(e){return Gv=fve(e),uO=Gv.format,kq=Gv.formatPrefix,Gv}function hve(e){return Math.max(0,-md(Math.abs(e)))}function mve(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(md(t)/3)))*3-md(Math.abs(e)))}function pve(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,md(t)-md(e))+1}function Aq(e,t,n,r){var i=nC(e,t,n),a;switch(r=Xm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=mve(i,o))&&(r.precision=a),kq(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=pve(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=hve(i))&&(r.precision=a-(r.type==="%")*2);break}}return uO(r)}function Jl(e){var t=e.domain;return e.ticks=function(n){var r=t();return eC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Aq(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=tC(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 Oq(){var e=sO();return e.copy=function(){return qp(e,Oq())},fa.apply(e,arguments),Jl(e)}function Nq(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,_x),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Nq(e).unknown(t)},e=arguments.length?Array.from(e,_x):[0,1],Jl(n)}function Tq(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 gz(e){return Math.log(e)}function vz(e){return Math.exp(e)}function gve(e){return-Math.log(-e)}function vve(e){return-Math.exp(-e)}function yve(e){return isFinite(e)?+("1e"+e):e<0?0:e}function xve(e){return e===10?yve:e===Math.E?Math.exp:t=>Math.pow(e,t)}function bve(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 yz(e){return(t,n)=>-e(-t,n)}function cO(e){const t=e(gz,vz),n=t.domain;let r=10,i,a;function o(){return i=bve(r),a=xve(r),n()[0]<0?(i=yz(i),a=yz(a),e(gve,vve)):e(gz,vz),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 E=[];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;E.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;E.push(w)}E.length*2<S&&(E=eC(f,h,S))}else E=eC(g,v,Math.min(v-g,S)).map(a);return d?E.reverse():E},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Xm(c)).precision==null&&(c.trim=!0),c=uO(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(Tq(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function Pq(){const e=cO(sb()).domain([1,10]);return e.copy=()=>qp(e,Pq()).base(e.base()),fa.apply(e,arguments),e}function xz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function bz(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fO(e){var t=1,n=e(xz(t),bz(t));return n.constant=function(r){return arguments.length?e(xz(t=+r),bz(t)):t},Jl(n)}function Mq(){var e=fO(sb());return e.copy=function(){return qp(e,Mq()).constant(e.constant())},fa.apply(e,arguments)}function wz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function wve(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Sve(e){return e<0?-e*e:e*e}function dO(e){var t=e(Gr,Gr),n=1;function r(){return n===1?e(Gr,Gr):n===.5?e(wve,Sve):e(wz(n),wz(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Jl(t)}function hO(){var e=dO(sb());return e.copy=function(){return qp(e,hO()).exponent(e.exponent())},fa.apply(e,arguments),e}function Eve(){return hO.apply(null,arguments).exponent(.5)}function Sz(e){return Math.sign(e)*e*e}function _ve(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Dq(){var e=sO(),t=[0,1],n=!1,r;function i(a){var o=_ve(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(Sz(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,_x)).map(Sz)),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 Dq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},fa.apply(i,arguments),Jl(i)}function Rq(){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]=Sge(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Up(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(Rl),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 Rq().domain(e).range(t).unknown(r)},fa.apply(a,arguments)}function Iq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Up(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 Iq().domain([e,t]).range(i).unknown(a)},fa.apply(Jl(o),arguments)}function Lq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Up(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 Lq().domain(e).range(t).unknown(n)},fa.apply(i,arguments)}const UE=new Date,HE=new Date;function sr(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=>sr(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)=>(UE.setTime(+a),HE.setTime(+o),e(UE),e(HE),Math.floor(n(UE,HE))),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 kx=sr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);kx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):kx);kx.range;const Jo=1e3,oa=Jo*60,es=oa*60,ms=es*24,mO=ms*7,Ez=ms*30,qE=ms*365,Lu=sr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Jo)},(e,t)=>(t-e)/Jo,e=>e.getUTCSeconds());Lu.range;const pO=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Jo)},(e,t)=>{e.setTime(+e+t*oa)},(e,t)=>(t-e)/oa,e=>e.getMinutes());pO.range;const gO=sr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*oa)},(e,t)=>(t-e)/oa,e=>e.getUTCMinutes());gO.range;const vO=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Jo-e.getMinutes()*oa)},(e,t)=>{e.setTime(+e+t*es)},(e,t)=>(t-e)/es,e=>e.getHours());vO.range;const yO=sr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*es)},(e,t)=>(t-e)/es,e=>e.getUTCHours());yO.range;const Vp=sr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*oa)/ms,e=>e.getDate()-1);Vp.range;const lb=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ms,e=>e.getUTCDate()-1);lb.range;const zq=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ms,e=>Math.floor(e/ms));zq.range;function Cc(e){return sr(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())*oa)/mO)}const ub=Cc(0),Ax=Cc(1),jve=Cc(2),Cve=Cc(3),pd=Cc(4),kve=Cc(5),Ave=Cc(6);ub.range;Ax.range;jve.range;Cve.range;pd.range;kve.range;Ave.range;function kc(e){return sr(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)/mO)}const cb=kc(0),Ox=kc(1),Ove=kc(2),Nve=kc(3),gd=kc(4),Tve=kc(5),Pve=kc(6);cb.range;Ox.range;Ove.range;Nve.range;gd.range;Tve.range;Pve.range;const xO=sr(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());xO.range;const bO=sr(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());bO.range;const ps=sr(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());ps.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(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)});ps.range;const gs=sr(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());gs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(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)});gs.range;function $q(e,t,n,r,i,a){const o=[[Lu,1,Jo],[Lu,5,5*Jo],[Lu,15,15*Jo],[Lu,30,30*Jo],[a,1,oa],[a,5,5*oa],[a,15,15*oa],[a,30,30*oa],[i,1,es],[i,3,3*es],[i,6,6*es],[i,12,12*es],[r,1,ms],[r,2,2*ms],[n,1,mO],[t,1,Ez],[t,3,3*Ez],[e,1,qE]];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=tO(([,,S])=>S).right(o,g);if(v===o.length)return e.every(nC(f/qE,h/qE,d));if(v===0)return kx.every(Math.max(nC(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[Mve,Dve]=$q(gs,bO,cb,zq,yO,gO),[Rve,Ive]=$q(ps,xO,ub,Vp,vO,pO);function VE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function KE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Jh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Lve(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=em(i),h=tm(i),d=em(a),g=tm(a),v=em(o),b=tm(o),w=em(l),S=tm(l),E=em(c),C=tm(c),j={a:q,A:X,b:V,B:R,c:null,d:Oz,e:Oz,f:oye,g:gye,G:yye,H:rye,I:iye,j:aye,L:Bq,m:sye,M:lye,p:H,q:U,Q:Pz,s:Mz,S:uye,u:cye,U:fye,V:dye,w:hye,W:mye,x:null,X:null,y:pye,Y:vye,Z:xye,"%":Tz},A={a:$,A:Q,b:Z,B:ne,c:null,d:Nz,e:Nz,f:Eye,g:Mye,G:Rye,H:bye,I:wye,j:Sye,L:Uq,m:_ye,M:jye,p:te,q:ie,Q:Pz,s:Mz,S:Cye,u:kye,U:Aye,V:Oye,w:Nye,W:Tye,x:null,X:null,y:Pye,Y:Dye,Z:Iye,"%":Tz},N={a:z,A:B,b:L,B:G,c:F,d:kz,e:kz,f:Jve,g:Cz,G:jz,H:Az,I:Az,j:Gve,L:Zve,m:Xve,M:Wve,p:I,q:Yve,Q:tye,s:nye,S:Qve,u:Uve,U:Hve,V:qve,w:Fve,W:Vve,x:K,X:D,y:Cz,Y:jz,Z:Kve,"%":eye};j.x=O(n,j),j.X=O(r,j),j.c=O(t,j),A.x=O(n,A),A.X=O(r,A),A.c=O(t,A);function O(ee,le){return function(pe){var ae=[],be=-1,we=0,Le=ee.length,Oe,Xe,Ke;for(pe instanceof Date||(pe=new Date(+pe));++be<Le;)ee.charCodeAt(be)===37&&(ae.push(ee.slice(we,be)),(Xe=_z[Oe=ee.charAt(++be)])!=null?Oe=ee.charAt(++be):Xe=Oe==="e"?" ":"0",(Ke=le[Oe])&&(Oe=Ke(pe,Xe)),ae.push(Oe),we=be+1);return ae.push(ee.slice(we,be)),ae.join("")}}function T(ee,le){return function(pe){var ae=Jh(1900,void 0,1),be=M(ae,ee,pe+="",0),we,Le;if(be!=pe.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(le&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(we=KE(Jh(ae.y,0,1)),Le=we.getUTCDay(),we=Le>4||Le===0?Ox.ceil(we):Ox(we),we=lb.offset(we,(ae.V-1)*7),ae.y=we.getUTCFullYear(),ae.m=we.getUTCMonth(),ae.d=we.getUTCDate()+(ae.w+6)%7):(we=VE(Jh(ae.y,0,1)),Le=we.getDay(),we=Le>4||Le===0?Ax.ceil(we):Ax(we),we=Vp.offset(we,(ae.V-1)*7),ae.y=we.getFullYear(),ae.m=we.getMonth(),ae.d=we.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Le="Z"in ae?KE(Jh(ae.y,0,1)).getUTCDay():VE(Jh(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Le+5)%7:ae.w+ae.U*7-(Le+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,KE(ae)):VE(ae)}}function M(ee,le,pe,ae){for(var be=0,we=le.length,Le=pe.length,Oe,Xe;be<we;){if(ae>=Le)return-1;if(Oe=le.charCodeAt(be++),Oe===37){if(Oe=le.charAt(be++),Xe=N[Oe in _z?le.charAt(be++):Oe],!Xe||(ae=Xe(ee,pe,ae))<0)return-1}else if(Oe!=pe.charCodeAt(ae++))return-1}return ae}function I(ee,le,pe){var ae=f.exec(le.slice(pe));return ae?(ee.p=h.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function z(ee,le,pe){var ae=v.exec(le.slice(pe));return ae?(ee.w=b.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function B(ee,le,pe){var ae=d.exec(le.slice(pe));return ae?(ee.w=g.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function L(ee,le,pe){var ae=E.exec(le.slice(pe));return ae?(ee.m=C.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function G(ee,le,pe){var ae=w.exec(le.slice(pe));return ae?(ee.m=S.get(ae[0].toLowerCase()),pe+ae[0].length):-1}function F(ee,le,pe){return M(ee,t,le,pe)}function K(ee,le,pe){return M(ee,n,le,pe)}function D(ee,le,pe){return M(ee,r,le,pe)}function q(ee){return o[ee.getDay()]}function X(ee){return a[ee.getDay()]}function V(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 $(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function Z(ee){return c[ee.getUTCMonth()]}function ne(ee){return l[ee.getUTCMonth()]}function te(ee){return i[+(ee.getUTCHours()>=12)]}function ie(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var le=O(ee+="",j);return le.toString=function(){return ee},le},parse:function(ee){var le=T(ee+="",!1);return le.toString=function(){return ee},le},utcFormat:function(ee){var le=O(ee+="",A);return le.toString=function(){return ee},le},utcParse:function(ee){var le=T(ee+="",!0);return le.toString=function(){return ee},le}}}var _z={"-":"",_:" ",0:"0"},xr=/^\s*\d+/,zve=/^%/,$ve=/[\\^$*+?|[\]().{}]/g;function Nt(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 Bve(e){return e.replace($ve,"\\$&")}function em(e){return new RegExp("^(?:"+e.map(Bve).join("|")+")","i")}function tm(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Fve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Uve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Hve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function qve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Vve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function jz(e,t,n){var r=xr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Cz(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Kve(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 Yve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Xve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kz(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Gve(e,t,n){var r=xr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Az(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Wve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Qve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Zve(e,t,n){var r=xr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Jve(e,t,n){var r=xr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function eye(e,t,n){var r=zve.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function tye(e,t,n){var r=xr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function nye(e,t,n){var r=xr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Oz(e,t){return Nt(e.getDate(),t,2)}function rye(e,t){return Nt(e.getHours(),t,2)}function iye(e,t){return Nt(e.getHours()%12||12,t,2)}function aye(e,t){return Nt(1+Vp.count(ps(e),e),t,3)}function Bq(e,t){return Nt(e.getMilliseconds(),t,3)}function oye(e,t){return Bq(e,t)+"000"}function sye(e,t){return Nt(e.getMonth()+1,t,2)}function lye(e,t){return Nt(e.getMinutes(),t,2)}function uye(e,t){return Nt(e.getSeconds(),t,2)}function cye(e){var t=e.getDay();return t===0?7:t}function fye(e,t){return Nt(ub.count(ps(e)-1,e),t,2)}function Fq(e){var t=e.getDay();return t>=4||t===0?pd(e):pd.ceil(e)}function dye(e,t){return e=Fq(e),Nt(pd.count(ps(e),e)+(ps(e).getDay()===4),t,2)}function hye(e){return e.getDay()}function mye(e,t){return Nt(Ax.count(ps(e)-1,e),t,2)}function pye(e,t){return Nt(e.getFullYear()%100,t,2)}function gye(e,t){return e=Fq(e),Nt(e.getFullYear()%100,t,2)}function vye(e,t){return Nt(e.getFullYear()%1e4,t,4)}function yye(e,t){var n=e.getDay();return e=n>=4||n===0?pd(e):pd.ceil(e),Nt(e.getFullYear()%1e4,t,4)}function xye(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Nt(t/60|0,"0",2)+Nt(t%60,"0",2)}function Nz(e,t){return Nt(e.getUTCDate(),t,2)}function bye(e,t){return Nt(e.getUTCHours(),t,2)}function wye(e,t){return Nt(e.getUTCHours()%12||12,t,2)}function Sye(e,t){return Nt(1+lb.count(gs(e),e),t,3)}function Uq(e,t){return Nt(e.getUTCMilliseconds(),t,3)}function Eye(e,t){return Uq(e,t)+"000"}function _ye(e,t){return Nt(e.getUTCMonth()+1,t,2)}function jye(e,t){return Nt(e.getUTCMinutes(),t,2)}function Cye(e,t){return Nt(e.getUTCSeconds(),t,2)}function kye(e){var t=e.getUTCDay();return t===0?7:t}function Aye(e,t){return Nt(cb.count(gs(e)-1,e),t,2)}function Hq(e){var t=e.getUTCDay();return t>=4||t===0?gd(e):gd.ceil(e)}function Oye(e,t){return e=Hq(e),Nt(gd.count(gs(e),e)+(gs(e).getUTCDay()===4),t,2)}function Nye(e){return e.getUTCDay()}function Tye(e,t){return Nt(Ox.count(gs(e)-1,e),t,2)}function Pye(e,t){return Nt(e.getUTCFullYear()%100,t,2)}function Mye(e,t){return e=Hq(e),Nt(e.getUTCFullYear()%100,t,2)}function Dye(e,t){return Nt(e.getUTCFullYear()%1e4,t,4)}function Rye(e,t){var n=e.getUTCDay();return e=n>=4||n===0?gd(e):gd.ceil(e),Nt(e.getUTCFullYear()%1e4,t,4)}function Iye(){return"+0000"}function Tz(){return"%"}function Pz(e){return+e}function Mz(e){return Math.floor(+e/1e3)}var yf,qq,Vq;Lye({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 Lye(e){return yf=Lve(e),qq=yf.format,yf.parse,Vq=yf.utcFormat,yf.utcParse,yf}function zye(e){return new Date(e)}function $ye(e){return e instanceof Date?+e:+new Date(+e)}function wO(e,t,n,r,i,a,o,l,c,f){var h=sO(),d=h.invert,g=h.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),S=f("%I %p"),E=f("%a %d"),C=f("%b %d"),j=f("%B"),A=f("%Y");function N(O){return(c(O)<O?v:l(O)<O?b:o(O)<O?w:a(O)<O?S:r(O)<O?i(O)<O?E:C:n(O)<O?j:A)(O)}return h.invert=function(O){return new Date(d(O))},h.domain=function(O){return arguments.length?g(Array.from(O,$ye)):g().map(zye)},h.ticks=function(O){var T=g();return e(T[0],T[T.length-1],O??10)},h.tickFormat=function(O,T){return T==null?N:f(T)},h.nice=function(O){var T=g();return(!O||typeof O.range!="function")&&(O=t(T[0],T[T.length-1],O??10)),O?g(Tq(T,O)):h},h.copy=function(){return qp(h,wO(e,t,n,r,i,a,o,l,c,f))},h}function Bye(){return fa.apply(wO(Rve,Ive,ps,xO,ub,Vp,vO,pO,Lu,qq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Fye(){return fa.apply(wO(Mve,Dve,gs,bO,cb,lb,yO,gO,Lu,Vq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function fb(){var e=0,t=1,n,r,i,a,o=Gr,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(rs),f.rangeRound=h(oO),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 eu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Kq(){var e=Jl(fb()(Gr));return e.copy=function(){return eu(e,Kq())},Os.apply(e,arguments)}function Yq(){var e=cO(fb()).domain([1,10]);return e.copy=function(){return eu(e,Yq()).base(e.base())},Os.apply(e,arguments)}function Xq(){var e=fO(fb());return e.copy=function(){return eu(e,Xq()).constant(e.constant())},Os.apply(e,arguments)}function SO(){var e=dO(fb());return e.copy=function(){return eu(e,SO()).exponent(e.exponent())},Os.apply(e,arguments)}function Uye(){return SO.apply(null,arguments).exponent(.5)}function Gq(){var e=[],t=Gr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Up(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(Rl),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)=>wge(e,a/r))},n.copy=function(){return Gq(t).domain(e)},Os.apply(n,arguments)}function db(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,f=Gr,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 E,C,j;return arguments.length?([E,C,j]=S,f=eve(w,[E,C,j]),v):[f(0),f(.5),f(1)]}}return v.range=b(rs),v.rangeRound=b(oO),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 Wq(){var e=Jl(db()(Gr));return e.copy=function(){return eu(e,Wq())},Os.apply(e,arguments)}function Qq(){var e=cO(db()).domain([.1,1,10]);return e.copy=function(){return eu(e,Qq()).base(e.base())},Os.apply(e,arguments)}function Zq(){var e=fO(db());return e.copy=function(){return eu(e,Zq()).constant(e.constant())},Os.apply(e,arguments)}function EO(){var e=dO(db());return e.copy=function(){return eu(e,EO()).exponent(e.exponent())},Os.apply(e,arguments)}function Hye(){return EO.apply(null,arguments).exponent(.5)}const gm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rO,scaleDiverging:Wq,scaleDivergingLog:Qq,scaleDivergingPow:EO,scaleDivergingSqrt:Hye,scaleDivergingSymlog:Zq,scaleIdentity:Nq,scaleImplicit:rC,scaleLinear:Oq,scaleLog:Pq,scaleOrdinal:nO,scalePoint:_ge,scalePow:hO,scaleQuantile:Rq,scaleQuantize:Iq,scaleRadial:Dq,scaleSequential:Kq,scaleSequentialLog:Yq,scaleSequentialPow:SO,scaleSequentialQuantile:Gq,scaleSequentialSqrt:Uye,scaleSequentialSymlog:Xq,scaleSqrt:Eve,scaleSymlog:Mq,scaleThreshold:Lq,scaleTime:Bye,scaleUtc:Fye,tickFormat:Aq},Symbol.toStringTag,{value:"Module"}));function qye(e){if(e in gm)return gm[e]();var t="scale".concat(Np(e));if(t in gm)return gm[t]()}function Dz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=qye(e);if(r!=null)return r.domain(t).range(n),r}}function _O(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Dz(e.scale,n,r):Dz(t,n,r)}function Vye(e){return"scale".concat(Np(e))}function Kye(e){return Vye(e)in gm}var Jq=(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 Kye(r)?r:"point"}};function Yye(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 e9(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=Yye(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 Xye(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):e9(e,void 0)}function Rz(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 Nx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rz(Object(n),!0).forEach(function(r){Gye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gye(e,t,n){return(t=Wye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wye(e){var t=Qye(e,"string");return typeof t=="symbol"?t:t+""}function Qye(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 lC=[0,"auto"],tr={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"},t9=(e,t)=>e.cartesianAxis.xAxis[t],Ns=(e,t)=>{var n=t9(e,t);return n??tr},nr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:lC,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:Dp},n9=(e,t)=>e.cartesianAxis.yAxis[t],Ts=(e,t)=>{var n=n9(e,t);return n??nr},Zye={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:""},jO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Zye},Mn=(e,t,n)=>{switch(t){case"xAxis":return Ns(e,n);case"yAxis":return Ts(e,n);case"zAxis":return jO(e,n);case"angleAxis":return WA(e,n);case"radiusAxis":return QA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Jye=(e,t,n)=>{switch(t){case"xAxis":return Ns(e,n);case"yAxis":return Ts(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ud=(e,t,n)=>{switch(t){case"xAxis":return Ns(e,n);case"yAxis":return Ts(e,n);case"angleAxis":return WA(e,n);case"radiusAxis":return QA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},r9=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function CO(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 hb=e=>e.graphicalItems.cartesianItems,exe=ue([Sn,Fp],CO),kO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Kp=ue([hb,Mn,exe],kO,{memoizeOptions:{resultEqualityCheck:ob}}),i9=ue([Kp],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(ib)),a9=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),txe=ue([Kp],a9),AO=e=>e.map(t=>t.data).filter(Boolean).flat(1),nxe=ue([Kp],AO,{memoizeOptions:{resultEqualityCheck:ob}}),OO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},NO=ue([nxe,HA],OO),TO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Kt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Kt(i,r)}))):e.map(r=>({value:r})),Yp=ue([NO,Mn,Kp],TO);function Uf(e){if(go(e)||e instanceof Date){var t=Number(e);if(St(t))return t}}function Iz(e){if(Array.isArray(e)){var t=[Uf(e[0]),Uf(e[1])];return fo(t)?t:void 0}var n=Uf(e);if(n!=null)return[n,n]}function vs(e){return e.map(Uf).filter(fi)}function rxe(e,t){var n=Uf(e),r=Uf(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var ixe=ue([Yp],e=>e==null?void 0:e.map(t=>t.value).sort(rxe));function o9(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function axe(e,t,n){return!n||typeof t!="number"||po(t)?[]:n.length?vs(n.flatMap(r=>{var i=Kt(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!St(a)||!St(o)))return[t-a,t+o]})):[]}var lr=e=>{var t=yr(e),n=Fd(e);return Ud(e,t,n)},Xp=ue([lr],e=>e==null?void 0:e.dataKey),oxe=ue([i9,HA,lr],pq),s9=(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(JA);return[l,{stackedData:Yde(e,h,n),graphicalItems:f}]}))},uC=ue([oxe,i9,Bp,lq],s9),l9=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Zde(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},sxe=ue([Mn],e=>e.allowDataOverflow),PO=e=>{var t;if(e==null||!("domain"in e))return lC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=vs(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:lC},MO=ue([Mn],PO),DO=ue([MO,sxe],GH),lxe=ue([uC,As,Sn,DO],l9,{memoizeOptions:{resultEqualityCheck:ab}}),mb=e=>e.errorBars,uxe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>o9(n,r)),Tx=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]}},RO=(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(E=>o9(i,E)),g=Kt(l,(h=t.dataKey)!==null&&h!==void 0?h:c.dataKey),v=axe(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=Iz(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=Iz(Kt(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]))}),St(a)&&St(o))return[a,o]},cxe=ue([NO,Mn,txe,mb,Sn],RO,{memoizeOptions:{resultEqualityCheck:ab}});function fxe(e){var{value:t}=e;if(go(t)||t instanceof Date)return t}var dxe=(e,t,n)=>{var r=e.map(fxe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&yU(r))?XH(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},u9=e=>e.referenceElements.dots,Hd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),hxe=ue([u9,Sn,Fp],Hd),c9=e=>e.referenceElements.areas,mxe=ue([c9,Sn,Fp],Hd),f9=e=>e.referenceElements.lines,pxe=ue([f9,Sn,Fp],Hd),d9=(e,t)=>{if(e!=null){var n=vs(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},gxe=ue(hxe,Sn,d9),h9=(e,t)=>{if(e!=null){var n=vs(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)]}},vxe=ue([mxe,Sn],h9);function yxe(e){var t;if(e.x!=null)return vs([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:vs(n)}function xxe(e){var t;if(e.y!=null)return vs([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:vs(n)}var m9=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?yxe(r):xxe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},bxe=ue([pxe,Sn],m9),wxe=ue(gxe,bxe,vxe,(e,t,n)=>Tx(e,n,t)),IO=(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?Tx(r,a,i):Tx(a,i);return Wpe(t,f,e.allowDataOverflow)},Sxe=ue([Mn,MO,DO,lxe,cxe,wxe,Tt,Sn],IO,{memoizeOptions:{resultEqualityCheck:ab}}),Exe=[0,1],LO=(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=js(t,a);if(f&&l==null){var h;return XH(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return c==="category"?dxe(r,e,f):i==="expand"?Exe:o}},zO=ue([Mn,Tt,NO,Yp,Bp,Sn,Sxe],LO),tu=ue([Mn,r9,YA],Jq),$O=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=PO(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&fo(e)){if(a)return VL(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return KL(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&fo(e))return VL(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&fo(e))return KL(e,t.tickCount,t.allowDecimals,"adaptive")}}},BO=ue([zO,Ud,tu],$O),FO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&fo(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},_xe=ue([Mn,zO,BO,Sn],FO),jxe=ue(Yp,Mn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(vs(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}}),p9=ue(jxe,Tt,sq,or,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!St(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=zr(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),Cxe=(e,t,n)=>{var r=Ns(e,t);return r==null||typeof r.padding!="string"?0:p9(e,"xAxis",t,n,r.padding)},kxe=(e,t,n)=>{var r=Ts(e,t);return r==null||typeof r.padding!="string"?0:p9(e,"yAxis",t,n,r.padding)},Axe=ue(Ns,Cxe,(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}}),Oxe=ue(Ts,kxe,(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}}),Nxe=ue([or,Axe,G0,X0,(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]}),Txe=ue([or,Tt,Oxe,G0,X0,(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]}),Gp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Nxe(e,n,r);case"yAxis":return Txe(e,n,r);case"zAxis":return(i=jO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return dq(e);case"radiusAxis":return hq(e,n);default:return}},g9=ue([Mn,Gp],tb),Pxe=ue([tu,_xe],gq),UO=ue([Mn,tu,Pxe,g9],_O),v9=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=js(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},HO=ue([Tt,Yp,Ud,Sn],v9),pb=ue([UO],eO);ue([UO],Xye);ue([UO,ixe],e9);ue([Kp,mb,Sn],uxe);function y9(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var gb=(e,t)=>t,vb=(e,t,n)=>n,Mxe=ue(K0,gb,vb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(y9)),Dxe=ue(Y0,gb,vb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(y9)),x9=(e,t)=>({width:e.width,height:t.height}),Rxe=(e,t)=>{var n=typeof t.width=="number"?t.width:Dp;return{width:n,height:e.height}},b9=ue(or,Ns,x9),Ixe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Lxe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},zxe=ue(ks,or,Mxe,gb,vb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=x9(t,l);o==null&&(o=Ixe(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}),$xe=ue(Cs,or,Dxe,gb,vb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=Rxe(t,l);o==null&&(o=Lxe(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}),Bxe=(e,t)=>{var n=Ns(e,t);if(n!=null)return zxe(e,n.orientation,n.mirror)},Fxe=ue([or,Ns,Bxe,(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}}}),Uxe=(e,t)=>{var n=Ts(e,t);if(n!=null)return $xe(e,n.orientation,n.mirror)},Hxe=ue([or,Ts,Uxe,(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}}}),w9=ue(or,Ts,(e,t)=>{var n=typeof t.width=="number"?t.width:Dp;return{width:n,height:e.height}}),Lz=(e,t,n)=>{switch(t){case"xAxis":return b9(e,n).width;case"yAxis":return w9(e,n).height;default:return}},S9=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=js(e,r),c=t.map(f=>f.value);if(o&&l&&a==="category"&&i&&yU(c))return c}},qO=ue([Tt,Yp,Mn,Sn],S9),zz=ue([Tt,Jye,tu,pb,qO,HO,Gp,BO,Sn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var f=js(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}}}),qxe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var f=js(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?pr(a[0]-a[1])*2*b:b;var w=d||i;return w?w.map((S,E)=>{var C=o?o.indexOf(S):S,j=r.map(C);return St(j)?{index:E,coordinate:j+b,value:S,offset:b}:null}).filter(fi):f&&l?l.map((S,E)=>{var C=r.map(S);return St(C)?{coordinate:C+b,value:S,index:E,offset:b}:null}).filter(fi):r.ticks?r.ticks(g).map((S,E)=>{var C=r.map(S);return St(C)?{coordinate:C+b,value:S,index:E,offset:b}:null}).filter(fi):r.domain().map((S,E)=>{var C=r.map(S);return St(C)?{coordinate:C+b,value:o?o[S]:S,index:E,offset:b}:null}).filter(fi)}},E9=ue([Tt,Ud,tu,pb,BO,Gp,qO,HO,Sn],qxe),Vxe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=js(e,o),{tickCount:c}=t,f=0;return f=o==="angleAxis"&&(r==null?void 0:r.length)>=2?pr(r[0]-r[1])*2*f:f,l&&a?a.map((h,d)=>{var g=n.map(h);return St(g)?{coordinate:g+f,value:h,index:d,offset:f}:null}).filter(fi):n.ticks?n.ticks(c).map((h,d)=>{var g=n.map(h);return St(g)?{coordinate:g+f,value:h,index:d,offset:f}:null}).filter(fi):n.domain().map((h,d)=>{var g=n.map(h);return St(g)?{coordinate:g+f,value:i?i[h]:h,index:d,offset:f}:null}).filter(fi)}},Hl=ue([Tt,Ud,pb,Gp,qO,HO,Sn],Vxe),ql=ue(Mn,pb,(e,t)=>{if(!(e==null||t==null))return Nx(Nx({},e),{},{scale:t})}),Kxe=ue([Mn,tu,zO,g9],_O),Yxe=ue([Kxe],eO);ue((e,t,n)=>jO(e,n),Yxe,(e,t)=>{if(!(e==null||t==null))return Nx(Nx({},e),{},{scale:t})});var Xxe=ue([Tt,K0,Y0],(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}}),Gxe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ue([Gxe],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 _9=e=>e.options.defaultTooltipEventType,j9=e=>e.options.validateTooltipEventTypes;function C9(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function VO(e,t){var n=_9(e),r=j9(e);return C9(t,n,r)}function Wxe(e){return Re(t=>VO(t,e))}var k9=(e,t)=>{var n,r=Number(t);if(!(po(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Qxe=e=>e.tooltip.settings,wl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Zxe={itemInteraction:{click:wl,hover:wl},axisInteraction:{click:wl,hover:wl},keyboardInteraction:wl,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}},A9=Br({name:"tooltip",initialState:Zxe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:an()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=aa(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:an()},removeTooltipEntrySettings:{reducer(e,t){var n=aa(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:an()},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:Jxe,replaceTooltipEntrySettings:e0e,removeTooltipEntrySettings:t0e,setTooltipSettingsState:n0e,setActiveMouseOverItemIndex:O9,mouseLeaveItem:r0e,mouseLeaveChart:N9,setActiveClickItemIndex:i0e,setMouseOverAxisIndex:T9,setMouseClickAxisIndex:a0e,setSyncInteraction:cC,setKeyboardInteraction:Px}=A9.actions,o0e=A9.reducer;function $z(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 Wv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$z(Object(n),!0).forEach(function(r){s0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$z(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s0e(e,t,n){return(t=l0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l0e(e){var t=u0e(e,"string");return typeof t=="symbol"?t:t+""}function u0e(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 c0e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function f0e(e){return e.index!=null}var P9=(e,t,n,r)=>{if(t==null)return wl;var i=c0e(e,t,n);if(i==null)return wl;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(f0e(i)){if(a)return Wv(Wv({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Wv(Wv({},wl),{},{coordinate:i.coordinate})};function d0e(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 h0e(e,t){var n=d0e(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 m0e(e,t,n){if(n==null||t==null)return!0;var r=Kt(e,t);return r==null||!fo(n)?!0:h0e(r,n)}var KO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!St(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||m0e(f,n,r)?String(c):null},M9=(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}}}},D9=(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})},R9=e=>e.options.tooltipPayloadSearcher,qd=e=>e.tooltip;function Bz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bz(Object(n),!0).forEach(function(r){p0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p0e(e,t,n){return(t=g0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g0e(e){var t=v0e(e,"string");return typeof t=="symbol"?t:t+""}function v0e(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 y0e(e){if(typeof e=="string"||typeof e=="number")return e}function x0e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function b0e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function Uz(e){if(typeof e=="string")return e}function w0e(e){if(!(e==null||typeof e!="object")){var t="name"in e?y0e(e.name):void 0,n="unit"in e?x0e(e.unit):void 0,r="dataKey"in e?b0e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Uz(e.color):void 0,o="fill"in e?Uz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function S0e(e,t){return e??t}var I9=(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,E=S0e(w,l),C=Array.isArray(E)?mH(E,f,h):E,j=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,A=S==null?void 0:S.nameKey,N;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?N=xU(C,r,i):N=a(C,t,c,A),Array.isArray(N))N.forEach(T=>{var M,I,z=w0e(T),B=z==null?void 0:z.name,L=z==null?void 0:z.dataKey,G=z==null?void 0:z.payload,F=Fz(Fz({},S),{},{name:B,unit:z==null?void 0:z.unit,color:(M=z==null?void 0:z.color)!==null&&M!==void 0?M:S==null?void 0:S.color,fill:(I=z==null?void 0:z.fill)!==null&&I!==void 0?I:S==null?void 0:S.fill});g.push(MI({tooltipEntrySettings:F,dataKey:L,payload:G,value:Kt(G,L),name:B==null?void 0:String(B)}))});else{var O;g.push(MI({tooltipEntrySettings:S,dataKey:j,payload:N,value:Kt(N,j),name:(O=Kt(N,A))!==null&&O!==void 0?O:S==null?void 0:S.name}))}return g},d)}},YO=ue([lr,r9,YA],Jq),E0e=ue([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),_0e=ue([yr,Fd],CO),Vd=ue([E0e,lr,_0e],kO,{memoizeOptions:{resultEqualityCheck:ob}}),j0e=ue([Vd],e=>e.filter(ib)),C0e=ue([Vd],AO,{memoizeOptions:{resultEqualityCheck:ob}}),Kd=ue([C0e,As],OO),k0e=ue([j0e,As,lr],pq),XO=ue([Kd,lr,Vd],TO),L9=ue([lr],PO),A0e=ue([lr],e=>e.allowDataOverflow),z9=ue([L9,A0e],GH),O0e=ue([Vd],e=>e.filter(ib)),N0e=ue([k0e,O0e,Bp,lq],s9),T0e=ue([N0e,As,yr,z9],l9),P0e=ue([Vd],a9),M0e=ue([Kd,lr,P0e,mb,yr],RO,{memoizeOptions:{resultEqualityCheck:ab}}),D0e=ue([u9,yr,Fd],Hd),R0e=ue([D0e,yr],d9),I0e=ue([c9,yr,Fd],Hd),L0e=ue([I0e,yr],h9),z0e=ue([f9,yr,Fd],Hd),$0e=ue([z0e,yr],m9),B0e=ue([R0e,$0e,L0e],Tx),F0e=ue([lr,L9,z9,T0e,M0e,B0e,Tt,yr],IO),Wp=ue([lr,Tt,Kd,XO,Bp,yr,F0e],LO),U0e=ue([Wp,lr,YO],$O),H0e=ue([lr,Wp,U0e,yr],FO),$9=e=>{var t=yr(e),n=Fd(e),r=!1;return Gp(e,t,n,r)},B9=ue([lr,$9],tb),q0e=ue([lr,YO,H0e,B9],_O),F9=ue([q0e],eO),V0e=ue([Tt,XO,lr,yr],S9),K0e=ue([Tt,XO,lr,yr],v9),Y0e=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,f=js(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?pr(i[0]-i[1])*2*d:d,f&&o?o.map((g,v)=>{var b=r.map(g);return St(b)?{coordinate:b+d,value:g,index:v,offset:d}:null}).filter(fi):r.domain().map((g,v)=>{var b=r.map(g);return St(b)?{coordinate:b+d,value:a?a[g]:g,index:v,offset:d}:null}).filter(fi)}}},Ps=ue([Tt,lr,YO,F9,$9,V0e,K0e,yr],Y0e),GO=ue([_9,j9,Qxe],(e,t,n)=>C9(n.shared,e,t)),U9=e=>e.tooltip.settings.trigger,WO=e=>e.tooltip.settings.defaultIndex,Qp=ue([qd,GO,U9,WO],P9),Vl=ue([Qp,Kd,Xp,Wp],KO),H9=ue([Ps,Vl],k9),QO=ue([Qp],e=>{if(e)return e.dataKey}),q9=ue([Qp],e=>{if(e)return e.graphicalItemId}),V9=ue([qd,GO,U9,WO],D9),X0e=ue([Cs,ks,Tt,or,Ps,WO,V9],M9),G0e=ue([Qp,X0e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),W0e=ue([Qp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Q0e=ue([V9,Vl,As,Xp,H9,R9,GO],I9),Z0e=ue([Q0e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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){J0e(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 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)}var nbe=()=>Re(lr),rbe=()=>{var e=nbe(),t=Re(Ps),n=Re(F9);return fd(!e||!n?void 0:qz(qz({},e),{},{scale:n}),t)};function Vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vz(Object(n),!0).forEach(function(r){ibe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ibe(e,t,n){return(t=abe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function abe(e){var t=obe(e,"string");return typeof t=="symbol"?t:t+""}function obe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sbe=(e,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}},lbe=(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 xf(xf(xf({},r),Yn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return xf(xf(xf({},r),Yn(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 ube(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 K9=(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(pr(b-v)!==pr(w-b)){var E=[];if(pr(w-b)===pr(i[1]-i[0])){S=w;var C=b+i[1]-i[0];E[0]=Math.min(C,(C+v)/2),E[1]=Math.max(C,(C+v)/2)}else{S=v;var j=w+i[1]-i[0];E[0]=Math.min(b,(j+b)/2),E[1]=Math.max(b,(j+b)/2)}var A=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>A[0]&&e<=A[1]||e>=E[0]&&e<=E[1]){var N;return(N=n[l])===null||N===void 0?void 0:N.index}}else{var O=Math.min(v,w),T=Math.max(v,w);if(e>(O+b)/2&&e<=(T+b)/2){var M;return(M=n[l])===null||M===void 0?void 0:M.index}}}else if(t)for(var I=0;I<o;I++){var z=t[I];if(z!=null){var B=t[I+1],L=t[I-1];if(I===0&&B!=null&&e<=(z.coordinate+B.coordinate)/2||I===o-1&&L!=null&&e>(z.coordinate+L.coordinate)/2||I>0&&I<o-1&&L!=null&&B!=null&&e>(z.coordinate+L.coordinate)/2&&e<=(z.coordinate+B.coordinate)/2)return z.index}}return-1},cbe=()=>Re(YA),ZO=(e,t)=>t,Y9=(e,t,n)=>n,JO=(e,t,n,r)=>r,fbe=ue(Ps,e=>I0(e,t=>t.coordinate)),eN=ue([qd,ZO,Y9,JO],P9),tN=ue([eN,Kd,Xp,Wp],KO),dbe=(e,t,n)=>{if(t!=null){var r=qd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},X9=ue([qd,ZO,Y9,JO],D9),Mx=ue([Cs,ks,Tt,or,Ps,JO,X9],M9),hbe=ue([eN,Mx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),G9=ue([Ps,tN],k9),mbe=ue([X9,tN,As,Xp,G9,R9,ZO],I9),pbe=ue([eN,tN],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),gbe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&ube(e,o)){var l=Jde(e,t),c=K9(l,a,i,n,r),f=sbe(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},vbe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=$pe(e,n);if(l){var c=ehe(l,t),f=K9(c,o,a,r,i),h=lbe(t,a,f,l);return{activeIndex:String(f),activeCoordinate:h}}}},ybe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?gbe(e,t,r,i,a,o,l):vbe(e,t,n,r,i,a,o)},xbe=ue(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}}),bbe=ue(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Xn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:uge}});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){wbe(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 wbe(e,t,n){return(t=Sbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sbe(e){var t=Ebe(e,"string");return typeof t=="symbol"?t:t+""}function Ebe(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 _be={},jbe={zIndexMap:Object.values(Xn).reduce((e,t)=>Yz(Yz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),_be)},Cbe=new Set(Object.values(Xn));function kbe(e){return Cbe.has(e)}var W9=Br({name:"zIndex",initialState:jbe,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:an()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!kbe(n)&&delete e.zIndexMap[n])},prepare:an()},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:an()},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:an()}}}),{registerZIndexPortal:Abe,unregisterZIndexPortal:Obe,registerZIndexPortalElement:Nbe,unregisterZIndexPortalElement:Tbe}=W9.actions,Pbe=W9.reducer;function hi(e){var{zIndex:t,children:n}=e,r=The(),i=r&&t!==void 0&&t!==0,a=Fr(),o=Yt();x.useLayoutEffect(()=>i?(o(Abe({zIndex:t})),()=>{o(Obe({zIndex:t}))}):Zl,[o,t,i]);var l=Re(c=>xbe(c,t,a));return i?l?Xl.createPortal(n,l):null:n}function fC(){return fC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fC.apply(null,arguments)}function 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 Qv(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){Mbe(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 Mbe(e,t,n){return(t=Dbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dbe(e){var t=Rbe(e,"string");return typeof t=="symbol"?t:t+""}function Rbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ibe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Lbe(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=epe,S=Xn.cursorLine;else if(h==="BarChart")b=tpe(l,d,a,o),w=HH,S=Xn.cursorRectangle;else if(l==="radial"&&wU(d)){var{cx:E,cy:C,radius:j,startAngle:A,endAngle:N}=VH(d);b={cx:E,cy:C,startAngle:A,endAngle:N,innerRadius:j,outerRadius:j},w=YH,S=Xn.cursorLine}else b={points:Hpe(l,d,a)},w=UA,S=Xn.cursorLine;var O=typeof c=="object"&&"className"in c?c.className:void 0,T=Qv(Qv(Qv(Qv({stroke:"#ccc",pointerEvents:"none"},a),b),sc(c)),{},{payload:g,payloadIndex:v,className:Ct("recharts-tooltip-cursor",O)});return x.createElement(hi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(Ibe,{cursor:c,cursorComp:w,cursorProps:T}))}function zbe(e){var t=rbe(),n=EH(),r=jc(),i=cbe();return t==null||n==null||r==null||i==null?null:x.createElement(Lbe,fC({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var Q9=x.createContext(null),$be=()=>x.useContext(Q9),YE={exports:{}},Gz;function Bbe(){return Gz||(Gz=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],E=arguments.length,C,j;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),E){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(j=1,C=new Array(E-1);j<E;j++)C[j-1]=arguments[j];S.fn.apply(S.context,C)}else{var A=S.length,N;for(j=0;j<A;j++)switch(S[j].once&&this.removeListener(f,S[j].fn,void 0,!0),E){case 1:S[j].fn.call(S[j].context);break;case 2:S[j].fn.call(S[j].context,h);break;case 3:S[j].fn.call(S[j].context,h,d);break;case 4:S[j].fn.call(S[j].context,h,d,g);break;default:if(!C)for(N=1,C=new Array(E-1);N<E;N++)C[N-1]=arguments[N];S[j].fn.apply(S[j].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=[],E=b.length;w<E;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})(YE)),YE.exports}var Fbe=Bbe();const Ube=Bi(Fbe);var Gm=new Ube,dC="recharts.syncEvent.tooltip",Wz="recharts.syncEvent.brush",nN=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!po(n))return e[n]}},Hbe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Z9=Br({name:"options",initialState:Hbe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),qbe=Z9.reducer,{createEventEmitter:Vbe}=Z9.actions;function Kbe(e){return e.tooltip.syncInteraction}var Ybe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},J9=Br({name:"chartData",initialState:Ybe,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:Qz,setDataStartEndIndexes:Xbe,setComputedData:t5e}=J9.actions,Gbe=J9.reducer,Wbe=["x","y"];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 bf(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){Qbe(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 Qbe(e,t,n){return(t=Zbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zbe(e){var t=Jbe(e,"string");return typeof t=="symbol"?t:t+""}function Jbe(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 ewe(e,t){if(e==null)return{};var n,r,i=twe(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 twe(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 nwe(){var e=Re(XA),t=Re(GA),n=Yt(),r=Re(uq),i=Re(Ps),a=jc(),o=W0(),l=Re(c=>c.rootProps.className);x.useEffect(()=>{if(e==null)return Zl;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=ewe(v,Wbe),{x:E,y:C,width:j,height:A}=h.payload.sourceViewBox,N=bf(bf({},S),{},{x:o.x+(j?(b-E)/j:0)*o.width,y:o.y+(A?(w-C)/A:0)*o.height});n(bf(bf({},h),{},{payload:bf(bf({},h.payload),{},{coordinate:N})}))}else n(h);return}if(i!=null){var O;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},M=r(i,T);O=i[M]}else r==="value"&&(O=i.find(D=>String(D.value)===h.payload.label));var{coordinate:I}=h.payload;if(O==null||h.payload.active===!1||I==null||o==null){n(cC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:z,y:B}=I,L=Math.min(z,o.x+o.width),G=Math.min(B,o.y+o.height),F={x:a==="horizontal"?O.coordinate:L,y:a==="horizontal"?G:O.coordinate},K=cC({active:h.payload.active,coordinate:F,dataKey:h.payload.dataKey,index:String(O.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(K)}}};return Gm.on(dC,c),()=>{Gm.off(dC,c)}},[l,n,t,e,r,i,a,o])}function rwe(){var e=Re(XA),t=Re(GA),n=Yt();x.useEffect(()=>{if(e==null)return Zl;var r=(i,a,o)=>{t!==o&&e===i&&n(Xbe(a))};return Gm.on(Wz,r),()=>{Gm.off(Wz,r)}},[n,t,e])}function iwe(){var e=Yt();x.useEffect(()=>{e(Vbe())},[e]),nwe(),rwe()}function awe(e,t,n,r,i,a){var o=Re(b=>dbe(b,e,t)),l=Re(q9),c=Re(GA),f=Re(XA),h=Re(uq),d=Re(Kbe),g=d==null?void 0:d.active,v=W0();x.useEffect(()=>{if(!g&&f!=null&&c!=null){var b=cC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});Gm.emit(dC,f,b,c)}},[g,n,o,l,i,r,c,f,h,a,v])}function Jz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function e3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jz(Object(n),!0).forEach(function(r){owe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function owe(e,t,n){return(t=swe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function swe(e){var t=lwe(e,"string");return typeof t=="symbol"?t:t+""}function lwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uwe(e){return e.dataKey}function cwe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Ome,t)}var t3=[],fwe={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 e7(e){var t,n,r=Wn(e,fwe),{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:E,shared:C,trigger:j,defaultIndex:A,portal:N,axisId:O}=r,T=Yt(),M=typeof A=="number"?String(A):A;x.useEffect(()=>{T(n0e({shared:C,trigger:j,axisId:O,active:i,defaultIndex:M}))},[T,C,j,O,i,M]);var I=W0(),z=zH(),B=Wxe(C),{activeIndex:L,isActive:G}=(t=Re(ie=>pbe(ie,B,j,M)))!==null&&t!==void 0?t:{},F=Re(ie=>mbe(ie,B,j,M)),K=Re(ie=>G9(ie,B,j,M)),D=Re(ie=>hbe(ie,B,j,M)),q=F,X=$be(),V=(n=i??G)!==null&&n!==void 0?n:!1,[R,H]=zU([q,V]),U=B==="axis"?K:void 0;awe(B,j,D,U,L,V);var $=N??X;if($==null||I==null||B==null)return null;var Q=q??t3;V||(Q=t3),f&&Q.length&&(Q=PU(Q.filter(ie=>ie.value!=null&&(ie.hide!==!0||r.includeHidden)),g,uwe));var Z=Q.length>0,ne=e3(e3({},r),{},{payload:Q,label:U,active:V,activeIndex:L,coordinate:D,accessibilityLayer:z}),te=x.createElement(Bme,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:h,active:V,coordinate:D,hasPayload:Z,offset:d,position:v,reverseDirection:b,useTranslate3d:w,viewBox:I,wrapperStyle:S,lastBoundingBox:R,innerRef:H,hasPortalFromProps:!!N},cwe(c,ne));return x.createElement(x.Fragment,null,Xl.createPortal(te,$),V&&x.createElement(zbe,{cursor:E,tooltipEventType:B,coordinate:D,payload:Q,index:L}))}var Zp=e=>null;Zp.displayName="Cell";function dwe(e,t,n){return(t=hwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hwe(e){var t=mwe(e,"string");return typeof t=="symbol"?t:t+""}function mwe(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 pwe{constructor(t){dwe(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 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 gwe(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){vwe(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 vwe(e,t,n){return(t=ywe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ywe(e){var t=xwe(e,"string");return typeof t=="symbol"?t:t+""}function xwe(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 bwe={cacheSize:2e3,enableCache:!0},t7=gwe({},bwe),r3=new pwe(t7.cacheSize),wwe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},i3="recharts_measurement_span";function Swe(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 a3=(e,t)=>{try{var n=document.getElementById(i3);n||(n=document.createElement("span"),n.setAttribute("id",i3),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,wwe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},bm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Lp.isSsr)return{width:0,height:0};if(!t7.enableCache)return a3(t,n);var r=Swe(t,n),i=r3.get(r);if(i)return i;var a=a3(t,n);return r3.set(r,a),a},n7;function Ewe(e,t,n){return(t=_we(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _we(e){var t=jwe(e,"string");return typeof t=="symbol"?t:t+""}function jwe(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 o3=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,s3=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cwe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,kwe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Awe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Owe=["cm","mm","pt","pc","in","Q","px"];function Nwe(e){return Owe.includes(e)}var Pf="NaN";function Twe(e,t){return e*Awe[t]}class jr{static parse(t){var n,[,r,i]=(n=kwe.exec(t))!==null&&n!==void 0?n:[];return r==null?jr.NaN:new jr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,po(t)&&(this.unit=""),n!==""&&!Cwe.test(n)&&(this.num=NaN,this.unit=""),Nwe(n)&&(this.num=Twe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new jr(NaN,""):new jr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new jr(NaN,""):new jr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new jr(NaN,""):new jr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new jr(NaN,""):new jr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return po(this.num)}}n7=jr;Ewe(jr,"NaN",new n7(NaN,""));function r7(e){if(e==null||e.includes(Pf))return Pf;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=o3.exec(t))!==null&&n!==void 0?n:[],o=jr.parse(r??""),l=jr.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Pf;t=t.replace(o3,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,h,d,g]=(f=s3.exec(t))!==null&&f!==void 0?f:[],v=jr.parse(h??""),b=jr.parse(g??""),w=d==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Pf;t=t.replace(s3,w.toString())}return t}var l3=/\(([^()]*)\)/;function Pwe(e){for(var t=e,n;(n=l3.exec(t))!=null;){var[,r]=n;t=t.replace(l3,r7(r))}return t}function Mwe(e){var t=e.replace(/\s+/g,"");return t=Pwe(t),t=r7(t),t}function Dwe(e){try{return Mwe(e)}catch{return Pf}}function XE(e){var t=Dwe(e.slice(5,-1));return t===Pf?"":t}var Rwe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Iwe=["dx","dy","angle","className","breakAll"];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 u3(e,t){if(e==null)return{};var n,r,i=Lwe(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 Lwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var i7=/[ \f\n\r\t\v\u2028\u2029]+/,a7=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];mn(t)||(n?i=t.toString().split(""):i=t.toString().split(i7));var a=i.map(l=>({word:l,width:bm(l,r).width})),o=n?0:bm(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function o7(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function zwe(e){return mn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var s7=(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},[]),l7=e=>e.reduce((t,n)=>t.width>n.width?t:n),$we="…",c3=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),f=a7({breakAll:n,style:r,children:c+$we});if(!f)return[!1,[]];var h=s7(f.wordsWithComputedWidth,a,o,l),d=h.length>i||l7(h).width>Number(a);return[d,h]},Bwe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,f=Pe(a),h=String(o),d=s7(t,r,n,i);if(!f||i)return d;var g=d.length>a||l7(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 E=Math.floor((v+b)/2),C=E-1,[j,A]=c3(h,C,c,l,a,r,n,i),[N]=c3(h,E,c,l,a,r,n,i);if(!j&&!N&&(v=E+1),j&&N&&(b=E-1),!j&&N){S=A;break}w++}return S||d},f3=e=>{var t=mn(e)?[]:e.toString().split(i7);return[{words:t,width:void 0}]},Fwe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Lp.isSsr){var l,c,f=a7({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:h,spaceWidth:d}=f;l=h,c=d}else return f3(r);return Bwe({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return f3(r)},u7="#808080",Uwe={angle:0,breakAll:!1,capHeight:"0.71em",fill:u7,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},yb=x.forwardRef((e,t)=>{var n=Wn(e,Uwe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:f,verticalAnchor:h}=n,d=u3(n,Rwe),g=x.useMemo(()=>Fwe({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:E}=d,C=u3(d,Iwe);if(!go(r)||!go(i)||g.length===0)return null;var j=Number(r)+(Pe(v)?v:0),A=Number(i)+(Pe(b)?b:0);if(!St(j)||!St(A))return null;var N;switch(h){case"start":N=XE("calc(".concat(o,")"));break;case"middle":N=XE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:N=XE("calc(".concat(g.length-1," * -").concat(a,")"));break}var O=[],T=g[0];if(c&&T!=null){var M=T.width,{width:I}=d;O.push("scale(".concat(Pe(I)&&Pe(M)?I/M:1,")"))}return w&&O.push("rotate(".concat(w,", ").concat(j,", ").concat(A,")")),O.length&&(C.transform=O.join(" ")),x.createElement("text",hC({},Wr(C),{ref:t,x:j,y:A,className:Ct("recharts-text",S),textAnchor:f,fill:l.includes("url")?u7:l}),g.map((z,B)=>{var L=z.words.join(E?"":" ");return x.createElement("tspan",{x:j,dy:B===0?N:a,key:"".concat(L,"-").concat(B)},L)}))});yb.displayName="Text";function d3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ja(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d3(Object(n),!0).forEach(function(r){Hwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hwe(e,t,n){return(t=qwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qwe(e){var t=Vwe(e,"string");return typeof t=="symbol"?t:t+""}function Vwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kwe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:f}=LA(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,E=w>0?"end":"start",C=w>0?"start":"end",j=c>=0?1:-1,A=j*r,N=j>0?"end":"start",O=j>0?"start":"end",T=i;if(n==="top"){var M={x:h+c/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:E};return T&&(M.height=Math.max(o-T.y,0),M.width=c),M}if(n==="bottom"){var I={x:d+f/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(I.height=Math.max(T.y+T.height-(o+l),0),I.width=f),I}if(n==="left"){var z={x:g-A,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"};return T&&(z.width=Math.max(z.x-T.x,0),z.height=l),z}if(n==="right"){var B={x:g+v+A,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(B.width=Math.max(T.x+T.width-B.x,0),B.height=l),B}var L=T?{width:v,height:l}:{};return n==="insideLeft"?Ja({x:g+A,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},L):n==="insideRight"?Ja({x:g+v-A,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"},L):n==="insideTop"?Ja({x:h+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideBottom"?Ja({x:d+f/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:E},L):n==="insideTopLeft"?Ja({x:h+A,y:o+S,horizontalAnchor:O,verticalAnchor:C},L):n==="insideTopRight"?Ja({x:h+c-A,y:o+S,horizontalAnchor:N,verticalAnchor:C},L):n==="insideBottomLeft"?Ja({x:d+A,y:o+l-S,horizontalAnchor:O,verticalAnchor:E},L):n==="insideBottomRight"?Ja({x:d+f-A,y:o+l-S,horizontalAnchor:N,verticalAnchor:E},L):n&&typeof n=="object"&&(Pe(n.x)||cc(n.x))&&(Pe(n.y)||cc(n.y))?Ja({x:a+zr(n.x,v),y:o+zr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},L):Ja({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},Ywe=["labelRef"],Xwe=["content"];function h3(e,t){if(e==null)return{};var n,r,i=Gwe(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 Gwe(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 m3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m3(Object(n),!0).forEach(function(r){Wwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wwe(e,t,n){return(t=Qwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qwe(e){var t=Zwe(e,"string");return typeof t=="symbol"?t:t+""}function Zwe(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 Zo(){return Zo=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},Zo.apply(null,arguments)}var c7=x.createContext(null),Jwe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,c=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return x.createElement(c7.Provider,{value:c},l)},f7=()=>{var e=x.useContext(c7),t=W0();return e||(t?LA(t):void 0)},e1e=x.createContext(null),t1e=()=>{var e=x.useContext(e1e),t=Re(mq);return e||t},n1e=e=>{var{value:t,formatter:n}=e,r=mn(e.children)?t:e.children;return typeof n=="function"?n(r):r},rN=e=>e!=null&&typeof e=="function",r1e=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},i1e=(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=r1e(d,g),S=w>=0?1:-1,E,C;switch(t){case"insideStart":E=d+S*a,C=v;break;case"insideEnd":E=g-S*a,C=!v;break;case"end":E=g+S*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=w<=0?C:!C;var j=Yn(l,c,b,E),A=Yn(l,c,b,E+(C?1:-1)*359),N="M".concat(j.x,",").concat(j.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(A.x,",").concat(A.y),O=mn(e.id)?Lm("recharts-radial-line-"):e.id;return x.createElement("text",Zo({},r,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:O,d:N})),x.createElement("textPath",{xlinkHref:"#".concat(O)},n))},a1e=(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}=Yn(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}=Yn(r,i,g,f);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},_y=e=>e!=null&&"cx"in e&&Pe(e.cx),o1e={angle:0,offset:5,zIndex:Xn.label,position:"middle",textBreakAll:!1};function s1e(e){if(!_y(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 xl(e){var t=Wn(e,o1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:f,labelRef:h}=t,d=t1e(),g=f7(),v=i==="center"?g:d??g,b,w,S;n==null?b=v:_y(n)?b=n:b=LA(n);var E=s1e(b);if(!b||mn(a)&&mn(o)&&!x.isValidElement(l)&&typeof l!="function")return null;var C=vm(vm({},t),{},{viewBox:b});if(x.isValidElement(l)){var{labelRef:j}=C,A=h3(C,Ywe);return x.cloneElement(l,A)}if(typeof l=="function"){var{content:N}=C,O=h3(C,Xwe);if(w=x.createElement(l,O),x.isValidElement(w))return w}else w=n1e(t);var T=Wr(t);if(_y(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return i1e(t,i,w,T,b);S=a1e(b,t.offset,t.position)}else{if(!E)return null;var M=Kwe({viewBox:E,position:i,offset:t.offset,parentViewBox:_y(r)?void 0:r});S=vm(vm({x:M.x,y:M.y,textAnchor:M.horizontalAnchor,verticalAnchor:M.verticalAnchor},M.width!==void 0?{width:M.width}:{}),M.height!==void 0?{height:M.height}:{})}return x.createElement(hi,{zIndex:t.zIndex},x.createElement(yb,Zo({ref:h,className:Ct("recharts-label",c)},T,S,{textAnchor:o7(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:f}),w))}xl.displayName="Label";var l1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(xl,Zo({key:"label-implicit"},r)):go(e)?x.createElement(xl,Zo({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===xl?x.cloneElement(e,vm({key:"label-implicit"},r)):x.createElement(xl,Zo({key:"label-implicit",content:e},r)):rN(e)?x.createElement(xl,Zo({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(xl,Zo({},e,{key:"label-implicit"},r)):null};function u1e(e){var{label:t,labelRef:n}=e,r=f7();return l1e(t,r,n)||null}var c1e=["valueAccessor"],f1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function Dx(){return Dx=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},Dx.apply(null,arguments)}function p3(e,t){if(e==null)return{};var n,r,i=d1e(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 d1e(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 h1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(zwe(t))return t},d7=x.createContext(void 0),h7=d7.Provider,m7=x.createContext(void 0),m1e=m7.Provider;function p1e(){return x.useContext(d7)}function g1e(){return x.useContext(m7)}function jy(e){var{valueAccessor:t=h1e}=e,n=p3(e,c1e),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=p3(n,f1e),f=p1e(),h=g1e(),d=f||h;return!d||!d.length?null:x.createElement(hi,{zIndex:l??Xn.label},x.createElement(ar,{className:"recharts-label-list"},d.map((g,v)=>{var b,w=mn(r)?t(g,v):Kt(g.payload,r),S=mn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(xl,Dx({key:"label-".concat(v)},Wr(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}))})))}jy.displayName="LabelList";function iN(e){var{label:t}=e;return t?t===!0?x.createElement(jy,{key:"labelList-implicit"}):x.isValidElement(t)||rN(t)?x.createElement(jy,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(jy,Dx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var p7=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ct("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?x.createElement("circle",mC({},Ii(e),jA(e),{className:a,cx:t,cy:n,r})):null},g7=e=>e.graphicalItems.polarItems,v1e=ue([Sn,Fp],CO),xb=ue([g7,Mn,v1e],kO),y1e=ue([xb],AO),bb=ue([y1e,eb],OO),x1e=ue([bb,Mn,xb],TO);ue([bb,Mn,xb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=Kt(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:Kt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var g3=()=>{},b1e=ue([bb,Mn,xb,mb,Sn],RO),w1e=ue([Mn,MO,DO,g3,b1e,g3,Tt,Sn],IO),v7=ue([Mn,Tt,bb,x1e,Bp,Sn,w1e],LO),S1e=ue([v7,Ud,tu],$O),E1e=ue([Mn,v7,S1e,Sn],FO);ue([tu,E1e],gq);var _1e={radiusAxis:{},angleAxis:{}},y7=Br({name:"polarAxis",initialState:_1e,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:n5e,removeRadiusAxis:r5e,addAngleAxis:i5e,removeAngleAxis:a5e}=y7.actions,j1e=y7.reducer;function x7(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function v3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function y3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v3(Object(n),!0).forEach(function(r){C1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C1e(e,t,n){return(t=k1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k1e(e){var t=A1e(e,"string");return typeof t=="symbol"?t:t+""}function A1e(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 O1e=(e,t)=>t,aN=ue([g7,O1e],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),N1e=[],oN=(e,t,n)=>(n==null?void 0:n.length)===0?N1e:n,b7=ue([eb,aN,oN],(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=>y3(y3({},t.presentationProps),a.props))),i!=null)return i}}),T1e=ue([b7,aN,oN],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=Kt(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:Ld(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),P1e=ue([b7,aN,oN,or],(e,t,n,r)=>{if(!(t==null||e==null))return ISe({offset:r,pieSettings:t,displayedData:e,cells:n})}),GE={exports:{}},Vt={};/**
 * @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 x3;function M1e(){if(x3)return Vt;x3=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 Vt.ContextConsumer=a,Vt.ContextProvider=o,Vt.Element=e,Vt.ForwardRef=l,Vt.Fragment=n,Vt.Lazy=d,Vt.Memo=h,Vt.Portal=t,Vt.Profiler=i,Vt.StrictMode=r,Vt.Suspense=c,Vt.SuspenseList=f,Vt.isContextConsumer=function(w){return b(w)===a},Vt.isContextProvider=function(w){return b(w)===o},Vt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Vt.isForwardRef=function(w){return b(w)===l},Vt.isFragment=function(w){return b(w)===n},Vt.isLazy=function(w){return b(w)===d},Vt.isMemo=function(w){return b(w)===h},Vt.isPortal=function(w){return b(w)===t},Vt.isProfiler=function(w){return b(w)===i},Vt.isStrictMode=function(w){return b(w)===r},Vt.isSuspense=function(w){return b(w)===c},Vt.isSuspenseList=function(w){return b(w)===f},Vt.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)},Vt.typeOf=b,Vt}var b3;function D1e(){return b3||(b3=1,GE.exports=M1e()),GE.exports}var R1e=D1e(),w3=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",S3=null,WE=null,w7=e=>{if(e===S3&&Array.isArray(WE))return WE;var t=[];return x.Children.forEach(e,n=>{mn(n)||(R1e.isFragment(n)?t=t.concat(w7(n.props.children)):t.push(n))}),WE=t,S3=e,t};function sN(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>w3(i)):r=[w3(t)],w7(e).forEach(i=>{var a=uc(i,"type.displayName")||uc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var S7=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,QE={},E3;function I1e(){return E3||(E3=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})(QE)),QE}var ZE,_3;function L1e(){return _3||(_3=1,ZE=I1e().isPlainObject),ZE}var z1e=L1e();const $1e=Bi(z1e);var j3,C3,k3,A3,O3;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 T3(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){B1e(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 B1e(e,t,n){return(t=F1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F1e(e){var t=U1e(e,"string");return typeof t=="symbol"?t:t+""}function U1e(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 Rx(){return Rx=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},Rx.apply(null,arguments)}function nm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var P3=(e,t,n,r,i)=>{var a=n-r,o;return o=On(j3||(j3=nm(["M ",",",""])),e,t),o+=On(C3||(C3=nm(["L ",",",""])),e+n,t),o+=On(k3||(k3=nm(["L ",",",""])),e+n-a/2,t+i),o+=On(A3||(A3=nm(["L ",",",""])),e+n-a/2-r,t+i),o+=On(O3||(O3=nm(["L ",","," Z"])),e,t),o},H1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},q1e=e=>{var t=Wn(e,H1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:f,animationBegin:h,isUpdateAnimationActive:d}=t,g=x.useRef(null),[v,b]=x.useState(-1),w=x.useRef(i),S=x.useRef(a),E=x.useRef(o),C=x.useRef(n),j=x.useRef(r),A=$p(e,"trapezoid-");if(x.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var F=g.current.getTotalLength();F&&b(F)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var N=Ct("recharts-trapezoid",l);if(!d)return x.createElement("g",null,x.createElement("path",Rx({},Wr(t),{className:N,d:P3(n,r,i,a,o)})));var O=w.current,T=S.current,M=E.current,I=C.current,z=j.current,B="0px ".concat(v===-1?1:v,"px"),L="".concat(v,"px ").concat(v,"px"),G=$H(["strokeDasharray"],f,c);return x.createElement(zp,{animationId:A,key:A,canBegin:v>0,duration:f,easing:c,isActive:d,begin:h},F=>{var K=cn(O,i,F),D=cn(T,a,F),q=cn(M,o,F),X=cn(I,n,F),V=cn(z,r,F);g.current&&(w.current=K,S.current=D,E.current=q,C.current=X,j.current=V);var R=F>0?{transition:G,strokeDasharray:L}:{strokeDasharray:B};return x.createElement("path",Rx({},Wr(t),{className:N,d:P3(X,V,K,D,q),ref:g,style:T3(T3({},R),t.style)}))})},V1e=["option","shapeType","activeClassName","inActiveClassName"];function K1e(e,t){if(e==null)return{};var n,r,i=Y1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Y1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function M3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ix(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M3(Object(n),!0).forEach(function(r){X1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X1e(e,t,n){return(t=G1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G1e(e){var t=W1e(e,"string");return typeof t=="symbol"?t:t+""}function W1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q1e(e,t){return Ix(Ix({},t),e)}function Z1e(e,t){return e==="symbols"}function D3(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(HH,n);case"trapezoid":return x.createElement(q1e,n);case"sector":return x.createElement(YH,n);case"symbols":if(Z1e(t))return x.createElement(_A,n);break;case"curve":return x.createElement(UA,n);default:return null}}function J1e(e){return x.isValidElement(e)?e.props:e}function lN(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=K1e(e,V1e),o;if(x.isValidElement(t))o=x.cloneElement(t,Ix(Ix({},a),J1e(t)));else if(typeof t=="function")o=t(a,a.index);else if($1e(t)&&typeof t!="boolean"){var l=Q1e(t,a);o=x.createElement(D3,{shapeType:n,elementProps:l})}else{var c=a;o=x.createElement(D3,{shapeType:n,elementProps:c})}return a.isActive?x.createElement(ar,{className:r},o):x.createElement(ar,{className:i},o)}var uN=(e,t,n)=>{var r=Yt();return(i,a)=>o=>{e==null||e(i,a,o),r(O9({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},cN=e=>{var t=Yt();return(n,r)=>i=>{e==null||e(n,r,i),t(r0e())}},fN=(e,t,n)=>{var r=Yt();return(i,a)=>o=>{e==null||e(i,a,o),r(i0e({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function dN(e){var{tooltipEntrySettings:t}=e,n=Yt(),r=Fr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Jxe(t)):i.current!==t&&n(e0e({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(t0e(i.current)),i.current=null)},[n]),null}function E7(e){var{legendPayload:t}=e,n=Yt(),r=Fr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(MH(t)):i.current!==t&&n(DH({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(RH(i.current)),i.current=null)},[n]),null}function eSe(e){var{legendPayload:t}=e,n=Yt(),r=Re(Tt),i=x.useRef(null);return x.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(MH(t)):i.current!==t&&n(DH({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(RH(i.current)),i.current=null)},[n]),null}var JE,tSe=()=>{var[e]=x.useState(()=>Lm("uid-"));return e},nSe=(JE=XC.useId)!==null&&JE!==void 0?JE:tSe;function rSe(e,t){var n=nSe();return t||(e?"".concat(e,"-").concat(n):n)}var iSe=x.createContext(void 0),hN=e=>{var{id:t,type:n,children:r}=e,i=rSe("recharts-".concat(n),t);return x.createElement(iSe.Provider,{value:i},r(i))},aSe={cartesianItems:[],polarItems:[]},_7=Br({name:"graphicalItems",initialState:aSe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:an()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=aa(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:an()},removeCartesianGraphicalItem:{reducer(e,t){var n=aa(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:an()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:an()},removePolarGraphicalItem:{reducer(e,t){var n=aa(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:an()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=aa(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:an()}}}),{addCartesianGraphicalItem:oSe,replaceCartesianGraphicalItem:sSe,removeCartesianGraphicalItem:lSe,addPolarGraphicalItem:uSe,removePolarGraphicalItem:cSe,replacePolarGraphicalItem:fSe}=_7.actions,dSe=_7.reducer,hSe=e=>{var t=Yt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(oSe(e)):n.current!==e&&t(sSe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(lSe(n.current)),n.current=null)},[t]),null},j7=x.memo(hSe),mSe=e=>{var t=Yt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(uSe(e)):n.current!==e&&t(fSe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(cSe(n.current)),n.current=null)},[t]),null},pSe=x.memo(mSe),gSe=["key"],vSe=["onMouseEnter","onClick","onMouseLeave"],ySe=["id"],xSe=["id"];function Kl(){return Kl=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},Kl.apply(null,arguments)}function wb(e,t){if(e==null)return{};var n,r,i=bSe(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 bSe(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 R3(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 fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R3(Object(n),!0).forEach(function(r){wSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wSe(e,t,n){return(t=SSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SSe(e){var t=ESe(e,"string");return typeof t=="symbol"?t:t+""}function ESe(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 _Se(e){var t=x.useMemo(()=>sN(e.children,Zp),[e.children]),n=Re(r=>T1e(r,e.id,t));return n==null?null:x.createElement(eSe,{legendPayload:n})}function jSe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(x.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var CSe=x.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=jSe(d),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(E=>fn(fn({},E),{},{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:Ld(l,t),hide:c,type:f,color:o,unit:"",graphicalItemId:h}};return x.createElement(dN,{tooltipEntrySettings:b})}),kSe=(e,t)=>e>t?"start":e<t?"end":"middle",ASe=(e,t,n)=>zr(typeof t=="function"?t(e):t,n,n*.8),OSe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=qH(a,o),c=i+zr(e.cx,a,a/2),f=r+zr(e.cy,o,o/2),h=zr(e.innerRadius,l,0),d=ASe(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}},NSe=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},TSe=(e,t)=>{if(x.isValidElement(e))return x.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Ct("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=wb(t,gSe);return x.createElement(UA,Kl({},i,{type:"linear",className:n}))},PSe=(e,t,n)=>{if(x.isValidElement(e))return x.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),x.isValidElement(r)))return r;var i=Ct("recharts-pie-label-text",x7(e));return x.createElement(yb,Kl({},t,{alignmentBaseline:"middle",className:i}),r)};function MSe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Ii(n),c=sc(i),f=sc(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=Yn(g.cx,g.cy,g.outerRadius+h,b),S=fn(fn(fn(fn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:kSe(w.x,g.cx)},w),E=fn(fn(fn(fn({},l),g),{},{fill:"none",stroke:g.fill},f),{},{index:v,points:[Yn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return x.createElement(hi,{zIndex:Xn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},x.createElement(ar,null,a&&TSe(a,E),PSe(i,S,Kt(g,o))))});return x.createElement(ar,{className:"recharts-pie-labels"},d)}function DSe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?x.createElement(iN,{label:i}):x.createElement(MSe,{sectors:t,props:n,showLabels:r})}function RSe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=Re(Vl),c=Re(QO),f=Re(q9),{onMouseEnter:h,onClick:d,onMouseLeave:g}=i,v=wb(i,vSe),b=uN(h,i.dataKey,o),w=cN(g),S=fN(d,i.dataKey,o);return t==null||t.length===0?null:x.createElement(x.Fragment,null,t.map((E,C)=>{if((E==null?void 0:E.startAngle)===0&&(E==null?void 0:E.endAngle)===0&&t.length!==1)return null;var j=f==null||f===o,A=String(C)===l&&(c==null||i.dataKey===c)&&j,N=l?r:null,O=n&&A?n:N,T=fn(fn({},E),{},{stroke:E.stroke,tabIndex:-1,[yH]:C,[xH]:o});return x.createElement(ar,Kl({key:"sector-".concat(E==null?void 0:E.startAngle,"-").concat(E==null?void 0:E.endAngle,"-").concat(E.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},Tp(v,E,C),{onMouseEnter:b(E,C),onMouseLeave:w(E,C),onClick:S(E,C)}),x.createElement(lN,Kl({option:a??O,index:C,shapeType:"sector",isActive:A},T)))}))}function ISe(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=NSe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(O=>Kt(O,f,0)!==0).length,E=(b>=360?S:S-1)*w,C=b-S*g-E,j=r.reduce((O,T)=>{var M=Kt(T,f,0);return O+(Pe(M)?M:0)},0),A;if(j>0){var N;A=r.map((O,T)=>{var M=Kt(O,f,0),I=Kt(O,h,T),z=OSe(n,a,O),B=(Pe(M)?M:0)/j,L,G=fn(fn({},O),i&&i[T]&&i[T].props),F=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;T?L=N.endAngle+pr(v)*w*(M!==0?1:0):L=l;var K=L+pr(v)*((M!==0?g:0)+B*C),D=(L+K)/2,q=(z.innerRadius+z.outerRadius)/2,X=[{name:I,value:M,payload:G,dataKey:f,type:d,color:F,fill:F,graphicalItemId:n.id}],V=Yn(z.cx,z.cy,q,D);return N=fn(fn(fn(fn({},n.presentationProps),{},{percent:B,cornerRadius:typeof o=="string"?parseFloat(o):o,name:I,tooltipPayload:X,midAngle:D,middleRadius:q,tooltipPosition:V},G),z),{},{value:M,dataKey:f,startAngle:L,endAngle:K,payload:G,paddingAngle:pr(v)*w}),N})}return A}function LSe(e){var{showLabels:t,sectors:n,children:r}=e,i=x.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 x.createElement(m1e,{value:t?i:void 0},r)}function zSe(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=$p(t,"recharts-pie-"),b=n.current,[w,S]=x.useState(!1),E=x.useCallback(()=>{typeof g=="function"&&g(),S(!1)},[g]),C=x.useCallback(()=>{typeof d=="function"&&d(),S(!0)},[d]);return x.createElement(LSe,{showLabels:!w,sectors:i},x.createElement(zp,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:E,key:v},j=>{var A,N=[],O=i&&i[0],T=(A=O==null?void 0:O.startAngle)!==null&&A!==void 0?A:0;return i==null||i.forEach((M,I)=>{var z=b&&b[I],B=I>0?uc(M,"paddingAngle",0):0;if(z){var L=cn(z.endAngle-z.startAngle,M.endAngle-M.startAngle,j),G=fn(fn({},M),{},{startAngle:T+B,endAngle:T+L+B});N.push(G),T=G.endAngle}else{var{endAngle:F,startAngle:K}=M,D=cn(0,F-K,j),q=fn(fn({},M),{},{startAngle:T+B,endAngle:T+D+B});N.push(q),T=q.endAngle}}),n.current=N,x.createElement(ar,null,x.createElement(RSe,{sectors:N,activeShape:f,inactiveShape:h,allOtherPieProps:t,shape:t.shape,id:r}))}),x.createElement(DSe,{showLabels:!w,sectors:i,props:t}),t.children)}var $Se={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:Xn.area};function BSe(e){var{id:t}=e,n=wb(e,ySe),{hide:r,className:i,rootTabIndex:a}=e,o=x.useMemo(()=>sN(e.children,Zp),[e.children]),l=Re(h=>P1e(h,t,o)),c=x.useRef(null),f=Ct("recharts-pie",i);return r||l==null?(c.current=null,x.createElement(ar,{tabIndex:a,className:f})):x.createElement(hi,{zIndex:e.zIndex},x.createElement(CSe,{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}),x.createElement(ar,{tabIndex:a,className:f},x.createElement(zSe,{props:fn(fn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function FSe(e){var t=Wn(e,$Se),{id:n}=t,r=wb(t,xSe),i=Ii(r);return x.createElement(hN,{id:n,type:"pie"},a=>x.createElement(x.Fragment,null,x.createElement(pSe,{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}),x.createElement(_Se,Kl({},r,{id:a})),x.createElement(BSe,Kl({},r,{id:a}))))}var C7=FSe;C7.displayName="Pie";var USe=["points"];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 e_(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){HSe(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 HSe(e,t,n){return(t=qSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qSe(e){var t=VSe(e,"string");return typeof t=="symbol"?t:t+""}function VSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lx(){return Lx=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},Lx.apply(null,arguments)}function KSe(e,t){if(e==null)return{};var n,r,i=YSe(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 YSe(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 XSe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Ct(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=KSe(a,USe);return x.createElement(p7,Lx({},l,{className:i}))}function GSe(e,t){return e==null?!1:t?!0:e.length===1}function WSe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:f=Xn.scatter}=e;if(!GSe(t,n))return null;var h=S7(n),d=Nue(n),g=t.map((b,w)=>{var S,E,C=e_(e_(e_({r:3},o),d),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(E=b.y)!==null&&E!==void 0?E:void 0,dataKey:a,value:b.value,payload:b.payload,points:t});return x.createElement(XSe,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(h?"":"dots-").concat(c,")")),x.createElement(hi,{zIndex:f},x.createElement(ar,Lx({className:r},v),g))}function L3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L3(Object(n),!0).forEach(function(r){QSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QSe(e,t,n){return(t=ZSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZSe(e){var t=JSe(e,"string");return typeof t=="symbol"?t:t+""}function JSe(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 k7=0,eEe={xAxis:{},yAxis:{},zAxis:{}},A7=Br({name:"cartesianAxis",initialState:eEe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:an()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:an()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:an()},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]=z3(z3({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:tEe,replaceXAxis:nEe,removeXAxis:rEe,addYAxis:iEe,replaceYAxis:aEe,removeYAxis:oEe,addZAxis:o5e,replaceZAxis:s5e,removeZAxis:l5e,updateYAxisWidth:sEe}=A7.actions,lEe=A7.reducer,uEe=ue([or],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),cEe=ue([uEe,Cs,ks],(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)}}),mN=()=>Re(cEe),fEe=()=>Re(Z0e);function $3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function t_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$3(Object(n),!0).forEach(function(r){dEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dEe(e,t,n){return(t=hEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hEe(e){var t=mEe(e,"string");return typeof t=="symbol"?t:t+""}function mEe(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 pEe=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=t_(t_(t_({},l),sc(i)),jA(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,c):typeof i=="function"?f=i(c):f=x.createElement(p7,c),x.createElement(ar,{className:"recharts-active-dot",clipPath:o},f)};function gEe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Xn.activeDot}=e,l=Re(Vl),c=fEe();if(t==null||c==null)return null;var f=t.find(h=>c.includes(h.payload));return mn(f)?null:x.createElement(hi,{zIndex:o},x.createElement(pEe,{point:f,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var B3=(e,t,n)=>{var r=n??e;if(!mn(r))return zr(r,t,0)},vEe=(e,t,n)=>{var r={},i=e.filter(ib),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=B3(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=B3(t,n,f.barSize);return{stackId:void 0,dataKeys:h,barSize:d}});return[...l,...c]};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 Zv(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){yEe(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 yEe(e,t,n){return(t=xEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xEe(e){var t=bEe(e,"string");return typeof t=="symbol"?t:t+""}function bEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wEe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=zr(e,n,0,!0),c,f=[];if(St((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,d=n/o,g=r.reduce((C,j)=>C+(j.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,j)=>{var A,N={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:b.offset+b.size+l,size:h?d:(A=j.barSize)!==null&&A!==void 0?A:0}},O=[...C,N];return b=N.position,O},f)}else{var w=zr(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 E=St(i)?Math.min(S,i):S;c=r.reduce((C,j,A)=>[...C,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:w+(S+l)*A+(S-E)/2,size:E}}],f)}return c}}var SEe=(e,t,n,r,i,a,o)=>{var l=mn(o)?t:o,c=wEe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(f=>Zv(Zv({},f),{},{position:Zv(Zv({},f.position),{},{offset:f.position.offset-i/2})}))),c},EEe=(e,t)=>{var n=JA(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)}}}},_Ee=(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 jEe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&St(e.zIndex)?e.zIndex:t}var O7=e=>{var{chartData:t}=e,n=Yt(),r=Fr();return x.useEffect(()=>r?()=>{}:(n(Qz(t)),()=>{n(Qz(void 0))}),[t,n,r]),null},U3={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},N7=Br({name:"brush",initialState:U3,reducers:{setBrushSettings(e,t){return t.payload==null?U3:t.payload}}}),{setBrushSettings:u5e}=N7.actions,CEe=N7.reducer;function kEe(e){return(e%180+180)%180}var AEe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=kEe(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)},OEe={dots:[],areas:[],lines:[]},T7=Br({name:"referenceElements",initialState:OEe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=aa(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=aa(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=aa(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:c5e,removeDot:f5e,addArea:d5e,removeArea:h5e,addLine:m5e,removeLine:p5e}=T7.actions,NEe=T7.reducer,TEe=x.createContext(void 0),PEe=e=>{var{children:t}=e,[n]=x.useState("".concat(Lm("recharts"),"-clip")),r=mN();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return x.createElement(TEe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:l,width:o}))),t)};function P7(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 MEe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return AEe(r,n)}function DEe(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 Wm(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 REe(e,t){return P7(e,t+1)}function IEe(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:P7(r,f)};var w=c,S,E=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,j=c===0||Wm(e,C,E,h,l);j||(c=0,h=o,f+=1),j&&(h=C+e*(E()/2+i),c+=f)},g;f<=a.length;)if(g=d(),g)return g.v;return[]}function LEe(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 A=r[w];if(A==null)return 0;var N=w,O,T=()=>(O===void 0&&(O=n(A,N)),O),M=A.coordinate,I=w===h||Wm(e,M,T,d,c);if(!I)return g=!1,1;I&&(d=M+e*(T()/2+i))},b,w=h;w<o&&(b=v(),!(b!==0&&b===1));w+=f);if(g){for(var S=[],E=h;E<o;E+=f){var C=r[E];C!=null&&S.push(C)}return S}}return[]}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 Mr(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){zEe(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 zEe(e,t,n){return(t=$Ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ee(e){var t=BEe(e,"string");return typeof t=="symbol"?t:t+""}function BEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FEe(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 E=e*(b.coordinate+e*S()/2-c);a[g]=b=Mr(Mr({},b),{},{tickCoord:E>0?b.coordinate-E*e:b.coordinate})}else a[g]=b=Mr(Mr({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var C=Wm(e,b.tickCoord,S,l,c);C&&(c=b.tickCoord-e*(S()/2+i),a[g]=Mr(Mr({},b),{},{isShow:!0}))}},h=o-1;h>=0;h--)f(h);return a}function UEe(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=Mr(Mr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate}),h.tickCoord!=null){var v=Wm(e,h.tickCoord,()=>d,c,f);v&&(f=h.tickCoord-e*(d/2+i),o[l-1]=Mr(Mr({},h),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var j=o[C];if(j==null)return 1;var A=j,N,O=()=>(N===void 0&&(N=n(j,C)),N);if(C===0){var T=e*(A.coordinate-e*O()/2-c);o[C]=A=Mr(Mr({},A),{},{tickCoord:T<0?A.coordinate-T*e:A.coordinate})}else o[C]=A=Mr(Mr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var M=Wm(e,A.tickCoord,O,c,f);M&&(c=A.tickCoord+e*(O()/2+i),o[C]=Mr(Mr({},A),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function pN(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(Pe(c)||Lp.isSsr){var g;return(g=REe(i,Pe(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=h&&b==="width"?bm(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(N,O)=>{var T=typeof f=="function"?f(N.value,O):N.value;return b==="width"?MEe(bm(T,{fontSize:t,letterSpacing:n}),w,d):bm(T,{fontSize:t,letterSpacing:n})[b]},E=i[0],C=i[1],j=i.length>=2&&E!=null&&C!=null?pr(C.coordinate-E.coordinate):1,A=DEe(a,j,b);return c==="equidistantPreserveStart"?IEe(j,A,S,i,o):c==="equidistantPreserveEnd"?LEe(j,A,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=UEe(j,A,S,i,o,c==="preserveStartEnd"):v=FEe(j,A,S,i,o),v.filter(N=>N.isShow))}var HEe=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},qEe={xAxis:{},yAxis:{}},M7=Br({name:"renderedTicks",initialState:qEe,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:VEe,removeRenderedTicks:KEe}=M7.actions,YEe=M7.reducer,XEe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function GEe(e,t){if(e==null)return{};var n,r,i=WEe(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 WEe(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 gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gc.apply(null,arguments)}function q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3(Object(n),!0).forEach(function(r){QEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QEe(e,t,n){return(t=ZEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZEe(e){var t=JEe(e,"string");return typeof t=="symbol"?t:t+""}function JEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var is={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:Xn.axis};function e_e(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=An(An(An({},c),Ii(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!o||a==="bottom"&&o);f=An(An({},f),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var d=+(a==="left"&&!o||a==="right"&&o);f=An(An({},f),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return x.createElement("line",gc({},f,{className:Ct("recharts-cartesian-axis-line",uc(l,"className"))}))}function t_e(e,t,n,r,i,a,o,l,c){var f,h,d,g,v,b,w=l?-1:1,S=e.tickSize||o,E=Pe(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=E;break;case"left":d=g=e.coordinate,h=t+ +!l*r,f=h-w*S,v=f-w*c,b=E;break;case"right":d=g=e.coordinate,h=t+ +l*r,f=h+w*S,v=f+w*c,b=E;break;default:f=h=e.coordinate,g=n+ +l*i,d=g+w*S,b=d+w*c,v=E;break}return{line:{x1:f,y1:d,x2:h,y2:g},tick:{x:v,y:b}}}function n_e(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function r_e(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function i_e(e){var{option:t,tickProps:n,value:r}=e,i,a=Ct(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,An(An({},n),{},{className:a}));else if(typeof t=="function")i=t(An(An({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Ct(o,x7(t))),i=x.createElement(yb,gc({},n,{className:o}),r)}return i}function a_e(e){var{ticks:t,axisType:n,axisId:r}=e,i=Yt();return x.useEffect(()=>{if(r==null||n==null)return Zl;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(VEe({ticks:a,axisId:r,axisType:n})),()=>{i(KEe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var o_e=x.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:E,fontSize:C,letterSpacing:j,getTicksConfig:A,events:N,axisType:O,axisId:T}=e,M=pN(An(An({},A),{},{ticks:n}),C,j),I=Ii(A),z=sc(r),B=o7(I.textAnchor)?I.textAnchor:n_e(h,d),L=r_e(h,d),G={};typeof i=="object"&&(G=i);var F=An(An({},I),{},{fill:"none"},G),K=M.map(X=>An({entry:X},t_e(X,g,v,b,w,h,S,d,E))),D=K.map(X=>{var{entry:V,line:R}=X;return x.createElement(ar,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},i&&x.createElement("line",gc({},F,R,{className:Ct("recharts-cartesian-axis-tick-line",uc(i,"className"))})))}),q=K.map((X,V)=>{var R,H,{entry:U,tick:$}=X,Q=An(An(An(An({verticalAnchor:L},I),{},{textAnchor:B,stroke:"none",fill:a},$),{},{index:V,payload:U,visibleTicksCount:M.length,tickFormatter:o,padding:c},f),{},{angle:(R=(H=f==null?void 0:f.angle)!==null&&H!==void 0?H:I.angle)!==null&&R!==void 0?R:0}),Z=An(An({},Q),z);return x.createElement(ar,gc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},Tp(N,U,V)),r&&x.createElement(i_e,{option:r,tickProps:Z,value:"".concat(typeof o=="function"?o(U.value,V):U.value).concat(l||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},x.createElement(a_e,{ticks:M,axisId:T,axisType:O}),q.length>0&&x.createElement(hi,{zIndex:Xn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},q)),D.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},D))}),s_e=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:f}=e,h=GEe(e,XEe),[d,g]=x.useState(""),[v,b]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var E;return HEe({ticks:w.current,label:(E=e.labelRef)===null||E===void 0?void 0:E.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=x.useCallback(E=>{if(E){var C=E.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=C;var j=C[0];if(j){var A=window.getComputedStyle(j),N=A.fontSize,O=A.letterSpacing;(N!==d||O!==v)&&(g(N),b(O))}}},[d,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(hi,{zIndex:e.zIndex},x.createElement(ar,{className:Ct("recharts-cartesian-axis",a)},x.createElement(e_e,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Ii(e)}),x.createElement(o_e,{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}),x.createElement(Jwe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(u1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),gN=x.forwardRef((e,t)=>{var n=Wn(e,is);return x.createElement(s_e,gc({},n,{ref:t}))});gN.displayName="CartesianAxis";var l_e=["x1","y1","x2","y2","key"],u_e=["offset"],c_e=["xAxisId","yAxisId"],f_e=["xAxisId","yAxisId"];function V3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V3(Object(n),!0).forEach(function(r){d_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d_e(e,t,n){return(t=h_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h_e(e){var t=m_e(e,"string");return typeof t=="symbol"?t:t+""}function m_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zu(){return zu=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},zu.apply(null,arguments)}function zx(e,t){if(e==null)return{};var n,r,i=p_e(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 p_e(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 g_e=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 x.createElement("rect",{x:r,y:i,ry:l,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function D7(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:l,y2:c,key:f}=n,h=zx(n,l_e),d=(i=Ii(h))!==null&&i!==void 0?i:{},{offset:g}=d,v=zx(d,u_e);r=x.createElement("line",zu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:f}))}return r}function v_e(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=zx(e,c_e),c=i.map((f,h)=>{var d=Rr(Rr({},l),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(h),index:h});return x.createElement(D7,{key:"line-".concat(h),option:r,lineItemProps:d})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function y_e(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=zx(e,f_e),c=i.map((f,h)=>{var d=Rr(Rr({},l),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(h),index:h});return x.createElement(D7,{option:r,lineItemProps:d,key:"line-".concat(h)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function x_e(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 x.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 x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function b_e(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 x.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 x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var w_e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return pH(pN(Rr(Rr(Rr({},is),n),{},{ticks:gH(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},S_e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return pH(pN(Rr(Rr(Rr({},is),n),{},{ticks:gH(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},E_e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Xn.grid};function vN(e){var t=zA(),n=$A(),r=EH(),i=Rr(Rr({},Wn(e,E_e)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(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=Fr(),w=Re(I=>zz(I,"xAxis",a,b)),S=Re(I=>zz(I,"yAxis",o,b));if(!vo(f)||!vo(h)||!Pe(l)||!Pe(c))return null;var E=i.verticalCoordinatesGenerator||w_e,C=i.horizontalCoordinatesGenerator||S_e,{horizontalPoints:j,verticalPoints:A}=i;if((!j||!j.length)&&typeof C=="function"){var N=g&&g.length,O=C({yAxis:S?Rr(Rr({},S),{},{ticks:N?g:S.ticks}):void 0,width:t??f,height:n??h,offset:r},N?!0:d);ux(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(j=O)}if((!A||!A.length)&&typeof E=="function"){var T=v&&v.length,M=E({xAxis:w?Rr(Rr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??f,height:n??h,offset:r},T?!0:d);ux(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(A=M)}return x.createElement(hi,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(g_e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(x_e,zu({},i,{horizontalPoints:j})),x.createElement(b_e,zu({},i,{verticalPoints:A})),x.createElement(v_e,zu({},i,{offset:r,horizontalPoints:j,xAxis:w,yAxis:S})),x.createElement(y_e,zu({},i,{offset:r,verticalPoints:A,xAxis:w,yAxis:S}))))}vN.displayName="CartesianGrid";var __e={},R7=Br({name:"errorBars",initialState:__e,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:g5e,replaceErrorBar:v5e,removeErrorBar:y5e}=R7.actions,j_e=R7.reducer,C_e=["children"];function k_e(e,t){if(e==null)return{};var n,r,i=A_e(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 A_e(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 O_e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},N_e=x.createContext(O_e);function I7(e){var{children:t}=e,n=k_e(e,C_e);return x.createElement(N_e.Provider,{value:n},t)}function yN(e,t){var n,r,i=Re(f=>Ns(f,e)),a=Re(f=>Ts(f,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:tr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:nr.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function L7(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=mN(),{needClipX:a,needClipY:o,needClip:l}=yN(t,n);if(!l||!i)return null;var{x:c,y:f,width:h,height:d}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.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 z7=(e,t,n,r)=>ql(e,"xAxis",t,r),$7=(e,t,n,r)=>Hl(e,"xAxis",t,r),B7=(e,t,n,r)=>ql(e,"yAxis",n,r),F7=(e,t,n,r)=>Hl(e,"yAxis",n,r),T_e=ue([Tt,z7,B7,$7,F7],(e,t,n,r,i)=>js(e,"xAxis")?fd(t,r,!1):fd(n,i,!1)),P_e=(e,t,n,r,i)=>i;function M_e(e){return e.type==="line"}var D_e=ue([hb,P_e],(e,t)=>e.filter(M_e).find(n=>n.id===t)),R_e=ue([Tt,z7,B7,$7,F7,D_e,T_e,HA],(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 nje({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:v})}});function I_e(e){var t=sc(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 L_e=["id"],z_e=["type","layout","connectNulls","needClip","shape"],$_e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Qm(){return Qm=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},Qm.apply(null,arguments)}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 io(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){B_e(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 B_e(e,t,n){return(t=F_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F_e(e){var t=U_e(e,"string");return typeof t=="symbol"?t:t+""}function U_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 xN(e,t){if(e==null)return{};var n,r,i=H_e(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 H_e(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 q_e=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ld(n,t),payload:e}]},V_e=x.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:Zl,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ld(o,t),hide:l,type:f,color:r,unit:c,graphicalItemId:h}};return x.createElement(dN,{tooltipEntrySettings:d})}),U7=(e,t)=>"".concat(t,"px ").concat(e,"px");function K_e(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var Y_e=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return U7(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[...K_e(n,i),...o,...d].map(g=>"".concat(g,"px")).join(", ")};function X_e(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=xN(r,L_e),f=Ii(c);return x.createElement(WSe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:o,clipPathId:t})}function G_e(e){var{showLabels:t,children:n,points:r}=e,i=x.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 io(io({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(h7,{value:t?i:void 0},n)}function Y3(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=xN(a,z_e),g=io(io({},Wr(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 x.createElement(x.Fragment,null,(r==null?void 0:r.length)>1&&x.createElement(lN,Qm({shapeType:"curve",option:h},g,{pathRef:n})),x.createElement(X_e,{points:r,clipPathId:t,props:a}))}function W_e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Q_e(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,E=i.current,C=$p(o,"recharts-line-"),j=x.useRef(C),[A,N]=x.useState(!1),O=!A,T=x.useCallback(()=>{typeof w=="function"&&w(),N(!1)},[w]),M=x.useCallback(()=>{typeof S=="function"&&S(),N(!0)},[S]),I=W_e(r.current),z=x.useRef(0);j.current!==C&&(z.current=a.current,j.current=C);var B=z.current;return x.createElement(G_e,{points:o,showLabels:O},n.children,x.createElement(zp,{animationId:C,begin:f,duration:h,isActive:c,easing:d,onAnimationEnd:T,onAnimationStart:M,key:C},L=>{var G=cn(B,I+B,L),F=Math.min(G,I),K;if(c)if(l){var D="".concat(l).split(/[,\s]+/gim).map(V=>parseFloat(V));K=Y_e(F,I,D)}else K=U7(I,F);else K=l==null?void 0:String(l);if(L>0&&I>0&&(i.current=o,a.current=Math.max(a.current,F)),E){var q=E.length/o.length,X=L===1?o:o.map((V,R)=>{var H=Math.floor(R*q);if(E[H]){var U=E[H];return io(io({},V),{},{x:cn(U.x,V.x,L),y:cn(U.y,V.y,L)})}return g?io(io({},V),{},{x:cn(v*2,V.x,L),y:cn(b/2,V.y,L)}):io(io({},V),{},{x:V.x,y:V.y})});return i.current=X,x.createElement(Y3,{props:n,points:X,clipPathId:t,pathRef:r,strokeDasharray:K})}return x.createElement(Y3,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:K})}),x.createElement(iN,{label:n.label}))}function Z_e(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(Q_e,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var J_e=(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:Kt(e.payload,t)}};class eje extends x.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=Ct("recharts-line",i),w=d,{r:S,strokeWidth:E}=I_e(n),C=S7(n),j=S*2+E,A=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return x.createElement(hi,{zIndex:v},x.createElement(ar,{className:b},g&&x.createElement("defs",null,x.createElement(L7,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(w)},x.createElement("rect",{x:c-j/2,y:l-j/2,width:f+j,height:h+j}))),x.createElement(I7,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:J_e,errorBarOffset:0},x.createElement(Z_e,{props:this.props,clipPathId:w}))),x.createElement(gEe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var H7={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:Xn.line,type:"linear"};function tje(e){var t=Wn(e,H7),{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=xN(t,$_e),{needClip:E}=yN(v,b),C=mN(),j=jc(),A=Fr(),N=Re(z=>R_e(z,v,b,A,w));if(j!=="horizontal"&&j!=="vertical"||N==null||C==null)return null;var{height:O,width:T,x:M,y:I}=C;return x.createElement(eje,Qm({},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:N,layout:j,height:O,width:T,left:M,top:I,needClip:E}))}function nje(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=Kt(f,o);if(t==="horizontal"){var g=OI({axis:n,ticks:i,bandSize:l,entry:f,index:h}),v=mn(d)?null:r.scale.map(d);return{x:g,y:v??null,value:d,payload:f}}var b=mn(d)?null:n.scale.map(d),w=OI({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 rje(e){var t=Wn(e,H7),n=Fr();return x.createElement(hN,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(E7,{legendPayload:q_e(t)}),x.createElement(V_e,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(j7,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(tje,Qm({},t,{id:r}))))}var q7=x.memo(rje,zd);q7.displayName="Line";function Ac(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:k7}function Oc(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:k7}var ije="Invariant failed";function aje(e,t){throw new Error(ije)}function pC(){return pC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pC.apply(null,arguments)}function bN(e){return x.createElement(lN,pC({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var oje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Pe(t))return t;var a=Pe(r)||mn(r);return a?t(r,i):(a||aje(),n)}},sje=(e,t,n)=>n,lje=(e,t)=>t,Jp=ue([hb,lje],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),uje=ue([Jp],e=>e==null?void 0:e.maxBarSize),cje=(e,t,n,r)=>r,fje=ue([Tt,hb,Ac,Oc,sje],(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")),dje=(e,t,n)=>{var r=Tt(e),i=Ac(e,t),a=Oc(e,t);if(!(i==null||a==null))return r==="horizontal"?uC(e,"yAxis",a,n):uC(e,"xAxis",i,n)},hje=(e,t)=>{var n=Tt(e),r=Ac(e,t),i=Oc(e,t);if(!(r==null||i==null))return n==="horizontal"?Lz(e,"xAxis",r):Lz(e,"yAxis",i)},mje=ue([fje,nge,hje],vEe),pje=(e,t,n)=>{var r,i,a=Jp(e,t);if(a==null)return 0;var o=Ac(e,t),l=Oc(e,t);if(o==null||l==null)return 0;var c=Tt(e),f=oq(e),{maxBarSize:h}=a,d=mn(h)?f:h,g,v;return c==="horizontal"?(g=ql(e,"xAxis",o,n),v=Hl(e,"xAxis",o,n)):(g=ql(e,"yAxis",l,n),v=Hl(e,"yAxis",l,n)),(r=(i=fd(g,v,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},V7=(e,t,n)=>{var r=Tt(e),i=Ac(e,t),a=Oc(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=ql(e,"xAxis",i,n),l=Hl(e,"xAxis",i,n)):(o=ql(e,"yAxis",a,n),l=Hl(e,"yAxis",a,n)),fd(o,l)}},gje=ue([mje,oq,tge,sq,pje,V7,uje],SEe),vje=(e,t,n)=>{var r=Ac(e,t);if(r!=null)return ql(e,"xAxis",r,n)},yje=(e,t,n)=>{var r=Oc(e,t);if(r!=null)return ql(e,"yAxis",r,n)},xje=(e,t,n)=>{var r=Ac(e,t);if(r!=null)return Hl(e,"xAxis",r,n)},bje=(e,t,n)=>{var r=Oc(e,t);if(r!=null)return Hl(e,"yAxis",r,n)},wje=ue([gje,Jp],_Ee),Sje=ue([dje,Jp],EEe),Eje=ue([or,DA,vje,yje,xje,bje,wje,Tt,Gpe,V7,Sje,Jp,cje],(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,E;if(S!=null&&S.length>0?E=S:E=v==null?void 0:v.slice(b,w+1),E!=null)return Qje({layout:l,barSettings:d,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:E,offset:e,cells:g,dataStartIndex:b})}}),_je=["index"];function gC(){return gC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gC.apply(null,arguments)}function jje(e,t){if(e==null)return{};var n,r,i=Cje(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 Cje(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 K7=x.createContext(void 0),kje=e=>{var t=x.useContext(K7);if(t!=null)return t.stackId;if(e!=null)return Xde(e)},Aje=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Oje=e=>{var t=x.useContext(K7);if(t!=null){var{stackId:n}=t;return"url(#".concat(Aje(n,e),")")}},Y7=e=>{var{index:t}=e,n=jje(e,_je),r=Oje(t);return x.createElement(ar,gC({className:"recharts-bar-stack-layer",clipPath:r},n))},Nje=["onMouseEnter","onMouseLeave","onClick"],Tje=["value","background","tooltipPosition"],Pje=["id"],Mje=["onMouseEnter","onClick","onMouseLeave"];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 X3(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 Kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X3(Object(n),!0).forEach(function(r){Dje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dje(e,t,n){return(t=Rje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rje(e){var t=Ije(e,"string");return typeof t=="symbol"?t:t+""}function Ije(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 $x(e,t){if(e==null)return{};var n,r,i=Lje(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 Lje(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 zje=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ld(n,t),payload:e}]},$je=x.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:Zl,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ld(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:f}};return x.createElement(dN,{tooltipEntrySettings:h})});function Bje(e){var t=Re(Vl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,f=$x(a,Nje),h=uN(o,r,a.id),d=cN(l),g=fN(c,r,a.id);if(!i||n==null)return null;var v=sc(i);return x.createElement(hi,{zIndex:jEe(i,Xn.barBackground)},n.map((b,w)=>{var{value:S,background:E,tooltipPosition:C}=b,j=$x(b,Tje);if(!E)return null;var A=h(b,w),N=d(b,w),O=g(b,w),T=Kr(Kr(Kr(Kr(Kr({option:i,isActive:String(w)===t},j),{},{fill:"#eee"},E),v),Tp(f,b,w)),{},{onMouseEnter:A,onMouseLeave:N,onClick:O,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return x.createElement(bN,Yl({key:"background-bar-".concat(w)},T))}))}function Fje(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 Kr(Kr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return x.createElement(h7,{value:t?i:void 0},n)}function Uje(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=Re(Vl),c=Re(QO),f=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[h,d]=x.useState(!1),[g,v]=x.useState(!1);x.useEffect(()=>{var j;return f?(d(!0),j=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(j)}},[f]);var b=x.useCallback(()=>{f||d(!1)},[f]),w=f&&g,S=f||h,E;f?n===!0?E=t:E=n:E=t;var C=x.createElement(bN,Yl({},r,{name:String(r.name)},i,{isActive:w,option:E,index:a,dataKey:o,onTransitionEnd:b}));return S?x.createElement(hi,{zIndex:Xn.activeBar},x.createElement(Y7,{index:i.originalDataIndex},C)):C}function Hje(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(bN,Yl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function qje(e){var t,{data:n,props:r}=e,i=(t=Ii(r))!==null&&t!==void 0?t:{},{id:a}=i,o=$x(i,Pje),{shape:l,dataKey:c,activeBar:f}=r,{onMouseEnter:h,onClick:d,onMouseLeave:g}=r,v=$x(r,Mje),b=uN(h,c,a),w=cN(g),S=fN(d,c,a);return n?x.createElement(x.Fragment,null,n.map((E,C)=>x.createElement(Y7,Yl({index:E.originalDataIndex,key:"rectangle-".concat(E==null?void 0:E.x,"-").concat(E==null?void 0:E.y,"-").concat(E==null?void 0:E.value,"-").concat(C),className:"recharts-bar-rectangle"},Tp(v,E,C),{onMouseEnter:b(E,C),onMouseLeave:w(E,C),onClick:S(E,C)}),f?x.createElement(Uje,{shape:l,activeBar:f,baseProps:o,entry:E,index:C,dataKey:c}):x.createElement(Hje,{shape:l,baseProps:o,entry:E,index:C,dataKey:c})))):null}function Vje(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=$p(t,"recharts-bar-"),[v,b]=x.useState(!1),w=!v,S=x.useCallback(()=>{typeof f=="function"&&f(),b(!1)},[f]),E=x.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);return x.createElement(Fje,{showLabels:w,rects:r},x.createElement(zp,{animationId:g,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:E,key:g},C=>{var j=C===1?r:r==null?void 0:r.map((A,N)=>{var O=d&&d[N];if(O)return Kr(Kr({},A),{},{x:cn(O.x,A.x,C),y:cn(O.y,A.y,C),width:cn(O.width,A.width,C),height:cn(O.height,A.height,C)});if(i==="horizontal"){var T=cn(0,A.height,C),M=cn(A.stackedBarStart,A.y,C);return Kr(Kr({},A),{},{y:M,height:T})}var I=cn(0,A.width,C),z=cn(A.stackedBarStart,A.x,C);return Kr(Kr({},A),{},{width:I,x:z})});return C>0&&(n.current=j??null),j==null?null:x.createElement(ar,null,x.createElement(qje,{props:t,data:j}))}),x.createElement(iN,{label:t.label}),t.children)}function Kje(e){var t=x.useRef(null);return x.createElement(Vje,{previousRectanglesRef:t,props:e})}var X7=0,Yje=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Kt(e,t)}};class Xje extends x.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=Ct("recharts-bar",i),d=f;return x.createElement(ar,{className:h,id:f},l&&x.createElement("defs",null,x.createElement(L7,{clipPathId:d,xAxisId:a,yAxisId:o})),x.createElement(ar,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},x.createElement(Bje,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),x.createElement(Kje,this.props)))}}var Gje={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:X7,xAxisId:0,yAxisId:0,zIndex:Xn.bar};function Wje(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}=yN(t,n),g=jc(),v=Fr(),b=sN(e.children,Zp),w=Re(C=>Eje(C,e.id,v,b));if(g!=="vertical"&&g!=="horizontal")return null;var S,E=w==null?void 0:w[0];return E==null||E.height==null||E.width==null?S=0:S=g==="vertical"?E.height/2:E.width/2,x.createElement(I7,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:Yje,errorBarOffset:S},x.createElement(Xje,Yl({},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 Qje(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,E=t==="horizontal"?c:l,C=d?E.scale.domain():null,j=Gde({numericAxis:E}),A=E.scale.map(j);return g.map((N,O)=>{var T,M,I,z,B,L;if(d){var G=d[O+S];if(G==null)return null;T=Hde(G,C)}else T=Kt(N,n),Array.isArray(T)||(T=[j,T]);var F=oje(r,X7)(T[1],O);if(t==="horizontal"){var K,D=c.scale.map(T[0]),q=c.scale.map(T[1]);if(D==null||q==null)return null;M=NI({axis:l,ticks:f,bandSize:o,offset:a.offset,entry:N,index:O}),I=(K=q??D)!==null&&K!==void 0?K:void 0,z=a.size;var X=D-q;if(B=po(X)?0:X,L={x:M,y:v.top,width:z,height:v.height},Math.abs(F)>0&&Math.abs(B)<Math.abs(F)){var V=pr(B||F)*(Math.abs(F)-Math.abs(B));I-=V,B+=V}}else{var R=l.scale.map(T[0]),H=l.scale.map(T[1]);if(R==null||H==null)return null;if(M=R,I=NI({axis:c,ticks:h,bandSize:o,offset:a.offset,entry:N,index:O}),z=H-R,B=a.size,L={x:v.left,y:I,width:v.width,height:B},Math.abs(F)>0&&Math.abs(z)<Math.abs(F)){var U=pr(z||F)*(Math.abs(F)-Math.abs(z));z+=U}}if(M==null||I==null||z==null||B==null||!i&&(z===0||B===0))return null;var $=Kr(Kr({},N),{},{stackedBarStart:A,x:M,y:I,width:z,height:B,value:d?T:T[1],payload:N,background:L,tooltipPosition:{x:M+z/2,y:I+B/2},parentViewBox:w,originalDataIndex:O},b&&b[O]&&b[O].props);return $}).filter(Boolean)}function Zje(e){var t=Wn(e,Gje),n=kje(t.stackId),r=Fr();return x.createElement(hN,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(E7,{legendPayload:zje(t)}),x.createElement($je,{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}),x.createElement(j7,{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}),x.createElement(hi,{zIndex:t.zIndex},x.createElement(Wje,Yl({},t,{id:i})))))}var vC=x.memo(Zje,zd);vC.displayName="Bar";var Jje=["domain","range"],eCe=["domain","range"];function G3(e,t){if(e==null)return{};var n,r,i=tCe(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 tCe(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 W3(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 G7(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=G3(e,Jje),{domain:a,range:o}=t,l=G3(t,eCe);return!W3(n,a)||!W3(r,o)?!1:zd(i,l)}var nCe=["type"],rCe=["dangerouslySetInnerHTML","ticks","scale"],iCe=["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 Q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Z3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q3(Object(n),!0).forEach(function(r){aCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aCe(e,t,n){return(t=oCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oCe(e){var t=sCe(e,"string");return typeof t=="symbol"?t:t+""}function sCe(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=lCe(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 lCe(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 uCe(e){var t=Yt(),n=x.useRef(null),r=_H(),{type:i}=e,a=xC(e,nCe),o=nb(r,"xAxis",i),l=x.useMemo(()=>{if(o!=null)return Z3(Z3({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{l!=null&&(n.current===null?t(tEe(l)):n.current!==l&&t(nEe({prev:n.current,next:l})),n.current=l)},[l,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(rEe(n.current)),n.current=null)},[t]),null}var cCe=e=>{var{xAxisId:t,className:n}=e,r=Re(DA),i=Fr(),a="xAxis",o=Re(E=>E9(E,a,t,i)),l=Re(E=>b9(E,t)),c=Re(E=>Fxe(E,t)),f=Re(E=>t9(E,t));if(l==null||c==null||f==null)return null;var{dangerouslySetInnerHTML:h,ticks:d,scale:g}=e,v=xC(e,rCe),{id:b,scale:w}=f,S=xC(f,iCe);return x.createElement(gN,yC({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:Ct("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},fCe={allowDataOverflow:tr.allowDataOverflow,allowDecimals:tr.allowDecimals,allowDuplicatedCategory:tr.allowDuplicatedCategory,angle:tr.angle,axisLine:is.axisLine,height:tr.height,hide:!1,includeHidden:tr.includeHidden,interval:tr.interval,label:!1,minTickGap:tr.minTickGap,mirror:tr.mirror,orientation:tr.orientation,padding:tr.padding,reversed:tr.reversed,scale:tr.scale,tick:tr.tick,tickCount:tr.tickCount,tickLine:is.tickLine,tickSize:is.tickSize,type:tr.type,niceTicks:tr.niceTicks,xAxisId:0},dCe=e=>{var t=Wn(e,fCe);return x.createElement(x.Fragment,null,x.createElement(uCe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(cCe,t))},wN=x.memo(dCe,G7);wN.displayName="XAxis";var hCe=["type"],mCe=["dangerouslySetInnerHTML","ticks","scale"],pCe=["id","scale"];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 J3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function e4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J3(Object(n),!0).forEach(function(r){gCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gCe(e,t,n){return(t=vCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vCe(e){var t=yCe(e,"string");return typeof t=="symbol"?t:t+""}function yCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wC(e,t){if(e==null)return{};var n,r,i=xCe(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 xCe(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 bCe(e){var t=Yt(),n=x.useRef(null),r=_H(),{type:i}=e,a=wC(e,hCe),o=nb(r,"yAxis",i),l=x.useMemo(()=>{if(o!=null)return e4(e4({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{l!=null&&(n.current===null?t(iEe(l)):n.current!==l&&t(aEe({prev:n.current,next:l})),n.current=l)},[l,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(oEe(n.current)),n.current=null)},[t]),null}function wCe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),l=Re(DA),c=Fr(),f=Yt(),h="yAxis",d=Re(O=>w9(O,t)),g=Re(O=>Hxe(O,t)),v=Re(O=>E9(O,h,t,c)),b=Re(O=>n9(O,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!d||rN(i)||x.isValidElement(i)||b==null)){var O=a.current;if(O){var T=O.getCalculatedWidth();Math.round(d.width)!==Math.round(T)&&f(sEe({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:E}=e,C=wC(e,mCe),{id:j,scale:A}=b,N=wC(b,pCe);return x.createElement(gN,bC({},C,N,{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:Ct("recharts-".concat(h," ").concat(h),n),viewBox:l,ticks:v,axisType:h,axisId:t}))}var SCe={allowDataOverflow:nr.allowDataOverflow,allowDecimals:nr.allowDecimals,allowDuplicatedCategory:nr.allowDuplicatedCategory,angle:nr.angle,axisLine:is.axisLine,hide:!1,includeHidden:nr.includeHidden,interval:nr.interval,label:!1,minTickGap:nr.minTickGap,mirror:nr.mirror,orientation:nr.orientation,padding:nr.padding,reversed:nr.reversed,scale:nr.scale,tick:nr.tick,tickCount:nr.tickCount,tickLine:is.tickLine,tickSize:is.tickSize,type:nr.type,niceTicks:nr.niceTicks,width:nr.width,yAxisId:0},ECe=e=>{var t=Wn(e,SCe);return x.createElement(x.Fragment,null,x.createElement(bCe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(wCe,t))},SN=x.memo(ECe,G7);SN.displayName="YAxis";var _Ce=(e,t)=>t,EN=ue([_Ce,Tt,mq,yr,B9,Ps,fbe,or],ybe);function jCe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function _N(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(jCe(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 W7=Li("mouseClick"),Q7=Mp();Q7.startListening({actionCreator:W7,effect:(e,t)=>{var n=e.payload,r=EN(t.getState(),_N(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(a0e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var SC=Li("mouseMove"),Z7=Mp(),wf=null,ju=null,n_=null;Z7.startListening({actionCreator:SC,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"));wf!==null&&(cancelAnimationFrame(wf),wf=null),ju!==null&&(typeof i!="number"||!o)&&(clearTimeout(ju),ju=null),n_=_N(n);var l=()=>{var c=t.getState(),f=VO(c,c.tooltip.settings.shared);if(!n_){wf=null,ju=null;return}if(f==="axis"){var h=EN(c,n_);(h==null?void 0:h.activeIndex)!=null?t.dispatch(T9({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate})):t.dispatch(N9())}wf=null,ju=null};if(!o){l();return}i==="raf"?wf=requestAnimationFrame(l):typeof i=="number"&&ju===null&&(ju=setTimeout(l,i))}});function CCe(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 t4={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},J7=Br({name:"rootProps",initialState:t4,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:t4.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}}}),kCe=J7.reducer,{updateOptions:ACe}=J7.actions,OCe=null,NCe={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)},eV=Br({name:"polarOptions",initialState:OCe,reducers:NCe}),{updatePolarOptions:TCe}=eV.actions,PCe=eV.reducer,tV=Li("keyDown"),nV=Li("focus"),rV=Li("blur"),Sb=Mp(),Sf=null,Cu=null,Jv=null;Sb.startListening({actionCreator:tV,effect:(e,t)=>{Jv=e.payload,Sf!==null&&(cancelAnimationFrame(Sf),Sf=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Cu!==null&&(typeof r!="number"||!a)&&(clearTimeout(Cu),Cu=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:f}=l.tooltip,h=Jv;if(h!=="ArrowRight"&&h!=="ArrowLeft"&&h!=="Enter")return;var d=KO(f,Kd(l),Xp(l),Wp(l)),g=d==null?-1:Number(d);if(!Number.isFinite(g)||g<0)return;var v=Ps(l);if(h==="Enter"){var b=Mx(l,"axis","hover",String(f.index));t.dispatch(Px({active:!f.active,activeIndex:f.index,activeCoordinate:b}));return}var w=Xxe(l),S=w==="left-to-right"?1:-1,E=h==="ArrowRight"?1:-1,C=g+E*S;if(v==null||C>=v.length||C<0)return;var j=Mx(l,"axis","hover",String(C));t.dispatch(Px({active:!0,activeIndex:C.toString(),activeCoordinate:j}))}finally{Sf=null,Cu=null}};if(!a){o();return}r==="raf"?Sf=requestAnimationFrame(o):typeof r=="number"&&Cu===null&&(o(),Jv=null,Cu=setTimeout(()=>{Jv?o():(Cu=null,Sf=null)},r))}});Sb.startListening({actionCreator:nV,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=Mx(n,"axis","hover",String(a));t.dispatch(Px({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Sb.startListening({actionCreator:rV,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Px({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function iV(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 Ji=Li("externalEvent"),aV=Mp(),ey=new Map,rm=new Map,r_=new Map;aV.startListening({actionCreator:Ji,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=iV(r);r_.set(i,{handler:n,reactEvent:a});var o=ey.get(i);o!==void 0&&(cancelAnimationFrame(o),ey.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=rm.get(i);g!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(g),rm.delete(i));var v=()=>{var S=r_.get(i);try{if(!S)return;var{handler:E,reactEvent:C}=S,j=t.getState(),A={activeCoordinate:G0e(j),activeDataKey:QO(j),activeIndex:Vl(j),activeLabel:H9(j),activeTooltipIndex:Vl(j),isTooltipActive:W0e(j)};E&&E(A,C)}finally{ey.delete(i),rm.delete(i),r_.delete(i)}};if(!d){v();return}if(c==="raf"){var b=requestAnimationFrame(v);ey.set(i,b)}else if(typeof c=="number"){if(!rm.has(i)){v();var w=setTimeout(v,c);rm.set(i,w)}}else v()}}});var MCe=ue([qd],e=>e.tooltipItemPayloads),DCe=ue([MCe,(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)}}}),oV=Li("touchMove"),sV=Mp(),ku=null,dl=null,n4=null,im=null;sV.startListening({actionCreator:oV,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){im=iV(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");ku!==null&&(cancelAnimationFrame(ku),ku=null),dl!==null&&(typeof i!="number"||!o)&&(clearTimeout(dl),dl=null),n4=Array.from(n.touches).map(c=>_N({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(im!=null){var c=t.getState(),f=VO(c,c.tooltip.settings.shared);if(f==="axis"){var h,d=(h=n4)===null||h===void 0?void 0:h[0];if(d==null){ku=null,dl=null;return}var g=EN(c,d);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(T9({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,b=im.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(yH),E=(v=w.getAttribute(xH))!==null&&v!==void 0?v:void 0,C=Vd(c).find(N=>N.id===E);if(S==null||C==null||E==null)return;var{dataKey:j}=C,A=DCe(c,S,E);t.dispatch(O9({activeDataKey:j,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:E}))}ku=null,dl=null}};if(!o){l();return}i==="raf"?ku=requestAnimationFrame(l):typeof i=="number"&&dl===null&&(l(),im=null,dl=setTimeout(()=>{im?l():(dl=null,ku=null)},i))}}});var jN={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},lV=Br({name:"eventSettings",initialState:jN,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:RCe}=lV.actions,ICe=lV.reducer,LCe=BU({brush:CEe,cartesianAxis:lEe,chartData:Gbe,errorBars:j_e,eventSettings:ICe,graphicalItems:dSe,layout:zde,legend:Vhe,options:qbe,polarAxis:j1e,polarOptions:PCe,referenceElements:NEe,renderedTicks:YEe,rootProps:kCe,tooltip:o0e,zIndex:Pbe}),zCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ude({reducer:LCe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([Q7.middleware,Z7.middleware,Sb.middleware,aV.middleware,sV.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(tH({type:"raf"}))},devTools:{serialize:{replacer:CCe},name:"recharts-".concat(n)}})};function uV(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Fr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=zCe(t,r));var o=kA;return x.createElement(sme,{context:o,store:a.current},n)}function $Ce(e){var{layout:t,margin:n}=e,r=Yt(),i=Fr();return x.useEffect(()=>{i||(r(Rde(t)),r(Dde(n)))},[r,i,t,n]),null}var cV=x.memo($Ce,zd);function fV(e){var t=Yt();return x.useEffect(()=>{t(ACe(e))},[t,e]),null}var BCe=e=>{var t=Yt();return x.useEffect(()=>{t(RCe(e))},[t,e]),null},dV=x.memo(BCe,zd);function r4(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Yt();return x.useLayoutEffect(()=>(r.current&&i(Nbe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Tbe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function i4(e){var{children:t,isPanorama:n}=e,r=Re(bbe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return x.createElement(x.Fragment,null,i.map(o=>x.createElement(r4,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(r4,{key:o,zIndex:o,isPanorama:n})))}var FCe=["children"];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 Bx(){return Bx=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},Bx.apply(null,arguments)}var qCe={width:"100%",height:"100%",display:"block"},VCe=x.forwardRef((e,t)=>{var n=zA(),r=$A(),i=zH();if(!vo(n)||!vo(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),x.createElement(vA,Bx({},o,{title:l,desc:c,role:h,tabIndex:f,width:n,height:r,style:qCe,ref:t}),a)}),KCe=e=>{var{children:t}=e,n=Re(G0);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(vA,{width:r,height:i,x:o,y:a},t)},a4=x.forwardRef((e,t)=>{var{children:n}=e,r=UCe(e,FCe),i=Fr();return i?x.createElement(KCe,null,x.createElement(i4,{isPanorama:!0},n)):x.createElement(VCe,Bx({ref:t},r),x.createElement(i4,{isPanorama:!1},n))});function YCe(){var e=Yt(),[t,n]=x.useState(null),r=Re(the);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;St(a)&&a!==r&&e(Lde(a))}},[t,e,r]),n}function o4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XCe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o4(Object(n),!0).forEach(function(r){GCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GCe(e,t,n){return(t=WCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WCe(e){var t=QCe(e,"string");return typeof t=="symbol"?t:t+""}function QCe(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 Il(){return Il=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},Il.apply(null,arguments)}var ZCe=()=>(iwe(),null);function Fx(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var JCe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:Fx((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Fx((r=e.style)===null||r===void 0?void 0:r.height)}),l=x.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=x.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:E}=w.contentRect;l(S,E)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,l]);return x.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[l]),x.createElement(x.Fragment,null,x.createElement(Rp,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Il({ref:c},e)))}),eke=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:Fx(n),containerHeight:Fx(r)}),o=x.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=x.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:f,height:h}=c.getBoundingClientRect();o(f,h)}},[t,o]);return x.createElement(x.Fragment,null,x.createElement(Rp,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Il({ref:l},e)))}),tke=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Rp,{width:n,height:r}),x.createElement("div",Il({ref:t},e)))}),nke=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(eke,Il({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(tke,Il({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Rp,{width:n,height:r}),x.createElement("div",Il({ref:t},e)))});function rke(e){return e?JCe:nke}var ike=x.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:E,responsive:C,dispatchTouchEvents:j=!0}=e,A=x.useRef(null),N=Yt(),[O,T]=x.useState(null),[M,I]=x.useState(null),z=YCe(),B=RA(),L=(B==null?void 0:B.width)>0?B.width:E,G=(B==null?void 0:B.height)>0?B.height:i,F=x.useCallback(le=>{z(le),typeof t=="function"&&t(le),T(le),I(le),le!=null&&(A.current=le)},[z,t,T,I]),K=x.useCallback(le=>{N(W7(le)),N(Ji({handler:a,reactEvent:le}))},[N,a]),D=x.useCallback(le=>{N(SC(le)),N(Ji({handler:f,reactEvent:le}))},[N,f]),q=x.useCallback(le=>{N(N9()),N(Ji({handler:h,reactEvent:le}))},[N,h]),X=x.useCallback(le=>{N(SC(le)),N(Ji({handler:d,reactEvent:le}))},[N,d]),V=x.useCallback(()=>{N(nV())},[N]),R=x.useCallback(()=>{N(rV())},[N]),H=x.useCallback(le=>{N(tV(le.key))},[N]),U=x.useCallback(le=>{N(Ji({handler:o,reactEvent:le}))},[N,o]),$=x.useCallback(le=>{N(Ji({handler:l,reactEvent:le}))},[N,l]),Q=x.useCallback(le=>{N(Ji({handler:c,reactEvent:le}))},[N,c]),Z=x.useCallback(le=>{N(Ji({handler:g,reactEvent:le}))},[N,g]),ne=x.useCallback(le=>{N(Ji({handler:w,reactEvent:le}))},[N,w]),te=x.useCallback(le=>{j&&N(oV(le)),N(Ji({handler:b,reactEvent:le}))},[N,j,b]),ie=x.useCallback(le=>{N(Ji({handler:v,reactEvent:le}))},[N,v]),ee=rke(C);return x.createElement(Q9.Provider,{value:O},x.createElement(eU.Provider,{value:M},x.createElement(ee,{width:L??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:Ct("recharts-wrapper",r),style:XCe({position:"relative",cursor:"default",width:L,height:G},S),onClick:K,onContextMenu:U,onDoubleClick:$,onFocus:V,onBlur:R,onKeyDown:H,onMouseDown:Q,onMouseEnter:D,onMouseLeave:q,onMouseMove:X,onMouseUp:Z,onTouchEnd:ie,onTouchMove:te,onTouchStart:ne,ref:F},x.createElement(ZCe,null),n)))}),ake=["width","height","responsive","children","className","style","compact","title","desc"];function oke(e,t){if(e==null)return{};var n,r,i=ske(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 ske(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 hV=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:f,desc:h}=e,d=oke(e,ake),g=Ii(d);return c?x.createElement(x.Fragment,null,x.createElement(Rp,{width:n,height:r}),x.createElement(a4,{otherAttributes:g,title:f,desc:h},a)):x.createElement(ike,{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},x.createElement(a4,{otherAttributes:g,title:f,desc:h,ref:t},x.createElement(PEe,null,a)))});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 s4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s4(Object(n),!0).forEach(function(r){uke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uke(e,t,n){return(t=cke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cke(e){var t=fke(e,"string");return typeof t=="symbol"?t:t+""}function fke(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={top:5,right:5,bottom:5,left:5},hke=lke({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:dke,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},jN),mV=x.forwardRef(function(t,n){var r,i=Wn(t.categoricalChartProps,hke),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:f}=t,h={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return x.createElement(uV,{preloadedState:{options:h},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(O7,{chartData:f.data}),x.createElement(cV,{layout:i.layout,margin:i.margin}),x.createElement(dV,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(fV,{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}),x.createElement(hV,EC({},i,{ref:n})))}),mke=["axis"],pke=x.forwardRef((e,t)=>x.createElement(mV,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:mke,tooltipPayloadSearcher:nN,categoricalChartProps:e,ref:t})),gke=["axis","item"],vke=x.forwardRef((e,t)=>x.createElement(mV,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gke,tooltipPayloadSearcher:nN,categoricalChartProps:e,ref:t}));function yke(e){var t=Yt();return x.useEffect(()=>{t(TCe(e))},[t,e]),null}var xke=["layout"];function _C(){return _C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_C.apply(null,arguments)}function bke(e,t){if(e==null)return{};var n,r,i=wke(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 wke(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 l4(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 Ske(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l4(Object(n),!0).forEach(function(r){Eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eke(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=jke(e,"string");return typeof t=="symbol"?t:t+""}function jke(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 Cke={top:5,right:5,bottom:5,left:5},pV=Ske({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Cke,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},jN),kke=x.forwardRef(function(t,n){var r,i=Wn(t.categoricalChartProps,pV),{layout:a}=i,o=bke(i,xke),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h}=t,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h,eventEmitter:void 0};return x.createElement(uV,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},x.createElement(O7,{chartData:i.data}),x.createElement(cV,{layout:a,margin:i.margin}),x.createElement(dV,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(fV,{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}),x.createElement(yke,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),x.createElement(hV,_C({},o,{ref:n})))});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 c4(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){Ake(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 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=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)}var Tke=["item"],Pke=c4(c4({},pV),{},{layout:"centric",startAngle:0,endAngle:360}),Mke=x.forwardRef((e,t)=>{var n=Wn(e,Pke);return x.createElement(kke,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Tke,tooltipPayloadSearcher:nN,categoricalChartProps:n,ref:t})});function Dke({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(IA,{width:140,height:140,children:m.jsx(Mke,{children:m.jsx(C7,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>m.jsx(Zp,{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 f4(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Rke({data:e}){return e.some(n=>n.total>0)?m.jsx(IA,{width:"100%",height:280,children:m.jsxs(vke,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[m.jsx(vN,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),m.jsx(wN,{dataKey:"date",tickFormatter:f4,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(SN,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(e7,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>f4(String(n))}),m.jsx(IH,{wrapperStyle:{fontSize:12,paddingTop:8}}),m.jsx(vC,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),m.jsx(vC,{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 d4(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ike(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function Lke({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(IA,{width:"100%",height:280,children:m.jsxs(pke,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[m.jsx(vN,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),m.jsx(wN,{dataKey:"date",tickFormatter:d4,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),m.jsx(SN,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),m.jsx(e7,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>d4(String(r)),formatter:r=>[Ike(Number(r)*6e4),"Avg Duration"]}),m.jsx(q7,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const zke=["7d","30d","90d"];function $ke(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function Bke({projectId:e}){const[t,n]=x.useState("30d"),{data:r,isLoading:i}=Cue(e,t);return i?m.jsxs("div",{className:"space-y-4",children:[m.jsx(Tn,{className:"h-8 w-48"}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(Tn,{className:"h-32"}),m.jsx(Tn,{className:"h-32"}),m.jsx(Tn,{className:"h-32"})]}),m.jsx(Tn,{className:"h-72"})]}):r?m.jsxs("div",{className:"space-y-6",children:[m.jsx("div",{className:"flex gap-1",children:zke.map(a=>m.jsx(je,{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(bn,{children:[m.jsx(Kh,{className:"pb-2",children:m.jsx(Yh,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),m.jsxs(wn,{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(bn,{children:[m.jsx(Kh,{className:"pb-2",children:m.jsx(Yh,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),m.jsx(wn,{className:"h-36",children:m.jsx(Dke,{completed:r.completed,failed:r.failed})})]}),m.jsxs(bn,{children:[m.jsx(Kh,{className:"pb-2",children:m.jsx(Yh,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),m.jsxs(wn,{children:[m.jsx("div",{className:"text-3xl font-bold",children:$ke(r.avg_duration_ms)}),m.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),m.jsxs(bn,{children:[m.jsx(Kh,{children:m.jsx(Yh,{className:"text-base",children:"Run Frequency"})}),m.jsx(wn,{children:m.jsx(Rke,{data:r.daily})})]}),m.jsxs(bn,{children:[m.jsx(Kh,{children:m.jsx(Yh,{className:"text-base",children:"Duration Trends"})}),m.jsx(wn,{children:m.jsx(Lke,{data:r.daily})})]})]}):null}function CN({className:e,orientation:t="horizontal",...n}){return m.jsx(die,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Ne("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const Fke=T0("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 kN({className:e,variant:t="default",...n}){return m.jsx(hie,{"data-slot":"tabs-list","data-variant":t,className:Ne(Fke({variant:t}),e),...n})}function Ai({className:e,...t}){return m.jsx(mie,{"data-slot":"tabs-trigger",className:Ne("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 Oi({className:e,...t}){return m.jsx(pie,{"data-slot":"tabs-content",className:Ne("flex-1 outline-none",e),...t})}function Uke(){return m.jsxs("div",{className:"space-y-6",children:[m.jsx(Tn,{className:"h-8 w-48"}),m.jsx(Tn,{className:"h-24 rounded-lg"}),m.jsx(Tn,{className:"h-64 rounded-lg"})]})}function Hke({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=x.useState(!1),[o,l]=x.useState(""),c=x.useRef(null),f=cA(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(nt,{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(je,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:h,"aria-label":"Rename",children:m.jsx(A0,{className:"h-3 w-3"})})]})}function qke({projectId:e,conversationId:t,label:n}){const[r,i]=x.useState(!1),a=NF(e);return r?m.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[m.jsx(je,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):m.jsx(je,{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(bs,{className:"h-3.5 w-3.5"})})}const h4={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function Vke(){var z,B,L;const{projectId:e}=yp(),t=Number(e),n=bo(),r=aA(t),[i,a]=x.useState(1),[o]=x.useState(1),l=Ose(t,i),c=YF(t),f=uA(t,o),h=CF(),[d,g]=x.useState(!1),[v,b]=x.useState(!1),[w,S]=x.useState("conversations"),E=r.isLoading||l.isLoading,C=r.error||l.error;if(E)return m.jsx(Uke,{});if(C)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{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(mo,{className:"h-4 w-4"}),m.jsx("span",{children:"Project not found"})]});const j=r.data,A=l.data,N=(A==null?void 0:A.items)??[],O=(A==null?void 0:A.total)??0,T=A?Math.ceil(A.total/A.per_page):0,M=c.data??[],I=M.reduce((G,F)=>(G[F.type]=(G[F.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(je,{variant:"outline",size:"sm",asChild:!0,children:m.jsxs(Ir,{to:"/projects",children:[m.jsx(Zk,{className:"mr-2 h-4 w-4"}),"Back"]})}),m.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:j.display_name})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs(je,{disabled:!j.dir_exists||h.isPending,onClick:()=>{h.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[m.jsx(k0,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),m.jsxs(je,{variant:"outline",onClick:()=>g(!0),disabled:!j.dir_exists,children:[m.jsx(nA,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),m.jsxs(je,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[m.jsx(C0,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),m.jsx(bn,{children:m.jsx(wn,{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:[j.working_dir,j.dir_exists?m.jsx(Bt,{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(Bt,{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(j.created_at).toLocaleString()}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),m.jsx("dd",{children:M.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(I).map(([G,F])=>m.jsxs(Bt,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[F," ",F===1?h4[G]??G:`${h4[G]??G}s`]},G))})})]})})}),m.jsx(tue,{projectId:t,open:d,onOpenChange:g}),m.jsx(pA,{open:v,onOpenChange:b,projectId:t}),m.jsxs(CN,{value:w,onValueChange:S,children:[m.jsxs(kN,{children:[m.jsxs(Ai,{value:"conversations",children:["Conversations (",((z=f.data)==null?void 0:z.total)??0,")"]}),m.jsxs(Ai,{value:"sessions",children:["Sessions (",O,")"]}),m.jsx(Ai,{value:"activity",children:"Activity"}),m.jsxs(Ai,{value:"resources",children:["Resources (",M.length,")"]}),m.jsx(Ai,{value:"files",children:"Files"})]}),m.jsx(Oi,{value:"sessions",className:"mt-4 space-y-3",children:O===0?m.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):m.jsxs(m.Fragment,{children:[m.jsx(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsx(Ej,{sessions:N})})}),m.jsx(Zle,{page:i,totalPages:T,onPageChange:a})]})}),m.jsx(Oi,{value:"conversations",className:"mt-4 space-y-3",children:(((B=f.data)==null?void 0:B.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(bn,{children:m.jsx(wn,{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:(((L=f.data)==null?void 0:L.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(Hke,{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(qke,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),m.jsx(Oi,{value:"activity",className:"mt-4",children:m.jsx(Bke,{projectId:t})}),m.jsx(Oi,{value:"resources",className:"mt-4",children:m.jsx(_ue,{projectId:t,installOpen:v,onInstallOpenChange:b})}),m.jsx(Oi,{value:"files",className:"mt-4",children:m.jsx(rue,{projectId:t})})]})]})}function Qn(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=Qn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Kke={value:()=>{}};function Eb(){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 Cy(n)}function Cy(e){this._=e}function Yke(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}})}Cy.prototype=Eb.prototype={constructor:Cy,on:function(e,t){var n=this._,r=Yke(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Xke(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]=m4(n[i],e.name,t);else if(t==null)for(i in n)n[i]=m4(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 Cy(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 Xke(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function m4(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Kke,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var jC="http://www.w3.org/1999/xhtml";const p4={svg:"http://www.w3.org/2000/svg",xhtml:jC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _b(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),p4.hasOwnProperty(t)?{space:p4[t],local:e}:e}function Gke(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===jC&&t.documentElement.namespaceURI===jC?t.createElement(e):t.createElementNS(n,e)}}function Wke(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gV(e){var t=_b(e);return(t.local?Wke:Gke)(t)}function Qke(){}function AN(e){return e==null?Qke:function(){return this.querySelector(e)}}function Zke(e){typeof e!="function"&&(e=AN(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 $i(r,this._parents)}function Jke(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function eAe(){return[]}function vV(e){return e==null?eAe:function(){return this.querySelectorAll(e)}}function tAe(e){return function(){return Jke(e.apply(this,arguments))}}function nAe(e){typeof e=="function"?e=tAe(e):e=vV(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 $i(r,i)}function yV(e){return function(){return this.matches(e)}}function xV(e){return function(t){return t.matches(e)}}var rAe=Array.prototype.find;function iAe(e){return function(){return rAe.call(this.children,e)}}function aAe(){return this.firstElementChild}function oAe(e){return this.select(e==null?aAe:iAe(typeof e=="function"?e:xV(e)))}var sAe=Array.prototype.filter;function lAe(){return Array.from(this.children)}function uAe(e){return function(){return sAe.call(this.children,e)}}function cAe(e){return this.selectAll(e==null?lAe:uAe(typeof e=="function"?e:xV(e)))}function fAe(e){typeof e!="function"&&(e=yV(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 $i(r,this._parents)}function bV(e){return new Array(e.length)}function dAe(){return new $i(this._enter||this._groups.map(bV),this._parents)}function Ux(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ux.prototype={constructor:Ux,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 hAe(e){return function(){return e}}function mAe(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 Ux(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function pAe(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 Ux(e,a[l]);for(l=0;l<h;++l)(c=t[l])&&f.get(g[l])===c&&(i[l]=c)}function gAe(e){return e.__data__}function vAe(e,t){if(!arguments.length)return Array.from(this,gAe);var n=t?pAe:mAe,r=this._parents,i=this._groups;typeof e!="function"&&(e=hAe(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=yAe(e.call(h,h&&h.__data__,f,r)),b=v.length,w=l[f]=new Array(b),S=o[f]=new Array(b),E=c[f]=new Array(g);n(h,d,w,S,E,v,t);for(var C=0,j=0,A,N;C<b;++C)if(A=w[C]){for(C>=j&&(j=C+1);!(N=S[j])&&++j<b;);A._next=N||null}}return o=new $i(o,r),o._enter=l,o._exit=c,o}function yAe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xAe(){return new $i(this._exit||this._groups.map(bV),this._parents)}function bAe(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 wAe(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 $i(l,this._parents)}function SAe(){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 EAe(e){e||(e=_Ae);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 $i(i,this._parents).order()}function _Ae(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function jAe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function CAe(){return Array.from(this)}function kAe(){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 AAe(){let e=0;for(const t of this)++e;return e}function OAe(){return!this.node()}function NAe(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 TAe(e){return function(){this.removeAttribute(e)}}function PAe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function MAe(e,t){return function(){this.setAttribute(e,t)}}function DAe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function RAe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function IAe(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 LAe(e,t){var n=_b(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?PAe:TAe:typeof t=="function"?n.local?IAe:RAe:n.local?DAe:MAe)(n,t))}function wV(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zAe(e){return function(){this.style.removeProperty(e)}}function $Ae(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BAe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function FAe(e,t,n){return arguments.length>1?this.each((t==null?zAe:typeof t=="function"?BAe:$Ae)(e,t,n??"")):vd(this.node(),e)}function vd(e,t){return e.style.getPropertyValue(t)||wV(e).getComputedStyle(e,null).getPropertyValue(t)}function UAe(e){return function(){delete this[e]}}function HAe(e,t){return function(){this[e]=t}}function qAe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function VAe(e,t){return arguments.length>1?this.each((t==null?UAe:typeof t=="function"?qAe:HAe)(e,t)):this.node()[e]}function SV(e){return e.trim().split(/^|\s+/)}function ON(e){return e.classList||new EV(e)}function EV(e){this._node=e,this._names=SV(e.getAttribute("class")||"")}EV.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 _V(e,t){for(var n=ON(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function jV(e,t){for(var n=ON(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function KAe(e){return function(){_V(this,e)}}function YAe(e){return function(){jV(this,e)}}function XAe(e,t){return function(){(t.apply(this,arguments)?_V:jV)(this,e)}}function GAe(e,t){var n=SV(e+"");if(arguments.length<2){for(var r=ON(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?XAe:t?KAe:YAe)(n,t))}function WAe(){this.textContent=""}function QAe(e){return function(){this.textContent=e}}function ZAe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function JAe(e){return arguments.length?this.each(e==null?WAe:(typeof e=="function"?ZAe:QAe)(e)):this.node().textContent}function eOe(){this.innerHTML=""}function tOe(e){return function(){this.innerHTML=e}}function nOe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function rOe(e){return arguments.length?this.each(e==null?eOe:(typeof e=="function"?nOe:tOe)(e)):this.node().innerHTML}function iOe(){this.nextSibling&&this.parentNode.appendChild(this)}function aOe(){return this.each(iOe)}function oOe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sOe(){return this.each(oOe)}function lOe(e){var t=typeof e=="function"?e:gV(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function uOe(){return null}function cOe(e,t){var n=typeof e=="function"?e:gV(e),r=t==null?uOe:typeof t=="function"?t:AN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fOe(){var e=this.parentNode;e&&e.removeChild(this)}function dOe(){return this.each(fOe)}function hOe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mOe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pOe(e){return this.select(e?mOe:hOe)}function gOe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vOe(e){return function(t){e.call(this,t,this.__data__)}}function yOe(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 xOe(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 bOe(e,t,n){return function(){var r=this.__on,i,a=vOe(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 wOe(e,t,n){var r=yOe(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?bOe:xOe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function CV(e,t,n){var r=wV(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 SOe(e,t){return function(){return CV(this,e,t)}}function EOe(e,t){return function(){return CV(this,e,t.apply(this,arguments))}}function _Oe(e,t){return this.each((typeof t=="function"?EOe:SOe)(e,t))}function*jOe(){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 kV=[null];function $i(e,t){this._groups=e,this._parents=t}function eg(){return new $i([[document.documentElement]],kV)}function COe(){return this}$i.prototype=eg.prototype={constructor:$i,select:Zke,selectAll:nAe,selectChild:oAe,selectChildren:cAe,filter:fAe,data:vAe,enter:dAe,exit:xAe,join:bAe,merge:wAe,selection:COe,order:SAe,sort:EAe,call:jAe,nodes:CAe,node:kAe,size:AAe,empty:OAe,each:NAe,attr:LAe,style:FAe,property:VAe,classed:GAe,text:JAe,html:rOe,raise:aOe,lower:sOe,append:lOe,insert:cOe,remove:dOe,clone:pOe,datum:gOe,on:wOe,dispatch:_Oe,[Symbol.iterator]:jOe};function Ti(e){return typeof e=="string"?new $i([[document.querySelector(e)]],[document.documentElement]):new $i([[e]],kV)}function kOe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sa(e,t){if(e=kOe(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 AOe={passive:!1},Zm={capture:!0,passive:!1};function i_(e){e.stopImmediatePropagation()}function Hf(e){e.preventDefault(),e.stopImmediatePropagation()}function AV(e){var t=e.document.documentElement,n=Ti(e).on("dragstart.drag",Hf,Zm);"onselectstart"in t?n.on("selectstart.drag",Hf,Zm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function OV(e,t){var n=e.document.documentElement,r=Ti(e).on("dragstart.drag",null);t&&(r.on("click.drag",Hf,Zm),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 ty=e=>()=>e;function CC(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}})}CC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function OOe(e){return!e.ctrlKey&&!e.button}function NOe(){return this.parentNode}function TOe(e,t){return t??{x:e.x,y:e.y}}function POe(){return navigator.maxTouchPoints||"ontouchstart"in this}function NV(){var e=OOe,t=NOe,n=TOe,r=POe,i={},a=Eb("start","drag","end"),o=0,l,c,f,h,d=0;function g(A){A.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",E,AOe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(A,N){if(!(h||!e.call(this,A,N))){var O=j(this,t.call(this,A,N),A,N,"mouse");O&&(Ti(A.view).on("mousemove.drag",b,Zm).on("mouseup.drag",w,Zm),AV(A.view),i_(A),f=!1,l=A.clientX,c=A.clientY,O("start",A))}}function b(A){if(Hf(A),!f){var N=A.clientX-l,O=A.clientY-c;f=N*N+O*O>d}i.mouse("drag",A)}function w(A){Ti(A.view).on("mousemove.drag mouseup.drag",null),OV(A.view,f),Hf(A),i.mouse("end",A)}function S(A,N){if(e.call(this,A,N)){var O=A.changedTouches,T=t.call(this,A,N),M=O.length,I,z;for(I=0;I<M;++I)(z=j(this,T,A,N,O[I].identifier,O[I]))&&(i_(A),z("start",A,O[I]))}}function E(A){var N=A.changedTouches,O=N.length,T,M;for(T=0;T<O;++T)(M=i[N[T].identifier])&&(Hf(A),M("drag",A,N[T]))}function C(A){var N=A.changedTouches,O=N.length,T,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),T=0;T<O;++T)(M=i[N[T].identifier])&&(i_(A),M("end",A,N[T]))}function j(A,N,O,T,M,I){var z=a.copy(),B=Sa(I||O,N),L,G,F;if((F=n.call(A,new CC("beforestart",{sourceEvent:O,target:g,identifier:M,active:o,x:B[0],y:B[1],dx:0,dy:0,dispatch:z}),T))!=null)return L=F.x-B[0]||0,G=F.y-B[1]||0,function K(D,q,X){var V=B,R;switch(D){case"start":i[M]=K,R=o++;break;case"end":delete i[M],--o;case"drag":B=Sa(X||q,N),R=o;break}z.call(D,A,new CC(D,{sourceEvent:q,subject:F,target:g,identifier:M,active:R,x:B[0]+L,y:B[1]+G,dx:B[0]-V[0],dy:B[1]-V[1],dispatch:z}),T)}}return g.filter=function(A){return arguments.length?(e=typeof A=="function"?A:ty(!!A),g):e},g.container=function(A){return arguments.length?(t=typeof A=="function"?A:ty(A),g):t},g.subject=function(A){return arguments.length?(n=typeof A=="function"?A:ty(A),g):n},g.touchable=function(A){return arguments.length?(r=typeof A=="function"?A:ty(!!A),g):r},g.on=function(){var A=a.on.apply(a,arguments);return A===a?g:A},g.clickDistance=function(A){return arguments.length?(d=(A=+A)*A,g):Math.sqrt(d)},g}var yd=0,ym=0,am=0,TV=1e3,Hx,xm,qx=0,vc=0,jb=0,Jm=typeof performance=="object"&&performance.now?performance:Date,PV=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function NN(){return vc||(PV(MOe),vc=Jm.now()+jb)}function MOe(){vc=0}function Vx(){this._call=this._time=this._next=null}Vx.prototype=MV.prototype={constructor:Vx,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?NN():+n)+(t==null?0:+t),!this._next&&xm!==this&&(xm?xm._next=this:Hx=this,xm=this),this._call=e,this._time=n,kC()},stop:function(){this._call&&(this._call=null,this._time=1/0,kC())}};function MV(e,t,n){var r=new Vx;return r.restart(e,t,n),r}function DOe(){NN(),++yd;for(var e=Hx,t;e;)(t=vc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yd}function g4(){vc=(qx=Jm.now())+jb,yd=ym=0;try{DOe()}finally{yd=0,IOe(),vc=0}}function ROe(){var e=Jm.now(),t=e-qx;t>TV&&(jb-=t,qx=e)}function IOe(){for(var e,t=Hx,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:Hx=n);xm=e,kC(r)}function kC(e){if(!yd){ym&&(ym=clearTimeout(ym));var t=e-vc;t>24?(e<1/0&&(ym=setTimeout(g4,e-Jm.now()-jb)),am&&(am=clearInterval(am))):(am||(qx=Jm.now(),am=setInterval(ROe,TV)),yd=1,PV(g4))}}function v4(e,t,n){var r=new Vx;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var LOe=Eb("start","end","cancel","interrupt"),zOe=[],DV=0,y4=1,AC=2,ky=3,x4=4,OC=5,Ay=6;function Cb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;$Oe(e,n,{name:t,index:r,group:i,on:LOe,tween:zOe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:DV})}function TN(e,t){var n=qa(e,t);if(n.state>DV)throw new Error("too late; already scheduled");return n}function Eo(e,t){var n=qa(e,t);if(n.state>ky)throw new Error("too late; already running");return n}function qa(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function $Oe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=MV(a,0,n.time);function a(f){n.state=y4,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!==y4)return c();for(h in r)if(v=r[h],v.name===n.name){if(v.state===ky)return v4(o);v.state===x4?(v.state=Ay,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[h]):+h<t&&(v.state=Ay,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[h])}if(v4(function(){n.state===ky&&(n.state=x4,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=AC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===AC){for(n.state=ky,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=OC,1),d=-1,g=i.length;++d<g;)i[d].call(e,h);n.state===OC&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ay,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Oy(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>AC&&r.state<OC,r.state=Ay,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function BOe(e){return this.each(function(){Oy(this,e)})}function FOe(e,t){var n,r;return function(){var i=Eo(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 UOe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Eo(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 HOe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=qa(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?FOe:UOe)(n,e,t))}function PN(e,t,n){var r=e._id;return e.each(function(){var i=Eo(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return qa(i,r).value[t]}}function RV(e,t){var n;return(typeof t=="number"?Ea:t instanceof pc?Ex:(n=pc(t))?(t=n,Ex):_q)(e,t)}function qOe(e){return function(){this.removeAttribute(e)}}function VOe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function KOe(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 YOe(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 XOe(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 GOe(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 WOe(e,t){var n=_b(e),r=n==="transform"?Wge:RV;return this.attrTween(e,typeof t=="function"?(n.local?GOe:XOe)(n,r,PN(this,"attr."+e,t)):t==null?(n.local?VOe:qOe)(n):(n.local?YOe:KOe)(n,r,t))}function QOe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ZOe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function JOe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&ZOe(e,a)),n}return i._value=t,i}function eNe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&QOe(e,a)),n}return i._value=t,i}function tNe(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=_b(e);return this.tween(n,(r.local?JOe:eNe)(r,t))}function nNe(e,t){return function(){TN(this,e).delay=+t.apply(this,arguments)}}function rNe(e,t){return t=+t,function(){TN(this,e).delay=t}}function iNe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nNe:rNe)(t,e)):qa(this.node(),t).delay}function aNe(e,t){return function(){Eo(this,e).duration=+t.apply(this,arguments)}}function oNe(e,t){return t=+t,function(){Eo(this,e).duration=t}}function sNe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?aNe:oNe)(t,e)):qa(this.node(),t).duration}function lNe(e,t){if(typeof t!="function")throw new Error;return function(){Eo(this,e).ease=t}}function uNe(e){var t=this._id;return arguments.length?this.each(lNe(t,e)):qa(this.node(),t).ease}function cNe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Eo(this,e).ease=n}}function fNe(e){if(typeof e!="function")throw new Error;return this.each(cNe(this._id,e))}function dNe(e){typeof e!="function"&&(e=yV(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 ys(r,this._parents,this._name,this._id)}function hNe(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 ys(o,this._parents,this._name,this._id)}function mNe(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 pNe(e,t,n){var r,i,a=mNe(t)?TN:Eo;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function gNe(e,t){var n=this._id;return arguments.length<2?qa(this.node(),n).on.on(e):this.each(pNe(n,e,t))}function vNe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yNe(){return this.on("end.remove",vNe(this._id))}function xNe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=AN(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,Cb(f[g],t,n,g,f,qa(h,n)));return new ys(a,this._parents,t,n)}function bNe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vV(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=qa(h,n),w=0,S=g.length;w<S;++w)(v=g[w])&&Cb(v,t,n,w,g,b);a.push(g),o.push(h)}return new ys(a,o,t,n)}var wNe=eg.prototype.constructor;function SNe(){return new wNe(this._groups,this._parents)}function ENe(e,t){var n,r,i;return function(){var a=vd(this,e),o=(this.style.removeProperty(e),vd(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function IV(e){return function(){this.style.removeProperty(e)}}function _Ne(e,t,n){var r,i=n+"",a;return function(){var o=vd(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function jNe(e,t,n){var r,i,a;return function(){var o=vd(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),vd(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function CNe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=Eo(this,e),f=c.on,h=c.value[a]==null?l||(l=IV(t)):void 0;(f!==n||i!==h)&&(r=(n=f).copy()).on(o,i=h),c.on=r}}function kNe(e,t,n){var r=(e+="")=="transform"?Gge:RV;return t==null?this.styleTween(e,ENe(e,r)).on("end.style."+e,IV(e)):typeof t=="function"?this.styleTween(e,jNe(e,r,PN(this,"style."+e,t))).each(CNe(this._id,e)):this.styleTween(e,_Ne(e,r,t),n).on("end.style."+e,null)}function ANe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ONe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&ANe(e,o,n)),r}return a._value=t,a}function NNe(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,ONe(e,t,n??""))}function TNe(e){return function(){this.textContent=e}}function PNe(e){return function(){var t=e(this);this.textContent=t??""}}function MNe(e){return this.tween("text",typeof e=="function"?PNe(PN(this,"text",e)):TNe(e==null?"":e+""))}function DNe(e){return function(t){this.textContent=e.call(this,t)}}function RNe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&DNe(i)),t}return r._value=e,r}function INe(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,RNe(e))}function LNe(){for(var e=this._name,t=this._id,n=LV(),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=qa(c,t);Cb(c,e,n,f,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ys(r,this._parents,e,n)}function zNe(){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=Eo(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 $Ne=0;function ys(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function LV(){return++$Ne}var Vo=eg.prototype;ys.prototype={constructor:ys,select:xNe,selectAll:bNe,selectChild:Vo.selectChild,selectChildren:Vo.selectChildren,filter:dNe,merge:hNe,selection:SNe,transition:LNe,call:Vo.call,nodes:Vo.nodes,node:Vo.node,size:Vo.size,empty:Vo.empty,each:Vo.each,on:gNe,attr:WOe,attrTween:tNe,style:kNe,styleTween:NNe,text:MNe,textTween:INe,remove:yNe,tween:HOe,delay:iNe,duration:sNe,ease:uNe,easeVarying:fNe,end:zNe,[Symbol.iterator]:Vo[Symbol.iterator]};function BNe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var FNe={time:null,delay:0,duration:250,ease:BNe};function UNe(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 HNe(e){var t,n;e instanceof ys?(t=e._id,e=e._name):(t=LV(),(n=FNe).time=NN(),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])&&Cb(c,e,t,f,o,n||UNe(c,t));return new ys(r,this._parents,e,t)}eg.prototype.interrupt=BOe;eg.prototype.transition=HNe;const ny=e=>()=>e;function qNe(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 ts(e,t,n){this.k=e,this.x=t,this.y=n}ts.prototype={constructor:ts,scale:function(e){return e===1?this:new ts(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ts(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 ts(1,0,0);zV.prototype=ts.prototype;function zV(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kb;return e.__zoom}function a_(e){e.stopImmediatePropagation()}function om(e){e.preventDefault(),e.stopImmediatePropagation()}function VNe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function KNe(){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 b4(){return this.__zoom||kb}function YNe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function XNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function GNe(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 $V(){var e=VNe,t=KNe,n=GNe,r=YNe,i=XNe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ey,f=Eb("start","zoom","end"),h,d,g,v=500,b=150,w=0,S=10;function E(F){F.property("__zoom",b4).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",B).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(F,K,D,q){var X=F.selection?F.selection():F;X.property("__zoom",b4),F!==X?N(F,K,D,q):X.interrupt().each(function(){O(this,arguments).event(q).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},E.scaleBy=function(F,K,D,q){E.scaleTo(F,function(){var X=this.__zoom.k,V=typeof K=="function"?K.apply(this,arguments):K;return X*V},D,q)},E.scaleTo=function(F,K,D,q){E.transform(F,function(){var X=t.apply(this,arguments),V=this.__zoom,R=D==null?A(X):typeof D=="function"?D.apply(this,arguments):D,H=V.invert(R),U=typeof K=="function"?K.apply(this,arguments):K;return n(j(C(V,U),R,H),X,o)},D,q)},E.translateBy=function(F,K,D,q){E.transform(F,function(){return n(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,q)},E.translateTo=function(F,K,D,q,X){E.transform(F,function(){var V=t.apply(this,arguments),R=this.__zoom,H=q==null?A(V):typeof q=="function"?q.apply(this,arguments):q;return n(kb.translate(H[0],H[1]).scale(R.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof D=="function"?-D.apply(this,arguments):-D),V,o)},q,X)};function C(F,K){return K=Math.max(a[0],Math.min(a[1],K)),K===F.k?F:new ts(K,F.x,F.y)}function j(F,K,D){var q=K[0]-D[0]*F.k,X=K[1]-D[1]*F.k;return q===F.x&&X===F.y?F:new ts(F.k,q,X)}function A(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function N(F,K,D,q){F.on("start.zoom",function(){O(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,V=arguments,R=O(X,V).event(q),H=t.apply(X,V),U=D==null?A(H):typeof D=="function"?D.apply(X,V):D,$=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=X.__zoom,Z=typeof K=="function"?K.apply(X,V):K,ne=c(Q.invert(U).concat($/Q.k),Z.invert(U).concat($/Z.k));return function(te){if(te===1)te=Z;else{var ie=ne(te),ee=$/ie[2];te=new ts(ee,U[0]-ie[0]*ee,U[1]-ie[1]*ee)}R.zoom(null,te)}})}function O(F,K,D){return!D&&F.__zooming||new T(F,K)}function T(F,K){this.that=F,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(F,K),this.taps=0}T.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,K){return this.mouse&&F!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var K=Ti(this.that).datum();f.call(F,this.that,new qNe(F,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:f}),K)}};function M(F,...K){if(!e.apply(this,arguments))return;var D=O(this,K).event(F),q=this.__zoom,X=Math.max(a[0],Math.min(a[1],q.k*Math.pow(2,r.apply(this,arguments)))),V=Sa(F);if(D.wheel)(D.mouse[0][0]!==V[0]||D.mouse[0][1]!==V[1])&&(D.mouse[1]=q.invert(D.mouse[0]=V)),clearTimeout(D.wheel);else{if(q.k===X)return;D.mouse=[V,q.invert(V)],Oy(this),D.start()}om(F),D.wheel=setTimeout(R,b),D.zoom("mouse",n(j(C(q,X),D.mouse[0],D.mouse[1]),D.extent,o));function R(){D.wheel=null,D.end()}}function I(F,...K){if(g||!e.apply(this,arguments))return;var D=F.currentTarget,q=O(this,K,!0).event(F),X=Ti(F.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),V=Sa(F,D),R=F.clientX,H=F.clientY;AV(F.view),a_(F),q.mouse=[V,this.__zoom.invert(V)],Oy(this),q.start();function U(Q){if(om(Q),!q.moved){var Z=Q.clientX-R,ne=Q.clientY-H;q.moved=Z*Z+ne*ne>w}q.event(Q).zoom("mouse",n(j(q.that.__zoom,q.mouse[0]=Sa(Q,D),q.mouse[1]),q.extent,o))}function $(Q){X.on("mousemove.zoom mouseup.zoom",null),OV(Q.view,q.moved),om(Q),q.event(Q).end()}}function z(F,...K){if(e.apply(this,arguments)){var D=this.__zoom,q=Sa(F.changedTouches?F.changedTouches[0]:F,this),X=D.invert(q),V=D.k*(F.shiftKey?.5:2),R=n(j(C(D,V),q,X),t.apply(this,K),o);om(F),l>0?Ti(this).transition().duration(l).call(N,R,q,F):Ti(this).call(E.transform,R,q,F)}}function B(F,...K){if(e.apply(this,arguments)){var D=F.touches,q=D.length,X=O(this,K,F.changedTouches.length===q).event(F),V,R,H,U;for(a_(F),R=0;R<q;++R)H=D[R],U=Sa(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,V=!0,X.taps=1+!!h);h&&(h=clearTimeout(h)),V&&(X.taps<2&&(d=U[0],h=setTimeout(function(){h=null},v)),Oy(this),X.start())}}function L(F,...K){if(this.__zooming){var D=O(this,K).event(F),q=F.changedTouches,X=q.length,V,R,H,U;for(om(F),V=0;V<X;++V)R=q[V],H=Sa(R,this),D.touch0&&D.touch0[2]===R.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===R.identifier&&(D.touch1[0]=H);if(R=D.that.__zoom,D.touch1){var $=D.touch0[0],Q=D.touch0[1],Z=D.touch1[0],ne=D.touch1[1],te=(te=Z[0]-$[0])*te+(te=Z[1]-$[1])*te,ie=(ie=ne[0]-Q[0])*ie+(ie=ne[1]-Q[1])*ie;R=C(R,Math.sqrt(te/ie)),H=[($[0]+Z[0])/2,($[1]+Z[1])/2],U=[(Q[0]+ne[0])/2,(Q[1]+ne[1])/2]}else if(D.touch0)H=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(j(R,H,U),D.extent,o))}}function G(F,...K){if(this.__zooming){var D=O(this,K).event(F),q=F.changedTouches,X=q.length,V,R;for(a_(F),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),V=0;V<X;++V)R=q[V],D.touch0&&D.touch0[2]===R.identifier?delete D.touch0:D.touch1&&D.touch1[2]===R.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(R=Sa(R,this),Math.hypot(d[0]-R[0],d[1]-R[1])<S)){var H=Ti(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return E.wheelDelta=function(F){return arguments.length?(r=typeof F=="function"?F:ny(+F),E):r},E.filter=function(F){return arguments.length?(e=typeof F=="function"?F:ny(!!F),E):e},E.touchable=function(F){return arguments.length?(i=typeof F=="function"?F:ny(!!F),E):i},E.extent=function(F){return arguments.length?(t=typeof F=="function"?F:ny([[+F[0][0],+F[0][1]],[+F[1][0],+F[1][1]]]),E):t},E.scaleExtent=function(F){return arguments.length?(a[0]=+F[0],a[1]=+F[1],E):[a[0],a[1]]},E.translateExtent=function(F){return arguments.length?(o[0][0]=+F[0][0],o[1][0]=+F[1][0],o[0][1]=+F[0][1],o[1][1]=+F[1][1],E):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},E.constrain=function(F){return arguments.length?(n=F,E):n},E.duration=function(F){return arguments.length?(l=+F,E):l},E.interpolate=function(F){return arguments.length?(c=F,E):c},E.on=function(){var F=f.on.apply(f,arguments);return F===f?E:F},E.clickDistance=function(F){return arguments.length?(w=(F=+F)*F,E):Math.sqrt(w)},E.tapDistance=function(F){return arguments.length?(S=+F,E):S},E}const xo={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."},ep=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],BV=["Enter"," ","Escape"],FV={"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 xd;(function(e){e.Strict="strict",e.Loose="loose"})(xd||(xd={}));var Zu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zu||(Zu={}));var tp;(function(e){e.Partial="partial",e.Full="full"})(tp||(tp={}));const UV={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Sl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Sl||(Sl={}));var bd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(bd||(bd={}));var He;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(He||(He={}));const w4={[He.Left]:He.Right,[He.Right]:He.Left,[He.Top]:He.Bottom,[He.Bottom]:He.Top};function HV(e){return e===null?null:e?"valid":"invalid"}const qV=e=>"id"in e&&"source"in e&&"target"in e,WNe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),MN=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),tg=(e,t=[0,0])=>{const{width:n,height:r}=Ms(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},QNe=(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):MN(i)?i:t.nodeLookup.get(i.id));const l=o?Kx(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ab(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ob(n)},ng=(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=Ab(n,Kx(i)),r=!0)}),r?Ob(n):{x:0,y:0,width:0,height:0}},DN=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...ig(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=np(l,Sd(f)),S=(v??0)*(b??0),E=a&&w>0;(!f.internals.handleBounds||E||w>=S||f.dragging)&&c.push(f)}return c},ZNe=(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 JNe(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 eTe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=JNe(e,o),c=ng(l),f=RN(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 VV({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",xo.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(d=[[c,f],[c+v,f+b]])}else l&&Ed(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=Ed(d)?yc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",xo.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 tTe({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=ZNe(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 wd=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),yc=(e={x:0,y:0},t,n)=>({x:wd(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:wd(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function KV(e,t,n){const{width:r,height:i}=Ms(n),{x:a,y:o}=n.internals.positionAbsolute;return yc(e,[[a,o],[a+r,o+i]],t)}const S4=(e,t,n)=>e<t?wd(Math.abs(e-t),1,t)/t:e>n?-wd(Math.abs(e-n),1,t)/t:0,YV=(e,t,n=15,r=40)=>{const i=S4(e.x,r,t.width-r)*n,a=S4(e.y,r,t.height-r)*n;return[i,a]},Ab=(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)}),NC=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ob=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Sd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=MN(e)?e.internals.positionAbsolute:tg(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}},Kx=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=MN(e)?e.internals.positionAbsolute:tg(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)}},XV=(e,t)=>Ob(Ab(NC(e),NC(t))),np=(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)},E4=e=>ka(e.width)&&ka(e.height)&&ka(e.x)&&ka(e.y),ka=e=>!isNaN(e)&&isFinite(e),nTe=(e,t)=>{},rg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ig=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?rg(l,o):l},Yx=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Ef(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 rTe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ef(e,n),i=Ef(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Ef(e.top??e.y??0,n),i=Ef(e.bottom??e.y??0,n),a=Ef(e.left??e.x??0,t),o=Ef(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 iTe(e,t,n,r,i,a){const{x:o,y:l}=Yx(e,[t,n,r]),{x:c,y:f}=Yx({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 RN=(e,t,n,r,i,a)=>{const o=rTe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),h=wd(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=iTe(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}},rp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ed(e){return e!=null&&e!=="parent"}function Ms(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 GV(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 WV(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 _4(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function aTe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function oTe(e){return{...FV,...e||{}}}function wm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Aa(e),l=ig({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?rg(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const IN=e=>({width:e.offsetWidth,height:e.offsetHeight}),QV=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},sTe=["INPUT","SELECT","TEXTAREA"];function ZV(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:sTe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const JV=e=>"clientX"in e,Aa=(e,t)=>{var a,o;const n=JV(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)}},j4=(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,...IN(o)}})};function eK({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 ry(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function C4({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case He.Left:return[t-ry(t-r,a),n];case He.Right:return[t+ry(r-t,a),n];case He.Top:return[t,n-ry(n-i,a)];case He.Bottom:return[t,n+ry(i-n,a)]}}function tK({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:i,targetPosition:a=He.Top,curvature:o=.25}){const[l,c]=C4({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,h]=C4({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,g,v,b]=eK({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 nK({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 lTe({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 uTe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Ab(Kx(e),Kx(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 np(o,Ob(a))>0}const cTe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,fTe=(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)),dTe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||cTe;let i;return qV(e)?i={...e}:i={...e,id:r(e)},fTe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function rK({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=nK({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const k4={[He.Left]:{x:-1,y:0},[He.Right]:{x:1,y:0},[He.Top]:{x:0,y:-1},[He.Bottom]:{x:0,y:1}},hTe=({source:e,sourcePosition:t=He.Bottom,target:n})=>t===He.Left||t===He.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},A4=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function mTe({source:e,sourcePosition:t=He.Bottom,target:n,targetPosition:r=He.Top,center:i,offset:a,stepPosition:o}){const l=k4[t],c=k4[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=hTe({source:f,sourcePosition:t,target:h}),g=d.x!==0?"x":"y",v=d[g];let b=[],w,S;const E={x:0,y:0},C={x:0,y:0},[,,j,A]=nK({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 O=[{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"?O:T:b=g==="x"?T:O}else{const O=[{x:f.x,y:h.y}],T=[{x:h.x,y:f.y}];if(g==="x"?b=l.x===v?T:O:b=l.y===v?O:T,t===r){const L=Math.abs(e[g]-n[g]);if(L<=a){const G=Math.min(a-1,a-L);l[g]===v?E[g]=(f[g]>e[g]?-1:1)*G:C[g]=(h[g]>n[g]?-1:1)*G}}if(t!==r){const L=g==="x"?"y":"x",G=l[g]===c[L],F=f[L]>h[L],K=f[L]<h[L];(l[g]===1&&(!G&&F||G&&K)||l[g]!==1&&(!G&&K||G&&F))&&(b=g==="x"?O:T)}const M={x:f.x+E.x,y:f.y+E.y},I={x:h.x+C.x,y:h.y+C.y},z=Math.max(Math.abs(M.x-b[0].x),Math.abs(I.x-b[0].x)),B=Math.max(Math.abs(M.y-b[0].y),Math.abs(I.y-b[0].y));z>=B?(w=(M.x+I.x)/2,S=b[0].y):(w=b[0].x,S=(M.y+I.y)/2)}return[[e,{x:f.x+E.x,y:f.y+E.y},...b,{x:h.x+C.x,y:h.y+C.y},n],w,S,j,A]}function pTe(e,t,n,r){const i=Math.min(A4(e,t)/2,A4(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 TC({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:i,targetPosition:a=He.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20,stepPosition:h=.5}){const[d,g,v,b,w]=mTe({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((E,C,j)=>{let A="";return j>0&&j<d.length-1?A=pTe(d[j-1],C,d[j+1],o):A=`${j===0?"M":"L"}${C.x} ${C.y}`,E+=A,E},""),g,v,b,w]}function O4(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function gTe(e){var d;const{sourceNode:t,targetNode:n}=e;if(!O4(t)||!O4(n))return null;const r=t.internals.handleBounds||N4(t.handles),i=n.internals.handleBounds||N4(n.handles),a=T4((r==null?void 0:r.source)??[],e.sourceHandle),o=T4(e.connectionMode===xd.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",xo.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||He.Bottom,c=(o==null?void 0:o.position)||He.Top,f=xc(t,a,l),h=xc(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function N4(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 xc(e,t,n=He.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??Ms(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case He.Top:return{x:i+o/2,y:a};case He.Right:return{x:i+o,y:a+l/2};case He.Bottom:return{x:i+o/2,y:a+l};case He.Left:return{x:i,y:a+l/2}}}function T4(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function PC(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function vTe(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=PC(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 iK=1e3,yTe=10,LN={nodeOrigin:[0,0],nodeExtent:ep,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xTe={...LN,checkEquality:!0};function zN(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function bTe(e,t,n){const r=zN(LN,n);for(const i of e.values())if(i.parentId)BN(i,e,t,r);else{const a=tg(i,r.nodeOrigin),o=Ed(i.extent)?i.extent:r.nodeExtent,l=yc(a,o,Ms(i));i.internals.positionAbsolute=l}}function wTe(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 $N(e){return e==="manual"}function MC(e,t,n,r={}){var f,h;const i=zN(xTe,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!$N(i.zIndexMode)?iK: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=tg(d,i.nodeOrigin),b=Ed(d.extent)?d.extent:i.nodeExtent,w=yc(v,b,Ms(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:wTe(d,g),z:aK(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&&BN(g,t,n,r,a)}return c}function STe(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 BN(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=zN(LN,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}STe(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*yTe),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const d=a&&!$N(c)?iK:0,{x:g,y:v,z:b}=ETe(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 aK(e,t,n){const r=ka(e.zIndex)?e.zIndex:0;return $N(n)?r:r+(e.selected?t:0)}function ETe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Ms(e),f=tg(e,n),h=Ed(e.extent)?yc(f,e.extent,c):f;let d=yc({x:o+h.x,y:l+h.y},r,c);e.extent==="parent"&&(d=KV(d,c,t));const g=aK(e,i,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=g?v+1:g}}function FN(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)??Sd(c),h=XV(f,l.rect);a.set(l.parentId,{expandedRect:h,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var j;const h=c.internals.positionAbsolute,d=Ms(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)),E=(w-d.width)*g[0],C=(S-d.height)*g[1];(v>0||b>0||E||C)&&(i.push({id:f,type:"position",position:{x:c.position.x-v+E,y:c.position.y-b+C}}),(j=n.get(f))==null||j.forEach(A=>{e.some(N=>N.id===A.id)||i.push({id:A.id,type:"position",position:{x:A.position.x+v,y:A.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-E:0),height:S+(b?g[1]*b-C:0)}})}),i}function _Te(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=IN(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(),j=Ed(b.extent)?b.extent:a;let{positionAbsolute:A}=b.internals;b.parentId&&b.extent==="parent"?A=KV(A,w,t.get(b.parentId)):j&&(A=yc(A,j,w));const N={...b,measured:w,internals:{...b.internals,positionAbsolute:A,handleBounds:{source:j4("source",v.nodeElement,C,d,b.id),target:j4("target",v.nodeElement,C,d,b.id)}}};t.set(b.id,N),b.parentId&&BN(N,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:Sd(N,i)}))}}if(g.length>0){const v=FN(g,t,n,i);f.push(...v)}return{changes:f,updatedInternals:c}}async function jTe({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 P4(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 oK(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}`;P4("source",c,h,e,i,o),P4("target",c,f,e,a,l),t.set(r.id,r)}}function sK(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:sK(n,t):!1}function M4(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 CTe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!sK(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 o_({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 kTe({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=rg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function ATe({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:j,domNode:A,isSelectable:N,nodeId:O,nodeClickDistance:T=0}){g=Ti(A);function M({x:L,y:G}){const{nodeLookup:F,nodeExtent:K,snapGrid:D,snapToGrid:q,nodeOrigin:X,onNodeDrag:V,onSelectionDrag:R,onError:H,updateNodePositions:U}=t();a={x:L,y:G};let $=!1;const Q=l.size>1,Z=Q&&K?NC(ng(l)):null,ne=Q&&q?kTe({dragItems:l,snapGrid:D,x:L,y:G}):null;for(const[te,ie]of l){if(!F.has(te))continue;let ee={x:L-ie.distance.x,y:G-ie.distance.y};q&&(ee=ne?{x:Math.round(ee.x+ne.x),y:Math.round(ee.y+ne.y)}:rg(ee,D));let le=null;if(Q&&K&&!ie.extent&&Z){const{positionAbsolute:be}=ie.internals,we=be.x-Z.x+K[0][0],Le=be.x+ie.measured.width-Z.x2+K[1][0],Oe=be.y-Z.y+K[0][1],Xe=be.y+ie.measured.height-Z.y2+K[1][1];le=[[we,Oe],[Le,Xe]]}const{position:pe,positionAbsolute:ae}=VV({nodeId:te,nextPosition:ee,nodeLookup:F,nodeExtent:le||K,nodeOrigin:X,onError:H});$=$||ie.position.x!==pe.x||ie.position.y!==pe.y,ie.position=pe,ie.internals.positionAbsolute=ae}if(b=b||$,!!$&&(U(l,!0),w&&(r||V||!O&&R))){const[te,ie]=o_({nodeId:O,dragItems:l,nodeLookup:F});r==null||r(w,l,te,ie),V==null||V(w,te,ie),O||R==null||R(w,ie)}}async function I(){if(!h)return;const{transform:L,panBy:G,autoPanSpeed:F,autoPanOnNodeDrag:K}=t();if(!K){c=!1,cancelAnimationFrame(o);return}const[D,q]=YV(f,h,F);(D!==0||q!==0)&&(a.x=(a.x??0)-D/L[2],a.y=(a.y??0)-q/L[2],await G({x:D,y:q})&&M(a)),o=requestAnimationFrame(I)}function z(L){var Q;const{nodeLookup:G,multiSelectionActive:F,nodesDraggable:K,transform:D,snapGrid:q,snapToGrid:X,selectNodesOnDrag:V,onNodeDragStart:R,onSelectionDragStart:H,unselectNodesAndEdges:U}=t();d=!0,(!V||!N)&&!F&&O&&((Q=G.get(O))!=null&&Q.selected||U()),N&&V&&O&&(e==null||e(O));const $=wm(L.sourceEvent,{transform:D,snapGrid:q,snapToGrid:X,containerBounds:h});if(a=$,l=CTe(G,K,$,O),l.size>0&&(n||R||!O&&H)){const[Z,ne]=o_({nodeId:O,dragItems:l,nodeLookup:G});n==null||n(L.sourceEvent,l,Z,ne),R==null||R(L.sourceEvent,Z,ne),O||H==null||H(L.sourceEvent,ne)}}const B=NV().clickDistance(T).on("start",L=>{const{domNode:G,nodeDragThreshold:F,transform:K,snapGrid:D,snapToGrid:q}=t();h=(G==null?void 0:G.getBoundingClientRect())||null,v=!1,b=!1,w=L.sourceEvent,F===0&&z(L),a=wm(L.sourceEvent,{transform:K,snapGrid:D,snapToGrid:q,containerBounds:h}),f=Aa(L.sourceEvent,h)}).on("drag",L=>{const{autoPanOnNodeDrag:G,transform:F,snapGrid:K,snapToGrid:D,nodeDragThreshold:q,nodeLookup:X}=t(),V=wm(L.sourceEvent,{transform:F,snapGrid:K,snapToGrid:D,containerBounds:h});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||O&&!X.has(O))&&(v=!0),!v){if(!c&&G&&d&&(c=!0,I()),!d){const R=Aa(L.sourceEvent,h),H=R.x-f.x,U=R.y-f.y;Math.sqrt(H*H+U*U)>q&&z(L)}(a.x!==V.xSnapped||a.y!==V.ySnapped)&&l&&d&&(f=Aa(L.sourceEvent,h),M(V))}}).on("end",L=>{if(!(!d||v)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:G,updateNodePositions:F,onNodeDragStop:K,onSelectionDragStop:D}=t();if(b&&(F(l,!1),b=!1),i||K||!O&&D){const[q,X]=o_({nodeId:O,dragItems:l,nodeLookup:G,dragging:!1});i==null||i(L.sourceEvent,l,q,X),K==null||K(L.sourceEvent,q,X),O||D==null||D(L.sourceEvent,X)}}}).filter(L=>{const G=L.target;return!L.button&&(!C||!M4(G,`.${C}`,A))&&(!j||M4(G,j,A))});g.call(B)}function E(){g==null||g.on(".drag",null)}return{update:S,destroy:E}}function OTe(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())np(i,Sd(a))>0&&r.push(a);return r}const NTe=250;function TTe(e,t,n,r){var l,c;let i=[],a=1/0;const o=OTe(e,n,t+NTe);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}=xc(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 lK(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,...xc(o,c,c.position,!0)}:c}function uK(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function PTe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const cK=()=>!0;function MTe(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:E=cK,onReconnectEnd:C,updateConnection:j,getTransform:A,getFromHandle:N,autoPanSpeed:O,dragThreshold:T=1,handleDomNode:M}){const I=QV(e.target);let z=0,B;const{x:L,y:G}=Aa(e),F=uK(a,M),K=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!K||!F)return;const q=lK(i,F,r,c,t);if(!q)return;let X=Aa(e,K),V=!1,R=null,H=!1,U=null;function $(){if(!h||!K)return;const[pe,ae]=YV(X,K,O);g({x:pe,y:ae}),z=requestAnimationFrame($)}const Q={...q,nodeId:i,type:F,position:q.position},Z=c.get(i);let te={inProgress:!0,isValid:null,from:xc(Z,Q,He.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:X,toHandle:null,toPosition:w4[Q.position],toNode:null,pointer:X};function ie(){D=!0,j(te),b==null||b(e,{nodeId:i,handleId:r,handleType:F})}T===0&&ie();function ee(pe){if(!D){const{x:Xe,y:Ke}=Aa(pe),tt=Xe-L,sn=Ke-G;if(!(tt*tt+sn*sn>T*T))return;ie()}if(!N()||!Q){le(pe);return}const ae=A();X=Aa(pe,K),B=TTe(ig(X,ae,!1,[1,1]),n,c,Q),V||($(),V=!0);const be=fK(pe,{handle:B,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:E,doc:I,lib:f,flowId:d,nodeLookup:c});U=be.handleDomNode,R=be.connection,H=PTe(!!B,be.isValid);const we=c.get(i),Le=we?xc(we,Q,He.Left,!0):te.from,Oe={...te,from:Le,isValid:H,to:be.toHandle&&H?Yx({x:be.toHandle.x,y:be.toHandle.y},ae):X,toHandle:be.toHandle,toPosition:H&&be.toHandle?be.toHandle.position:w4[Q.position],toNode:be.toHandle?c.get(be.toHandle.nodeId):null,pointer:X};j(Oe),te=Oe}function le(pe){if(!("touches"in pe&&pe.touches.length>0)){if(D){(B||U)&&R&&H&&(w==null||w(R));const{inProgress:ae,...be}=te,we={...be,toPosition:te.toHandle?te.toPosition:null};S==null||S(pe,we),a&&(C==null||C(pe,we))}v(),cancelAnimationFrame(z),V=!1,H=!1,R=null,U=null,I.removeEventListener("mousemove",ee),I.removeEventListener("mouseup",le),I.removeEventListener("touchmove",ee),I.removeEventListener("touchend",le)}}I.addEventListener("mousemove",ee),I.addEventListener("mouseup",le),I.addEventListener("touchmove",ee),I.addEventListener("touchend",le)}function fK(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=cK,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}=Aa(e),w=o.elementFromPoint(v,b),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,E={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=uK(void 0,S),j=S.getAttribute("data-nodeid"),A=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),O=S.classList.contains("connectableend");if(!j||!C)return E;const T={source:d?j:r,sourceHandle:d?A:i,target:d?r:j,targetHandle:d?i:A};E.connection=T;const I=N&&O&&(n===xd.Strict?d&&C==="source"||!d&&C==="target":j!==r||A!==i);E.isValid=I&&f(T),E.toHandle=lK(j,C,A,h,n,!0)}return E}const DC={onPointerDown:MTe,isValid:fK};function DTe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Ti(e);function a({translateExtent:l,width:c,height:f,zoomStep:h=1,pannable:d=!0,zoomable:g=!0,inversePan:v=!1}){const b=j=>{if(j.sourceEvent.type!=="wheel"||!t)return;const A=n(),N=j.sourceEvent.ctrlKey&&rp()?10:1,O=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*h,T=A[2]*Math.pow(2,O*N);t.scaleTo(T)};let w=[0,0];const S=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(w=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},E=j=>{const A=n();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!t)return;const N=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],O=[N[0]-w[0],N[1]-w[1]];w=N;const T=r()*Math.max(A[2],Math.log(A[2]))*(v?-1:1),M={x:A[0]-O[0]*T,y:A[1]-O[1]*T},I=[[0,0],[c,f]];t.setViewportConstrained({x:M.x,y:M.y,zoom:A[2]},I,l)},C=$V().on("start",S).on("zoom",d?E:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:Sa}}const Nb=e=>({x:e.x,y:e.y,zoom:e.k}),s_=({x:e,y:t,zoom:n})=>kb.translate(e,t).scale(n),Mf=(e,t)=>e.target.closest(`.${t}`),dK=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),RTe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,l_=(e,t=0,n=RTe,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},hK=e=>{const t=e.ctrlKey&&rp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ITe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return h=>{if(Mf(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=Sa(h),E=hK(h),C=d*Math.pow(2,E);r.scaleTo(n,C,S,h);return}const g=h.deltaMode===1?20:1;let v=i===Zu.Vertical?0:h.deltaX*g,b=i===Zu.Horizontal?0:h.deltaY*g;!rp()&&h.shiftKey&&i!==Zu.Vertical&&(v=h.deltaY*g,b=0),r.translateBy(n,-(v/d)*a,-(b/d)*a,{internal:!0});const w=Nb(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 LTe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Mf(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function zTe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Nb(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 $Te({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&dK(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,Nb(a.transform)))}}function BTe({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&&dK(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=Nb(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function FTe({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"&&(Mf(d,`${f}-flow__node`)||Mf(d,`${f}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||h&&!b||Mf(d,l)&&b||Mf(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 UTe({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=$V().scaleExtent([t,n]).translateExtent(r),g=Ti(e).call(d);C({x:i.x,y:i.y,zoom:wd(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");d.wheelDelta(hK);function w(B,L){return g?new Promise(G=>{d==null||d.interpolate((L==null?void 0:L.interpolate)==="linear"?rs:Ey).transform(l_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function S({noWheelClassName:B,noPanClassName:L,onPaneContextMenu:G,userSelectionActive:F,panOnScroll:K,panOnDrag:D,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:V,zoomOnPinch:R,zoomOnScroll:H,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:Z,connectionInProgress:ne,paneClickDistance:te,selectionOnDrag:ie}){F&&!f.isZoomingOrPanning&&E();const ee=K&&!$&&!F;d.clickDistance(ie?1/0:!ka(te)||te<0?0:te);const le=ee?ITe({zoomPanValues:f,noWheelClassName:B,d3Selection:g,d3Zoom:d,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:R,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):LTe({noWheelClassName:B,preventScrolling:V,d3ZoomHandler:v});if(g.on("wheel.zoom",le,{passive:!1}),!F){const ae=zTe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});d.on("start",ae);const be=$Te({zoomPanValues:f,panOnDrag:D,onPaneContextMenu:!!G,onPanZoom:a,onTransformChange:Z});d.on("zoom",be);const we=BTe({zoomPanValues:f,panOnDrag:D,panOnScroll:K,onPaneContextMenu:G,onPanZoomEnd:l,onDraggingChange:c});d.on("end",we)}const pe=FTe({zoomActivationKeyPressed:$,panOnDrag:D,zoomOnScroll:H,panOnScroll:K,zoomOnDoubleClick:U,zoomOnPinch:R,userSelectionActive:F,noPanClassName:L,noWheelClassName:B,lib:Q,connectionInProgress:ne});d.filter(pe),U?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function E(){d.on("zoom",null)}async function C(B,L,G){const F=s_(B),K=d==null?void 0:d.constrain()(F,L,G);return K&&await w(K),new Promise(D=>D(K))}async function j(B,L){const G=s_(B);return await w(G,L),new Promise(F=>F(G))}function A(B){if(g){const L=s_(B),G=g.property("__zoom");(G.k!==B.zoom||G.x!==B.x||G.y!==B.y)&&(d==null||d.transform(g,L,null,{sync:!0}))}}function N(){const B=g?zV(g.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function O(B,L){return g?new Promise(G=>{d==null||d.interpolate((L==null?void 0:L.interpolate)==="linear"?rs:Ey).scaleTo(l_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function T(B,L){return g?new Promise(G=>{d==null||d.interpolate((L==null?void 0:L.interpolate)==="linear"?rs:Ey).scaleBy(l_(g,L==null?void 0:L.duration,L==null?void 0:L.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function M(B){d==null||d.scaleExtent(B)}function I(B){d==null||d.translateExtent(B)}function z(B){const L=!ka(B)||B<0?0:B;d==null||d.clickDistance(L)}return{update:S,destroy:E,setViewport:j,setViewportConstrained:C,getViewport:N,scaleTo:O,scaleBy:T,setScaleExtent:M,setTranslateExtent:I,syncViewport:A,setClickDistance:z}}var _d;(function(e){e.Line="line",e.Handle="handle"})(_d||(_d={}));function HTe({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 D4(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 hl(e,t){return Math.max(0,t-e)}function ml(e,t){return Math.max(0,e-t)}function iy(e,t,n){return Math.max(0,t-e,e-n)}function R4(e,t){return e?!t:t}function qTe(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:E,maxHeight:C}=r,{x:j,y:A,width:N,height:O,aspectRatio:T}=e;let M=Math.floor(h?v-e.pointerX:0),I=Math.floor(d?b-e.pointerY:0);const z=N+(c?-M:M),B=O+(f?-I:I),L=-a[0]*N,G=-a[1]*O;let F=iy(z,w,S),K=iy(B,E,C);if(o){let X=0,V=0;c&&M<0?X=hl(j+M+L,o[0][0]):!c&&M>0&&(X=ml(j+z+L,o[1][0])),f&&I<0?V=hl(A+I+G,o[0][1]):!f&&I>0&&(V=ml(A+B+G,o[1][1])),F=Math.max(F,X),K=Math.max(K,V)}if(l){let X=0,V=0;c&&M>0?X=ml(j+M,l[0][0]):!c&&M<0&&(X=hl(j+z,l[1][0])),f&&I>0?V=ml(A+I,l[0][1]):!f&&I<0&&(V=hl(A+B,l[1][1])),F=Math.max(F,X),K=Math.max(K,V)}if(i){if(h){const X=iy(z/T,E,C)*T;if(F=Math.max(F,X),o){let V=0;!c&&!f||c&&!f&&g?V=ml(A+G+z/T,o[1][1])*T:V=hl(A+G+(c?M:-M)/T,o[0][1])*T,F=Math.max(F,V)}if(l){let V=0;!c&&!f||c&&!f&&g?V=hl(A+z/T,l[1][1])*T:V=ml(A+(c?M:-M)/T,l[0][1])*T,F=Math.max(F,V)}}if(d){const X=iy(B*T,w,S)/T;if(K=Math.max(K,X),o){let V=0;!c&&!f||f&&!c&&g?V=ml(j+B*T+L,o[1][0])/T:V=hl(j+(f?I:-I)*T+L,o[0][0])/T,K=Math.max(K,V)}if(l){let V=0;!c&&!f||f&&!c&&g?V=hl(j+B*T,l[1][0])/T:V=ml(j+(f?I:-I)*T,l[0][0])/T,K=Math.max(K,V)}}}I=I+(I<0?K:-K),M=M+(M<0?F:-F),i&&(g?z>B*T?I=(R4(c,f)?-M:M)/T:M=(R4(c,f)?-I:I)*T:h?(I=M/T,f=c):(M=I*T,c=f));const D=c?j+M:j,q=f?A+I:A;return{width:N+(c?-M:M),height:O+(f?-I:I),x:a[0]*M*(c?-1:1)+D,y:a[1]*I*(f?-1:1)+q}}const mK={width:0,height:0,x:0,y:0},VTe={...mK,pointerX:0,pointerY:0,aspectRatio:1};function KTe(e){return[[0,0],[e.measured.width,e.measured.height]]}function YTe(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 XTe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Ti(e);let o={controlDirection:D4("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 E={...mK},C={...VTe};o={boundaries:h,resizeDirection:g,keepAspectRatio:d,controlDirection:D4(f)};let j,A=null,N=[],O,T,M,I=!1;const z=NV().on("start",B=>{const{nodeLookup:L,transform:G,snapGrid:F,snapToGrid:K,nodeOrigin:D,paneDomNode:q}=n();if(j=L.get(t),!j)return;A=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:X,ySnapped:V}=wm(B.sourceEvent,{transform:G,snapGrid:F,snapToGrid:K,containerBounds:A});E={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},C={...E,pointerX:X,pointerY:V,aspectRatio:E.width/E.height},O=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(O=L.get(j.parentId),T=O&&j.extent==="parent"?KTe(O):void 0),N=[],M=void 0;for(const[R,H]of L)if(H.parentId===t&&(N.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const U=YTe(H,j,H.origin??D);M?M=[[Math.min(U[0][0],M[0][0]),Math.min(U[0][1],M[0][1])],[Math.max(U[1][0],M[1][0]),Math.max(U[1][1],M[1][1])]]:M=U}v==null||v(B,{...E})}).on("drag",B=>{const{transform:L,snapGrid:G,snapToGrid:F,nodeOrigin:K}=n(),D=wm(B.sourceEvent,{transform:L,snapGrid:G,snapToGrid:F,containerBounds:A}),q=[];if(!j)return;const{x:X,y:V,width:R,height:H}=E,U={},$=j.origin??K,{width:Q,height:Z,x:ne,y:te}=qTe(C,o.controlDirection,D,o.boundaries,o.keepAspectRatio,$,T,M),ie=Q!==R,ee=Z!==H,le=ne!==X&&ie,pe=te!==V&&ee;if(!le&&!pe&&!ie&&!ee)return;if((le||pe||$[0]===1||$[1]===1)&&(U.x=le?ne:E.x,U.y=pe?te:E.y,E.x=U.x,E.y=U.y,N.length>0)){const Le=ne-X,Oe=te-V;for(const Xe of N)Xe.position={x:Xe.position.x-Le+$[0]*(Q-R),y:Xe.position.y-Oe+$[1]*(Z-H)},q.push(Xe)}if((ie||ee)&&(U.width=ie&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:E.width,U.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:E.height,E.width=U.width,E.height=U.height),O&&j.expandParent){const Le=$[0]*(U.width??0);U.x&&U.x<Le&&(E.x=Le,C.x=C.x-(U.x-Le));const Oe=$[1]*(U.height??0);U.y&&U.y<Oe&&(E.y=Oe,C.y=C.y-(U.y-Oe))}const ae=HTe({width:E.width,prevWidth:R,height:E.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),be={...E,direction:ae};(S==null?void 0:S(B,be))!==!1&&(I=!0,b==null||b(B,be),r(U,q))}).on("end",B=>{I&&(w==null||w(B,{...E}),i==null||i({...E}),I=!1)});a.call(z)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const GTe={},I4=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:()=>{(GTe?"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},WTe=e=>e?I4(e):I4,{useDebugValue:QTe}=_e,{useSyncExternalStoreWithSelector:ZTe}=mfe,JTe=e=>e;function pK(e,t=JTe,n){const r=ZTe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return QTe(r),r}const L4=(e,t)=>{const n=WTe(e),r=(i,a=t)=>pK(n,i,a);return Object.assign(r,n),r},e2e=(e,t)=>e?L4(e,t):L4;function pn(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 Tb=x.createContext(null),t2e=Tb.Provider,gK=xo.error001();function jt(e,t){const n=x.useContext(Tb);if(n===null)throw new Error(gK);return pK(n,e,t)}function gn(){const e=x.useContext(Tb);if(e===null)throw new Error(gK);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const z4={display:"none"},n2e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vK="react-flow__node-desc",yK="react-flow__edge-desc",r2e="react-flow__aria-live",i2e=e=>e.ariaLiveMessage,a2e=e=>e.ariaLabelConfig;function o2e({rfId:e}){const t=jt(i2e);return m.jsx("div",{id:`${r2e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:n2e,children:t})}function s2e({rfId:e,disableKeyboardA11y:t}){const n=jt(a2e);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${vK}-${e}`,style:z4,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${yK}-${e}`,style:z4,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(o2e,{rfId:e})]})}const Pb=x.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return m.jsx("div",{className:Qn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});Pb.displayName="Panel";function l2e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Pb,{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 u2e=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}},ay=e=>e.id;function c2e(e,t){return pn(e.selectedNodes.map(ay),t.selectedNodes.map(ay))&&pn(e.selectedEdges.map(ay),t.selectedEdges.map(ay))}function f2e({onSelectionChange:e}){const t=gn(),{selectedNodes:n,selectedEdges:r}=jt(u2e,c2e);return x.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const d2e=e=>!!e.onSelectionChangeHandlers;function h2e({onSelectionChange:e}){const t=jt(d2e);return e||t?m.jsx(f2e,{onSelectionChange:e}):null}const xK=[0,0],m2e={x:0,y:0,zoom:1},p2e=["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"],$4=[...p2e,"rfId"],g2e=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}),B4={translateExtent:ep,nodeOrigin:xK,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function v2e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=jt(g2e,pn),f=gn();x.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=B4,l()}),[]);const h=x.useRef(B4);return x.useEffect(()=>{for(const d of $4){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:oTe(g)}):d==="fitView"?f.setState({fitViewQueued:g}):d==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[d]:g})))}h.current=e},$4.map(d=>e[d])),null}function F4(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function y2e(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const i=F4(),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=F4())!=null&&r.matches?"dark":"light"}const U4=typeof document<"u"?document:null;function ip(e=null,t={target:U4,actInsideInputWithModifier:!0}){const[n,r]=x.useState(!1),i=x.useRef(!1),a=x.useRef(new Set([])),[o,l]=x.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 x.useEffect(()=>{const c=(t==null?void 0:t.target)??U4,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=v=>{var S,E;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!f)&&ZV(v))return!1;const w=q4(v.code,l);if(a.current.add(v[w]),H4(o,a.current,!1)){const C=((E=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:E[0])||v.target,j=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!j)&&v.preventDefault(),r(!0)}},d=v=>{const b=q4(v.code,l);H4(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 H4(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function q4(e,t){return t.includes(e)?"code":"key"}const x2e=()=>{const e=gn();return x.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,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=RN(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 ig(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=Yx(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function bK(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)b2e(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 b2e(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 w2e(e,t){return bK(e,t)}function S2e(e,t){return bK(e,t)}function Mu(e,t){return{id:e,type:"select",selected:t}}function Df(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(Mu(a.id,o)))}return r}function V4({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 K4(e){return{id:e.id,type:"remove"}}const Y4=e=>WNe(e),E2e=e=>qV(e);function wK(e){return x.forwardRef(e)}const _2e=typeof window<"u"?x.useLayoutEffect:x.useEffect;function X4(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>j2e(()=>n(i=>i+BigInt(1))));return _2e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function j2e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const SK=x.createContext(null);function C2e({children:e}){const t=gn(),n=x.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:h,onNodesChange:d,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=c;for(const E of l)w=typeof E=="function"?E(w):E;let S=V4({items:w,lookup:g});for(const E of b.values())S=E(S);h&&f(w),S.length>0?d==null||d(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:C,setNodes:j}=t.getState();E&&j(C)})},[]),r=X4(n),i=x.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(V4({items:v,lookup:g}))},[]),a=X4(i),o=x.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return m.jsx(SK.Provider,{value:o,children:e})}function k2e(){const e=x.useContext(SK);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const A2e=e=>!!e.panZoom;function Mb(){const e=x2e(),t=gn(),n=k2e(),r=jt(A2e),i=x.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var E,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=Y4(d)?d:g.get(d.id),w=b.parentId?WV(b.position,b.measured,b.parentId,g,v):b.position,S={...b,position:w,width:((E=b.measured)==null?void 0:E.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return Sd(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&&Y4(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&&E2e(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(E=>({...E})),edges:g.map(E=>({...E})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:E,triggerEdgeChanges:C,onDelete:j,onBeforeDelete:A}=t.getState(),{nodes:N,edges:O}=await tTe({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:A}),T=O.length>0,M=N.length>0;if(T){const I=O.map(K4);S==null||S(O),C(I)}if(M){const I=N.map(K4);w==null||w(N),E(I)}return(M||T)&&(j==null||j({nodes:N,edges:O})),{deletedNodes:N,deletedEdges:O}},getIntersectingNodes:(d,g=!0,v)=>{const b=E4(d),w=b?d:c(d),S=v!==void 0;return w?(v||t.getState().nodes).filter(E=>{const C=t.getState().nodeLookup.get(E.id);if(C&&!b&&(E.id===d.id||!C.internals.positionAbsolute))return!1;const j=Sd(S?E:C),A=np(j,w);return g&&A>0||A>=j.width*j.height||A>=w.width*w.height}):[]},isNodeIntersecting:(d,g,v=!0)=>{const w=E4(d)?d:c(d);if(!w)return!1;const S=np(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 QNe(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??aTe();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return x.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const G4=e=>e.selected,O2e=typeof window<"u"?window:void 0;function N2e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=gn(),{deleteElements:r}=Mb(),i=ip(e,{actInsideInputWithModifier:!1}),a=ip(t,{target:O2e});x.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(G4),edges:o.filter(G4)}),n.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function T2e(e){const t=gn();x.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=IN(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",xo.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 Db={position:"absolute",width:"100%",height:"100%",top:0,left:0},P2e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function M2e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Zu.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:E,isControlledViewport:C,paneClickDistance:j,selectionOnDrag:A}){const N=gn(),O=x.useRef(null),{userSelectionActive:T,lib:M,connectionInProgress:I}=jt(P2e,pn),z=ip(g),B=x.useRef();T2e(O);const L=x.useCallback(G=>{E==null||E({x:G[0],y:G[1],zoom:G[2]}),C||N.setState({transform:G})},[E,C]);return x.useEffect(()=>{if(O.current){B.current=UTe({domNode:O.current,minZoom:h,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:D=>N.setState(q=>q.paneDragging===D?q:{paneDragging:D}),onPanZoomStart:(D,q)=>{const{onViewportChangeStart:X,onMoveStart:V}=N.getState();V==null||V(D,q),X==null||X(q)},onPanZoom:(D,q)=>{const{onViewportChange:X,onMove:V}=N.getState();V==null||V(D,q),X==null||X(q)},onPanZoomEnd:(D,q)=>{const{onViewportChangeEnd:X,onMoveEnd:V}=N.getState();V==null||V(D,q),X==null||X(q)}});const{x:G,y:F,zoom:K}=B.current.getViewport();return N.setState({panZoom:B.current,transform:[G,F,K],domNode:O.current.closest(".react-flow")}),()=>{var D;(D=B.current)==null||D.destroy()}}},[]),x.useEffect(()=>{var G;(G=B.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:M,onTransformChange:L,connectionInProgress:I,selectionOnDrag:A,paneClickDistance:j})},[e,t,n,r,i,a,o,l,z,v,S,T,w,M,L,I,A,j]),m.jsx("div",{className:"react-flow__renderer",ref:O,style:Db,children:b})}const D2e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function R2e(){const{userSelectionActive:e,userSelectionRect:t}=jt(D2e,pn);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 u_=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},I2e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function L2e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=tp.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=gn(),{userSelectionActive:S,elementsSelectable:E,dragging:C,connectionInProgress:j}=jt(I2e,pn),A=E&&(e||S),N=x.useRef(null),O=x.useRef(),T=x.useRef(new Set),M=x.useRef(new Set),I=x.useRef(!1),z=X=>{if(I.current||j){I.current=!1;return}c==null||c(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},B=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}f==null||f(X)},L=h?X=>h(X):void 0,G=X=>{I.current&&(X.stopPropagation(),I.current=!1)},F=X=>{var Z,ne;const{domNode:V}=w.getState();if(O.current=V==null?void 0:V.getBoundingClientRect(),!O.current)return;const R=X.target===N.current;if(!R&&!!X.target.closest(".nokey")||!e||!(a&&R||t)||X.button!==0||!X.isPrimary)return;(ne=(Z=X.target)==null?void 0:Z.setPointerCapture)==null||ne.call(Z,X.pointerId),I.current=!1;const{x:$,y:Q}=Aa(X.nativeEvent,O.current);w.setState({userSelectionRect:{width:0,height:0,startX:$,startY:Q,x:$,y:Q}}),R||(X.stopPropagation(),X.preventDefault())},K=X=>{const{userSelectionRect:V,transform:R,nodeLookup:H,edgeLookup:U,connectionLookup:$,triggerNodeChanges:Q,triggerEdgeChanges:Z,defaultEdgeOptions:ne,resetSelectedElements:te}=w.getState();if(!O.current||!V)return;const{x:ie,y:ee}=Aa(X.nativeEvent,O.current),{startX:le,startY:pe}=V;if(!I.current){const Oe=t?0:i;if(Math.hypot(ie-le,ee-pe)<=Oe)return;te(),o==null||o(X)}I.current=!0;const ae={startX:le,startY:pe,x:ie<le?ie:le,y:ee<pe?ee:pe,width:Math.abs(ie-le),height:Math.abs(ee-pe)},be=T.current,we=M.current;T.current=new Set(DN(H,ae,R,n===tp.Partial,!0).map(Oe=>Oe.id)),M.current=new Set;const Le=(ne==null?void 0:ne.selectable)??!0;for(const Oe of T.current){const Xe=$.get(Oe);if(Xe)for(const{edgeId:Ke}of Xe.values()){const tt=U.get(Ke);tt&&(tt.selectable??Le)&&M.current.add(Ke)}}if(!_4(be,T.current)){const Oe=Df(H,T.current,!0);Q(Oe)}if(!_4(we,M.current)){const Oe=Df(U,M.current);Z(Oe)}w.setState({userSelectionRect:ae,userSelectionActive:!0,nodesSelectionActive:!1})},D=X=>{var V,R;X.button===0&&((R=(V=X.target)==null?void 0:V.releasePointerCapture)==null||R.call(V,X.pointerId),!S&&X.target===N.current&&w.getState().userSelectionRect&&(z==null||z(X)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.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:Qn(["react-flow__pane",{draggable:q,dragging:C,selection:e}]),onClick:A?void 0:u_(z,N),onContextMenu:u_(B,N),onWheel:u_(L,N),onPointerEnter:A?void 0:d,onPointerMove:A?K:g,onPointerUp:A?D:void 0,onPointerDownCapture:A?F:void 0,onClickCapture:A?G:void 0,onPointerLeave:v,ref:N,style:Db,children:[b,m.jsx(R2e,{})]})}function RC({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",xo.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 EK({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=gn(),[c,f]=x.useState(!1),h=x.useRef();return x.useEffect(()=>{h.current=ATe({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{RC({id:d,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),x.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 z2e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function _K(){const e=gn();return x.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=z2e(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[,E]of f){if(!g(E))continue;let C={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+S};i&&(C=rg(C,a));const{position:j,positionAbsolute:A}=VV({nodeId:E.id,nextPosition:C,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:l});E.position=j,E.internals.positionAbsolute=A,d.set(E.id,E)}c(d)},[])}const UN=x.createContext(null),$2e=UN.Provider;UN.Consumer;const jK=()=>x.useContext(UN),B2e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),F2e=(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===xd.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 U2e({type:e="source",position:t=He.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 K,D;const b=o||null,w=e==="target",S=gn(),E=jK(),{connectOnClick:C,noPanClassName:j,rfId:A}=jt(B2e,pn),{connectingFrom:N,connectingTo:O,clickConnecting:T,isPossibleEndHandle:M,connectionInProcess:I,clickConnectionInProcess:z,valid:B}=jt(F2e(E,b,e),pn);E||(D=(K=S.getState()).onError)==null||D.call(K,"010",xo.error010());const L=q=>{const{defaultEdgeOptions:X,onConnect:V,hasDefaultEdges:R}=S.getState(),H={...X,...q};if(R){const{edges:U,setEdges:$}=S.getState();$(dTe(H,U))}V==null||V(H),l==null||l(H)},G=q=>{if(!E)return;const X=JV(q.nativeEvent);if(i&&(X&&q.button===0||!X)){const V=S.getState();DC.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:w,handleId:b,nodeId:E,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...R)=>{var H,U;return(U=(H=S.getState()).onConnectEnd)==null?void 0:U.call(H,...R)},updateConnection:V.updateConnection,onConnect:L,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:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}X?h==null||h(q):d==null||d(q)},F=q=>{const{onClickConnectStart:X,onClickConnectEnd:V,connectionClickStartHandle:R,connectionMode:H,isValidConnection:U,lib:$,rfId:Q,nodeLookup:Z,connection:ne}=S.getState();if(!E||!R&&!i)return;if(!R){X==null||X(q.nativeEvent,{nodeId:E,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:b}});return}const te=QV(q.target),ie=n||U,{connection:ee,isValid:le}=DC.isValid(q.nativeEvent,{handle:{nodeId:E,id:b,type:e},connectionMode:H,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:ie,flowId:Q,doc:te,lib:$,nodeLookup:Z});le&&ee&&L(ee);const pe=structuredClone(ne);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,V==null||V(q,pe),S.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":b,"data-nodeid":E,"data-handlepos":t,"data-id":`${A}-${E}-${b}-${e}`,className:Qn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:N,connectingto:O,valid:B,connectionindicator:r&&(!I||M)&&(I||z?a:i)}]),onMouseDown:G,onTouchStart:G,onClick:C?F:void 0,ref:v,...g,children:c})}const jd=x.memo(wK(U2e));function H2e({data:e,isConnectable:t,sourcePosition:n=He.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(jd,{type:"source",position:n,isConnectable:t})]})}function q2e({data:e,isConnectable:t,targetPosition:n=He.Top,sourcePosition:r=He.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(jd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(jd,{type:"source",position:r,isConnectable:t})]})}function V2e(){return null}function K2e({data:e,isConnectable:t,targetPosition:n=He.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(jd,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Xx={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},W4={input:H2e,default:q2e,output:K2e,group:V2e};function Y2e(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 X2e=e=>{const{width:t,height:n,x:r,y:i}=ng(e.nodeLookup,{filter:a=>!!a.selected});return{width:ka(t)?t:null,height:ka(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 G2e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=gn(),{width:i,height:a,transformString:o,userSelectionActive:l}=jt(X2e,pn),c=_K(),f=x.useRef(null);x.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const h=!l&&i!==null&&a!==null;if(EK({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(Xx,v.key)&&(v.preventDefault(),c({direction:Xx[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Qn(["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 Q4=typeof window<"u"?window:void 0,W2e=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function CK({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:E,zoomOnScroll:C,zoomOnPinch:j,panOnScroll:A,panOnScrollSpeed:N,panOnScrollMode:O,zoomOnDoubleClick:T,panOnDrag:M,defaultViewport:I,translateExtent:z,minZoom:B,maxZoom:L,preventScrolling:G,onSelectionContextMenu:F,noWheelClassName:K,noPanClassName:D,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:V}){const{nodesSelectionActive:R,userSelectionActive:H}=jt(W2e,pn),U=ip(f,{target:Q4}),$=ip(w,{target:Q4}),Q=$||M,Z=$||A,ne=h&&Q!==!0,te=U||H||ne;return N2e({deleteKeyCode:c,multiSelectionKeyCode:b}),m.jsx(M2e,{onPaneContextMenu:a,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:j,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:O,zoomOnDoubleClick:T,panOnDrag:!U&&Q,defaultViewport:I,translateExtent:z,minZoom:B,maxZoom:L,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:K,noPanClassName:D,onViewportChange:X,isControlledViewport:V,paneClickDistance:l,selectionOnDrag:ne,children:m.jsxs(L2e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!te,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,R&&m.jsx(G2e,{onSelectionContextMenu:F,noPanClassName:D,disableKeyboardA11y:q})]})})}CK.displayName="FlowRenderer";const Q2e=x.memo(CK),Z2e=e=>t=>e?DN(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 J2e(e){return jt(x.useCallback(Z2e(e),[e]),pn)}const ePe=e=>e.updateNodeInternals;function tPe(){const e=jt(ePe),[t]=x.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 x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function nPe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=gn(),a=x.useRef(null),o=x.useRef(null),l=x.useRef(e.sourcePosition),c=x.useRef(e.targetPosition),f=x.useRef(t),h=n&&!!e.internals.handleBounds;return x.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]),x.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),x.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 rPe({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:E,onError:C}){const{node:j,internals:A,isParent:N}=jt(ie=>{const ee=ie.nodeLookup.get(e),le=ie.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:le}},pn);let O=j.type||"default",T=(S==null?void 0:S[O])||W4[O];T===void 0&&(C==null||C("003",xo.error003(O)),O="default",T=(S==null?void 0:S.default)||W4.default);const M=!!(j.draggable||l&&typeof j.draggable>"u"),I=!!(j.selectable||c&&typeof j.selectable>"u"),z=!!(j.connectable||f&&typeof j.connectable>"u"),B=!!(j.focusable||h&&typeof j.focusable>"u"),L=gn(),G=GV(j),F=nPe({node:j,nodeType:O,hasDimensions:G,resizeObserver:d}),K=EK({nodeRef:F,disabled:j.hidden||!M,noDragClassName:g,handleSelector:j.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:E}),D=_K();if(j.hidden)return null;const q=Ms(j),X=Y2e(j),V=I||M||t||n||r||i,R=n?ie=>n(ie,{...A.userNode}):void 0,H=r?ie=>r(ie,{...A.userNode}):void 0,U=i?ie=>i(ie,{...A.userNode}):void 0,$=a?ie=>a(ie,{...A.userNode}):void 0,Q=o?ie=>o(ie,{...A.userNode}):void 0,Z=ie=>{const{selectNodesOnDrag:ee,nodeDragThreshold:le}=L.getState();I&&(!ee||!M||le>0)&&RC({id:e,store:L,nodeRef:F}),t&&t(ie,{...A.userNode})},ne=ie=>{if(!(ZV(ie.nativeEvent)||b)){if(BV.includes(ie.key)&&I){const ee=ie.key==="Escape";RC({id:e,store:L,unselect:ee,nodeRef:F})}else if(M&&j.selected&&Object.prototype.hasOwnProperty.call(Xx,ie.key)){ie.preventDefault();const{ariaLabelConfig:ee}=L.getState();L.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:ie.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),D({direction:Xx[ie.key],factor:ie.shiftKey?4:1})}}},te=()=>{var we;if(b||!((we=F.current)!=null&&we.matches(":focus-visible")))return;const{transform:ie,width:ee,height:le,autoPanOnNodeFocus:pe,setCenter:ae}=L.getState();if(!pe)return;DN(new Map([[e,j]]),{x:0,y:0,width:ee,height:le},ie,!0).length>0||ae(j.position.x+q.width/2,j.position.y+q.height/2,{zoom:ie[2]})};return m.jsx("div",{className:Qn(["react-flow__node",`react-flow__node-${O}`,{[v]:M},j.className,{selected:j.selected,selectable:I,parent:N,draggable:M,dragging:K}]),ref:F,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:G?"visible":"hidden",...j.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:H,onMouseLeave:U,onContextMenu:$,onClick:Z,onDoubleClick:Q,onKeyDown:B?ne:void 0,tabIndex:B?0:void 0,onFocus:B?te:void 0,role:j.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${vK}-${w}`,"aria-label":j.ariaLabel,...j.domAttributes,children:m.jsx($2e,{value:e,children:m.jsx(T,{id:e,data:j.data,type:O,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:j.selected??!1,selectable:I,draggable:M,deletable:j.deletable??!0,isConnectable:z,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:K,dragHandle:j.dragHandle,zIndex:A.z,parentId:j.parentId,...q})})})}var iPe=x.memo(rPe);const aPe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function kK(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=jt(aPe,pn),o=J2e(e.onlyRenderVisibleElements),l=tPe();return m.jsx("div",{className:"react-flow__nodes",style:Db,children:o.map(c=>m.jsx(iPe,{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))})}kK.displayName="NodeRenderer";const oPe=x.memo(kK);function sPe(e){return jt(x.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&&uTe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),pn)}const lPe=({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"})},uPe=({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"})},Z4={[bd.Arrow]:lPe,[bd.ArrowClosed]:uPe};function cPe(e){const t=gn();return x.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(Z4,e)?Z4[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",xo.error009(e)),null)},[e])}const fPe=({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=cPe(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},AK=({defaultColor:e,rfId:t})=>{const n=jt(a=>a.edges),r=jt(a=>a.defaultEdgeOptions),i=x.useMemo(()=>vTe(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(fPe,{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};AK.displayName="MarkerDefinitions";var dPe=x.memo(AK);function OK({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]=x.useState({x:1,y:0,width:0,height:0}),v=Qn(["react-flow__edge-textwrapper",f]),b=x.useRef(null);return x.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}OK.displayName="EdgeText";const hPe=x.memo(OK);function Rb({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:Qn(["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&&ka(t)&&ka(n)?m.jsx(hPe,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function J4({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===He.Left||e===He.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function NK({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:i,targetPosition:a=He.Top}){const[o,l]=J4({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=J4({pos:a,x1:r,y1:i,x2:e,y2:t}),[h,d,g,v]=eK({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 TK(e){return x.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:E})=>{const[C,j,A]=NK({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return m.jsx(Rb,{id:N,path:C,labelX:j,labelY:A,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:E})})}const mPe=TK({isInternal:!1}),PK=TK({isInternal:!0});mPe.displayName="SimpleBezierEdge";PK.displayName="SimpleBezierEdgeInternal";function MK(e){return x.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=He.Bottom,targetPosition:b=He.Top,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[j,A,N]=TC({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:b,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),O=e.isInternal?void 0:t;return m.jsx(Rb,{id:O,path:j,labelX:A,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const DK=MK({isInternal:!1}),RK=MK({isInternal:!0});DK.displayName="SmoothStepEdge";RK.displayName="SmoothStepEdgeInternal";function IK(e){return x.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return m.jsx(DK,{...n,id:r,pathOptions:x.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const pPe=IK({isInternal:!1}),LK=IK({isInternal:!0});pPe.displayName="StepEdge";LK.displayName="StepEdgeInternal";function zK(e){return x.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,E,C]=rK({sourceX:n,sourceY:r,targetX:i,targetY:a}),j=e.isInternal?void 0:t;return m.jsx(Rb,{id:j,path:S,labelX:E,labelY:C,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const gPe=zK({isInternal:!1}),$K=zK({isInternal:!0});gPe.displayName="StraightEdge";$K.displayName="StraightEdgeInternal";function BK(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=He.Bottom,targetPosition:l=He.Top,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:C})=>{const[j,A,N]=tK({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:E==null?void 0:E.curvature}),O=e.isInternal?void 0:t;return m.jsx(Rb,{id:O,path:j,labelX:A,labelY:N,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const vPe=BK({isInternal:!1}),FK=BK({isInternal:!0});vPe.displayName="BezierEdge";FK.displayName="BezierEdgeInternal";const e5={default:FK,straight:$K,step:LK,smoothstep:RK,simplebezier:PK},t5={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yPe=(e,t,n)=>n===He.Left?e-t:n===He.Right?e+t:e,xPe=(e,t,n)=>n===He.Top?e-t:n===He.Bottom?e+t:e,n5="react-flow__edgeupdater";function r5({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:Qn([n5,`${n5}-${l}`]),cx:yPe(t,r,e),cy:xPe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function bPe({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=gn(),w=(A,N)=>{if(A.button!==0)return;const{autoPanOnConnect:O,domNode:T,connectionMode:M,connectionRadius:I,lib:z,onConnectStart:B,cancelConnection:L,nodeLookup:G,rfId:F,panBy:K,updateConnection:D}=b.getState(),q=N.type==="target",X=(H,U)=>{g(!1),d==null||d(H,n,N.type,U)},V=H=>f==null?void 0:f(n,H),R=(H,U)=>{g(!0),h==null||h(A,n,N.type),B==null||B(H,U)};DC.onPointerDown(A.nativeEvent,{autoPanOnConnect:O,connectionMode:M,connectionRadius:I,domNode:T,handleId:N.id,nodeId:N.nodeId,nodeLookup:G,isTarget:q,edgeUpdaterType:N.type,lib:z,flowId:F,cancelConnection:L,panBy:K,isValidConnection:(...H)=>{var U,$;return(($=(U=b.getState()).isValidConnection)==null?void 0:$.call(U,...H))??!0},onConnect:V,onConnectStart:R,onConnectEnd:(...H)=>{var U,$;return($=(U=b.getState()).onConnectEnd)==null?void 0:$.call(U,...H)},onReconnectEnd:X,updateConnection:D,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},S=A=>w(A,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=A=>w(A,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),j=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(r5,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:j,type:"source"}),(e===!0||e==="target")&&m.jsx(r5,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:E,onMouseEnter:C,onMouseOut:j,type:"target"})]})}function wPe({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:E,disableKeyboardA11y:C}){let j=jt(ae=>ae.edgeLookup.get(e));const A=jt(ae=>ae.defaultEdgeOptions);j=A?{...A,...j}:j;let N=j.type||"default",O=(w==null?void 0:w[N])||e5[N];O===void 0&&(E==null||E("011",xo.error011(N)),N="default",O=(w==null?void 0:w.default)||e5.default);const T=!!(j.focusable||t&&typeof j.focusable>"u"),M=typeof d<"u"&&(j.reconnectable||n&&typeof j.reconnectable>"u"),I=!!(j.selectable||r&&typeof j.selectable>"u"),z=x.useRef(null),[B,L]=x.useState(!1),[G,F]=x.useState(!1),K=gn(),{zIndex:D,sourceX:q,sourceY:X,targetX:V,targetY:R,sourcePosition:H,targetPosition:U}=jt(x.useCallback(ae=>{const be=ae.nodeLookup.get(j.source),we=ae.nodeLookup.get(j.target);if(!be||!we)return{zIndex:j.zIndex,...t5};const Le=gTe({id:e,sourceNode:be,targetNode:we,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:ae.connectionMode,onError:E});return{zIndex:lTe({selected:j.selected,zIndex:j.zIndex,sourceNode:be,targetNode:we,elevateOnSelect:ae.elevateEdgesOnSelect,zIndexMode:ae.zIndexMode}),...Le||t5}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),pn),$=x.useMemo(()=>j.markerStart?`url('#${PC(j.markerStart,b)}')`:void 0,[j.markerStart,b]),Q=x.useMemo(()=>j.markerEnd?`url('#${PC(j.markerEnd,b)}')`:void 0,[j.markerEnd,b]);if(j.hidden||q===null||X===null||V===null||R===null)return null;const Z=ae=>{var Oe;const{addSelectedEdges:be,unselectNodesAndEdges:we,multiSelectionActive:Le}=K.getState();I&&(K.setState({nodesSelectionActive:!1}),j.selected&&Le?(we({nodes:[],edges:[j]}),(Oe=z.current)==null||Oe.blur()):be([e])),i&&i(ae,j)},ne=a?ae=>{a(ae,{...j})}:void 0,te=o?ae=>{o(ae,{...j})}:void 0,ie=l?ae=>{l(ae,{...j})}:void 0,ee=c?ae=>{c(ae,{...j})}:void 0,le=f?ae=>{f(ae,{...j})}:void 0,pe=ae=>{var be;if(!C&&BV.includes(ae.key)&&I){const{unselectNodesAndEdges:we,addSelectedEdges:Le}=K.getState();ae.key==="Escape"?((be=z.current)==null||be.blur(),we({edges:[j]})):Le([e])}};return m.jsx("svg",{style:{zIndex:D},children:m.jsxs("g",{className:Qn(["react-flow__edge",`react-flow__edge-${N}`,j.className,S,{selected:j.selected,animated:j.animated,inactive:!I&&!i,updating:B,selectable:I}]),onClick:Z,onDoubleClick:ne,onContextMenu:te,onMouseEnter:ie,onMouseMove:ee,onMouseLeave:le,onKeyDown:T?pe:void 0,tabIndex:T?0:void 0,role:j.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":j.ariaLabel===null?void 0:j.ariaLabel||`Edge from ${j.source} to ${j.target}`,"aria-describedby":T?`${yK}-${b}`:void 0,ref:z,...j.domAttributes,children:[!G&&m.jsx(O,{id:e,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:I,deletable:j.deletable??!0,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:V,targetY:R,sourcePosition:H,targetPosition:U,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:$,markerEnd:Q,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),M&&m.jsx(bPe,{edge:j,isReconnectable:M,reconnectRadius:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:V,targetY:R,sourcePosition:H,targetPosition:U,setUpdateHover:L,setReconnecting:F})]})})}var SPe=x.memo(wPe);const EPe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function UK({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:E,elementsSelectable:C,onError:j}=jt(EPe,pn),A=sPe(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(dPe,{defaultColor:e,rfId:n}),A.map(N=>m.jsx(SPe,{id:N,edgesFocusable:S,edgesReconnectable:E,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:j,edgeTypes:r,disableKeyboardA11y:w},N))]})}UK.displayName="EdgeRenderer";const _Pe=x.memo(UK),jPe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CPe({children:e}){const t=jt(jPe);return m.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function kPe(e){const t=Mb(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const APe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function OPe(e){const t=jt(APe),n=gn();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function NPe(e){return e.connection.inProgress?{...e.connection,to:ig(e.connection.to,e.transform)}:{...e.connection}}function TPe(e){return NPe}function PPe(e){const t=TPe();return jt(t,pn)}const MPe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function DPe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=jt(MPe,pn);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:Qn(["react-flow__connection",HV(l)]),children:m.jsx(HK,{style:t,type:n,CustomComponent:r,isValid:l})})})}const HK=({style:e,type:t=Sl.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}=PPe();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:HV(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 Sl.Bezier:[b]=tK(w);break;case Sl.SimpleBezier:[b]=NK(w);break;case Sl.Step:[b]=TC({...w,borderRadius:0});break;case Sl.SmoothStep:[b]=TC(w);break;default:[b]=rK(w)}return m.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};HK.displayName="ConnectionLine";const RPe={};function i5(e=RPe){x.useRef(e),gn(),x.useEffect(()=>{},[e])}function IPe(){gn(),x.useRef(!1),x.useEffect(()=>{},[])}function qK({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:E,selectionKeyCode:C,selectionOnDrag:j,selectionMode:A,multiSelectionKeyCode:N,panActivationKeyCode:O,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:z,defaultViewport:B,translateExtent:L,minZoom:G,maxZoom:F,preventScrolling:K,defaultMarkerColor:D,zoomOnScroll:q,zoomOnPinch:X,panOnScroll:V,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:$,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:te,onPaneScroll:ie,onPaneContextMenu:ee,paneClickDistance:le,nodeClickDistance:pe,onEdgeContextMenu:ae,onEdgeMouseEnter:be,onEdgeMouseMove:we,onEdgeMouseLeave:Le,reconnectRadius:Oe,onReconnect:Xe,onReconnectStart:Ke,onReconnectEnd:tt,noDragClassName:sn,noWheelClassName:En,noPanClassName:Et,disableKeyboardA11y:vn,nodeExtent:Pt,rfId:Jt,viewport:he,onViewportChange:oe}){return i5(e),i5(t),IPe(),kPe(n),OPe(he),m.jsx(Q2e,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:ne,onPaneMouseLeave:te,onPaneContextMenu:ee,onPaneScroll:ie,paneClickDistance:le,deleteKeyCode:M,selectionKeyCode:C,selectionOnDrag:j,selectionMode:A,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:N,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:z,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:U,panOnScroll:V,panOnScrollSpeed:R,panOnScrollMode:H,panOnDrag:$,defaultViewport:B,translateExtent:L,minZoom:G,maxZoom:F,onSelectionContextMenu:d,preventScrolling:K,noDragClassName:sn,noWheelClassName:En,noPanClassName:Et,disableKeyboardA11y:vn,onViewportChange:oe,isControlledViewport:!!he,children:m.jsxs(CPe,{children:[m.jsx(_Pe,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:Xe,onReconnectStart:Ke,onReconnectEnd:tt,onlyRenderVisibleElements:I,onEdgeContextMenu:ae,onEdgeMouseEnter:be,onEdgeMouseMove:we,onEdgeMouseLeave:Le,reconnectRadius:Oe,defaultMarkerColor:D,noPanClassName:Et,disableKeyboardA11y:vn,rfId:Jt}),m.jsx(DPe,{style:w,type:b,component:S,containerStyle:E}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(oPe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:pe,onlyRenderVisibleElements:I,noPanClassName:Et,noDragClassName:sn,disableKeyboardA11y:vn,nodeExtent:Pt,rfId:Jt}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}qK.displayName="GraphView";const LPe=x.memo(qK),a5=({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,E=r??t??[],C=n??e??[],j=h??[0,0],A=d??ep;oK(w,S,E);const N=MC(C,v,b,{nodeOrigin:j,nodeExtent:A,zIndexMode:g});let O=[0,0,1];if(o&&i&&a){const T=ng(v,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:M,y:I,zoom:z}=RN(T,i,a,c,f,(l==null?void 0:l.padding)??.1);O=[M,I,z]}return{rfId:"1",width:i??0,height:a??0,transform:O,nodes:C,nodesInitialized:N,nodeLookup:v,parentLookup:b,edges:E,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:ep,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...UV},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nTe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:FV,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},zPe=({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})=>e2e((v,b)=>{async function w(){const{nodeLookup:S,panZoom:E,fitViewOptions:C,fitViewResolver:j,width:A,height:N,minZoom:O,maxZoom:T}=b();E&&(await eTe({nodes:S,width:A,height:N,panZoom:E,minZoom:O,maxZoom:T},C),j==null||j.resolve(!0),v({fitViewResolver:null}))}return{...a5({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:E,parentLookup:C,nodeOrigin:j,elevateNodesOnSelect:A,fitViewQueued:N,zIndexMode:O}=b(),T=MC(S,E,C,{nodeOrigin:j,nodeExtent:d,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:O});N&&T?(w(),v({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:T})},setEdges:S=>{const{connectionLookup:E,edgeLookup:C}=b();oK(E,C,S),v({edges:S})},setDefaultNodesAndEdges:(S,E)=>{if(S){const{setNodes:C}=b();C(S),v({hasDefaultNodes:!0})}if(E){const{setEdges:C}=b();C(E),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:E,nodeLookup:C,parentLookup:j,domNode:A,nodeOrigin:N,nodeExtent:O,debug:T,fitViewQueued:M,zIndexMode:I}=b(),{changes:z,updatedInternals:B}=_Te(S,C,j,A,N,O,I);B&&(bTe(C,j,{nodeOrigin:N,nodeExtent:O,zIndexMode:I}),M?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(z==null?void 0:z.length)>0&&(T&&console.log("React Flow: trigger node changes",z),E==null||E(z)))},updateNodePositions:(S,E=!1)=>{const C=[];let j=[];const{nodeLookup:A,triggerNodeChanges:N,connection:O,updateConnection:T,onNodesChangeMiddlewareMap:M}=b();for(const[I,z]of S){const B=A.get(I),L=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(z!=null&&z.position)),G={id:I,type:"position",position:L?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:E};if(B&&O.inProgress&&O.fromNode.id===B.id){const F=xc(B,O.fromHandle,He.Left,!0);T({...O,from:F})}L&&B.parentId&&C.push({id:I,parentId:B.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),j.push(G)}if(C.length>0){const{parentLookup:I,nodeOrigin:z}=b(),B=FN(C,A,I,z);j.push(...B)}for(const I of M.values())j=I(j);N(j)},triggerNodeChanges:S=>{const{onNodesChange:E,setNodes:C,nodes:j,hasDefaultNodes:A,debug:N}=b();if(S!=null&&S.length){if(A){const O=w2e(S,j);C(O)}N&&console.log("React Flow: trigger node changes",S),E==null||E(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:E,setEdges:C,edges:j,hasDefaultEdges:A,debug:N}=b();if(S!=null&&S.length){if(A){const O=S2e(S,j);C(O)}N&&console.log("React Flow: trigger edge changes",S),E==null||E(S)}},addSelectedNodes:S=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:j,triggerNodeChanges:A,triggerEdgeChanges:N}=b();if(E){const O=S.map(T=>Mu(T,!0));A(O);return}A(Df(j,new Set([...S]),!0)),N(Df(C))},addSelectedEdges:S=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:j,triggerNodeChanges:A,triggerEdgeChanges:N}=b();if(E){const O=S.map(T=>Mu(T,!0));N(O);return}N(Df(C,new Set([...S]))),A(Df(j,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:E}={})=>{const{edges:C,nodes:j,nodeLookup:A,triggerNodeChanges:N,triggerEdgeChanges:O}=b(),T=S||j,M=E||C,I=[];for(const B of T){if(!B.selected)continue;const L=A.get(B.id);L&&(L.selected=!1),I.push(Mu(B.id,!1))}const z=[];for(const B of M)B.selected&&z.push(Mu(B.id,!1));N(I),O(z)},setMinZoom:S=>{const{panZoom:E,maxZoom:C}=b();E==null||E.setScaleExtent([S,C]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:E,minZoom:C}=b();E==null||E.setScaleExtent([C,S]),v({maxZoom:S})},setTranslateExtent:S=>{var E;(E=b().panZoom)==null||E.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:E,triggerNodeChanges:C,triggerEdgeChanges:j,elementsSelectable:A}=b();if(!A)return;const N=E.reduce((T,M)=>M.selected?[...T,Mu(M.id,!1)]:T,[]),O=S.reduce((T,M)=>M.selected?[...T,Mu(M.id,!1)]:T,[]);C(N),j(O)},setNodeExtent:S=>{const{nodes:E,nodeLookup:C,parentLookup:j,nodeOrigin:A,elevateNodesOnSelect:N,nodeExtent:O,zIndexMode:T}=b();S[0][0]===O[0][0]&&S[0][1]===O[0][1]&&S[1][0]===O[1][0]&&S[1][1]===O[1][1]||(MC(E,C,j,{nodeOrigin:A,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:E,width:C,height:j,panZoom:A,translateExtent:N}=b();return jTe({delta:S,panZoom:A,transform:E,translateExtent:N,width:C,height:j})},setCenter:async(S,E,C)=>{const{width:j,height:A,maxZoom:N,panZoom:O}=b();if(!O)return Promise.resolve(!1);const T=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:N;return await O.setViewport({x:j/2-S*T,y:A/2-E*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:{...UV}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...a5()})}},Object.is);function VK({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]=x.useState(()=>zPe({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(t2e,{value:b,children:m.jsx(C2e,{children:v})})}function $Pe({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 x.useContext(Tb)?m.jsx(m.Fragment,{children:e}):m.jsx(VK,{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 BPe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function FPe({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:E,onNodeMouseEnter:C,onNodeMouseMove:j,onNodeMouseLeave:A,onNodeContextMenu:N,onNodeDoubleClick:O,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:z,onEdgesDelete:B,onDelete:L,onSelectionChange:G,onSelectionDragStart:F,onSelectionDrag:K,onSelectionDragStop:D,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:V,onBeforeDelete:R,connectionMode:H,connectionLineType:U=Sl.Bezier,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:ne="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ie=!1,selectionMode:ee=tp.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:pe=rp()?"Meta":"Control",zoomActivationKeyCode:ae=rp()?"Meta":"Control",snapToGrid:be,snapGrid:we,onlyRenderVisibleElements:Le=!1,selectNodesOnDrag:Oe,nodesDraggable:Xe,autoPanOnNodeFocus:Ke,nodesConnectable:tt,nodesFocusable:sn,nodeOrigin:En=xK,edgesFocusable:Et,edgesReconnectable:vn,elementsSelectable:Pt=!0,defaultViewport:Jt=m2e,minZoom:he=.5,maxZoom:oe=2,translateExtent:ke=ep,preventScrolling:Ue=!0,nodeExtent:Ye,defaultMarkerColor:yn="#b1b1b7",zoomOnScroll:ln=!0,zoomOnPinch:Xt=!0,panOnScroll:Se=!1,panOnScrollSpeed:ut=.5,panOnScrollMode:Qe=Zu.Free,zoomOnDoubleClick:Dn=!0,panOnDrag:xn=!0,onPaneClick:$n,onPaneMouseEnter:Fi,onPaneMouseMove:da,onPaneMouseLeave:Ui,onPaneScroll:Hr,onPaneContextMenu:Ze,paneClickDistance:Ft=1,nodeClickDistance:_n=0,children:Bn,onReconnect:pi,onReconnectStart:Lt,onReconnectEnd:ur,onEdgeContextMenu:ha,onEdgeDoubleClick:Zn,onEdgeMouseEnter:cr,onEdgeMouseMove:Va,onEdgeMouseLeave:Ar,reconnectRadius:ye=10,onNodesChange:kt,onEdgesChange:Rn,noDragClassName:Gt="nodrag",noWheelClassName:fr="nowheel",noPanClassName:gi="nopan",fitView:Tc,fitViewOptions:lg,connectOnClick:Fb,attributionPosition:ug,proOptions:ru,defaultEdgeOptions:Gd,elevateNodesOnSelect:Rs=!0,elevateEdgesOnSelect:Is=!1,disableKeyboardA11y:Ls=!1,autoPanOnConnect:zs,autoPanOnNodeDrag:Fn,autoPanSpeed:cg,connectionRadius:fg,isValidConnection:jo,onError:$s,style:Ub,id:Wd,nodeDragThreshold:dg,connectionDragThreshold:Hb,viewport:Pc,onViewportChange:Mc,width:ma,height:Jr,colorMode:hg="light",debug:qb,onScroll:Bs,ariaLabelConfig:mg,zIndexMode:iu="basic",...Vb},ei){const au=Wd||"1",pg=y2e(hg),Qd=x.useCallback(Co=>{Co.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Bs==null||Bs(Co)},[Bs]);return m.jsx("div",{"data-testid":"rf__wrapper",...Vb,onScroll:Qd,style:{...Ub,...BPe},ref:ei,className:Qn(["react-flow",i,pg]),id:Wd,role:"application",children:m.jsxs($Pe,{nodes:e,edges:t,width:ma,height:Jr,fitView:Tc,fitViewOptions:lg,minZoom:he,maxZoom:oe,nodeOrigin:En,nodeExtent:Ye,zIndexMode:iu,children:[m.jsx(LPe,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:j,onNodeMouseLeave:A,onNodeContextMenu:N,onNodeDoubleClick:O,nodeTypes:a,edgeTypes:o,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:Z,selectionKeyCode:te,selectionOnDrag:ie,selectionMode:ee,deleteKeyCode:ne,multiSelectionKeyCode:pe,panActivationKeyCode:le,zoomActivationKeyCode:ae,onlyRenderVisibleElements:Le,defaultViewport:Jt,translateExtent:ke,minZoom:he,maxZoom:oe,preventScrolling:Ue,zoomOnScroll:ln,zoomOnPinch:Xt,zoomOnDoubleClick:Dn,panOnScroll:Se,panOnScrollSpeed:ut,panOnScrollMode:Qe,panOnDrag:xn,onPaneClick:$n,onPaneMouseEnter:Fi,onPaneMouseMove:da,onPaneMouseLeave:Ui,onPaneScroll:Hr,onPaneContextMenu:Ze,paneClickDistance:Ft,nodeClickDistance:_n,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:V,onReconnect:pi,onReconnectStart:Lt,onReconnectEnd:ur,onEdgeContextMenu:ha,onEdgeDoubleClick:Zn,onEdgeMouseEnter:cr,onEdgeMouseMove:Va,onEdgeMouseLeave:Ar,reconnectRadius:ye,defaultMarkerColor:yn,noDragClassName:Gt,noWheelClassName:fr,noPanClassName:gi,rfId:au,disableKeyboardA11y:Ls,nodeExtent:Ye,viewport:Pc,onViewportChange:Mc}),m.jsx(v2e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Xe,autoPanOnNodeFocus:Ke,nodesConnectable:tt,nodesFocusable:sn,edgesFocusable:Et,edgesReconnectable:vn,elementsSelectable:Pt,elevateNodesOnSelect:Rs,elevateEdgesOnSelect:Is,minZoom:he,maxZoom:oe,nodeExtent:Ye,onNodesChange:kt,onEdgesChange:Rn,snapToGrid:be,snapGrid:we,connectionMode:H,translateExtent:ke,connectOnClick:Fb,defaultEdgeOptions:Gd,fitView:Tc,fitViewOptions:lg,onNodesDelete:z,onEdgesDelete:B,onDelete:L,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:K,onSelectionDragStart:F,onSelectionDragStop:D,onMove:h,onMoveStart:d,onMoveEnd:g,noPanClassName:gi,nodeOrigin:En,rfId:au,autoPanOnConnect:zs,autoPanOnNodeDrag:Fn,autoPanSpeed:cg,onError:$s,connectionRadius:fg,isValidConnection:jo,selectNodesOnDrag:Oe,nodeDragThreshold:dg,connectionDragThreshold:Hb,onBeforeDelete:R,debug:qb,ariaLabelConfig:mg,zIndexMode:iu}),m.jsx(h2e,{onSelectionChange:G}),Bn,m.jsx(l2e,{proOptions:ru,position:ug}),m.jsx(s2e,{rfId:au,disableKeyboardA11y:Ls})]})})}var UPe=wK(FPe);function HPe({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:Qn(["react-flow__background-pattern",n,r])})}function qPe({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Qn(["react-flow__background-pattern","dots",t])})}var Ll;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ll||(Ll={}));const VPe={[Ll.Dots]:1,[Ll.Lines]:1,[Ll.Cross]:6},KPe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function KK({id:e,variant:t=Ll.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:h}){const d=x.useRef(null),{transform:g,patternId:v}=jt(KPe,pn),b=r||VPe[t],w=t===Ll.Dots,S=t===Ll.Cross,E=Array.isArray(n)?n:[n,n],C=[E[0]*g[2]||1,E[1]*g[2]||1],j=b*g[2],A=Array.isArray(a)?a:[a,a],N=S?[j,j]:C,O=[A[0]*g[2]||1+N[0]/2,A[1]*g[2]||1+N[1]/2],T=`${v}${e||""}`;return m.jsxs("svg",{className:Qn(["react-flow__background",f]),style:{...c,...Db,"--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(-${O[0]},-${O[1]})`,children:w?m.jsx(qPe,{radius:j/2,className:h}):m.jsx(HPe,{dimensions:N,lineWidth:i,variant:t,className:h})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}KK.displayName="Background";x.memo(KK);function YPe(){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 XPe(){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 GPe(){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 WPe(){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 QPe(){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 oy({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Qn(["react-flow__controls-button",t]),...n,children:e})}const ZPe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function YK({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=gn(),{isInteractive:w,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:C}=jt(ZPe,pn),{zoomIn:j,zoomOut:A,fitView:N}=Mb(),O=()=>{j(),a==null||a()},T=()=>{A(),o==null||o()},M=()=>{N(i),l==null||l()},I=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},z=g==="horizontal"?"horizontal":"vertical";return m.jsxs(Pb,{className:Qn(["react-flow__controls",z,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(oy,{onClick:O,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:E,children:m.jsx(YPe,{})}),m.jsx(oy,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:m.jsx(XPe,{})})]}),n&&m.jsx(oy,{className:"react-flow__controls-fitview",onClick:M,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:m.jsx(GPe,{})}),r&&m.jsx(oy,{className:"react-flow__controls-interactive",onClick:I,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?m.jsx(QPe,{}):m.jsx(WPe,{})}),h]})}YK.displayName="Controls";x.memo(YK);function JPe({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:Qn(["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?E=>v(E,e):void 0})}const eMe=x.memo(JPe),tMe=e=>e.nodes.map(t=>t.id),c_=e=>e instanceof Function?e:()=>e;function nMe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=eMe,onClick:o}){const l=jt(tMe,pn),c=c_(t),f=c_(e),h=c_(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:l.map(g=>m.jsx(iMe,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},g))})}function rMe({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}=jt(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:E,y:C}=w.internals.positionAbsolute,{width:j,height:A}=Ms(S);return{node:S,x:E,y:C,width:j,height:A}},pn);return!f||f.hidden||!GV(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 iMe=x.memo(rMe);var aMe=x.memo(nMe);const oMe=200,sMe=150,lMe=e=>!e.hidden,uMe=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?XV(ng(e.nodeLookup,{filter:lMe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},cMe="react-flow__minimap-desc";function XK({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:E,inversePan:C,zoomStep:j=1,offsetScale:A=5}){const N=gn(),O=x.useRef(null),{boundingRect:T,viewBB:M,rfId:I,panZoom:z,translateExtent:B,flowWidth:L,flowHeight:G,ariaLabelConfig:F}=jt(uMe,pn),K=(e==null?void 0:e.width)??oMe,D=(e==null?void 0:e.height)??sMe,q=T.width/K,X=T.height/D,V=Math.max(q,X),R=V*K,H=V*D,U=A*V,$=T.x-(R-T.width)/2-U,Q=T.y-(H-T.height)/2-U,Z=R+U*2,ne=H+U*2,te=`${cMe}-${I}`,ie=x.useRef(0),ee=x.useRef();ie.current=V,x.useEffect(()=>{if(O.current&&z)return ee.current=DTe({domNode:O.current,panZoom:z,getTransform:()=>N.getState().transform,getViewScale:()=>ie.current}),()=>{var be;(be=ee.current)==null||be.destroy()}},[z]),x.useEffect(()=>{var be;(be=ee.current)==null||be.update({translateExtent:B,width:L,height:G,inversePan:C,pannable:w,zoomStep:j,zoomable:S})},[w,S,C,j,B,L,G]);const le=v?be=>{var Oe;const[we,Le]=((Oe=ee.current)==null?void 0:Oe.pointer(be))||[0,0];v(be,{x:we,y:Le})}:void 0,pe=b?x.useCallback((be,we)=>{const Le=N.getState().nodeLookup.get(we).internals.userNode;b(be,Le)},[]):void 0,ae=E??F["minimap.ariaLabel"];return m.jsx(Pb,{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*V:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Qn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:K,height:D,viewBox:`${$} ${Q} ${Z} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:O,onClick:le,children:[ae&&m.jsx("title",{id:te,children:ae}),m.jsx(aMe,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-U},${Q-U}h${Z+U*2}v${ne+U*2}h${-Z-U*2}z
        M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}XK.displayName="MiniMap";x.memo(XK);const fMe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,dMe={[_d.Line]:"right",[_d.Handle]:"bottom-right"};function hMe({nodeId:e,position:t,variant:n=_d.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:E}){const C=jK(),j=typeof e=="string"?e:C,A=gn(),N=x.useRef(null),O=n===_d.Handle,T=jt(x.useCallback(fMe(O&&v),[O,v]),pn),M=x.useRef(null),I=t??dMe[n];x.useEffect(()=>{if(!(!N.current||!j))return M.current||(M.current=XTe({domNode:N.current,nodeId:j,getStoreItems:()=>{const{nodeLookup:B,transform:L,snapGrid:G,snapToGrid:F,nodeOrigin:K,domNode:D}=A.getState();return{nodeLookup:B,transform:L,snapGrid:G,snapToGrid:F,nodeOrigin:K,paneDomNode:D}},onChange:(B,L)=>{const{triggerNodeChanges:G,nodeLookup:F,parentLookup:K,nodeOrigin:D}=A.getState(),q=[],X={x:B.x,y:B.y},V=F.get(j);if(V&&V.expandParent&&V.parentId){const R=V.origin??D,H=B.width??V.measured.width??0,U=B.height??V.measured.height??0,$={id:V.id,parentId:V.parentId,rect:{width:H,height:U,...WV({x:B.x??V.position.x,y:B.y??V.position.y},{width:H,height:U},V.parentId,F,R)}},Q=FN([$],F,K,D);q.push(...Q),X.x=B.x?Math.max(R[0]*H,B.x):void 0,X.y=B.y?Math.max(R[1]*U,B.y):void 0}if(X.x!==void 0&&X.y!==void 0){const R={id:j,type:"position",position:{...X}};q.push(R)}if(B.width!==void 0&&B.height!==void 0){const H={id:j,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};q.push(H)}for(const R of L){const H={...R,type:"position"};q.push(H)}G(q)},onEnd:({width:B,height:L})=>{const G={id:j,type:"dimensions",resizing:!1,dimensions:{width:B,height:L}};A.getState().triggerNodeChanges([G])}})),M.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:h},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:E,shouldResize:b}),()=>{var B;(B=M.current)==null||B.destroy()}},[I,l,c,f,h,d,w,S,E,b]);const z=I.split("-");return m.jsx("div",{className:Qn(["react-flow__resize-control","nodrag",...z,n,r]),ref:N,style:{...i,scale:T,...o&&{[O?"backgroundColor":"borderColor"]:o}},children:a})}x.memo(hMe);const GK=180,mMe=70,Gx=24,pMe=60;function gMe({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${uR(e.status)}`;return m.jsxs("div",{className:t,children:[m.jsx(jd,{type:"target",position:He.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 ${uR(e.status)}`}),m.jsx("span",{children:e.status}),e.duration_ms!=null&&m.jsx("span",{children:P0(e.duration_ms)}),e.exit_code!=null&&m.jsxs("span",{children:["exit ",e.exit_code]})]}),m.jsx(jd,{type:"source",position:He.Bottom})]})}const vMe={agent:gMe};function yMe(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 Wx(e){return e.children.length===0?GK:e.children.reduce((t,n)=>t+Wx(n)+Gx,-Gx)}function WK(e,t,n,r){if(r.set(e.id,{x:t-GK/2,y:n}),e.children.length===0)return;const i=Wx(e);let a=t-i/2;for(const o of e.children){const l=Wx(o),c=a+l/2;WK(o,c,n+mMe+pMe,r),a+=l+Gx}}function xMe({treeData:e,connected:t}){return m.jsx(VK,{children:m.jsx(bMe,{treeData:e,connected:t})})}function bMe({treeData:e,connected:t}){const{fitView:n}=Mb(),r=x.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=x.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=yMe(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=Wx(v),w=c+b/2;WK(v,w,0,l),c+=b+Gx*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:bd.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:bd.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(UPe,{nodes:i,edges:a,nodeTypes:vMe,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 Au=18,o5=10;function wMe({runId:e,agents:t,active:n}){var K;const r=Object.keys(t),i=r.find(D=>t[D].parent===null)??r[0]??"",[a,o]=x.useState(i),{lines:l,connected:c,done:f}=qF(e,a,!0),[h,d]=x.useState(""),g=h.toLowerCase(),v=h?l.reduce((D,q,X)=>(q.toLowerCase().includes(g)&&D.push(X),D),[]):[],b=x.useRef(null),[w,S]=x.useState(0),[E,C]=x.useState(0),[j,A]=x.useState(!0),N=x.useRef(0),O=l.length*Au,T=Math.max(0,Math.floor(w/Au)-o5),M=Math.ceil(E/Au)+o5*2,I=Math.min(l.length,T+M),z=l.slice(T,I),B=String(l.length).length,L=x.useCallback(()=>{const D=b.current;if(!D)return;S(D.scrollTop),C(D.clientHeight);const q=D.scrollTop+D.clientHeight>=D.scrollHeight-Au*2;A(q)},[]);x.useEffect(()=>{const D=b.current;D&&C(D.clientHeight)},[]),x.useEffect(()=>{if(j&&l.length>N.current){const D=b.current;D&&(D.scrollTop=D.scrollHeight)}N.current=l.length},[l.length,j]);const G=()=>{const D=b.current;D&&(D.scrollTop=D.scrollHeight,A(!0))},F=async()=>{try{const D=await fetch(`/api/sessions/${e}/logs/${a}/full`);if(!D.ok)return;const q=await D.text(),X=new Blob([q],{type:"text/plain"}),V=URL.createObjectURL(X),R=document.createElement("a");R.href=V,R.download=`${a}.log`,R.click(),URL.revokeObjectURL(V)}catch{}};return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[r.length>1&&m.jsxs(Da,{value:a,onValueChange:o,children:[m.jsx(Ia,{className:"w-[220px]",children:m.jsx(Ra,{})}),m.jsx(La,{children:r.map(D=>m.jsxs(Pn,{value:D,children:[t[D].role," (",D.slice(0,8),")"]},D))})]}),r.length===1&&m.jsxs("span",{className:"text-sm text-muted-foreground",children:[(K=t[a])==null?void 0:K.role," (",a.slice(0,8),")"]}),m.jsxs("div",{className:"relative ml-auto",children:[m.jsx(xF,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),m.jsx(nt,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:h,onChange:D=>d(D.target.value)})]}),h&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[v.length," match",v.length!==1?"es":""]}),m.jsxs(je,{variant:"outline",size:"sm",onClick:F,children:[m.jsx(C0,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),m.jsx(SMe,{connected:c,done:f,active:n})]}),m.jsxs("div",{className:"relative",children:[m.jsx("div",{ref:b,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:L,children:l.length===0?m.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!f?"Waiting for log output...":"No log output."}):m.jsx("div",{style:{height:O,position:"relative"},children:m.jsx("div",{style:{position:"absolute",top:T*Au,left:0,right:0},children:z.map((D,q)=>{const X=T+q,V=h&&D.toLowerCase().includes(g);return m.jsxs("div",{className:V?"bg-yellow-900/30":void 0,style:{height:Au,lineHeight:`${Au}px`,display:"flex",whiteSpace:"pre"},children:[m.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(B+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:X+1}),m.jsx("span",{children:V?m.jsx(EMe,{line:D,search:g}):D})]},X)})})})}),!j&&l.length>0&&m.jsxs(je,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:G,children:[m.jsx(Rae,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function SMe({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 EMe({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 _Me({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=x.useState([]),[a,o]=x.useState(""),l=x.useRef(null),c=x.useRef(new Set);x.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]),x.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]),x.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(bn,{className:"flex h-[500px] flex-col",children:m.jsxs(wn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[m.jsx(Op,{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(k0,{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:Ne("flex",d.role==="user"?"justify-end":"justify-start"),children:m.jsx("div",{className:Ne("max-w-[80%] rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:m.jsx("p",{className:"whitespace-pre-wrap",children:d.text})})}),(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(je,{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(Bt,{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(nt,{value:a,onChange:d=>o(d.target.value),placeholder:h?"Type your response...":"Waiting for agent question...",disabled:!h}),m.jsx(je,{type:"submit",size:"icon",disabled:!h||!a.trim(),children:m.jsx(Roe,{className:"h-4 w-4"})})]})]})})}function HN(e,t){const[n,r]=x.useState([]),[i,a]=x.useState([]),[o,l]=x.useState([]),[c,f]=x.useState(null),[h,d]=x.useState(!1),g=x.useRef(null),v=x.useRef(0),b=x.useRef(void 0),w=x.useRef(1e3),S=x.useRef(!1),E=x.useCallback((C,j)=>{var A;(A=g.current)==null||A.send(JSON.stringify({type:"ask_user_response",request_id:C,text:j}))},[]);return x.useEffect(()=>{r([]),a([]),l([]),f(null),S.current=!1,v.current=0},[e]),x.useEffect(()=>{if(!t){r([]),d(!1);return}function C(){if(S.current)return;const A=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,N=new WebSocket(A);g.current=N,N.onopen=()=>{d(!0),w.current=1e3,N.send(JSON.stringify({type:"init",trace_offset:v.current}))},N.onmessage=O=>{let T;try{T=JSON.parse(O.data)}catch{return}switch(T.type){case"tree_snapshot":case"tree_delta":{const{type:M,...I}=T;f(I);break}case"trace_snapshot":Array.isArray(T.events)&&l(T.events),typeof T.next_offset=="number"&&(v.current=T.next_offset);break;case"trace_delta":Array.isArray(T.events)&&l(M=>[...M,...T.events]),typeof T.next_offset=="number"&&(v.current=T.next_offset);break;case"ask_user":{const M=T;r(I=>I.some(z=>z.request_id===M.request_id)?I:[...I,M]);break}case"ask_user_resolved":typeof T.request_id=="string"?r(M=>M.filter(I=>I.request_id!==T.request_id)):r([]);break;case"chat_history":Array.isArray(T.messages)&&a(T.messages);break;case"stream_complete":S.current=!0,N.close(),g.current=null,d(!1);break}},N.onclose=()=>{g.current=null,d(!1),!S.current&&(b.current=setTimeout(()=>{w.current=Math.min(w.current*2,15e3),C()},w.current))},N.onerror=()=>{N.close()}}return C(),()=>{var j;(j=g.current)==null||j.close(),g.current=null,b.current&&clearTimeout(b.current)}},[e,t]),{pendingAskUsers:n,chatMessages:i,traceEvents:o,treeData:c,connected:h,respond:E}}function jMe(){return m.jsxs("div",{className:"space-y-6",children:[m.jsx(Tn,{className:"h-8 w-64"}),m.jsx(Tn,{className:"h-32 rounded-lg"}),m.jsx(Tn,{className:"h-64 rounded-lg"})]})}function CMe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kMe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AMe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OMe={};function s5(e,t){return(OMe.jsx?AMe:kMe).test(e)}const NMe=/[ \t\n\f\r]/g;function TMe(e){return typeof e=="object"?e.type==="text"?l5(e.value):!1:l5(e)}function l5(e){return e.replace(NMe,"")===""}class ag{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ag.prototype.normal={};ag.prototype.property={};ag.prototype.space=void 0;function QK(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ag(n,r,t)}function IC(e){return e.toLowerCase()}class mi{constructor(t,n){this.attribute=n,this.property=t}}mi.prototype.attribute="";mi.prototype.booleanish=!1;mi.prototype.boolean=!1;mi.prototype.commaOrSpaceSeparated=!1;mi.prototype.commaSeparated=!1;mi.prototype.defined=!1;mi.prototype.mustUseProperty=!1;mi.prototype.number=!1;mi.prototype.overloadedBoolean=!1;mi.prototype.property="";mi.prototype.spaceSeparated=!1;mi.prototype.space=void 0;let PMe=0;const lt=Nc(),Kn=Nc(),LC=Nc(),Ee=Nc(),en=Nc(),qf=Nc(),ji=Nc();function Nc(){return 2**++PMe}const zC=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Kn,commaOrSpaceSeparated:ji,commaSeparated:qf,number:Ee,overloadedBoolean:LC,spaceSeparated:en},Symbol.toStringTag,{value:"Module"})),f_=Object.keys(zC);class qN extends mi{constructor(t,n,r,i){let a=-1;if(super(t,n),u5(this,"space",i),typeof r=="number")for(;++a<f_.length;){const o=f_[a];u5(this,f_[a],(r&zC[o])===zC[o])}}}qN.prototype.defined=!0;function u5(e,t,n){n&&(e[t]=n)}function Yd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new qN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[IC(r)]=r,n[IC(a.attribute)]=r}return new ag(t,n,e.space)}const ZK=Yd({properties:{ariaActiveDescendant:null,ariaAtomic:Kn,ariaAutoComplete:null,ariaBusy:Kn,ariaChecked:Kn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:en,ariaCurrent:null,ariaDescribedBy:en,ariaDetails:null,ariaDisabled:Kn,ariaDropEffect:en,ariaErrorMessage:null,ariaExpanded:Kn,ariaFlowTo:en,ariaGrabbed:Kn,ariaHasPopup:null,ariaHidden:Kn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:en,ariaLevel:Ee,ariaLive:null,ariaModal:Kn,ariaMultiLine:Kn,ariaMultiSelectable:Kn,ariaOrientation:null,ariaOwns:en,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Kn,ariaReadOnly:Kn,ariaRelevant:null,ariaRequired:Kn,ariaRoleDescription:en,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Kn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function JK(e,t){return t in e?e[t]:t}function eY(e,t){return JK(e,t.toLowerCase())}const MMe=Yd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qf,acceptCharset:en,accessKey:en,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:en,autoFocus:lt,autoPlay:lt,blocking:en,capture:null,charSet:null,checked:lt,cite:null,className:en,cols:Ee,colSpan:null,content:null,contentEditable:Kn,controls:lt,controlsList:en,coords:Ee|qf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:LC,draggable:Kn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:en,height:Ee,hidden:LC,high:Ee,href:null,hrefLang:null,htmlFor:en,httpEquiv:en,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:en,itemRef:en,itemScope:lt,itemType:en,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,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:lt,optimum:Ee,pattern:null,ping:en,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:en,required:lt,reversed:lt,rows:Ee,rowSpan:Ee,sandbox:en,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Kn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:Kn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:en,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Kn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:eY}),DMe=Yd({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:ji,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:en,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:qf,g2:qf,glyphName:qf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:ji,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,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:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:en,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ji,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ji,rev:ji,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ji,requiredFeatures:ji,requiredFonts:ji,requiredFormats:ji,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:ji,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ji,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ji,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JK}),tY=Yd({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()}}),nY=Yd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eY}),rY=Yd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),RMe={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"},IMe=/[A-Z]/g,c5=/-[a-z]/g,LMe=/^data[-\w.:]+$/i;function zMe(e,t){const n=IC(t);let r=t,i=mi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LMe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(c5,BMe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!c5.test(a)){let o=a.replace(IMe,$Me);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=qN}return new i(r,t)}function $Me(e){return"-"+e.toLowerCase()}function BMe(e){return e.charAt(1).toUpperCase()}const FMe=QK([ZK,MMe,tY,nY,rY],"html"),VN=QK([ZK,DMe,tY,nY,rY],"svg");function UMe(e){return e.join(" ").trim()}var _f={},d_,f5;function HMe(){if(f5)return d_;f5=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,E){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];E=E||{};var C=1,j=1;function A(F){var K=F.match(t);K&&(C+=K.length);var D=F.lastIndexOf(c);j=~D?F.length-D:j+F.length}function N(){var F={line:C,column:j};return function(K){return K.position=new O(F),I(),K}}function O(F){this.start=F,this.end={line:C,column:j},this.source=E.source}O.prototype.content=S;function T(F){var K=new Error(E.source+":"+C+":"+j+": "+F);if(K.reason=F,K.filename=E.source,K.line=C,K.column=j,K.source=S,!E.silent)throw K}function M(F){var K=F.exec(S);if(K){var D=K[0];return A(D),S=S.slice(D.length),K}}function I(){M(n)}function z(F){var K;for(F=F||[];K=B();)K!==!1&&F.push(K);return F}function B(){var F=N();if(!(f!=S.charAt(0)||h!=S.charAt(1))){for(var K=2;d!=S.charAt(K)&&(h!=S.charAt(K)||f!=S.charAt(K+1));)++K;if(K+=2,d===S.charAt(K-1))return T("End of comment missing");var D=S.slice(2,K-2);return j+=2,A(D),S=S.slice(K),j+=2,F({type:g,comment:D})}}function L(){var F=N(),K=M(r);if(K){if(B(),!M(i))return T("property missing ':'");var D=M(a),q=F({type:v,property:w(K[0].replace(e,d)),value:D?w(D[0].replace(e,d)):d});return M(o),q}}function G(){var F=[];z(F);for(var K;K=L();)K!==!1&&(F.push(K),z(F));return F}return I(),G()}function w(S){return S?S.replace(l,d):d}return d_=b,d_}var d5;function qMe(){if(d5)return _f;d5=1;var e=_f&&_f.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_f,"__esModule",{value:!0}),_f.default=n;const t=e(HMe());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 _f}var sm={},h5;function VMe(){if(h5)return sm;h5=1,Object.defineProperty(sm,"__esModule",{value:!0}),sm.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 sm.camelCase=c,sm}var lm,m5;function KMe(){if(m5)return lm;m5=1;var e=lm&&lm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(qMe()),n=VMe();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,lm=r,lm}var YMe=KMe();const XMe=Bi(YMe),iY=aY("end"),KN=aY("start");function aY(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 GMe(e){const t=KN(e),n=iY(e);if(t&&n)return{start:t,end:n}}function Sm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?p5(e.position):"start"in e||"end"in e?p5(e):"line"in e||"column"in e?$C(e):""}function $C(e){return g5(e&&e.line)+":"+g5(e&&e.column)}function p5(e){return $C(e&&e.start)+"-"+$C(e&&e.end)}function g5(e){return e&&typeof e=="number"?e:1}class Ur 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=Sm(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}}Ur.prototype.file="";Ur.prototype.name="";Ur.prototype.reason="";Ur.prototype.message="";Ur.prototype.stack="";Ur.prototype.column=void 0;Ur.prototype.line=void 0;Ur.prototype.ancestors=void 0;Ur.prototype.cause=void 0;Ur.prototype.fatal=void 0;Ur.prototype.place=void 0;Ur.prototype.ruleId=void 0;Ur.prototype.source=void 0;const YN={}.hasOwnProperty,WMe=new Map,QMe=/[A-Z]/g,ZMe=new Set(["table","tbody","thead","tfoot","tr"]),JMe=new Set(["td","th"]),oY="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eDe(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=lDe(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=sDe(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"?VN:FMe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=sY(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function sY(e,t,n){if(t.type==="element")return tDe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nDe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return iDe(e,t,n);if(t.type==="mdxjsEsm")return rDe(e,t);if(t.type==="root")return aDe(e,t,n);if(t.type==="text")return oDe(e,t)}function tDe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=VN,e.schema=i),e.ancestors.push(t);const a=uY(e,t.tagName,!1),o=uDe(e,t);let l=GN(e,t);return ZMe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!TMe(c):!0})),lY(e,o,a,t),XN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nDe(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)}ap(e,t.position)}function rDe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ap(e,t.position)}function iDe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=VN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:uY(e,t.name,!0),o=cDe(e,t),l=GN(e,t);return lY(e,o,a,t),XN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aDe(e,t,n){const r={};return XN(r,GN(e,t)),e.create(t,e.Fragment,r,n)}function oDe(e,t){return t.value}function lY(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function XN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function sDe(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 lDe(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=KN(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 uDe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&YN.call(t.properties,i)){const a=fDe(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&JMe.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 cDe(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 ap(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 ap(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function GN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:WMe;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=sY(e,a,o);l!==void 0&&n.push(l)}return n}function fDe(e,t,n){const r=zMe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?CMe(n):UMe(n)),r.property==="style"){let i=typeof n=="object"?n:dDe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=hDe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?RMe[r.property]||r.property:r.attribute,n]}}function dDe(e,t){try{return XMe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ur("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=oY+"#cannot-parse-style-attribute",i}}function uY(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=s5(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=s5(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return YN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ap(e)}function ap(e,t){const n=new Ur("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=oY+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hDe(e){const t={};let n;for(n in e)YN.call(e,n)&&(t[mDe(n)]=e[n]);return t}function mDe(e){let t=e.replace(QMe,pDe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pDe(e){return"-"+e.toLowerCase()}const h_={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"]},gDe={};function WN(e,t){const n=gDe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return cY(e,r,i)}function cY(e,t,n){if(vDe(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 v5(e.children,t,n)}return Array.isArray(e)?v5(e,t,n):""}function v5(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=cY(e[i],t,n);return r.join("")}function vDe(e){return!!(e&&typeof e=="object")}const y5=document.createElement("i");function QN(e){const t="&"+e+";";y5.innerHTML=t;const n=y5.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ri(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 ia(e,t){return e.length>0?(Ri(e,e.length,0,t),e):t}const x5={}.hasOwnProperty;function fY(e){const t={};let n=-1;for(;++n<e.length;)yDe(t,e[n]);return t}function yDe(e,t){let n;for(n in t){const i=(x5.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){x5.call(i,o)||(i[o]=[]);const l=a[o];xDe(i[o],Array.isArray(l)?l:l?[l]:[])}}}function xDe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ri(e,0,0,r)}function dY(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 Na(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yr=nu(/[A-Za-z]/),Lr=nu(/[\dA-Za-z]/),bDe=nu(/[#-'*+\--9=?A-Z^-~]/);function Qx(e){return e!==null&&(e<32||e===127)}const BC=nu(/\d/),wDe=nu(/[\dA-Fa-f]/),SDe=nu(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function Zt(e){return e!==null&&(e<0||e===32)}function mt(e){return e===-2||e===-1||e===32}const Ib=nu(new RegExp("\\p{P}|\\p{S}","u")),bc=nu(/\s/);function nu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Lr(e.charCodeAt(n+1))&&Lr(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 _t(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return mt(c)?(e.enter(n),l(c)):t(c)}function l(c){return mt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const EDe={tokenize:_De};function _De(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"),_t(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 Ge(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const jDe={tokenize:CDe},b5={tokenize:kDe};function CDe(e){const t=this,n=[];let r=0,i,a,o;return l;function l(j){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,c,f)(j)}return f(j)}function c(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const A=t.events.length;let N=A,O;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){O=t.events[N][1].end;break}E(r);let T=A;for(;T<t.events.length;)t.events[T][1].end={...O},T++;return Ri(t.events,N+1,0,t.events.slice(A)),t.events.length=T,f(j)}return l(j)}function f(j){if(r===n.length){if(!i)return g(j);if(i.currentConstruct&&i.currentConstruct.concrete)return b(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(b5,h,d)(j)}function h(j){return i&&C(),E(r),g(j)}function d(j){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(j)}function g(j){return t.containerState={},e.attempt(b5,v,b)(j)}function v(j){return r++,n.push([t.currentConstruct,t.containerState]),g(j)}function b(j){if(j===null){i&&C(),E(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(j)}function w(j){if(j===null){S(e.exit("chunkFlow"),!0),E(0),e.consume(j);return}return Ge(j)?(e.consume(j),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(j),w)}function S(j,A){const N=t.sliceStream(j);if(A&&N.push(null),j.previous=a,a&&(a.next=j),a=j,i.defineSkip(j.start),i.write(N),t.parser.lazy[j.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<o&&(!i.events[O][1].end||i.events[O][1].end.offset>o))return;const T=t.events.length;let M=T,I,z;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(I){z=t.events[M][1].end;break}I=!0}for(E(r),O=T;O<t.events.length;)t.events[O][1].end={...z},O++;Ri(t.events,M+1,0,t.events.slice(T)),t.events.length=O}}function E(j){let A=n.length;for(;A-- >j;){const N=n[A];t.containerState=N[1],N[0].exit.call(t,e)}n.length=j}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kDe(e,t,n){return _t(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cd(e){if(e===null||Zt(e)||bc(e))return 1;if(Ib(e))return 2}function Lb(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 FC={name:"attention",resolveAll:ADe,tokenize:ODe};function ADe(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};w5(d,-c),w5(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=ia(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=ia(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=ia(f,Lb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=ia(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=ia(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ri(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 ODe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Cd(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=Cd(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 w5(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NDe={name:"autolink",tokenize:TDe};function TDe(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 Yr(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Lr(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||Lr(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||Qx(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),h):bDe(v)?(e.consume(v),f):n(v)}function h(v){return Lr(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||Lr(v))&&r++<63){const b=v===45?g:d;return e.consume(v),b}return n(v)}}const og={partial:!0,tokenize:PDe};function PDe(e,t,n){return r;function r(a){return mt(a)?_t(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ge(a)?t(a):n(a)}}const hY={continuation:{tokenize:DDe},exit:RDe,name:"blockQuote",tokenize:MDe};function MDe(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 mt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function DDe(e,t,n){const r=this;return i;function i(o){return mt(o)?_t(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(hY,t,n)(o)}}function RDe(e){e.exit("blockQuote")}const mY={name:"characterEscape",tokenize:IDe};function IDe(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 SDe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const pY={name:"characterReference",tokenize:LDe};function LDe(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=Lr,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=wDe,h):(e.enter("characterReferenceValue"),a=7,o=BC,h(d))}function h(d){if(d===59&&i){const g=e.exit("characterReferenceValue");return o===Lr&&!QN(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 S5={partial:!0,tokenize:$De},E5={concrete:!0,name:"codeFenced",tokenize:zDe};function zDe(e,t,n){const r=this,i={partial:!0,tokenize:N};let a=0,o=0,l;return c;function c(O){return f(O)}function f(O){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(O)}function h(O){return O===l?(o++,e.consume(O),h):o<3?n(O):(e.exit("codeFencedFenceSequence"),mt(O)?_t(e,d,"whitespace")(O):d(O))}function d(O){return O===null||Ge(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(S5,w,A)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||Ge(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(O)):mt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_t(e,v,"whitespace")(O)):O===96&&O===l?n(O):(e.consume(O),g)}function v(O){return O===null||Ge(O)?d(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Ge(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(O)):O===96&&O===l?n(O):(e.consume(O),b)}function w(O){return e.attempt(i,A,S)(O)}function S(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return a>0&&mt(O)?_t(e,C,"linePrefix",a+1)(O):C(O)}function C(O){return O===null||Ge(O)?e.check(S5,w,A)(O):(e.enter("codeFlowValue"),j(O))}function j(O){return O===null||Ge(O)?(e.exit("codeFlowValue"),C(O)):(e.consume(O),j)}function A(O){return e.exit("codeFenced"),t(O)}function N(O,T,M){let I=0;return z;function z(K){return O.enter("lineEnding"),O.consume(K),O.exit("lineEnding"),B}function B(K){return O.enter("codeFencedFence"),mt(K)?_t(O,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):L(K)}function L(K){return K===l?(O.enter("codeFencedFenceSequence"),G(K)):M(K)}function G(K){return K===l?(I++,O.consume(K),G):I>=o?(O.exit("codeFencedFenceSequence"),mt(K)?_t(O,F,"whitespace")(K):F(K)):M(K)}function F(K){return K===null||Ge(K)?(O.exit("codeFencedFence"),T(K)):M(K)}}}function $De(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 m_={name:"codeIndented",tokenize:FDe},BDe={partial:!0,tokenize:UDe};function FDe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),_t(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):Ge(f)?e.attempt(BDe,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||Ge(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function UDe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ge(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):_t(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):Ge(o)?i(o):n(o)}}const HDe={name:"codeText",previous:VDe,resolve:qDe,tokenize:KDe};function qDe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function VDe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KDe(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)):Ge(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||Ge(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 YDe{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&&um(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),um(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),um(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);um(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);um(this.left,n.reverse())}}}function um(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 gY(e){const t={};let n=-1,r,i,a,o,l,c,f;const h=new YDe(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,XDe(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 Ri(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function XDe(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 E=l.slice(S[g],S[g+1]),C=a.pop();c.push([C,C+E.length-1]),e.splice(C,2,E)}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 GDe={resolve:QDe,tokenize:ZDe},WDe={partial:!0,tokenize:JDe};function QDe(e){return gY(e),e}function ZDe(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):Ge(l)?e.check(WDe,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 JDe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),_t(e,a,"linePrefix")}function a(o){if(o===null||Ge(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 vY(e,t,n,r,i,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),g):E===null||E===32||E===41||Qx(E)?n(E):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(E))}function g(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(l),g(E)):E===null||E===60||Ge(E)?n(E):(e.consume(E),E===92?b:v)}function b(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function w(E){return!h&&(E===null||E===41||Zt(E))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(E)):h<f&&E===40?(e.consume(E),h++,w):E===41?(e.consume(E),h--,w):E===null||E===32||E===40||Qx(E)?n(E):(e.consume(E),E===92?S:w)}function S(E){return E===40||E===41||E===92?(e.consume(E),w):w(E)}}function yY(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):Ge(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||Ge(v)||l++>999?(e.exit("chunkString"),h(v)):(e.consume(v),c||(c=!mt(v)),v===92?g:d)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,d):d(v)}}function xY(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):Ge(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_t(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===o||g===null||Ge(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 Ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mt(i)?_t(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const eRe={name:"definition",tokenize:nRe},tRe={partial:!0,tokenize:rRe};function nRe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return yY.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Na(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 Zt(v)?Em(e,f)(v):f(v)}function f(v){return vY(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function h(v){return e.attempt(tRe,d,d)(v)}function d(v){return mt(v)?_t(e,g,"whitespace")(v):g(v)}function g(v){return v===null||Ge(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function rRe(e,t,n){return r;function r(l){return Zt(l)?Em(e,i)(l):n(l)}function i(l){return xY(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return mt(l)?_t(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ge(l)?t(l):n(l)}}const iRe={name:"hardBreakEscape",tokenize:aRe};function aRe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ge(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const oRe={name:"headingAtx",resolve:sRe,tokenize:lRe};function sRe(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"},Ri(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function lRe(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||Zt(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||Ge(h)?(e.exit("atxHeading"),t(h)):mt(h)?_t(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||Zt(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const uRe=["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"],_5=["pre","script","style","textarea"],cRe={concrete:!0,name:"htmlFlow",resolveTo:hRe,tokenize:mRe},fRe={partial:!0,tokenize:gRe},dRe={partial:!0,tokenize:pRe};function hRe(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 mRe(e,t,n){const r=this;let i,a,o,l,c;return f;function f($){return h($)}function h($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),d}function d($){return $===33?(e.consume($),g):$===47?(e.consume($),a=!0,w):$===63?(e.consume($),i=3,r.interrupt?t:R):Yr($)?(e.consume($),o=String.fromCharCode($),S):n($)}function g($){return $===45?(e.consume($),i=2,v):$===91?(e.consume($),i=5,l=0,b):Yr($)?(e.consume($),i=4,r.interrupt?t:R):n($)}function v($){return $===45?(e.consume($),r.interrupt?t:R):n($)}function b($){const Q="CDATA[";return $===Q.charCodeAt(l++)?(e.consume($),l===Q.length?r.interrupt?t:L:b):n($)}function w($){return Yr($)?(e.consume($),o=String.fromCharCode($),S):n($)}function S($){if($===null||$===47||$===62||Zt($)){const Q=$===47,Z=o.toLowerCase();return!Q&&!a&&_5.includes(Z)?(i=1,r.interrupt?t($):L($)):uRe.includes(o.toLowerCase())?(i=6,Q?(e.consume($),E):r.interrupt?t($):L($)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):a?C($):j($))}return $===45||Lr($)?(e.consume($),o+=String.fromCharCode($),S):n($)}function E($){return $===62?(e.consume($),r.interrupt?t:L):n($)}function C($){return mt($)?(e.consume($),C):z($)}function j($){return $===47?(e.consume($),z):$===58||$===95||Yr($)?(e.consume($),A):mt($)?(e.consume($),j):z($)}function A($){return $===45||$===46||$===58||$===95||Lr($)?(e.consume($),A):N($)}function N($){return $===61?(e.consume($),O):mt($)?(e.consume($),N):j($)}function O($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),c=$,T):mt($)?(e.consume($),O):M($)}function T($){return $===c?(e.consume($),c=null,I):$===null||Ge($)?n($):(e.consume($),T)}function M($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Zt($)?N($):(e.consume($),M)}function I($){return $===47||$===62||mt($)?j($):n($)}function z($){return $===62?(e.consume($),B):n($)}function B($){return $===null||Ge($)?L($):mt($)?(e.consume($),B):n($)}function L($){return $===45&&i===2?(e.consume($),D):$===60&&i===1?(e.consume($),q):$===62&&i===4?(e.consume($),H):$===63&&i===3?(e.consume($),R):$===93&&i===5?(e.consume($),V):Ge($)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(fRe,U,G)($)):$===null||Ge($)?(e.exit("htmlFlowData"),G($)):(e.consume($),L)}function G($){return e.check(dRe,F,U)($)}function F($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),K}function K($){return $===null||Ge($)?G($):(e.enter("htmlFlowData"),L($))}function D($){return $===45?(e.consume($),R):L($)}function q($){return $===47?(e.consume($),o="",X):L($)}function X($){if($===62){const Q=o.toLowerCase();return _5.includes(Q)?(e.consume($),H):L($)}return Yr($)&&o.length<8?(e.consume($),o+=String.fromCharCode($),X):L($)}function V($){return $===93?(e.consume($),R):L($)}function R($){return $===62?(e.consume($),H):$===45&&i===2?(e.consume($),R):L($)}function H($){return $===null||Ge($)?(e.exit("htmlFlowData"),U($)):(e.consume($),H)}function U($){return e.exit("htmlFlow"),t($)}}function pRe(e,t,n){const r=this;return i;function i(o){return Ge(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 gRe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(og,t,n)}}const vRe={name:"htmlText",tokenize:yRe};function yRe(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),N):R===63?(e.consume(R),j):Yr(R)?(e.consume(R),M):n(R)}function f(R){return R===45?(e.consume(R),h):R===91?(e.consume(R),a=0,b):Yr(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):Ge(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?D(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):Ge(R)?(o=w,q(R)):(e.consume(R),w)}function S(R){return R===93?(e.consume(R),E):w(R)}function E(R){return R===62?D(R):R===93?(e.consume(R),E):w(R)}function C(R){return R===null||R===62?D(R):Ge(R)?(o=C,q(R)):(e.consume(R),C)}function j(R){return R===null?n(R):R===63?(e.consume(R),A):Ge(R)?(o=j,q(R)):(e.consume(R),j)}function A(R){return R===62?D(R):j(R)}function N(R){return Yr(R)?(e.consume(R),O):n(R)}function O(R){return R===45||Lr(R)?(e.consume(R),O):T(R)}function T(R){return Ge(R)?(o=T,q(R)):mt(R)?(e.consume(R),T):D(R)}function M(R){return R===45||Lr(R)?(e.consume(R),M):R===47||R===62||Zt(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),D):R===58||R===95||Yr(R)?(e.consume(R),z):Ge(R)?(o=I,q(R)):mt(R)?(e.consume(R),I):D(R)}function z(R){return R===45||R===46||R===58||R===95||Lr(R)?(e.consume(R),z):B(R)}function B(R){return R===61?(e.consume(R),L):Ge(R)?(o=B,q(R)):mt(R)?(e.consume(R),B):I(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,G):Ge(R)?(o=L,q(R)):mt(R)?(e.consume(R),L):(e.consume(R),F)}function G(R){return R===i?(e.consume(R),i=void 0,K):R===null?n(R):Ge(R)?(o=G,q(R)):(e.consume(R),G)}function F(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Zt(R)?I(R):(e.consume(R),F)}function K(R){return R===47||R===62||Zt(R)?I(R):n(R)}function D(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 mt(R)?_t(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):V(R)}function V(R){return e.enter("htmlTextData"),o(R)}}const ZN={name:"labelEnd",resolveAll:SRe,resolveTo:ERe,tokenize:_Re},xRe={tokenize:jRe},bRe={tokenize:CRe},wRe={tokenize:kRe};function SRe(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&&Ri(e,0,e.length,n),e}function ERe(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=ia(l,e.slice(a+1,a+r+3)),l=ia(l,[["enter",h,t]]),l=ia(l,Lb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ia(l,[["exit",h,t],e[o-2],e[o-1],["exit",f,t]]),l=ia(l,e.slice(o+1)),l=ia(l,[["exit",c,t]]),Ri(e,a,e.length,l),e}function _Re(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(Na(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(xRe,h,o?h:d)(g):g===91?e.attempt(bRe,h,o?f:d)(g):o?h(g):d(g)}function f(g){return e.attempt(wRe,h,d)(g)}function h(g){return t(g)}function d(g){return a._balanced=!0,n(g)}}function jRe(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 Zt(d)?Em(e,a)(d):a(d)}function a(d){return d===41?h(d):vY(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Zt(d)?Em(e,c)(d):h(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?xY(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function f(d){return Zt(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 CRe(e,t,n){const r=this;return i;function i(l){return yY.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Na(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function kRe(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 ARe={name:"labelStartImage",resolveAll:ZN.resolveAll,tokenize:ORe};function ORe(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 NRe={name:"labelStartLink",resolveAll:ZN.resolveAll,tokenize:TRe};function TRe(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 p_={name:"lineEnding",tokenize:PRe};function PRe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),_t(e,t,"linePrefix")}}const Ny={name:"thematicBreak",tokenize:MRe};function MRe(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||Ge(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===i?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),mt(f)?_t(e,l,"whitespace")(f):l(f))}}const si={continuation:{tokenize:LRe},exit:$Re,name:"list",tokenize:IRe},DRe={partial:!0,tokenize:BRe},RRe={partial:!0,tokenize:zRe};function IRe(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:BC(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(Ny,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 BC(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(og,r.interrupt?n:h,e.attempt(DRe,g,d))}function h(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function d(v){return mt(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 LRe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(og,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_t(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!mt(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(RRe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,_t(e,e.attempt(si,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function zRe(e,t,n){const r=this;return _t(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 $Re(e){e.exit(this.containerState.type)}function BRe(e,t,n){const r=this;return _t(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!mt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const j5={name:"setextUnderline",resolveTo:FRe,tokenize:URe};function FRe(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 URe(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"),mt(f)?_t(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Ge(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const HRe={tokenize:qRe};function qRe(e){const t=this,n=e.attempt(og,r,e.attempt(this.parser.constructs.flowInitial,i,_t(e,e.attempt(this.parser.constructs.flow,i,e.attempt(GDe,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 VRe={resolveAll:wY()},KRe=bY("string"),YRe=bY("text");function bY(e){return{resolveAll:wY(e==="text"?XRe: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 wY(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 XRe(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 GRe={42:si,43:si,45:si,48:si,49:si,50:si,51:si,52:si,53:si,54:si,55:si,56:si,57:si,62:hY},WRe={91:eRe},QRe={[-2]:m_,[-1]:m_,32:m_},ZRe={35:oRe,42:Ny,45:[j5,Ny],60:cRe,61:j5,95:Ny,96:E5,126:E5},JRe={38:pY,92:mY},eIe={[-5]:p_,[-4]:p_,[-3]:p_,33:ARe,38:pY,42:FC,60:[NDe,vRe],91:NRe,92:[iRe,mY],93:ZN,95:FC,96:HDe},tIe={null:[FC,VRe]},nIe={null:[42,95]},rIe={null:[]},iIe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nIe,contentInitial:WRe,disable:rIe,document:GRe,flow:ZRe,flowInitial:QRe,insideSpan:tIe,string:JRe,text:eIe},Symbol.toStringTag,{value:"Module"}));function aIe(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(N),check:T(O),consume:C,enter:j,exit:A,interrupt:T(O,{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(B){return o=ia(o,B),S(),o[o.length-1]!==null?[]:(M(t,0),f.events=Lb(a,f.events,f),f.events)}function g(B,L){return sIe(v(B),L)}function v(B){return oIe(o,B)}function b(){const{_bufferIndex:B,_index:L,line:G,column:F,offset:K}=r;return{_bufferIndex:B,_index:L,line:G,column:F,offset:K}}function w(B){i[B.line]=B.column,z()}function S(){let B;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<L.length;)E(L.charCodeAt(r._bufferIndex));else E(L)}}function E(B){h=h(B)}function C(B){Ge(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,z()):B!==-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=B}function j(B,L){const G=L||{};return G.type=B,G.start=b(),f.events.push(["enter",G,f]),l.push(G),G}function A(B){const L=l.pop();return L.end=b(),f.events.push(["exit",L,f]),L}function N(B,L){M(B,L.from)}function O(B,L){L.restore()}function T(B,L){return G;function G(F,K,D){let q,X,V,R;return Array.isArray(F)?U(F):"tokenize"in F?U([F]):H(F);function H(ne){return te;function te(ie){const ee=ie!==null&&ne[ie],le=ie!==null&&ne.null,pe=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(le)?le:le?[le]:[]];return U(pe)(ie)}}function U(ne){return q=ne,X=0,ne.length===0?D:$(ne[X])}function $(ne){return te;function te(ie){return R=I(),V=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?Z():ne.tokenize.call(L?Object.assign(Object.create(f),L):f,c,Q,Z)(ie)}}function Q(ne){return B(V,R),K}function Z(ne){return R.restore(),++X<q.length?$(q[X]):D}}}function M(B,L){B.resolveAll&&!a.includes(B)&&a.push(B),B.resolve&&Ri(f.events,L,f.events.length-L,B.resolve(f.events.slice(L),f)),B.resolveTo&&(f.events=B.resolveTo(f.events,f))}function I(){const B=b(),L=f.previous,G=f.currentConstruct,F=f.events.length,K=Array.from(l);return{from:F,restore:D};function D(){r=B,f.previous=L,f.currentConstruct=G,f.events.length=F,l=K,z()}}function z(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function oIe(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 sIe(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 lIe(e){const r={constructs:fY([iIe,...(e||{}).extensions||[]]),content:i(EDe),defined:[],document:i(jDe),flow:i(HRe),lazy:{},string:i(KRe),text:i(YRe)};return r;function i(a){return o;function o(l){return aIe(r,a,l)}}}function uIe(e){for(;!gY(e););return e}const C5=/[\0\t\n\r]/g;function cIe(){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(C5.lastIndex=d,f=C5.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 fIe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dIe(e){return e.replace(fIe,hIe)}function hIe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return dY(n.slice(a?2:1),a?16:10)}return QN(n)||e}const SY={}.hasOwnProperty;function mIe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),pIe(n)(uIe(lIe(n).document().write(cIe()(e,t,!0))))}function pIe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(tt),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(Le),blockQuote:a(le),characterEscape:I,characterReference:I,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(ae,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(we),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(Xe,o),htmlFlowData:I,htmlText:a(Xe,o),htmlTextData:I,image:a(Ke),label:o,link:a(tt),listItem:a(En),listItemValue:g,listOrdered:a(sn,d),listUnordered:a(sn),paragraph:a(Et),reference:$,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Le),strong:a(vn),thematicBreak:a(Jt)},exit:{atxHeading:c(),atxHeadingSequence:N,autolink:c(),autolinkEmail:ee,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:ne,characterReference:te,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:z,codeIndented:c(E),codeText:c(K),codeTextData:z,data:z,definition:c(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(L),hardBreakTrailing:c(L),htmlFlow:c(G),htmlFlowData:z,htmlText:c(F),htmlTextData:z,image:c(q),label:V,labelText:X,lineEnding:B,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:R,resourceTitleString:H,resource:U,setextHeading:c(M),setextHeadingLineSequence:T,setextHeadingText:O,strong:c(),thematicBreak:c()}};EY(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let oe={type:"root",children:[]};const ke={stack:[oe],tokenStack:[],config:t,enter:l,exit:f,buffer:o,resume:h,data:n},Ue=[];let Ye=-1;for(;++Ye<he.length;)if(he[Ye][1].type==="listOrdered"||he[Ye][1].type==="listUnordered")if(he[Ye][0]==="enter")Ue.push(Ye);else{const yn=Ue.pop();Ye=i(he,yn,Ye)}for(Ye=-1;++Ye<he.length;){const yn=t[he[Ye][0]];SY.call(yn,he[Ye][1].type)&&yn[he[Ye][1].type].call(Object.assign({sliceSerialize:he[Ye][2].sliceSerialize},ke),he[Ye][1])}if(ke.tokenStack.length>0){const yn=ke.tokenStack[ke.tokenStack.length-1];(yn[1]||k5).call(ke,void 0,yn[0])}for(oe.position={start:pl(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:pl(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)oe=t.transforms[Ye](oe)||oe;return oe}function i(he,oe,ke){let Ue=oe-1,Ye=-1,yn=!1,ln,Xt,Se,ut;for(;++Ue<=ke;){const Qe=he[Ue];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ye++:Ye--,ut=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(ln&&!ut&&!Ye&&!Se&&(Se=Ue),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Ye&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ye===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(ln){let Dn=Ue;for(Xt=void 0;Dn--;){const xn=he[Dn];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;Xt&&(he[Xt][1].type="lineEndingBlank",yn=!0),xn[1].type="lineEnding",Xt=Dn}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}Se&&(!Xt||Se<Xt)&&(ln._spread=!0),ln.end=Object.assign({},Xt?he[Xt][1].start:Qe[1].end),he.splice(Xt||Ue,0,["exit",ln,Qe[2]]),Ue++,ke++}if(Qe[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};ln=Dn,he.splice(Ue,0,["enter",Dn,Qe[2]]),Ue++,ke++,Se=void 0,ut=!0}}}return he[oe][1]._spread=yn,ke}function a(he,oe){return ke;function ke(Ue){l.call(this,he(Ue),Ue),oe&&oe.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(he,oe,ke){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([oe,ke||void 0]),he.position={start:pl(oe.start),end:void 0}}function c(he){return oe;function oe(ke){he&&he.call(this,ke),f.call(this,ke)}}function f(he,oe){const ke=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==he.type&&(oe?oe.call(this,he,Ue[0]):(Ue[1]||k5).call(this,he,Ue[0]));else throw new Error("Cannot close `"+he.type+"` ("+Sm({start:he.start,end:he.end})+"): it’s not open");ke.position.end=pl(he.end)}function h(){return WN(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function g(he){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function v(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=he}function b(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.value=he.replace(/(\r?\n|\r)$/g,"")}function C(he){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.label=oe,ke.identifier=Na(this.sliceSerialize(he)).toLowerCase()}function j(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.title=he}function A(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.url=he}function N(he){const oe=this.stack[this.stack.length-1];if(!oe.depth){const ke=this.sliceSerialize(he).length;oe.depth=ke}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function T(he){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function I(he){const ke=this.stack[this.stack.length-1].children;let Ue=ke[ke.length-1];(!Ue||Ue.type!=="text")&&(Ue=Pt(),Ue.position={start:pl(he.start),end:void 0},ke.push(Ue)),this.stack.push(Ue)}function z(he){const oe=this.stack.pop();oe.value+=this.sliceSerialize(he),oe.position.end=pl(he.end)}function B(he){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=oe.children[oe.children.length-1];ke.position.end=pl(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(I.call(this,he),z.call(this,he))}function L(){this.data.atHardBreak=!0}function G(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.value=he}function F(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.value=he}function K(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.value=he}function D(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=oe,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function q(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=oe,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function X(he){const oe=this.sliceSerialize(he),ke=this.stack[this.stack.length-2];ke.label=dIe(oe),ke.identifier=Na(oe).toLowerCase()}function V(){const he=this.stack[this.stack.length-1],oe=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Ue=he.children;ke.children=Ue}else ke.alt=oe}function R(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.url=he}function H(){const he=this.resume(),oe=this.stack[this.stack.length-1];oe.title=he}function U(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function Q(he){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.label=oe,ke.identifier=Na(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function Z(he){this.data.characterReferenceType=he.type}function ne(he){const oe=this.sliceSerialize(he),ke=this.data.characterReferenceType;let Ue;ke?(Ue=dY(oe,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=QN(oe);const Ye=this.stack[this.stack.length-1];Ye.value+=Ue}function te(he){const oe=this.stack.pop();oe.position.end=pl(he.end)}function ie(he){z.call(this,he);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(he)}function ee(he){z.call(this,he);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(he)}function le(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ae(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function we(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function Ke(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function sn(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function En(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Et(){return{type:"paragraph",children:[]}}function vn(){return{type:"strong",children:[]}}function Pt(){return{type:"text",value:""}}function Jt(){return{type:"thematicBreak"}}}function pl(e){return{line:e.line,column:e.column,offset:e.offset}}function EY(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?EY(e,r):gIe(e,r)}}function gIe(e,t){let n;for(n in t)if(SY.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 k5(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Sm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Sm({start:t.start,end:t.end})+") is still open")}function vIe(e){const t=this;t.parser=n;function n(r){return mIe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yIe(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 xIe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function bIe(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 wIe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SIe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EIe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Xd(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 _Ie(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 jIe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _Y(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 CIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _Y(e,t);const i={src:Xd(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 kIe(e,t){const n={src:Xd(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 AIe(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 OIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _Y(e,t);const i={href:Xd(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 NIe(e,t){const n={href:Xd(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 TIe(e,t,n){const r=e.all(t),i=n?PIe(n):jY(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 PIe(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=jY(n[r])}return t}function jY(e){const t=e.spread;return t??e.children.length>1}function MIe(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 DIe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RIe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function IIe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LIe(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=KN(t.children[1]),c=iY(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 zIe(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 $Ie(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const A5=9,O5=32;function BIe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(N5(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(N5(t.slice(i),i>0,!1)),a.join("")}function N5(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===A5||a===O5;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===A5||a===O5;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function FIe(e,t){const n={type:"text",value:BIe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UIe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const HIe={blockquote:yIe,break:xIe,code:bIe,delete:wIe,emphasis:SIe,footnoteReference:EIe,heading:_Ie,html:jIe,imageReference:CIe,image:kIe,inlineCode:AIe,linkReference:OIe,link:NIe,listItem:TIe,list:MIe,paragraph:DIe,root:RIe,strong:IIe,table:LIe,tableCell:$Ie,tableRow:zIe,text:FIe,thematicBreak:UIe,toml:sy,yaml:sy,definition:sy,footnoteDefinition:sy};function sy(){}const CY=-1,zb=0,_m=1,Zx=2,JN=3,eT=4,tT=5,nT=6,kY=7,AY=8,T5=typeof self=="object"?self:globalThis,qIe=(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 zb:case CY:return n(o,i);case _m:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Zx:{const l=n({},i);for(const[c,f]of o)l[r(c)]=r(f);return l}case JN:return n(new Date(o),i);case eT:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case tT:{const l=n(new Map,i);for(const[c,f]of o)l.set(r(c),r(f));return l}case nT:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case kY:{const{name:l,message:c}=o;return n(new T5[l](c),i)}case AY: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 T5[a](o),i)};return r},P5=e=>qIe(new Map,e)(0),jf="",{toString:VIe}={},{keys:KIe}=Object,cm=e=>{const t=typeof e;if(t!=="object"||!e)return[zb,t];const n=VIe.call(e).slice(8,-1);switch(n){case"Array":return[_m,jf];case"Object":return[Zx,jf];case"Date":return[JN,jf];case"RegExp":return[eT,jf];case"Map":return[tT,jf];case"Set":return[nT,jf];case"DataView":return[_m,n]}return n.includes("Array")?[_m,n]:n.includes("Error")?[kY,n]:[Zx,n]},ly=([e,t])=>e===zb&&(t==="function"||t==="symbol"),YIe=(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]=cm(o);switch(l){case zb:{let h=o;switch(c){case"bigint":l=AY,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([CY],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 Zx:{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 KIe(o))(e||!ly(cm(o[g])))&&h.push([a(g),a(o[g])]);return d}case JN:return i([l,o.toISOString()],o);case eT:{const{source:h,flags:d}=o;return i([l,{source:h,flags:d}],o)}case tT:{const h=[],d=i([l,h],o);for(const[g,v]of o)(e||!(ly(cm(g))||ly(cm(v))))&&h.push([a(g),a(v)]);return d}case nT:{const h=[],d=i([l,h],o);for(const g of o)(e||!ly(cm(g)))&&h.push(a(g));return d}}const{message:f}=o;return i([l,{name:c,message:f}],o)};return a},M5=(e,{json:t,lossy:n}={})=>{const r=[];return YIe(!(t||n),!!t,new Map,r)(e),r},Jx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?P5(M5(e,t)):structuredClone(e):(e,t)=>P5(M5(e,t));function XIe(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 GIe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WIe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||XIe,r=e.options.footnoteBackLabel||GIe,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=Xd(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 E={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(h,!0)};e.patch(f,E),l.push(E)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Jx(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 $b=(function(e){if(e==null)return eLe;if(typeof e=="function")return Bb(e);if(typeof e=="object")return Array.isArray(e)?QIe(e):ZIe(e);if(typeof e=="string")return JIe(e);throw new Error("Expected function, string, or object as test")});function QIe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$b(e[n]);return Bb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function ZIe(e){const t=e;return Bb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function JIe(e){return Bb(t);function t(n){return n&&n.type===e}}function Bb(e){return t;function t(n,r,i){return!!(tLe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function eLe(){return!0}function tLe(e){return e!==null&&typeof e=="object"&&"type"in e}const OY=[],nLe=!0,UC=!1,rLe="skip";function NY(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=$b(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=OY,b,w,S;if((!t||a(c,f,h[h.length-1]||void 0))&&(v=iLe(n(c,h)),v[0]===UC))return v;if("children"in c&&c.children){const E=c;if(E.children&&v[0]!==rLe)for(w=(r?E.children.length:-1)+o,S=h.concat(E);w>-1&&w<E.children.length;){const C=E.children[w];if(b=l(C,w,S)(),b[0]===UC)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function iLe(e){return Array.isArray(e)?e:typeof e=="number"?[nLe,e]:e==null?OY:[e]}function rT(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),NY(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 HC={}.hasOwnProperty,aLe={};function oLe(e,t){const n=t||aLe,r=new Map,i=new Map,a=new Map,o={...HIe,...n.handlers},l={all:f,applyData:lLe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:sLe,wrap:cLe};return rT(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(HC.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,E=Jx(S);return E.children=l.all(h),E}return Jx(h)}return(l.options.unknownHandler||uLe)(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=D5(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=D5(w.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function sLe(e,t){e.position&&(t.position=GMe(e))}function lLe(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,Jx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function uLe(e,t){const n=t.data||{},r="value"in t&&!(HC.call(n,"hProperties")||HC.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 cLe(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 D5(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function R5(e,t){const n=oLe(e,t),r=n.one(e,void 0),i=WIe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function fLe(e,t){return e&&"run"in e?async function(n,r){const i=R5(n,{file:r,...t});await e.run(i,r)}:function(n,r){return R5(n,{file:r,...e||t})}}function I5(e){if(e)throw e}var g_,L5;function dLe(){if(L5)return g_;L5=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 g_=function c(){var f,h,d,g,v,b,w=arguments[0],S=1,E=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<E;++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},g_}var hLe=dLe();const v_=Bi(hLe);function qC(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 mLe(){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?pLe(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 pLe(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 eo={basename:gLe,dirname:vLe,extname:yLe,join:xLe,sep:"/"};function gLe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sg(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 vLe(e){if(sg(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 yLe(e){sg(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 xLe(...e){let t=-1,n;for(;++t<e.length;)sg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bLe(n)}function bLe(e){sg(e);const t=e.codePointAt(0)===47;let n=wLe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function wLe(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 sg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SLe={cwd:ELe};function ELe(){return"/"}function VC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _Le(e){if(typeof e=="string")e=new URL(e);else if(!VC(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 jLe(e)}function jLe(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 y_=["history","path","basename","stem","extname","dirname"];class TY{constructor(t){let n;t?VC(t)?n={path:t}:typeof t=="string"||CLe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":SLe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<y_.length;){const a=y_[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)y_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?eo.basename(this.path):void 0}set basename(t){b_(t,"basename"),x_(t,"basename"),this.path=eo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?eo.dirname(this.path):void 0}set dirname(t){z5(this.basename,"dirname"),this.path=eo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?eo.extname(this.path):void 0}set extname(t){if(x_(t,"extname"),z5(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=eo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){VC(t)&&(t=_Le(t)),b_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?eo.basename(this.path,this.extname):void 0}set stem(t){b_(t,"stem"),x_(t,"stem"),this.path=eo.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 Ur(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 x_(e,t){if(e&&e.includes(eo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+eo.sep+"`")}function b_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function z5(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function CLe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kLe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),ALe={}.hasOwnProperty;class iT extends kLe{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=mLe()}copy(){const t=new iT;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(v_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(E_("data",this.frozen),this.namespace[t]=n,this):ALe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(E_("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=uy(t),r=this.parser||this.Parser;return w_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),w_("process",this.parser||this.Parser),S_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=uy(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);TLe(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(),w_("processSync",this.parser||this.Parser),S_("processSync",this.compiler||this.Compiler),this.process(t,i),B5("processSync","process",n),r;function i(a,o){n=!0,I5(a),r=o}}run(t,n,r){$5(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=uy(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),B5("runSync","run",r),i;function a(o,l){I5(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=uy(n),i=this.compiler||this.Compiler;return S_("stringify",i),$5(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(E_("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=v_(!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];qC(w)&&qC(v)&&(v=v_(!0,w,v)),r[g]=[f,v,...b]}}}}const OLe=new iT().freeze();function w_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function S_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function E_(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 $5(e){if(!qC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function B5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function uy(e){return NLe(e)?e:new TY(e)}function NLe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function TLe(e){return typeof e=="string"||PLe(e)}function PLe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MLe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",F5=[],U5={allowDangerousHtml:!0},DLe=/^(https?|ircs?|mailto|xmpp)$/i,RLe=[{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 ILe(e){const t=LLe(e),n=zLe(e);return $Le(t.runSync(t.parse(n),n),e)}function LLe(e){const t=e.rehypePlugins||F5,n=e.remarkPlugins||F5,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...U5}:U5;return OLe().use(vIe).use(n).use(fLe,r).use(t)}function zLe(e){const t=e.children||"",n=new TY;return typeof t=="string"&&(n.value=t),n}function $Le(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||BLe;for(const h of RLe)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+MLe+h.id,void 0);return rT(e,f),eDe(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 h_)if(Object.hasOwn(h_,v)&&Object.hasOwn(h.properties,v)){const b=h.properties[v],w=h_[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 BLe(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||DLe.test(e.slice(0,t))?e:""}function H5(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 FLe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ULe(e,t,n){const i=$b((n||{}).ignore||[]),a=HLe(t);let o=-1;for(;++o<a.length;)NY(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 E=!1,C=[];g.lastIndex=0;let j=g.exec(f.value);for(;j;){const A=j.index,N={index:j.index,input:j.input,stack:[...h,f]};let O=v(...j,N);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?g.lastIndex=A+1:(b!==A&&C.push({type:"text",value:f.value.slice(b,A)}),Array.isArray(O)?C.push(...O):O&&C.push(O),b=A+j[0].length,E=!0),!g.global)break;j=g.exec(f.value)}return E?(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 HLe(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([qLe(i[0]),VLe(i[1])])}return t}function qLe(e){return typeof e=="string"?new RegExp(FLe(e),"g"):e}function VLe(e){return typeof e=="function"?e:function(){return e}}const __="phrasing",j_=["autolink","link","image","label"];function KLe(){return{transforms:[JLe],enter:{literalAutolink:XLe,literalAutolinkEmail:C_,literalAutolinkHttp:C_,literalAutolinkWww:C_},exit:{literalAutolink:ZLe,literalAutolinkEmail:QLe,literalAutolinkHttp:GLe,literalAutolinkWww:WLe}}}function YLe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:__,notInConstruct:j_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:__,notInConstruct:j_},{character:":",before:"[ps]",after:"\\/",inConstruct:__,notInConstruct:j_}]}}function XLe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function C_(e){this.config.enter.autolinkProtocol.call(this,e)}function GLe(e){this.config.exit.autolinkProtocol.call(this,e)}function WLe(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 QLe(e){this.config.exit.autolinkEmail.call(this,e)}function ZLe(e){this.exit(e)}function JLe(e){ULe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eze],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tze]],{ignore:["link","linkReference"]})}function eze(e,t,n,r,i){let a="";if(!PY(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!nze(n)))return!1;const o=rze(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 tze(e,t,n,r){return!PY(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function nze(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 rze(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=H5(e,"(");let a=H5(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 PY(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bc(n)||Ib(n))&&(!t||n!==47)}MY.peek=dze;function ize(){this.buffer()}function aze(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function oze(){this.buffer()}function sze(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lze(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uze(e){this.exit(e)}function cze(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fze(e){this.exit(e)}function dze(){return"["}function MY(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 hze(){return{enter:{gfmFootnoteCallString:ize,gfmFootnoteCall:aze,gfmFootnoteDefinitionLabelString:oze,gfmFootnoteDefinition:sze},exit:{gfmFootnoteCallString:lze,gfmFootnoteCall:uze,gfmFootnoteDefinitionLabelString:cze,gfmFootnoteDefinition:fze}}}function mze(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:MY},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?DY:pze))),f(),c}}function pze(e,t,n){return t===0?e:DY(e,t,n)}function DY(e,t,n){return(n?"":"    ")+e}const gze=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];RY.peek=wze;function vze(){return{canContainEols:["delete"],enter:{strikethrough:xze},exit:{strikethrough:bze}}}function yze(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gze}],handlers:{delete:RY}}}function xze(e){this.enter({type:"delete",children:[]},e)}function bze(e){this.exit(e)}function RY(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 wze(){return"~"}function Sze(e){return e.length}function Eze(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Sze,a=[],o=[],l=[],c=[];let f=0,h=-1;for(;++h<e.length;){const w=[],S=[];let E=-1;for(e[h].length>f&&(f=e[h].length);++E<e[h].length;){const C=_ze(e[h][E]);if(n.alignDelimiters!==!1){const j=i(C);S[E]=j,(c[E]===void 0||j>c[E])&&(c[E]=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]=q5(r[d]);else{const w=q5(r);for(;++d<f;)a[d]=w}d=-1;const g=[],v=[];for(;++d<f;){const w=a[d];let S="",E="";w===99?(S=":",E=":"):w===108?S=":":w===114&&(E=":");let C=n.alignDelimiters===!1?1:Math.max(1,c[d]-S.length-E.length);const j=S+"-".repeat(C)+E;n.alignDelimiters!==!1&&(C=S.length+C+E.length,C>c[d]&&(c[d]=C),v[d]=C),g[d]=j}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 E=[];for(;++d<f;){const C=w[d]||"";let j="",A="";if(n.alignDelimiters!==!1){const N=c[d]-(S[d]||0),O=a[d];O===114?j=" ".repeat(N):O===99?N%2?(j=" ".repeat(N/2+.5),A=" ".repeat(N/2-.5)):(j=" ".repeat(N/2),A=j):A=" ".repeat(N)}n.delimiterStart!==!1&&!d&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||d)&&E.push(" "),n.alignDelimiters!==!1&&E.push(j),E.push(C),n.alignDelimiters!==!1&&E.push(A),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&E.push("|")}b.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return b.join(`
`)}function _ze(e){return e==null?"":String(e)}function q5(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 jze(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()),Cze);return i(),o}function Cze(e,t,n){return">"+(n?"":" ")+e}function kze(e,t){return V5(e,t.inConstruct,!0)&&!V5(e,t.notInConstruct,!1)}function V5(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 K5(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&kze(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Aze(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 Oze(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 Nze(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 Tze(e,t,n,r){const i=Nze(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Oze(e,n)){const d=n.enter("codeIndented"),g=n.indentLines(a,Pze);return d(),g}const l=n.createTracker(r),c=i.repeat(Math.max(Aze(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 Pze(e,t,n){return(n?"":"    ")+e}function aT(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 Mze(e,t,n,r){const i=aT(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 Dze(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 op(e){return"&#x"+e.toString(16).toUpperCase()+";"}function e0(e,t,n){const r=Cd(e),i=Cd(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}}IY.peek=Rze;function IY(e,t,n,r){const i=Dze(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=e0(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=op(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=e0(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+op(d));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+v}function Rze(e,t,n){return n.options.emphasis||"*"}function Ize(e,t){let n=!1;return rT(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,UC}),!!((!e.depth||e.depth<3)&&WN(e)&&(t.options.setext||n))}function Lze(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Ize(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=op(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,n.options.closeAtx&&(f+=" "+o),c(),l(),f}LY.peek=zze;function LY(e){return e.value||""}function zze(){return"<"}zY.peek=$ze;function zY(e,t,n,r){const i=aT(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 $ze(){return"!"}$Y.peek=Bze;function $Y(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 Bze(){return"!"}BY.peek=Fze;function BY(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 Fze(){return"`"}function FY(e,t){const n=WN(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))}UY.peek=Uze;function UY(e,t,n,r){const i=aT(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(FY(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 Uze(e,t,n){return FY(e,n)?"<":"["}HY.peek=Hze;function HY(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 Hze(){return"["}function oT(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 qze(e){const t=oT(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 Vze(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 qY(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 Kze(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Vze(n):oT(n);const l=e.ordered?o==="."?")":".":qze(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),qY(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 Yze(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 Xze(e,t,n,r){const i=Yze(n);let a=n.bulletCurrent||oT(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 Gze(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Wze=$b(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Qze(e,t,n,r){return(e.children.some(function(o){return Wze(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Zze(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}VY.peek=Jze;function VY(e,t,n,r){const i=Zze(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=e0(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=op(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=e0(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+op(d));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},l+c+v}function Jze(e,t,n){return n.options.strong||"*"}function e3e(e,t,n,r){return n.safe(e.value,r)}function t3e(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 n3e(e,t,n){const r=(qY(n)+(n.options.ruleSpaces?" ":"")).repeat(t3e(n));return n.options.ruleSpaces?r.slice(0,-1):r}const KY={blockquote:jze,break:K5,code:Tze,definition:Mze,emphasis:IY,hardBreak:K5,heading:Lze,html:LY,image:zY,imageReference:$Y,inlineCode:BY,link:UY,linkReference:HY,list:Kze,listItem:Xze,paragraph:Gze,root:Qze,strong:VY,text:e3e,thematicBreak:n3e};function r3e(){return{enter:{table:i3e,tableData:Y5,tableHeader:Y5,tableRow:o3e},exit:{codeText:s3e,table:a3e,tableData:k_,tableHeader:k_,tableRow:k_}}}function i3e(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 a3e(e){this.exit(e),this.data.inTable=void 0}function o3e(e){this.enter({type:"tableRow",children:[]},e)}function k_(e){this.exit(e)}function Y5(e){this.enter({type:"tableCell",children:[]},e)}function s3e(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,l3e));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function l3e(e,t){return t==="|"?t:e}function u3e(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 E=d(v,w,S),C=f([E]);return C.slice(0,C.indexOf(`
`))}function c(v,b,w,S){const E=w.enter("tableCell"),C=w.enter("phrasing"),j=w.containerPhrasing(v,{...S,before:a,after:a});return C(),E(),j}function f(v,b){return Eze(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function h(v,b,w){const S=v.children;let E=-1;const C=[],j=b.enter("table");for(;++E<S.length;)C[E]=d(S[E],b,w);return j(),C}function d(v,b,w){const S=v.children;let E=-1;const C=[],j=b.enter("tableRow");for(;++E<S.length;)C[E]=c(S[E],v,b,w);return j(),C}function g(v,b,w){let S=KY.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function c3e(){return{exit:{taskListCheckValueChecked:X5,taskListCheckValueUnchecked:X5,paragraph:d3e}}}function f3e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:h3e}}}function X5(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function d3e(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 h3e(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=KY.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 m3e(){return[KLe(),hze(),vze(),r3e(),c3e()]}function p3e(e){return{extensions:[YLe(),mze(e),yze(),u3e(e),f3e()]}}const g3e={tokenize:S3e,partial:!0},YY={tokenize:E3e,partial:!0},XY={tokenize:_3e,partial:!0},GY={tokenize:j3e,partial:!0},v3e={tokenize:C3e,partial:!0},WY={name:"wwwAutolink",tokenize:b3e,previous:ZY},QY={name:"protocolAutolink",tokenize:w3e,previous:JY},Ds={name:"emailAutolink",tokenize:x3e,previous:eX},_o={};function y3e(){return{text:_o}}let Ou=48;for(;Ou<123;)_o[Ou]=Ds,Ou++,Ou===58?Ou=65:Ou===91&&(Ou=97);_o[43]=Ds;_o[45]=Ds;_o[46]=Ds;_o[95]=Ds;_o[72]=[Ds,QY];_o[104]=[Ds,QY];_o[87]=[Ds,WY];_o[119]=[Ds,WY];function x3e(e,t,n){const r=this;let i,a;return o;function o(d){return!KC(d)||!eX.call(r,r.previous)||sT(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return KC(d)?(e.consume(d),l):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(v3e,h,f)(d):d===45||d===95||Lr(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&&Yr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function b3e(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!ZY.call(r,r.previous)||sT(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(g3e,e.attempt(YY,e.attempt(XY,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function w3e(e,t,n){const r=this;let i="",a=!1;return o;function o(d){return(d===72||d===104)&&JY.call(r,r.previous)&&!sT(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(Yr(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||Qx(d)||Zt(d)||bc(d)||Ib(d)?n(d):e.attempt(YY,e.attempt(XY,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function S3e(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 E3e(e,t,n){let r,i,a;return o;function o(f){return f===46||f===95?e.check(GY,c,l)(f):f===null||Zt(f)||bc(f)||f!==45&&Ib(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 _3e(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(GY,t,a)(o):o===null||Zt(o)||bc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function j3e(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||Zt(l)||bc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||Zt(l)||bc(l)?t(l):r(l)}function a(l){return Yr(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):Yr(l)?(e.consume(l),o):n(l)}}function C3e(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Lr(a)?n(a):t(a)}}function ZY(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Zt(e)}function JY(e){return!Yr(e)}function eX(e){return!(e===47||KC(e))}function KC(e){return e===43||e===45||e===46||e===95||Lr(e)}function sT(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 k3e={tokenize:R3e,partial:!0};function A3e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:P3e,continuation:{tokenize:M3e},exit:D3e}},text:{91:{name:"gfmFootnoteCall",tokenize:T3e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O3e,resolveTo:N3e}}}}function O3e(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=Na(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 N3e(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 T3e(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||Zt(d))return n(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Na(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Zt(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 P3e(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||Zt(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Na(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return Zt(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),_t(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function M3e(e,t,n){return e.check(og,t,e.attempt(k3e,t,n))}function D3e(e){e.exit("gfmFootnoteDefinition")}function R3e(e,t,n){const r=this;return _t(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 I3e(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&&Ri(g,g.length,0,Lb(v,o.slice(f+1,c),l)),Ri(g,g.length,0,[["exit",d,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",h,l]]),Ri(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=Cd(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"),E=Cd(b);return S._open=!E||E===2&&!!w,S._close=!w||w===2&&!!E,l(b)}}}class L3e{constructor(){this.map=[]}add(t,n,r){z3e(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 z3e(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 $3e(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 B3e(){return{flow:{null:{name:"table",tokenize:F3e,resolveAll:U3e}}}}function F3e(e,t,n){const r=this;let i=0,a=0,o;return l;function l(z){let B=r.events.length-1;for(;B>-1;){const F=r.events[B][1].type;if(F==="lineEnding"||F==="linePrefix")B--;else break}const L=B>-1?r.events[B][1].type:null,G=L==="tableHead"||L==="tableRow"?O:c;return G===O&&r.parser.lazy[r.now().line]?n(z):G(z)}function c(z){return e.enter("tableHead"),e.enter("tableRow"),f(z)}function f(z){return z===124||(o=!0,a+=1),h(z)}function h(z){return z===null?n(z):Ge(z)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),v):n(z):mt(z)?_t(e,h,"whitespace")(z):(a+=1,o&&(o=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),d(z)))}function d(z){return z===null||z===124||Zt(z)?(e.exit("data"),h(z)):(e.consume(z),z===92?g:d)}function g(z){return z===92||z===124?(e.consume(z),d):d(z)}function v(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),o=!1,mt(z)?_t(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):b(z))}function b(z){return z===45||z===58?S(z):z===124?(o=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),w):N(z)}function w(z){return mt(z)?_t(e,S,"whitespace")(z):S(z)}function S(z){return z===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),E):z===45?(a+=1,E(z)):z===null||Ge(z)?A(z):N(z)}function E(z){return z===45?(e.enter("tableDelimiterFiller"),C(z)):N(z)}function C(z){return z===45?(e.consume(z),C):z===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(z))}function j(z){return mt(z)?_t(e,A,"whitespace")(z):A(z)}function A(z){return z===124?b(z):z===null||Ge(z)?!o||i!==a?N(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):N(z)}function N(z){return n(z)}function O(z){return e.enter("tableRow"),T(z)}function T(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),T):z===null||Ge(z)?(e.exit("tableRow"),t(z)):mt(z)?_t(e,T,"whitespace")(z):(e.enter("data"),M(z))}function M(z){return z===null||z===124||Zt(z)?(e.exit("data"),T(z)):(e.consume(z),z===92?I:M)}function I(z){return z===92||z===124?(e.consume(z),M):M(z)}}function U3e(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 L3e;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(G5(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=cy(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=cy(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=cy(g,t,a,i,n,d)):o[1]!==0&&(d=cy(g,t,o,i,n,d)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&G5(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=$3e(t.events,n))}return e}function cy(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Nf(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Nf(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=Nf(t.events,n[2]),h=Nf(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({},Nf(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function G5(e,t,n,r,i){const a=[],o=Nf(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 Nf(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const H3e={name:"tasklistCheck",tokenize:V3e};function q3e(){return{text:{91:H3e}}}function V3e(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 Zt(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 Ge(c)?t(c):mt(c)?e.check({tokenize:K3e},t,n)(c):n(c)}}function K3e(e,t,n){return _t(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Y3e(e){return fY([y3e(),A3e(),I3e(e),B3e(),q3e()])}const X3e={};function G3e(e){const t=this,n=e||X3e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Y3e(n)),a.push(m3e()),o.push(p3e(n))}function sp({content:e,className:t}){return m.jsx("div",{className:t,children:m.jsx(ILe,{remarkPlugins:[G3e],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 W3e(){const{projectId:e,runId:t}=yp(),[n]=VQ(),r=Number(e),i=T=>T==="starting"||T==="running",a=Nse(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);x.useEffect(()=>{if(!l)return;const T=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(T)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:f,chatMessages:h,traceEvents:d,treeData:g,connected:v,respond:b}=HN(t??"",l||c),w=g??(o==null?void 0:o.tree)??null,S=(o==null?void 0:o.events)??[],E=d.length>0?d:S,[C,j]=x.useState(void 0);if(x.useEffect(()=>{f.length>0&&j("chat")},[f]),a.isLoading)return m.jsx(jMe,{});if(a.error)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{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(mo,{className:"h-4 w-4"}),m.jsx("span",{children:"Session not found"})]});const A=r4e(E),N=n4e(E),O=n.get("tab")??(l?"agent-tree":"overview");return m.jsxs("div",{className:"space-y-6",children:[m.jsx(Q3e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),m.jsx(e4e,{session:o}),m.jsxs(CN,{value:C??O,onValueChange:j,children:[m.jsxs(kN,{children:[m.jsx(Ai,{value:"overview",children:"Overview"}),c&&m.jsxs(Ai,{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(Ai,{value:"agent-tree",children:"Agent Tree"}),m.jsx(Ai,{value:"logs",children:"Logs"}),m.jsxs(Ai,{value:"trace",children:["Trace",E.length>0&&` (${E.length})`]}),m.jsxs(Ai,{value:"artifacts",children:["Artifacts",A.length>0&&` (${A.length})`]})]}),m.jsxs(Oi,{value:"overview",className:"space-y-4",children:[o.user_task&&m.jsx(Lf,{defaultOpen:!0,children:m.jsxs("div",{className:"space-y-2",children:[m.jsxs(zf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[m.jsx(Xu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"User Task"]}),m.jsx($f,{children:m.jsx(bn,{children:m.jsx(wn,{className:"pt-4",children:m.jsx(sp,{content:o.user_task,className:"text-sm"})})})})]})}),o.task&&m.jsx(Lf,{defaultOpen:!o.user_task,children:m.jsxs("div",{className:"space-y-2",children:[m.jsxs(zf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[m.jsx(Xu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"Task"]}),m.jsx($f,{children:m.jsx(bn,{children:m.jsx(wn,{className:"pt-4",children:m.jsx(sp,{content:o.task,className:"text-sm"})})})})]})}),N&&m.jsx(Lf,{defaultOpen:!0,children:m.jsxs("div",{className:"space-y-2",children:[m.jsxs(zf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[m.jsx(Xu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"Output"]}),m.jsx($f,{children:m.jsx(bn,{children:m.jsx(wn,{className:"pt-4",children:m.jsx(t4e,{runId:o.run_id,hash:N})})})})]})}),!o.user_task&&!o.task&&!N&&m.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&m.jsx(Oi,{value:"chat",children:m.jsx(_Me,{pendingAskUsers:f,initialMessages:h,respond:b})}),m.jsx(Oi,{value:"agent-tree",children:m.jsx(xMe,{treeData:w,connected:v})}),m.jsx(Oi,{value:"logs",children:Object.keys(o.agents).length>0?m.jsx(wMe,{runId:o.run_id,agents:o.agents,active:l}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),m.jsx(Oi,{value:"trace",children:E.length>0?m.jsx(l4e,{events:E,runId:o.run_id}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),m.jsx(Oi,{value:"artifacts",children:A.length>0?m.jsx(i4e,{artifacts:A,runId:o.run_id}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function Q3e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=x.useState(!1),o=hA(),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(je,{variant:"outline",size:"sm",asChild:!0,children:m.jsxs(Ir,{to:`/projects/${t}`,children:[m.jsx(Zk,{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(je,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):m.jsxs(je,{variant:"destructive",onClick:()=>a(!0),children:[m.jsx(gF,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function Z3e({status:e}){const t=J3e(e);return m.jsxs(Bt,{variant:"outline",className:Ne("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 J3e(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 e4e({session:e}){return m.jsx(bn,{children:m.jsx(wn,{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(Z3e,{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:Ky(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:Ky(e.ended_at)})]}),m.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),m.jsx("dd",{children:P0(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 t4e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.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("span",{className:"text-destructive",children:["Error: ",i]}):n===null?m.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):m.jsx(sp,{content:n,className:"text-sm"})}function n4e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function r4e(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 i4e({artifacts:e,runId:t}){return m.jsx("div",{className:"space-y-1",children:e.map(n=>m.jsxs(Lf,{children:[m.jsxs(zf,{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(Xu,{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($f,{children:m.jsx(a4e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function a4e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.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(Op,{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 o4e({event:e}){const t=s4e(e);return m.jsx(Bt,{variant:"outline",className:Ne("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 s4e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function l4e({events:e,runId:t}){const[n,r]=x.useState(null);return m.jsxs(m.Fragment,{children:[m.jsx(bn,{children:m.jsx(wn,{className:"p-0",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Time"}),m.jsx(it,{children:"Event"}),m.jsx(it,{children:"Span"}),m.jsx(it,{children:"Details"})]})}),m.jsx(ds,{children:e.map((i,a)=>m.jsxs(ir,{children:[m.jsx(rt,{className:"text-sm text-muted-foreground",children:Ky(i.ts)}),m.jsx(rt,{children:m.jsx(o4e,{event:i.event})}),m.jsx(rt,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),m.jsx(rt,{className:"max-w-[400px] text-sm",children:c4e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),m.jsx(ws,{open:!!n,onOpenChange:()=>r(null),children:m.jsxs(Ss,{className:"max-w-3xl overflow-hidden",children:[m.jsx(Es,{children:m.jsx(_s,{children:n==null?void 0:n.label})}),n&&m.jsx(u4e,{runId:t,hash:n.hash})]})})]})}function u4e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.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:"text-sm text-destructive",children:["Error: ",i]}):n===null?m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):m.jsx(Op,{className:"max-h-[60vh]",children: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"?P0(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 f4e(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 d4e({status:e}){return e==="running"||e==="starting"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[m.jsx(Xr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[m.jsx(j0,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[m.jsx(tA,{className:"h-3 w-3"}),"Failed"]}):m.jsx(Bt,{variant:"outline",children:e})}function h4e({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(d4e,{status:e.status}),e.duration_ms!==null&&m.jsx("span",{className:"text-xs text-muted-foreground",children:f4e(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(Xr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?m.jsx(sp,{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(roe,{className:"h-3 w-3"}),"View session"]})]})}function m4e({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 p4e(){var Ar;const{projectId:e,conversationId:t}=yp(),n=Number(e),r=Number(t),[i,a]=x.useState(""),[o,l]=x.useState(""),[c,f]=x.useState([]),[h,d]=x.useState(!1),[g,v]=x.useState(!1),[b,w]=x.useState(!1),[S,E]=x.useState(""),[C,j]=x.useState(!1),[A,N]=x.useState(""),[O,T]=x.useState(!1),[M,I]=x.useState(""),[z,B]=x.useState(""),[L,G]=x.useState(""),[F,K]=x.useState(""),[D,q]=x.useState(""),[X,V]=x.useState(""),[R,H]=x.useState(""),[U,$]=x.useState(!0),[Q,Z]=x.useState(""),ne=x.useRef(null),te=x.useRef(null),ie=x.useRef(0),ee=x.useRef(void 0),le=x.useRef(0),pe=x.useRef(null),ae=pt(),be=mA(),{data:we}=Oa("agents"),{data:Le}=Oa("memories"),Oe=sA(n),Xe=oA(n),Ke=(Ar=Oe.data)==null?void 0:Ar.merged,{data:tt,isLoading:sn,error:En,fetchPreviousPage:Et,hasPreviousPage:vn,isFetchingPreviousPage:Pt}=Vy(r),Jt=(tt==null?void 0:tt.pages.flatMap(ye=>ye.sessions))??[],he=tt==null?void 0:tt.pages[tt.pages.length-1],oe=Jt[Jt.length-1],ke=(oe==null?void 0:oe.status)==="running"||(oe==null?void 0:oe.status)==="starting";Vy(r,{refetchInterval:ke?2e3:!1});const Ue=kF(r),Ye=hA(),yn=cA(n),{pendingAskUsers:ln,chatMessages:Xt,respond:Se}=HN((oe==null?void 0:oe.run_id)??"",!!oe&&U),ut=o.trim()&&!(be.data??[]).includes(o.trim())?"Role not found in installed roles":"",Qe=ke;x.useEffect(()=>{if(!ne.current)return;const ye=ne.current.scrollHeight-ie.current;ye>0&&(ne.current.scrollTop+=ye,ie.current=0)},[tt==null?void 0:tt.pages.length]),x.useEffect(()=>{ne.current&&((oe==null?void 0:oe.run_id)!==ee.current&&(ne.current.scrollTop=ne.current.scrollHeight),ee.current=oe==null?void 0:oe.run_id)},[oe==null?void 0:oe.run_id]),x.useEffect(()=>{ne.current&&(Xt.length>le.current&&(ne.current.scrollTop=ne.current.scrollHeight),le.current=Xt.length)},[Xt.length]),x.useEffect(()=>{if(!te.current||!ne.current)return;const ye=new IntersectionObserver(([kt])=>{var Rn;kt.isIntersecting&&vn&&!Pt&&(ie.current=((Rn=ne.current)==null?void 0:Rn.scrollHeight)??0,Et())},{root:ne.current,threshold:.1});return ye.observe(te.current),()=>ye.disconnect()},[vn,Pt,Et]);const Dn=(we??[]).map(ye=>ye.name),xn=[...new Set((Le??[]).map(ye=>ye.name)),"none"].sort(),$n=M.trim()&&Dn.length>0&&!Dn.includes(M.trim())?"Runtime not found in installed agents":"",Fi=z.trim()&&xn.length>0&&!xn.includes(z.trim())?"Memory not found in installed providers":"",da=!!$n||!!Fi,Ui=[M,z,L,F,D,X,R].filter(ye=>ye.trim()).length,Hr=ye=>f(kt=>kt.includes(ye)?kt.filter(Rn=>Rn!==ye):[...kt,ye]),Ze=ye=>{ye.preventDefault(),v(!0)},Ft=ye=>{ye.preventDefault(),v(!0)},_n=ye=>{ye.preventDefault(),v(!1)},Bn=async ye=>{ye.preventDefault(),v(!1);const kt=Array.from(ye.dataTransfer.files);if(kt.length){w(!0);try{const Rn=await Be.upload(`/projects/${n}/files`,kt);ae.invalidateQueries({queryKey:Ve.projects.files(n)}),f(Gt=>{const fr=Rn.map(gi=>gi.path).filter(gi=>!Gt.includes(gi));return[...Gt,...fr]})}catch{}finally{w(!1)}}};function pi(ye){ye.preventDefault();const kt=i.trim();if(!kt||Qe||ut||da)return;const Rn={task:kt,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:U,system_prompt:L.trim()||void 0,runtime:M.trim()||void 0,memory:z.trim()||void 0,max_num_delegations:F.trim()?Number(F):void 0,cache_delegations:D?D==="true":void 0,cache_max_entries:X.trim()?Number(X):void 0,cache_ttl_seconds:R.trim()?Number(R):void 0};Ue.mutate(Rn,{onSuccess:()=>{a(""),f([]),d(!1)}})}function Lt(ye,kt){kt.trim()&&(Se(ye.request_id,kt.trim()),Z(""))}function ur(ye){ye.key==="Enter"&&!ye.shiftKey&&(ye.preventDefault(),pi(ye))}function ha(){N((he==null?void 0:he.title)??""),j(!0),setTimeout(()=>{var ye;return(ye=pe.current)==null?void 0:ye.select()},0)}function Zn(){const ye=A.trim();yn.mutate({conversationId:r,title:ye||null}),j(!1)}function cr(ye){ye.key==="Enter"&&(ye.preventDefault(),Zn()),ye.key==="Escape"&&j(!1)}if(En)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",En.message]})]});const Va=(he==null?void 0:he.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(nt,{ref:pe,value:A,onChange:ye=>N(ye.target.value),onBlur:Zn,onKeyDown:cr,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:ha,title:"Click to rename",children:Va})}),Jt.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[Jt.length," session",Jt.length!==1?"s":""]})]}),m.jsx("div",{ref:ne,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:te,className:"h-1"}),Pt&&m.jsx("div",{className:"flex justify-center py-2",children:m.jsx(Xr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!sn&&Jt.length===0&&m.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),Jt.map((ye,kt)=>{const Rn=kt===Jt.length-1;return m.jsxs("div",{className:"space-y-4",children:[(ye.user_task??ye.task)&&m.jsx(m4e,{task:ye.user_task??ye.task}),Rn&&Xt.map(Gt=>m.jsx("div",{className:`flex ${Gt.role==="user"?"justify-end":"justify-start"}`,children:m.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Gt.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:m.jsx("p",{className:"whitespace-pre-wrap",children:Gt.text})})},Gt.id)),m.jsx(h4e,{session:ye,projectId:n})]},ye.run_id)})]})}),ln.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:ln.map(ye=>m.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[m.jsx("p",{className:"text-sm font-medium",children:ye.question}),ye.why&&m.jsx("p",{className:"text-xs text-muted-foreground",children:ye.why}),ye.choices?m.jsx("div",{className:"flex flex-wrap gap-1.5",children:ye.choices.map(kt=>m.jsx(je,{type:"button",size:"sm",variant:"outline",onClick:()=>Lt(ye,kt),children:kt},kt))}):m.jsxs("div",{className:"flex gap-2",children:[m.jsx(nt,{value:Q,onChange:kt=>Z(kt.target.value),onKeyDown:kt=>{kt.key==="Enter"&&!kt.shiftKey&&(kt.preventDefault(),Lt(ye,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),m.jsx(je,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>Lt(ye,Q),children:m.jsx(qy,{className:"h-4 w-4"})})]})]},ye.request_id))})}),m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:m.jsxs("form",{onSubmit:pi,className:"mx-auto max-w-2xl space-y-2",children:[m.jsxs("div",{className:"relative",onDragOver:Ze,onDragEnter:Ft,onDragLeave:_n,onDrop:Bn,children:[m.jsx(Ul,{value:i,onChange:ye=>a(ye.target.value),onKeyDown:ur,placeholder:Qe?"Agent is working…":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:Qe||Ue.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(Xr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):m.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[m.jsx(iA,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(Xe.data??[]).length>0&&m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(Dm,{children:[m.jsx(Rm,{asChild:!0,children:m.jsxs(je,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[m.jsx(vF,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),m.jsxs(Im,{align:"start",className:"w-64",onCloseAutoFocus:ye=>ye.preventDefault(),children:[m.jsx("div",{className:"px-2 py-1.5",children:m.jsx(nt,{placeholder:"Filter files…",value:S,onChange:ye=>E(ye.target.value),className:"h-7 text-xs",onKeyDown:ye=>ye.stopPropagation()})}),m.jsx("div",{className:"max-h-48 overflow-y-auto",children:(Xe.data??[]).filter(ye=>ye.path.toLowerCase().includes(S.toLowerCase())).map(ye=>m.jsx(UF,{checked:c.includes(ye.path),onCheckedChange:()=>Hr(ye.path),onSelect:kt=>kt.preventDefault(),children:m.jsx("span",{className:"font-mono text-xs",children:ye.path})},ye.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(ye=>m.jsxs(Bt,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[m.jsx("button",{type:"button",onClick:()=>Hr(ye),className:"mr-0.5 rounded-sm hover:bg-muted",children:m.jsx(O0,{className:"h-3 w-3"})}),"@",ye]},ye)),!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(nt,{list:"datalist-role",value:o,onChange:ye=>l(ye.target.value),placeholder:"Default role",className:"w-48 text-sm"}),ut&&m.jsx("p",{className:"text-xs text-destructive",children:ut})]}),m.jsx("datalist",{id:"datalist-role",children:(be.data??[]).map(ye=>m.jsx("option",{value:ye},ye))}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(je,{type:"button",variant:U?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>$(ye=>!ye),title:U?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[m.jsx(k0,{className:"h-3.5 w-3.5"}),U?"Interactive":"Auto"]}),m.jsxs(je,{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(rA,{className:"h-4 w-4"}),Ui>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:Ui})]}),Qe?m.jsxs(je,{type:"button",variant:"destructive",onClick:()=>oe&&Ye.mutate(oe.run_id),disabled:Ye.isPending,children:[Ye.isPending?m.jsx(Xr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(bF,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}):m.jsx(je,{type:"submit",disabled:!i.trim()||Ue.isPending||!!ut||da,children:Ue.isPending?m.jsx(Xr,{className:"h-4 w-4 animate-spin"}):m.jsx(qy,{className:"h-4 w-4"})})]})]})})]})}),m.jsx(ws,{open:O,onOpenChange:T,children:m.jsxs(Ss,{className:"max-w-lg",children:[m.jsx(Es,{children:m.jsx(_s,{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(ct,{children:"Runtime"}),m.jsx(nt,{list:"adv-datalist-runtime",value:M,onChange:ye=>I(ye.target.value),placeholder:(Ke==null?void 0:Ke.runtime)??"default",className:"text-sm"}),m.jsx("datalist",{id:"adv-datalist-runtime",children:Dn.map(ye=>m.jsx("option",{value:ye},ye))}),$n&&m.jsx("p",{className:"text-xs text-destructive",children:$n})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Memory"}),m.jsx(nt,{list:"adv-datalist-memory",value:z,onChange:ye=>B(ye.target.value),placeholder:(Ke==null?void 0:Ke.memory)??"dial",className:"text-sm"}),m.jsx("datalist",{id:"adv-datalist-memory",children:xn.map(ye=>m.jsx("option",{value:ye},ye))}),Fi&&m.jsx("p",{className:"text-xs text-destructive",children:Fi})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"System Prompt"}),m.jsx(Ul,{value:L,onChange:ye=>G(ye.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(ct,{children:"Max Delegations"}),m.jsx(nt,{type:"number",min:"0",value:F,onChange:ye=>K(ye.target.value),placeholder:Ke!=null&&Ke.max_num_delegations?String(Ke.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Delegations"}),m.jsxs(Da,{value:D||"__empty__",onValueChange:ye=>q(ye==="__empty__"?"":ye),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{placeholder:`Default (${(Ke==null?void 0:Ke.cache_delegations)!==!1?"true":"false"})`})}),m.jsxs(La,{children:[m.jsxs(Pn,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Ke==null?void 0:Ke.cache_delegations)!==!1?"true":"false",")"]}),m.jsx(Pn,{value:"true",children:"true"}),m.jsx(Pn,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Max Entries"}),m.jsx(nt,{type:"number",min:"0",value:X,onChange:ye=>V(ye.target.value),placeholder:Ke!=null&&Ke.cache_max_entries?String(Ke.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache TTL (seconds)"}),m.jsx(nt,{type:"number",min:"0",value:R,onChange:ye=>H(ye.target.value),placeholder:Ke!=null&&Ke.cache_ttl_seconds?String(Ke.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),m.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[m.jsx(je,{variant:"ghost",size:"sm",onClick:()=>{I(""),B(""),G(""),K(""),q(""),V(""),H("")},children:"Reset"}),m.jsx(je,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const W5="imu";function g4e(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 v4e({status:e}){return e==="running"||e==="starting"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[m.jsx(Xr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[m.jsx(j0,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?m.jsxs(Bt,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[m.jsx(tA,{className:"h-3 w-3"}),"Failed"]}):m.jsx(Bt,{variant:"outline",children:e})}function y4e({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(v4e,{status:e.status}),e.duration_ms!==null&&m.jsx("span",{className:"text-xs text-muted-foreground",children:g4e(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(Xr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?m.jsx(sp,{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."})})]})}function x4e({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 b4e({cid:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!0),[a,o]=x.useState(!1),[l,c]=x.useState(""),[f,h]=x.useState(!1),[d,g]=x.useState(""),[v,b]=x.useState(""),[w,S]=x.useState(""),[E,C]=x.useState(""),[j,A]=x.useState(""),[N,O]=x.useState(""),[T,M]=x.useState(""),[I,z]=x.useState(""),B=x.useRef(null),L=x.useRef(null),G=x.useRef(0),F=x.useRef(void 0),K=x.useRef(0),D=x.useRef(null),{data:q}=Oa("agents"),{data:X}=Oa("memories"),{data:V,isLoading:R,error:H,fetchPreviousPage:U,hasPreviousPage:$,isFetchingPreviousPage:Q}=Vy(e),Z=(V==null?void 0:V.pages.flatMap(oe=>oe.sessions))??[],ne=V==null?void 0:V.pages[V.pages.length-1],te=Z[Z.length-1],ie=(te==null?void 0:te.status)==="running"||(te==null?void 0:te.status)==="starting";Vy(e,{refetchInterval:ie?2e3:!1});const ee=kF(e),le=hA(),pe=OF(),{pendingAskUsers:ae,chatMessages:be,respond:we}=HN((te==null?void 0:te.run_id)??"",!!te&&r),Le=(q??[]).map(oe=>oe.name),Oe=[...new Set((X??[]).map(oe=>oe.name)),"none"].sort(),Xe=d.trim()&&Le.length>0&&!Le.includes(d.trim())?"Runtime not found in installed agents":"",Ke=v.trim()&&Oe.length>0&&!Oe.includes(v.trim())?"Memory not found in installed providers":"",tt=!!Xe||!!Ke,sn=[d,v,w,E,j,N,T].filter(oe=>oe.trim()).length;x.useEffect(()=>{if(!B.current)return;const oe=B.current.scrollHeight-G.current;oe>0&&(B.current.scrollTop+=oe,G.current=0)},[V==null?void 0:V.pages.length]),x.useEffect(()=>{B.current&&((te==null?void 0:te.run_id)!==F.current&&(B.current.scrollTop=B.current.scrollHeight),F.current=te==null?void 0:te.run_id)},[te==null?void 0:te.run_id]),x.useEffect(()=>{B.current&&(be.length>K.current&&(B.current.scrollTop=B.current.scrollHeight),K.current=be.length)},[be.length]),x.useEffect(()=>{if(!L.current||!B.current)return;const oe=new IntersectionObserver(([ke])=>{var Ue;ke.isIntersecting&&$&&!Q&&(G.current=((Ue=B.current)==null?void 0:Ue.scrollHeight)??0,U())},{root:B.current,threshold:.1});return oe.observe(L.current),()=>oe.disconnect()},[$,Q,U]);function En(oe){oe.preventDefault();const ke=t.trim();!ke||ie||tt||ee.mutate({task:ke,role:W5,interactive:r,system_prompt:w.trim()||void 0,runtime:d.trim()||void 0,memory:v.trim()||void 0,max_num_delegations:E.trim()?Number(E):void 0,cache_delegations:j?j==="true":void 0,cache_max_entries:N.trim()?Number(N):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>n("")})}function Et(oe,ke){ke.trim()&&(we(oe.request_id,ke.trim()),z(""))}function vn(oe){oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),En(oe))}function Pt(){c((ne==null?void 0:ne.title)??""),o(!0),setTimeout(()=>{var oe;return(oe=D.current)==null?void 0:oe.select()},0)}function Jt(){const oe=l.trim();pe.mutate({conversationId:e,title:oe||null}),o(!1)}if(H)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{className:"h-4 w-4"}),m.jsxs("span",{children:["Error: ",H.message]})]});const he=(ne==null?void 0:ne.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(nt,{ref:D,value:l,onChange:oe=>c(oe.target.value),onBlur:Jt,onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),Jt()),oe.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:Pt,title:"Click to rename",children:he})}),Z.length>0&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:[Z.length," session",Z.length!==1?"s":""]})]}),m.jsx("div",{ref:B,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:L,className:"h-1"}),Q&&m.jsx("div",{className:"flex justify-center py-2",children:m.jsx(Xr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!R&&Z.length===0&&m.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start a conversation with Bot Imu below."}),Z.map((oe,ke)=>{const Ue=ke===Z.length-1;return m.jsxs("div",{className:"space-y-4",children:[(oe.user_task??oe.task)&&m.jsx(x4e,{task:oe.user_task??oe.task}),Ue&&be.map(Ye=>m.jsx("div",{className:`flex ${Ye.role==="user"?"justify-end":"justify-start"}`,children:m.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Ye.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:m.jsx("p",{className:"whitespace-pre-wrap",children:Ye.text})})},Ye.id)),m.jsx(y4e,{session:oe})]},oe.run_id)})]})}),ae.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:ae.map(oe=>m.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[m.jsx("p",{className:"text-sm font-medium",children:oe.question}),oe.why&&m.jsx("p",{className:"text-xs text-muted-foreground",children:oe.why}),oe.choices?m.jsx("div",{className:"flex flex-wrap gap-1.5",children:oe.choices.map(ke=>m.jsx(je,{type:"button",size:"sm",variant:"outline",onClick:()=>Et(oe,ke),children:ke},ke))}):m.jsxs("div",{className:"flex gap-2",children:[m.jsx(nt,{value:I,onChange:ke=>z(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&!ke.shiftKey&&(ke.preventDefault(),Et(oe,I))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),m.jsx(je,{type:"button",size:"icon",disabled:!I.trim(),onClick:()=>Et(oe,I),children:m.jsx(qy,{className:"h-4 w-4"})})]})]},oe.request_id))})}),m.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:m.jsxs("form",{onSubmit:En,className:"mx-auto max-w-2xl space-y-2",children:[m.jsx(Ul,{value:t,onChange:oe=>n(oe.target.value),onKeyDown:vn,placeholder:ie?"Bot Imu is working…":"Ask Bot Imu anything… (Enter to send, Shift+Enter for new line)",disabled:ie||ee.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),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: ",W5]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsxs(je,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(oe=>!oe),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[m.jsx(k0,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),m.jsxs(je,{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(rA,{className:"h-4 w-4"}),sn>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:sn})]}),ie?m.jsxs(je,{type:"button",variant:"destructive",onClick:()=>te&&le.mutate(te.run_id),disabled:le.isPending,children:[le.isPending?m.jsx(Xr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(bF,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}):m.jsx(je,{type:"submit",disabled:!t.trim()||ee.isPending||tt,children:ee.isPending?m.jsx(Xr,{className:"h-4 w-4 animate-spin"}):m.jsx(qy,{className:"h-4 w-4"})})]})]})]})}),m.jsx(ws,{open:f,onOpenChange:h,children:m.jsxs(Ss,{className:"max-w-lg",children:[m.jsx(Es,{children:m.jsx(_s,{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(ct,{children:"Runtime"}),m.jsx(nt,{list:"imu-adv-runtime",value:d,onChange:oe=>g(oe.target.value),placeholder:"default",className:"text-sm"}),m.jsx("datalist",{id:"imu-adv-runtime",children:Le.map(oe=>m.jsx("option",{value:oe},oe))}),Xe&&m.jsx("p",{className:"text-xs text-destructive",children:Xe})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Memory"}),m.jsx(nt,{list:"imu-adv-memory",value:v,onChange:oe=>b(oe.target.value),placeholder:"dial",className:"text-sm"}),m.jsx("datalist",{id:"imu-adv-memory",children:Oe.map(oe=>m.jsx("option",{value:oe},oe))}),Ke&&m.jsx("p",{className:"text-xs text-destructive",children:Ke})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"System Prompt"}),m.jsx(Ul,{value:w,onChange:oe=>S(oe.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(ct,{children:"Max Delegations"}),m.jsx(nt,{type:"number",min:"0",value:E,onChange:oe=>C(oe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Delegations"}),m.jsxs(Da,{value:j||"__empty__",onValueChange:oe=>A(oe==="__empty__"?"":oe),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{placeholder:"Default (true)"})}),m.jsxs(La,{children:[m.jsx(Pn,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),m.jsx(Pn,{value:"true",children:"true"}),m.jsx(Pn,{value:"false",children:"false"})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache Max Entries"}),m.jsx(nt,{type:"number",min:"0",value:N,onChange:oe=>O(oe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{children:"Cache TTL (seconds)"}),m.jsx(nt,{type:"number",min:"0",value:T,onChange:oe=>M(oe.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),m.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[m.jsx(je,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),A(""),O(""),M("")},children:"Reset"}),m.jsx(je,{size:"sm",onClick:()=>h(!1),children:"Done"})]})]})})]})}function w4e(){const e=bo(),t=lA(),n=AF();return x.useEffect(()=>{t.data&&t.data.length>0&&e(`/imu/${t.data[0].id}`,{replace:!0})},[t.data,e]),t.isLoading?m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx(Xr,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[m.jsx(Jk,{className:"h-12 w-12 text-muted-foreground/40"}),m.jsxs("div",{className:"text-center",children:[m.jsx("h2",{className:"text-lg font-semibold",children:"Bot Imu"}),m.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your personal AI assistant"})]}),m.jsxs(je,{onClick:()=>n.mutate(void 0,{onSuccess:r=>e(`/imu/${r.id}`)}),disabled:n.isPending,children:[n.isPending?m.jsx(Xr,{className:"mr-2 h-4 w-4 animate-spin"}):m.jsx(ud,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]})}function Q5(){const{conversationId:e}=yp(),t=e?Number(e):null;return t!==null?m.jsx(b4e,{cid:t}):m.jsx(w4e,{})}const S4e={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},E4e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function _4e(){const{resourceType:e="roles"}=yp(),{data:t,isLoading:n}=Oa(e),[r,i]=x.useState(null),[a,o]=x.useState(!1),[l,c]=x.useState(!1),{data:f}=eue(e,r??"",{enabled:a&&!!r}),h=E4e[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(je,{onClick:()=>c(!0),size:"sm",children:[m.jsx(C0,{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(Tn,{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(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{children:"Version"}),m.jsx(it,{children:"Description"}),m.jsx(it,{children:"Source"}),m.jsx(it,{className:"w-24"})]})}),m.jsx(ds,{children:t.map(d=>{var g;return m.jsxs(ir,{className:"cursor-pointer",onClick:()=>{i(d.name),o(!0)},children:[m.jsx(rt,{className:"font-medium",children:d.name}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:d.version??"—"}),m.jsx(rt,{className:"max-w-[300px] truncate text-sm",children:d.description||"—"}),m.jsx(rt,{children:m.jsx(Bt,{variant:"outline",className:"text-xs",children:d.source})}),m.jsx(rt,{children:!((g=S4e[e])!=null&&g.includes(d.name))&&m.jsx(j4e,{resourceType:e,name:d.name})})]},d.name)})})]}),m.jsx(QF,{resource:f??null,resourceType:e,open:a,onOpenChange:o}),m.jsx(pA,{open:l,onOpenChange:c,defaultType:e})]})}function j4e({resourceType:e,name:t}){const[n,r]=x.useState(!1),i=GF(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?Dt.success(`Uninstalled ${t}`):Dt.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{Dt.error("Uninstall request failed"),r(!1)}})};return n?m.jsxs("div",{className:"flex gap-1",children:[m.jsx(je,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),m.jsx(je,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):m.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:m.jsx(bs,{className:"h-4 w-4"})})}function C4e(){return zn({queryKey:Ve.schedules.all,queryFn:()=>Be.get("/schedules")})}function k4e(){const e=pt();return It({mutationFn:t=>Be.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.schedules.all})}})}function A4e(){const e=pt();return It({mutationFn:({id:t,...n})=>Be.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.schedules.all})}})}function O4e(){const e=pt();return It({mutationFn:t=>Be.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.schedules.all})}})}function N4e(){const e=pt();return It({mutationFn:({id:t,enable:n})=>Be.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Ve.schedules.all})}})}var A_={exports:{}},Z5;function T4e(){return Z5||(Z5=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(E){return E.trim()}).filter(function(E){return E!==""}).map(function(E){return isNaN(Number(E))?E:Number(E)}).filter(function(E){return E!==null&&E!==""});w.length===0&&w.push("*"),w.sort(function(E,C){return E!==null&&C!==null?E-C:0}),v[b]=w.map(function(E){return E!==null?E.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(N){var O=N.replace(/\D/,""),T=O;return v.dayOfWeekStartIndexZero?O=="7"&&(T="0"):T=(parseInt(O)-1).toString(),N.replace(O,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(N){var O=N.replace(/\D/,""),T=O;return v.monthStartIndexZero&&(T=(parseInt(O)+1).toString()),N.replace(O,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 E in S)g[4]=g[4].replace(new RegExp(E,"gi"),S[E].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(N){return N!==""}).join(",")||"*"),g[C]=="*/1"&&(g[C]="*"),g[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[C])){var j=null;switch(C){case 4:j="12";break;case 5:j="6";break;case 6:j="9999";break;default:j=null;break}if(j!==null){var A=g[C].split("/");g[C]="".concat(A[0],"-").concat(j,"/").concat(A[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,E=S===void 0?!0:S,C=w.verbose,j=C===void 0?!1:C,A=w.dayOfWeekStartIndexZero,N=A===void 0?!0:A,O=w.monthStartIndexZero,T=O===void 0?!1:O,M=w.use24HourTimeFormat,I=w.locale,z=I===void 0?null:I,B=w.logicalAndDayFields,L=B===void 0?!1:B,G={throwExceptionOnParseError:E,verbose:j,dayOfWeekStartIndexZero:N,monthStartIndexZero:T,use24HourTimeFormat:M,locale:z,logicalAndDayFields:L};G.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var F=new g(v,G);return F.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 E=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),j=this.getMonthDescription(),A=this.getDayOfWeekDescription(),N=this.getYearDescription();w+=E+C+A+j+N,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(O){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(O)}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 E=b.split("-");S+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,E[0],""),this.formatTime(w,E[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 j=0;j<C.length;j++)S+=" ",S+=this.formatTime(C[j],b,""),j<C.length-2&&(S+=","),j==C.length-2&&(S+=this.i18n.spaceAnd())}else{var A=this.getSecondsDescription(),N=this.getMinutesDescription(),O=this.getHoursDescription();if(S+=A,S&&N&&(S+=", "),S+=N,N===O)return S;S&&O&&(S+=", "),S+=O}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(E){return E},function(E){return f.StringUtilities.format(v.i18n.everyX0Minutes(E),E)},function(E){return v.i18n.minutesX0ThroughX1PastTheHour()},function(E){var C,j;try{return E=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():E=="0"?((j=(C=v.i18n).onTheHour)===null||j===void 0?void 0:j.call(C))||v.i18n.atX0MinutesPastTheHour(E):parseInt(E)<20?v.i18n.atX0MinutesPastTheHour(E):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(E)}catch{return v.i18n.atX0MinutesPastTheHour(E)}});return S},g.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(j){var A=j.split("-");A.length===2&&S.push({value:A[1],index:w+1}),w+=A.length});var E=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(j){var A=S.find(function(O){return O.value===j&&O.index===E}),N=A&&v.expressionParts[1]!=="0";return E++,N?v.formatTime(j,"59",""):v.formatTime(j,"0","")},function(j){return f.StringUtilities.format(v.i18n.everyX0Hours(j),j)},function(j){return v.i18n.betweenX0AndX1()},function(j){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,E){var C=S;S.indexOf("#")>-1?C=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(C=C.replace("L",""));var j=parseInt(C),A=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(E)[j]:b[j];if(S.indexOf("#")>-1){var N=null,O=S.substring(S.indexOf("#")+1),T=S.substring(0,S.indexOf("#"));switch(O){case"1":N=v.i18n.first(T);break;case"2":N=v.i18n.second(T);break;case"3":N=v.i18n.third(T);break;case"4":N=v.i18n.fourth(T);break;case"5":N=v.i18n.fifth(T);break}A=N+" "+A}return A},function(S){return parseInt(S)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var E=S.substring(0,S.indexOf("-")),C=v.expressionParts[3]!="*";return C?v.i18n.commaAndX0ThroughX1(E):v.i18n.commaX0ThroughX1(E)},function(S){var E=null;if(S.indexOf("#")>-1){var C=S.substring(S.indexOf("#")+1),j=S.substring(0,S.indexOf("#"));E=v.i18n.commaOnThe(C,j).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)E=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var A=v.expressionParts[3]!="*";A?v.options.logicalAndDayFields?E=v.i18n.commaOnlyOnX0(S):E=v.i18n.commaAndOnX0():E=v.i18n.commaOnlyOnX0(S)}return E}),w},g.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,E){return E&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(E)[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 E=parseInt(S[0].replace("W","")),C=E==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),E.toString());b=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var j=w.match(/L-(\d{1,2})/);if(j){var A=j[1];b=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(A),A);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(N){return N=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),N):N},function(N){return N=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(N)},function(N){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(N)},function(N){return v.i18n.commaOnDayX0OfTheMonth(N)})}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,E,C){var j=null,A=v.indexOf("/")>-1,N=v.indexOf("-")>-1,O=v.indexOf(",")>-1;if(!v)j="";else if(v==="*")j=b;else if(!A&&!N&&!O)j=f.StringUtilities.format(C(v),w(v));else if(O){for(var T=v.split(","),M="",I=0;I<T.length;I++)if(I>0&&T.length>2&&(M+=",",I<T.length-1&&(M+=" ")),I>0&&T.length>1&&(I==T.length-1||T.length==2)&&(M+="".concat(this.i18n.spaceAnd()," ")),T[I].indexOf("/")>-1||T[I].indexOf("-")>-1){var z=T[I].indexOf("-")>-1&&T[I].indexOf("/")==-1,B=this.getSegmentDescription(T[I],b,w,S,z?this.i18n.commaX0ThroughX1:E,C);z&&(B=B.replace(", ","")),M+=B}else if(!A)M+=w(T[I]);else{var L=this.getSegmentDescription(T[I],b,w,S,E,C);L&&L.startsWith(", ")&&(L=L.substring(2)),M+=L}A?j=M:j=f.StringUtilities.format(C(v),M)}else if(A){var T=v.split("/");if(j=f.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var G=this.generateRangeSegmentDescription(T[0],E,w);G.indexOf(", ")!=0&&(j+=", "),j+=G}else if(T[0].indexOf("*")==-1){var F=f.StringUtilities.format(C(T[0]),w(T[0]));F=F.replace(", ",""),j+=f.StringUtilities.format(this.i18n.commaStartingX0(),F)}}else N&&(j=this.generateRangeSegmentDescription(v,E,w));return j},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",E=v.split("-"),C=w(E[0],1),j=w(E[1],2),A=b(v);return S+=f.StringUtilities.format(A,C,j),S},g.prototype.formatTime=function(v,b,w){var S=0,E=0,C=parseInt(v)+S,j=parseInt(b)+E;j>=60?(j-=60,C+=1):j<0&&(j+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var A="",N=!1;this.options.use24HourTimeFormat||(N=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),A=N?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var O="";return w&&(O=":".concat(("00"+w).substring(w.length))),"".concat(N?A:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+j.toString()).substring(j.toString().length)).concat(O).concat(N?"":A)},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 E=S[w],C=E[0],j=E[1];v=v.replace(new RegExp(C,"g"),j)}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})())})(A_)),A_.exports}var P4e=T4e();const M4e=Bi(P4e),D4e=[{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 R4e({open:e,onOpenChange:t,editing:n}){const{data:r}=Rd(),{data:i}=mA(),a=k4e(),o=A4e(),[l,c]=x.useState(""),[f,h]=x.useState(""),[d,g]=x.useState(""),[v,b]=x.useState(""),[w,S]=x.useState(""),[E,C]=x.useState(""),[j,A]=x.useState(!0),[N,O]=x.useState(!1);x.useEffect(()=>{e&&n?(c(n.name),h(String(n.project_id)),g(n.task),b(n.cron_expr),S(n.role??""),C(n.system_prompt??""),A(n.skip_if_running)):e&&!n&&T()},[e,n]);function T(){c(""),h(""),g(""),b(""),S(""),C(""),A(!0),O(!1)}async function M(L){L.preventDefault();try{const G={name:l.trim(),task:d.trim(),cron_expr:v.trim(),role:w.trim()||void 0,system_prompt:E.trim()||void 0,skip_if_running:j};n?await o.mutateAsync({id:n.id,...G}):await a.mutateAsync({...G,project_id:Number(f)}),T(),t(!1)}catch{}}const I=x.useMemo(()=>{if(!v.trim())return null;try{return M4e.toString(v.trim())}catch{return null}},[v]),z=a.isPending||o.isPending,B=a.error||o.error;return m.jsx(ws,{open:e,onOpenChange:t,children:m.jsxs(Ss,{className:"max-w-lg",children:[m.jsx(Es,{children:m.jsx(_s,{children:n?"Edit Schedule":"Create Schedule"})}),m.jsxs("form",{onSubmit:M,className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsxs(ct,{htmlFor:"sched-name",children:["Name ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(nt,{id:"sched-name",value:l,onChange:L=>c(L.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs(ct,{htmlFor:"sched-project",children:["Project ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs(Da,{value:f,onValueChange:h,required:!0,children:[m.jsx(Ia,{id:"sched-project",children:m.jsx(Ra,{placeholder:"Select a project"})}),m.jsx(La,{children:(r??[]).map(L=>m.jsx(Pn,{value:String(L.id),children:L.display_name},L.id))})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs(ct,{htmlFor:"sched-task",children:["Task ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsx(Ul,{id:"sched-task",value:d,onChange:L=>g(L.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(ct,{htmlFor:"sched-cron",children:["Cron Expression ",m.jsx("span",{className:"text-destructive",children:"*"})]}),m.jsxs(Dm,{children:[m.jsx(Rm,{asChild:!0,children:m.jsxs(je,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",m.jsx(Mm,{className:"ml-1 h-3 w-3"})]})}),m.jsx(Im,{align:"end",children:D4e.map(L=>m.jsxs(mm,{onClick:()=>b(L.value),children:[m.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:L.value}),L.label]},L.value))})]})]}),m.jsx(nt,{id:"sched-cron",value:v,onChange:L=>b(L.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),I&&m.jsx("p",{className:"text-xs text-muted-foreground",children:I})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"sched-role",children:"Role"}),m.jsx(nt,{id:"sched-role",value:w,onChange:L=>S(L.target.value),placeholder:(i==null?void 0:i[0])??"orchestrator",list:"sched-role-list"}),m.jsx("datalist",{id:"sched-role-list",children:(i??[]).map(L=>m.jsx("option",{value:L},L))})]}),m.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:j,onChange:L=>A(L.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(Lf,{open:N,onOpenChange:O,children:[m.jsx(zf,{asChild:!0,children:m.jsxs(je,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[m.jsx(Mm,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),m.jsx($f,{className:"space-y-4 pt-2",children:m.jsxs("div",{className:"space-y-2",children:[m.jsx(ct,{htmlFor:"sched-prompt",children:"System Prompt"}),m.jsx(Ul,{id:"sched-prompt",value:E,onChange:L=>C(L.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),B&&m.jsx("p",{className:"text-sm text-destructive",children:B.message}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.jsx(je,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),m.jsx(je,{type:"submit",disabled:z,children:z?"Saving...":n?"Update":"Create"})]})]})]})})}function J5(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 I4e({schedule:e}){return e.enabled?e.last_error?m.jsx(cF,{children:m.jsxs(Cae,{children:[m.jsx(kae,{children:m.jsx(Bt,{variant:"destructive",children:"Error"})}),m.jsx(Aae,{className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:e.last_error})})]})}):m.jsx(Bt,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):m.jsx(Bt,{variant:"secondary",children:"Disabled"})}function L4e(){const{data:e,isLoading:t,error:n}=C4e(),[r,i]=x.useState(!1),[a,o]=x.useState(null),l=O4e(),c=N4e();if(t)return m.jsxs("div",{className:"space-y-6",children:[m.jsx(Tn,{className:"h-8 w-48"}),m.jsx(Tn,{className:"h-64 rounded-lg"})]});if(n)return m.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[m.jsx(mo,{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:"Scheduled Tasks"}),m.jsxs(je,{onClick:()=>{o(null),i(!0)},children:[m.jsx(ud,{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 scheduled tasks yet."}),m.jsxs(je,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[m.jsx(ud,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):m.jsx("div",{className:"rounded-lg border",children:m.jsxs(cs,{children:[m.jsx(fs,{children:m.jsxs(ir,{children:[m.jsx(it,{children:"Name"}),m.jsx(it,{children:"Project"}),m.jsx(it,{children:"Cron"}),m.jsx(it,{children:"Next Run"}),m.jsx(it,{children:"Last Run"}),m.jsx(it,{children:"Status"}),m.jsx(it,{className:"w-[120px]",children:"Actions"})]})}),m.jsx(ds,{children:f.map(h=>m.jsxs(ir,{children:[m.jsx(rt,{className:"font-medium",children:h.name}),m.jsx(rt,{className:"text-muted-foreground",children:h.project_name}),m.jsx(rt,{children:m.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:h.cron_expr})}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:J5(h.next_run_at)}),m.jsx(rt,{className:"text-sm text-muted-foreground",children:J5(h.last_run_at)}),m.jsx(rt,{children:m.jsx(I4e,{schedule:h})}),m.jsx(rt,{children:m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(h),i(!0)},children:m.jsx(A0,{className:"h-3.5 w-3.5"})}),m.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:h.id,enable:!h.enabled}),children:h.enabled?m.jsx(Aoe,{className:"h-3.5 w-3.5"}):m.jsx(nA,{className:"h-3.5 w-3.5"})}),m.jsx(je,{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(bs,{className:"h-3.5 w-3.5"})})]})})]},h.id))})]})}),m.jsx(R4e,{open:r,onOpenChange:i,editing:a})]})}function O_(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Nr(e.runtime),isolation:Nr(e.isolation),memory:Nr(e.memory),orchestrator_role:Nr(t.role),orchestrator_permission_mode:Nr(t.permission_mode),policy_max_depth:Nr(n.max_depth),policy_agent_timeout:Nr(n.agent_timeout),policy_max_delegate_retries:Nr(n.max_delegate_retries),policy_cache_delegations:Nr(n.cache_delegations),policy_cache_max_entries:Nr(n.cache_max_entries),policy_cache_ttl_seconds:Nr(n.cache_ttl_seconds),policy_max_num_delegations:Nr(n.max_num_delegations),session_merge_strategy:Nr(r.merge_strategy),session_pull_before_session:Nr(r.pull_before_session),session_pr_command:Nr(r.pr_command),trace_enabled:Nr(i.enabled)}}function Nr(e){return e==null?"":String(e)}function z4e(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 $4e=["none","worktree"],B4e=["default","plan","bypassPermissions"],F4e=["auto","local","pr"],U4e=["prompt","always","never"],e$=["true","false"],N_="__empty__";function t$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=x.useState(O_(e)),{data:o}=Oa("agents"),{data:l}=Oa("roles"),{data:c}=Oa("memories"),f=t?O_(t):void 0,h=JSON.stringify(e);x.useEffect(()=>{a(O_(e))},[h]);const d=N=>O=>a(T=>({...T,[N]:O})),g=()=>{n(z4e(i))},v=(o??[]).map(N=>N.name),b=(l??[]).map(N=>N.name),w=new Set((c??[]).map(N=>N.name));w.add("none");const S=[...w].sort(),E=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":"",j=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",A=!!E||!!C||!!j;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(bl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsxs(Tr,{label:"Runtime",children:[m.jsx(nt,{list:"cfg-dl-runtime",value:i.runtime,onChange:N=>d("runtime")(N.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(N=>m.jsx("option",{value:N},N))}),E&&m.jsx("p",{className:"text-xs text-destructive",children:E})]}),m.jsx(Tr,{label:"Isolation",children:m.jsx(Cf,{value:i.isolation,onChange:d("isolation"),options:$4e,placeholder:(f==null?void 0:f.isolation)||"none",allowEmpty:!0})}),m.jsxs(Tr,{label:"Memory",children:[m.jsx(nt,{list:"cfg-dl-memory",value:i.memory,onChange:N=>d("memory")(N.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(N=>m.jsx("option",{value:N},N))}),j&&m.jsx("p",{className:"text-xs text-destructive",children:j})]})]})]}),m.jsxs("section",{className:"flex flex-col gap-3",children:[m.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),m.jsx(bl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[m.jsxs(Tr,{label:"Role",children:[m.jsx(nt,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:N=>d("orchestrator_role")(N.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(N=>m.jsx("option",{value:N},N))}),C&&m.jsx("p",{className:"text-xs text-destructive",children:C})]}),m.jsx(Tr,{label:"Permission Mode",children:m.jsx(Cf,{value:i.orchestrator_permission_mode,onChange:d("orchestrator_permission_mode"),options:B4e,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(bl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(Tr,{label:"Max Depth",children:m.jsx(nt,{type:"number",value:i.policy_max_depth,onChange:N=>d("policy_max_depth")(N.target.value),placeholder:(f==null?void 0:f.policy_max_depth)||"3",className:"h-8 text-xs"})}),m.jsx(Tr,{label:"Agent Timeout (seconds)",children:m.jsx(nt,{type:"number",value:i.policy_agent_timeout,onChange:N=>d("policy_agent_timeout")(N.target.value),placeholder:(f==null?void 0:f.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),m.jsx(Tr,{label:"Max Delegate Retries",children:m.jsx(nt,{type:"number",value:i.policy_max_delegate_retries,onChange:N=>d("policy_max_delegate_retries")(N.target.value),placeholder:(f==null?void 0:f.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),m.jsx(Tr,{label:"Cache Delegations",children:m.jsx(Cf,{value:i.policy_cache_delegations,onChange:d("policy_cache_delegations"),options:e$,placeholder:(f==null?void 0:f.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),m.jsx(Tr,{label:"Cache Max Entries",children:m.jsx(nt,{value:i.policy_cache_max_entries,onChange:N=>d("policy_cache_max_entries")(N.target.value),placeholder:(f==null?void 0:f.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),m.jsx(Tr,{label:"Cache TTL (seconds)",children:m.jsx(nt,{value:i.policy_cache_ttl_seconds,onChange:N=>d("policy_cache_ttl_seconds")(N.target.value),placeholder:(f==null?void 0:f.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),m.jsx(Tr,{label:"Max Delegations",children:m.jsx(nt,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:N=>d("policy_max_num_delegations")(N.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(bl,{}),m.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[m.jsx(Tr,{label:"Merge Strategy",children:m.jsx(Cf,{value:i.session_merge_strategy,onChange:d("session_merge_strategy"),options:F4e,placeholder:(f==null?void 0:f.session_merge_strategy)||"auto",allowEmpty:!0})}),m.jsx(Tr,{label:"Pull Before Session",children:m.jsx(Cf,{value:i.session_pull_before_session,onChange:d("session_pull_before_session"),options:U4e,placeholder:(f==null?void 0:f.session_pull_before_session)||"prompt",allowEmpty:!0})}),m.jsx(Tr,{label:"PR Command",className:"sm:col-span-3",children:m.jsx(nt,{value:i.session_pr_command,onChange:N=>d("session_pr_command")(N.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(bl,{}),m.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:m.jsx(Tr,{label:"Enabled",children:m.jsx(Cf,{value:i.trace_enabled,onChange:d("trace_enabled"),options:e$,placeholder:(f==null?void 0:f.trace_enabled)||"true",allowEmpty:!0})})})]}),m.jsxs(je,{size:"sm",onClick:g,disabled:r||A,className:"self-start",children:[m.jsx(yF,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Tr({label:e,children:t,className:n}){return m.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[m.jsx(ct,{className:"text-xs",children:e}),t]})}function Cf({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return m.jsxs(Da,{value:e||(i?N_:""),onValueChange:a=>t(a===N_?"":a),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{placeholder:r})}),m.jsxs(La,{children:[i&&m.jsx(Pn,{value:N_,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>m.jsx(Pn,{value:a,children:a},a))]})]})}function H4e(){var g,v;const[e,t]=x.useState("global"),[n,r]=x.useState(null),i=pt(),a=VF(),o=Rd(),l=sA(n??0,{enabled:n!=null}),c=Ble(),f=KF(),h=b=>{c.mutate(b,{onSuccess:()=>Dt.success("Global configuration saved"),onError:()=>Dt.error("Failed to save global configuration")})},d=b=>{n!=null&&f.mutate({projectId:n,data:b},{onSuccess:()=>Dt.success("Project configuration saved"),onError:()=>Dt.error("Failed to save project configuration")})};return x.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Ve.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(CN,{value:e,onValueChange:t,children:[m.jsxs(kN,{children:[m.jsx(Ai,{value:"global",children:"Global"}),m.jsx(Ai,{value:"project",children:"Project"})]}),m.jsx(Oi,{value:"global",className:"mt-4",children:a.isLoading?m.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):m.jsx(t$,{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(Oi,{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(ct,{className:"text-xs",children:"Project"}),m.jsxs(Da,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[m.jsx(Ia,{className:"h-8 text-xs",children:m.jsx(Ra,{placeholder:"Select a project"})}),m.jsx(La,{children:(o.data??[]).map(b=>m.jsx(Pn,{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(t$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:d,saving:f.isPending},n)]})})]})]})}function q4e(){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(je,{variant:"outline",asChild:!0,children:m.jsxs(Ir,{to:"/",children:[m.jsx(moe,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const V4e=3,K4e=1e4,Y4e=2e3;function X4e(){const e=pt(),t=x.useRef(null),n=x.useRef(void 0),r=x.useRef(1e3),i=x.useRef(0),a=x.useRef({});x.useEffect(()=>{function o(c){const f=Date.now();if(f-i.current<Y4e)return!1;const h=(a.current[c]??[]).filter(d=>f-d<K4e);return h.length>=V4e?!1:(h.push(f),a.current[c]=h,!0)}function l(){const c=new EventSource("/api/events");t.current=c,c.onopen=()=>{r.current=1e3,i.current=Date.now()};const f=h=>{try{const d=JSON.parse(h.data),g=(d.run_id??"unknown").slice(0,12);o(h.type)&&(h.type==="session_started"?Dt.info(`Session ${g} started`):h.type==="session_completed"?Dt.success(`Session ${g} completed`):h.type==="session_failed"?Dt.error(`Session ${g} failed`):h.type==="session_stopped"&&Dt.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),d.project_id&&(e.invalidateQueries({queryKey:Ve.projects.sessions(d.project_id)}),e.invalidateQueries({queryKey:Ve.conversations.all(d.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}catch{}};c.addEventListener("session_started",f),c.addEventListener("session_completed",f),c.addEventListener("session_failed",f),c.addEventListener("session_stopped",f),c.onerror=()=>{c.close(),t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),l()},r.current)}}return l(),()=>{var c;(c=t.current)==null||c.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function G4e(){return X4e(),m.jsx(gQ,{children:m.jsxs(_i,{element:m.jsx(jle,{}),children:[m.jsx(_i,{index:!0,element:m.jsx(Rle,{})}),m.jsx(_i,{path:"projects",element:m.jsx(Vle,{})}),m.jsx(_i,{path:"projects/:projectId",element:m.jsx(Vke,{})}),m.jsx(_i,{path:"projects/:projectId/sessions/:runId",element:m.jsx(W3e,{})}),m.jsx(_i,{path:"projects/:projectId/conversations/:conversationId",element:m.jsx(p4e,{})}),m.jsx(_i,{path:"imu",element:m.jsx(Q5,{})}),m.jsx(_i,{path:"imu/:conversationId",element:m.jsx(Q5,{})}),m.jsx(_i,{path:"schedules",element:m.jsx(L4e,{})}),m.jsx(_i,{path:"resources/:resourceType",element:m.jsx(_4e,{})}),m.jsx(_i,{path:"settings",element:m.jsx(H4e,{})}),m.jsx(_i,{path:"*",element:m.jsx(q4e,{})})]})})}vW.createRoot(document.getElementById("root")).render(m.jsx(x.StrictMode,{children:m.jsx(MZ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:m.jsx(_Z,{client:Sse,children:m.jsxs(cF,{children:[m.jsx(FQ,{children:m.jsx(G4e,{})}),m.jsx(wse,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
