var IW=Object.defineProperty;var sD=e=>{throw TypeError(e)};var LW=(e,t,n)=>t in e?IW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pS=(e,t,n)=>LW(e,typeof t!="symbol"?t+"":t,n),gS=(e,t,n)=>t.has(e)||sD("Cannot "+n);var W=(e,t,n)=>(gS(e,t,"read from private field"),n?n.call(e):t.get(e)),De=(e,t,n)=>t.has(e)?sD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ne=(e,t,n,r)=>(gS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(gS(e,t,"access private method"),n);var zv=(e,t,n,r)=>({set _(i){Ne(e,t,i,n)},get _(){return W(e,t,r)}});function zW(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vS={exports:{}},Hh={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lD;function $W(){if(lD)return Hh;lD=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Hh.Fragment=t,Hh.jsx=n,Hh.jsxs=n,Hh}var uD;function BW(){return uD||(uD=1,vS.exports=$W()),vS.exports}var h=BW(),yS={exports:{}},ct={};/**
 * @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 cD;function FW(){if(cD)return ct;cD=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"),m=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=g&&H[g]||H["@@iterator"],typeof H=="function"?H:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(H,U,B){this.props=H,this.context=U,this.refs=S,this.updater=B||b}j.prototype.isReactComponent={},j.prototype.setState=function(H,U){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,U,"setState")},j.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function C(){}C.prototype=j.prototype;function _(H,U,B){this.props=H,this.context=U,this.refs=S,this.updater=B||b}var k=_.prototype=new C;k.constructor=_,w(k,j.prototype),k.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function L(H,U,B){var Q=B.ref;return{$$typeof:e,type:H,key:U,ref:Q!==void 0?Q:null,props:B}}function I(H,U){return L(H.type,U,H.props)}function F(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function $(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(B){return U[B]})}var X=/\/+/g;function D(H,U){return typeof H=="object"&&H!==null&&H.key!=null?$(""+H.key):U.toString(36)}function V(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(A,A):(H.status="pending",H.then(function(U){H.status==="pending"&&(H.status="fulfilled",H.value=U)},function(U){H.status==="pending"&&(H.status="rejected",H.reason=U)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function z(H,U,B,Q,Z){var te=typeof H;(te==="undefined"||te==="boolean")&&(H=null);var ae=!1;if(H===null)ae=!0;else switch(te){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(H.$$typeof){case e:case t:ae=!0;break;case m:return ae=H._init,z(ae(H._payload),U,B,Q,Z)}}if(ae)return Z=Z(H),ae=Q===""?"."+D(H,0):Q,O(Z)?(B="",ae!=null&&(B=ae.replace(X,"$&/")+"/"),z(Z,U,B,"",function(se){return se})):Z!=null&&(F(Z)&&(Z=I(Z,B+(Z.key==null||H&&H.key===Z.key?"":(""+Z.key).replace(X,"$&/")+"/")+ae)),U.push(Z)),1;ae=0;var re=Q===""?".":Q+":";if(O(H))for(var ee=0;ee<H.length;ee++)Q=H[ee],te=re+D(Q,ee),ae+=z(Q,U,B,te,Z);else if(ee=v(H),typeof ee=="function")for(H=ee.call(H),ee=0;!(Q=H.next()).done;)Q=Q.value,te=re+D(Q,ee++),ae+=z(Q,U,B,te,Z);else if(te==="object"){if(typeof H.then=="function")return z(V(H),U,B,Q,Z);throw U=String(H),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function q(H,U,B){if(H==null)return H;var Q=[],Z=0;return z(H,Q,"","",function(te){return U.call(B,te,Z++)}),Q}function G(H){if(H._status===-1){var U=H._result;U=U(),U.then(function(B){(H._status===0||H._status===-1)&&(H._status=1,H._result=B)},function(B){(H._status===0||H._status===-1)&&(H._status=2,H._result=B)}),H._status===-1&&(H._status=0,H._result=U)}if(H._status===1)return H._result.default;throw H._result}var K=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},R={map:q,forEach:function(H,U,B){q(H,function(){U.apply(this,arguments)},B)},count:function(H){var U=0;return q(H,function(){U++}),U},toArray:function(H){return q(H,function(U){return U})||[]},only:function(H){if(!F(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return ct.Activity=d,ct.Children=R,ct.Component=j,ct.Fragment=n,ct.Profiler=i,ct.PureComponent=_,ct.StrictMode=r,ct.Suspense=c,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ct.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},ct.cache=function(H){return function(){return H.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(H,U,B){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Q=w({},H.props),Z=H.key;if(U!=null)for(te in U.key!==void 0&&(Z=""+U.key),U)!P.call(U,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&U.ref===void 0||(Q[te]=U[te]);var te=arguments.length-2;if(te===1)Q.children=B;else if(1<te){for(var ae=Array(te),re=0;re<te;re++)ae[re]=arguments[re+2];Q.children=ae}return L(H.type,Z,Q)},ct.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},ct.createElement=function(H,U,B){var Q,Z={},te=null;if(U!=null)for(Q in U.key!==void 0&&(te=""+U.key),U)P.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(Z[Q]=U[Q]);var ae=arguments.length-2;if(ae===1)Z.children=B;else if(1<ae){for(var re=Array(ae),ee=0;ee<ae;ee++)re[ee]=arguments[ee+2];Z.children=re}if(H&&H.defaultProps)for(Q in ae=H.defaultProps,ae)Z[Q]===void 0&&(Z[Q]=ae[Q]);return L(H,te,Z)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(H){return{$$typeof:l,render:H}},ct.isValidElement=F,ct.lazy=function(H){return{$$typeof:m,_payload:{_status:-1,_result:H},_init:G}},ct.memo=function(H,U){return{$$typeof:f,type:H,compare:U===void 0?null:U}},ct.startTransition=function(H){var U=T.T,B={};T.T=B;try{var Q=H(),Z=T.S;Z!==null&&Z(B,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,K)}catch(te){K(te)}finally{U!==null&&B.types!==null&&(U.types=B.types),T.T=U}},ct.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ct.use=function(H){return T.H.use(H)},ct.useActionState=function(H,U,B){return T.H.useActionState(H,U,B)},ct.useCallback=function(H,U){return T.H.useCallback(H,U)},ct.useContext=function(H){return T.H.useContext(H)},ct.useDebugValue=function(){},ct.useDeferredValue=function(H,U){return T.H.useDeferredValue(H,U)},ct.useEffect=function(H,U){return T.H.useEffect(H,U)},ct.useEffectEvent=function(H){return T.H.useEffectEvent(H)},ct.useId=function(){return T.H.useId()},ct.useImperativeHandle=function(H,U,B){return T.H.useImperativeHandle(H,U,B)},ct.useInsertionEffect=function(H,U){return T.H.useInsertionEffect(H,U)},ct.useLayoutEffect=function(H,U){return T.H.useLayoutEffect(H,U)},ct.useMemo=function(H,U){return T.H.useMemo(H,U)},ct.useOptimistic=function(H,U){return T.H.useOptimistic(H,U)},ct.useReducer=function(H,U,B){return T.H.useReducer(H,U,B)},ct.useRef=function(H){return T.H.useRef(H)},ct.useState=function(H){return T.H.useState(H)},ct.useSyncExternalStore=function(H,U,B){return T.H.useSyncExternalStore(H,U,B)},ct.useTransition=function(){return T.H.useTransition()},ct.version="19.2.4",ct}var fD;function Pd(){return fD||(fD=1,yS.exports=FW()),yS.exports}var y=Pd();const Ce=Hi(y),pN=zW({__proto__:null,default:Ce},[y]);var xS={exports:{}},qh={},bS={exports:{}},wS={};/**
 * @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 dD;function UW(){return dD||(dD=1,(function(e){function t(z,q){var G=z.length;z.push(q);e:for(;0<G;){var K=G-1>>>1,R=z[K];if(0<i(R,q))z[K]=q,z[G]=R,G=K;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var q=z[0],G=z.pop();if(G!==q){z[0]=G;e:for(var K=0,R=z.length,H=R>>>1;K<H;){var U=2*(K+1)-1,B=z[U],Q=U+1,Z=z[Q];if(0>i(B,G))Q<R&&0>i(Z,B)?(z[K]=Z,z[Q]=G,K=Q):(z[K]=B,z[U]=G,K=U);else if(Q<R&&0>i(Z,G))z[K]=Z,z[Q]=G,K=Q;else break e}}return q}function i(z,q){var G=z.sortIndex-q.sortIndex;return G!==0?G:z.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],m=1,d=null,g=3,v=!1,b=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function k(z){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=z)r(f),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(f)}}function O(z){if(w=!1,k(z),!b)if(n(c)!==null)b=!0,A||(A=!0,$());else{var q=n(f);q!==null&&V(O,q.startTime-z)}}var A=!1,T=-1,P=5,L=-1;function I(){return S?!0:!(e.unstable_now()-L<P)}function F(){if(S=!1,A){var z=e.unstable_now();L=z;var q=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var G=g;try{t:{for(k(z),d=n(c);d!==null&&!(d.expirationTime>z&&I());){var K=d.callback;if(typeof K=="function"){d.callback=null,g=d.priorityLevel;var R=K(d.expirationTime<=z);if(z=e.unstable_now(),typeof R=="function"){d.callback=R,k(z),q=!0;break t}d===n(c)&&r(c),k(z)}else r(c);d=n(c)}if(d!==null)q=!0;else{var H=n(f);H!==null&&V(O,H.startTime-z),q=!1}}break e}finally{d=null,g=G,v=!1}q=void 0}}finally{q?$():A=!1}}}var $;if(typeof _=="function")$=function(){_(F)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,D=X.port2;X.port1.onmessage=F,$=function(){D.postMessage(null)}}else $=function(){j(F,0)};function V(z,q){T=j(function(){z(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var G=g;g=q;try{return z()}finally{g=G}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=g;g=z;try{return q()}finally{g=G}},e.unstable_scheduleCallback=function(z,q,G){var K=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?K+G:K):G=K,z){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=G+R,z={id:m++,callback:q,priorityLevel:z,startTime:G,expirationTime:R,sortIndex:-1},G>K?(z.sortIndex=G,t(f,z),n(c)===null&&z===n(f)&&(w?(C(T),T=-1):w=!0,V(O,G-K))):(z.sortIndex=R,t(c,z),b||v||(b=!0,A||(A=!0,$()))),z},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(z){var q=g;return function(){var G=g;g=q;try{return z.apply(this,arguments)}finally{g=G}}}})(wS)),wS}var hD;function HW(){return hD||(hD=1,bS.exports=UW()),bS.exports}var SS={exports:{}},Rr={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var mD;function qW(){if(mD)return Rr;mD=1;var e=Pd();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}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,m){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:m}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rr.createPortal=function(c,f){var m=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,m)},Rr.flushSync=function(c){var f=o.T,m=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=f,r.p=m,r.d.f()}},Rr.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Rr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Rr.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var m=f.as,d=l(m,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:v}):m==="script"&&r.d.X(c,{crossOrigin:d,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Rr.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=l(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Rr.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,d=l(m,f.crossOrigin);r.d.L(c,m,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Rr.preloadModule=function(c,f){if(typeof c=="string")if(f){var m=l(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Rr.requestFormReset=function(c){r.d.r(c)},Rr.unstable_batchedUpdates=function(c,f){return c(f)},Rr.useFormState=function(c,f,m){return o.H.useFormState(c,f,m)},Rr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Rr.version="19.2.4",Rr}var pD;function I$(){if(pD)return SS.exports;pD=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(),SS.exports=qW(),SS.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 gD;function VW(){if(gD)return qh;gD=1;var e=HW(),t=Pd(),n=I$();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var u=s,p=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(p=u.return),s=u.return;while(s)}return u.tag===3?p:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function l(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(a(s)!==s)throw Error(r(188))}function f(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var p=s,x=u;;){var E=p.return;if(E===null)break;var N=E.alternate;if(N===null){if(x=E.return,x!==null){p=x;continue}break}if(E.child===N.child){for(N=E.child;N;){if(N===p)return c(E),s;if(N===x)return c(E),u;N=N.sibling}throw Error(r(188))}if(p.return!==x.return)p=E,x=N;else{for(var M=!1,Y=E.child;Y;){if(Y===p){M=!0,p=E,x=N;break}if(Y===x){M=!0,x=E,p=N;break}Y=Y.sibling}if(!M){for(Y=N.child;Y;){if(Y===p){M=!0,p=N,x=E;break}if(Y===x){M=!0,x=N,p=E;break}Y=Y.sibling}if(!M)throw Error(r(189))}}if(p.alternate!==x)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:u}function m(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=m(s),u!==null)return u;s=s.sibling}return null}var d=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),_=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var X=Symbol.for("react.client.reference");function D(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===X?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case j:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case _:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case k:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return u=s.displayName||null,u!==null?u:D(s.type)||"Memo";case P:u=s._payload,s=s._init;try{return D(s(u))}catch{}}return null}var V=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},K=[],R=-1;function H(s){return{current:s}}function U(s){0>R||(s.current=K[R],K[R]=null,R--)}function B(s,u){R++,K[R]=s.current,s.current=u}var Q=H(null),Z=H(null),te=H(null),ae=H(null);function re(s,u){switch(B(te,u),B(Z,s),B(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?OM(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=OM(u),s=TM(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(Q),B(Q,s)}function ee(){U(Q),U(Z),U(te)}function se(s){s.memoizedState!==null&&B(ae,s);var u=Q.current,p=TM(u,s.type);u!==p&&(B(Z,s),B(Q,p))}function ge(s){Z.current===s&&(U(Q),U(Z)),ae.current===s&&(U(ae),$h._currentValue=G)}var ie,Se;function Ee(s){if(ie===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ie=u&&u[1]||"",Se=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+Se}var He=!1;function ke(s,u){if(!s||He)return"";He=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(he){var de=he}Reflect.construct(s,[],be)}else{try{be.call()}catch(he){de=he}s.call(be.prototype)}}else{try{throw Error()}catch(he){de=he}(be=s())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(he){if(he&&de&&typeof he.stack=="string")return[he.stack,de.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=x.DetermineComponentFrameRoot(),M=N[0],Y=N[1];if(M&&Y){var J=M.split(`
`),fe=Y.split(`
`);for(E=x=0;x<J.length&&!J[x].includes("DetermineComponentFrameRoot");)x++;for(;E<fe.length&&!fe[E].includes("DetermineComponentFrameRoot");)E++;if(x===J.length||E===fe.length)for(x=J.length-1,E=fe.length-1;1<=x&&0<=E&&J[x]!==fe[E];)E--;for(;1<=x&&0<=E;x--,E--)if(J[x]!==fe[E]){if(x!==1||E!==1)do if(x--,E--,0>E||J[x]!==fe[E]){var ve=`
`+J[x].replace(" at new "," at ");return s.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",s.displayName)),ve}while(1<=x&&0<=E);break}}}finally{He=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ee(p):""}function it(s,u){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==u&&u!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return ke(s.type,!1);case 11:return ke(s.type.render,!1);case 1:return ke(s.type,!0);case 31:return Ee("Activity");default:return""}}function Je(s){try{var u="",p=null;do u+=it(s,p),p=s,s=s.return;while(s);return u}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var We=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mt=e.unstable_cancelCallback,Et=e.unstable_shouldYield,Kt=e.unstable_requestPaint,It=e.unstable_now,fn=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,et=e.unstable_LowPriority,tt=e.unstable_IdlePriority,Xt=e.log,nn=e.unstable_setDisableYieldValue,je=null,st=null;function xt(s){if(typeof Xt=="function"&&nn(s),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(je,s)}catch{}}var ut=Math.clz32?Math.clz32:hr,Bn=Math.log,rn=Math.LN2;function hr(s){return s>>>=0,s===0?32:31-(Bn(s)/rn|0)|0}var Gr=256,Dr=262144,ai=4194304;function Er(s){var u=s&42;if(u!==0)return u;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Qe(s,u,p){var x=s.pendingLanes;if(x===0)return 0;var E=0,N=s.suspendedLanes,M=s.pingedLanes;s=s.warmLanes;var Y=x&134217727;return Y!==0?(x=Y&~N,x!==0?E=Er(x):(M&=Y,M!==0?E=Er(M):p||(p=Y&~s,p!==0&&(E=Er(p))))):(Y=x&~N,Y!==0?E=Er(Y):M!==0?E=Er(M):p||(p=x&~s,p!==0&&(E=Er(p)))),E===0?0:u!==0&&u!==E&&(u&N)===0&&(N=E&-E,p=u&-u,N>=p||N===32&&(p&4194048)!==0)?u:E}function qt(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function me(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var s=ai;return ai<<=1,(ai&62914560)===0&&(ai=4194304),s}function an(s){for(var u=[],p=0;31>p;p++)u.push(s);return u}function _t(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Pn(s,u,p,x,E,N){var M=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var Y=s.entanglements,J=s.expirationTimes,fe=s.hiddenUpdates;for(p=M&~p;0<p;){var ve=31-ut(p),be=1<<ve;Y[ve]=0,J[ve]=-1;var de=fe[ve];if(de!==null)for(fe[ve]=null,ve=0;ve<de.length;ve++){var he=de[ve];he!==null&&(he.lane&=-536870913)}p&=~be}x!==0&&Xr(s,x,0),N!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=N&~(M&~u))}function Xr(s,u,p){s.pendingLanes|=u,s.suspendedLanes&=~u;var x=31-ut(u);s.entangledLanes|=u,s.entanglements[x]=s.entanglements[x]|1073741824|p&261930}function mr(s,u){var p=s.entangledLanes|=u;for(s=s.entanglements;p;){var x=31-ut(p),E=1<<x;E&u|s[x]&u&&(s[x]|=u),p&=~E}}function er(s,u){var p=u&-u;return p=(p&42)!==0?1:eo(p),(p&(s.suspendedLanes|u))!==0?0:p}function eo(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Wr(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Is(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:eD(s.type))}function pe(s,u){var p=q.p;try{return q.p=s,u()}finally{q.p=p}}var pt=Math.random().toString(36).slice(2),Lt="__reactFiber$"+pt,on="__reactProps$"+pt,Oa="__reactContainer$"+pt,to="__reactEvents$"+pt,wg="__reactListeners$"+pt,ow="__reactHandles$"+pt,Sg="__reactResources$"+pt,iu="__reactMarker$"+pt;function Jd(s){delete s[Lt],delete s[on],delete s[to],delete s[wg],delete s[ow]}function Ls(s){var u=s[Lt];if(u)return u;for(var p=s.parentNode;p;){if(u=p[Oa]||p[Lt]){if(p=u.alternate,u.child!==null||p!==null&&p.child!==null)for(s=zM(s);s!==null;){if(p=s[Lt])return p;s=zM(s)}return u}s=p,p=s.parentNode}return null}function zs(s){if(s=s[Lt]||s[Oa]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function $s(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Bs(s){var u=s[Sg];return u||(u=s[Sg]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Hn(s){s[iu]=!0}var jg=new Set,Eg={};function Do(s,u){Fs(s,u),Fs(s+"Capture",u)}function Fs(s,u){for(Eg[s]=u,s=0;s<u.length;s++)jg.add(u[s])}var sw=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),eh={},_g={};function lw(s){return We.call(_g,s)?!0:We.call(eh,s)?!1:sw.test(s)?_g[s]=!0:(eh[s]=!0,!1)}function Lc(s,u,p){if(lw(u))if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var x=u.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+p)}}function zc(s,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+p)}}function Ta(s,u,p,x){if(x===null)s.removeAttribute(p);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(u,p,""+x)}}function oi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Cg(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function uw(s,u,p){var x=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var E=x.get,N=x.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return E.call(this)},set:function(M){p=""+M,N.call(this,M)}}),Object.defineProperty(s,u,{enumerable:x.enumerable}),{getValue:function(){return p},setValue:function(M){p=""+M},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Us(s){if(!s._valueTracker){var u=Cg(s)?"checked":"value";s._valueTracker=uw(s,u,""+s[u])}}function Ng(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var p=u.getValue(),x="";return s&&(x=Cg(s)?s.checked?"true":"false":s.value),s=x,s!==p?(u.setValue(s),!0):!1}function au(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var cw=/[\n"\\]/g;function si(s){return s.replace(cw,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function ou(s,u,p,x,E,N,M,Y){s.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.type=M:s.removeAttribute("type"),u!=null?M==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+oi(u)):s.value!==""+oi(u)&&(s.value=""+oi(u)):M!=="submit"&&M!=="reset"||s.removeAttribute("value"),u!=null?th(s,M,oi(u)):p!=null?th(s,M,oi(p)):x!=null&&s.removeAttribute("value"),E==null&&N!=null&&(s.defaultChecked=!!N),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?s.name=""+oi(Y):s.removeAttribute("name")}function kg(s,u,p,x,E,N,M,Y){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),u!=null||p!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){Us(s);return}p=p!=null?""+oi(p):"",u=u!=null?""+oi(u):p,Y||u===s.value||(s.value=u),s.defaultValue=u}x=x??E,x=typeof x!="function"&&typeof x!="symbol"&&!!x,s.checked=Y?s.checked:!!x,s.defaultChecked=!!x,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.name=M),Us(s)}function th(s,u,p){u==="number"&&au(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function Ro(s,u,p,x){if(s=s.options,u){u={};for(var E=0;E<p.length;E++)u["$"+p[E]]=!0;for(p=0;p<s.length;p++)E=u.hasOwnProperty("$"+s[p].value),s[p].selected!==E&&(s[p].selected=E),E&&x&&(s[p].defaultSelected=!0)}else{for(p=""+oi(p),u=null,E=0;E<s.length;E++){if(s[E].value===p){s[E].selected=!0,x&&(s[E].defaultSelected=!0);return}u!==null||s[E].disabled||(u=s[E])}u!==null&&(u.selected=!0)}}function _2(s,u,p){if(u!=null&&(u=""+oi(u),u!==s.value&&(s.value=u),p==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=p!=null?""+oi(p):""}function C2(s,u,p,x){if(u==null){if(x!=null){if(p!=null)throw Error(r(92));if(V(x)){if(1<x.length)throw Error(r(93));x=x[0]}p=x}p==null&&(p=""),u=p}p=oi(u),s.defaultValue=p,x=s.textContent,x===p&&x!==""&&x!==null&&(s.value=x),Us(s)}function $c(s,u){if(u){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=u;return}}s.textContent=u}var TG=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 N2(s,u,p){var x=u.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?x?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":x?s.setProperty(u,p):typeof p!="number"||p===0||TG.has(u)?u==="float"?s.cssFloat=p:s[u]=(""+p).trim():s[u]=p+"px"}function k2(s,u,p){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,p!=null){for(var x in p)!p.hasOwnProperty(x)||u!=null&&u.hasOwnProperty(x)||(x.indexOf("--")===0?s.setProperty(x,""):x==="float"?s.cssFloat="":s[x]="");for(var E in u)x=u[E],u.hasOwnProperty(E)&&p[E]!==x&&N2(s,E,x)}else for(var N in u)u.hasOwnProperty(N)&&N2(s,N,u[N])}function fw(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var PG=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),MG=/^[\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 Ag(s){return MG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Io(){}var dw=null;function hw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Bc=null,Fc=null;function A2(s){var u=zs(s);if(u&&(s=u.stateNode)){var p=s[on]||null;e:switch(s=u.stateNode,u.type){case"input":if(ou(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),u=p.name,p.type==="radio"&&u!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+si(""+u)+'"][type="radio"]'),u=0;u<p.length;u++){var x=p[u];if(x!==s&&x.form===s.form){var E=x[on]||null;if(!E)throw Error(r(90));ou(x,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(u=0;u<p.length;u++)x=p[u],x.form===s.form&&Ng(x)}break e;case"textarea":_2(s,p.value,p.defaultValue);break e;case"select":u=p.value,u!=null&&Ro(s,!!p.multiple,u,!1)}}}var mw=!1;function O2(s,u,p){if(mw)return s(u,p);mw=!0;try{var x=s(u);return x}finally{if(mw=!1,(Bc!==null||Fc!==null)&&(gv(),Bc&&(u=Bc,s=Fc,Fc=Bc=null,A2(u),s)))for(u=0;u<s.length;u++)A2(s[u])}}function nh(s,u){var p=s.stateNode;if(p===null)return null;var x=p[on]||null;if(x===null)return null;p=x[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(s=s.type,x=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!x;break e;default:s=!1}if(s)return null;if(p&&typeof p!="function")throw Error(r(231,u,typeof p));return p}var Lo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pw=!1;if(Lo)try{var rh={};Object.defineProperty(rh,"passive",{get:function(){pw=!0}}),window.addEventListener("test",rh,rh),window.removeEventListener("test",rh,rh)}catch{pw=!1}var Hs=null,gw=null,Og=null;function T2(){if(Og)return Og;var s,u=gw,p=u.length,x,E="value"in Hs?Hs.value:Hs.textContent,N=E.length;for(s=0;s<p&&u[s]===E[s];s++);var M=p-s;for(x=1;x<=M&&u[p-x]===E[N-x];x++);return Og=E.slice(s,1<x?1-x:void 0)}function Tg(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 Pg(){return!0}function P2(){return!1}function li(s){function u(p,x,E,N,M){this._reactName=p,this._targetInst=E,this.type=x,this.nativeEvent=N,this.target=M,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(p=s[Y],this[Y]=p?p(N):N[Y]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Pg:P2,this.isPropagationStopped=P2,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=Pg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Pg)},persist:function(){},isPersistent:Pg}),u}var su={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mg=li(su),ih=d({},su,{view:0,detail:0}),DG=li(ih),vw,yw,ah,Dg=d({},ih,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bw,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==ah&&(ah&&s.type==="mousemove"?(vw=s.screenX-ah.screenX,yw=s.screenY-ah.screenY):yw=vw=0,ah=s),vw)},movementY:function(s){return"movementY"in s?s.movementY:yw}}),M2=li(Dg),RG=d({},Dg,{dataTransfer:0}),IG=li(RG),LG=d({},ih,{relatedTarget:0}),xw=li(LG),zG=d({},su,{animationName:0,elapsedTime:0,pseudoElement:0}),$G=li(zG),BG=d({},su,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),FG=li(BG),UG=d({},su,{data:0}),D2=li(UG),HG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qG={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"},VG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KG(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=VG[s])?!!u[s]:!1}function bw(){return KG}var YG=d({},ih,{key:function(s){if(s.key){var u=HG[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=Tg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?qG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bw,charCode:function(s){return s.type==="keypress"?Tg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Tg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),GG=li(YG),XG=d({},Dg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),R2=li(XG),WG=d({},ih,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bw}),QG=li(WG),ZG=d({},su,{propertyName:0,elapsedTime:0,pseudoElement:0}),JG=li(ZG),eX=d({},Dg,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),tX=li(eX),nX=d({},su,{newState:0,oldState:0}),rX=li(nX),iX=[9,13,27,32],ww=Lo&&"CompositionEvent"in window,oh=null;Lo&&"documentMode"in document&&(oh=document.documentMode);var aX=Lo&&"TextEvent"in window&&!oh,I2=Lo&&(!ww||oh&&8<oh&&11>=oh),L2=" ",z2=!1;function $2(s,u){switch(s){case"keyup":return iX.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B2(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Uc=!1;function oX(s,u){switch(s){case"compositionend":return B2(u);case"keypress":return u.which!==32?null:(z2=!0,L2);case"textInput":return s=u.data,s===L2&&z2?null:s;default:return null}}function sX(s,u){if(Uc)return s==="compositionend"||!ww&&$2(s,u)?(s=T2(),Og=gw=Hs=null,Uc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return I2&&u.locale!=="ko"?null:u.data;default:return null}}var lX={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 F2(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!lX[s.type]:u==="textarea"}function U2(s,u,p,x){Bc?Fc?Fc.push(x):Fc=[x]:Bc=x,u=jv(u,"onChange"),0<u.length&&(p=new Mg("onChange","change",null,p,x),s.push({event:p,listeners:u}))}var sh=null,lh=null;function uX(s){EM(s,0)}function Rg(s){var u=$s(s);if(Ng(u))return s}function H2(s,u){if(s==="change")return u}var q2=!1;if(Lo){var Sw;if(Lo){var jw="oninput"in document;if(!jw){var V2=document.createElement("div");V2.setAttribute("oninput","return;"),jw=typeof V2.oninput=="function"}Sw=jw}else Sw=!1;q2=Sw&&(!document.documentMode||9<document.documentMode)}function K2(){sh&&(sh.detachEvent("onpropertychange",Y2),lh=sh=null)}function Y2(s){if(s.propertyName==="value"&&Rg(lh)){var u=[];U2(u,lh,s,hw(s)),O2(uX,u)}}function cX(s,u,p){s==="focusin"?(K2(),sh=u,lh=p,sh.attachEvent("onpropertychange",Y2)):s==="focusout"&&K2()}function fX(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Rg(lh)}function dX(s,u){if(s==="click")return Rg(u)}function hX(s,u){if(s==="input"||s==="change")return Rg(u)}function mX(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var Si=typeof Object.is=="function"?Object.is:mX;function uh(s,u){if(Si(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var p=Object.keys(s),x=Object.keys(u);if(p.length!==x.length)return!1;for(x=0;x<p.length;x++){var E=p[x];if(!We.call(u,E)||!Si(s[E],u[E]))return!1}return!0}function G2(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function X2(s,u){var p=G2(s);s=0;for(var x;p;){if(p.nodeType===3){if(x=s+p.textContent.length,s<=u&&x>=u)return{node:p,offset:u-s};s=x}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=G2(p)}}function W2(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?W2(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function Q2(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=au(s.document);u instanceof s.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)s=u.contentWindow;else break;u=au(s.document)}return u}function Ew(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 pX=Lo&&"documentMode"in document&&11>=document.documentMode,Hc=null,_w=null,ch=null,Cw=!1;function Z2(s,u,p){var x=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Cw||Hc==null||Hc!==au(x)||(x=Hc,"selectionStart"in x&&Ew(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),ch&&uh(ch,x)||(ch=x,x=jv(_w,"onSelect"),0<x.length&&(u=new Mg("onSelect","select",null,u,p),s.push({event:u,listeners:x}),u.target=Hc)))}function lu(s,u){var p={};return p[s.toLowerCase()]=u.toLowerCase(),p["Webkit"+s]="webkit"+u,p["Moz"+s]="moz"+u,p}var qc={animationend:lu("Animation","AnimationEnd"),animationiteration:lu("Animation","AnimationIteration"),animationstart:lu("Animation","AnimationStart"),transitionrun:lu("Transition","TransitionRun"),transitionstart:lu("Transition","TransitionStart"),transitioncancel:lu("Transition","TransitionCancel"),transitionend:lu("Transition","TransitionEnd")},Nw={},J2={};Lo&&(J2=document.createElement("div").style,"AnimationEvent"in window||(delete qc.animationend.animation,delete qc.animationiteration.animation,delete qc.animationstart.animation),"TransitionEvent"in window||delete qc.transitionend.transition);function uu(s){if(Nw[s])return Nw[s];if(!qc[s])return s;var u=qc[s],p;for(p in u)if(u.hasOwnProperty(p)&&p in J2)return Nw[s]=u[p];return s}var eT=uu("animationend"),tT=uu("animationiteration"),nT=uu("animationstart"),gX=uu("transitionrun"),vX=uu("transitionstart"),yX=uu("transitioncancel"),rT=uu("transitionend"),iT=new Map,kw="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(" ");kw.push("scrollEnd");function Pa(s,u){iT.set(s,u),Do(u,[s])}var Ig=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Vi=[],Vc=0,Aw=0;function Lg(){for(var s=Vc,u=Aw=Vc=0;u<s;){var p=Vi[u];Vi[u++]=null;var x=Vi[u];Vi[u++]=null;var E=Vi[u];Vi[u++]=null;var N=Vi[u];if(Vi[u++]=null,x!==null&&E!==null){var M=x.pending;M===null?E.next=E:(E.next=M.next,M.next=E),x.pending=E}N!==0&&aT(p,E,N)}}function zg(s,u,p,x){Vi[Vc++]=s,Vi[Vc++]=u,Vi[Vc++]=p,Vi[Vc++]=x,Aw|=x,s.lanes|=x,s=s.alternate,s!==null&&(s.lanes|=x)}function Ow(s,u,p,x){return zg(s,u,p,x),$g(s)}function cu(s,u){return zg(s,null,null,u),$g(s)}function aT(s,u,p){s.lanes|=p;var x=s.alternate;x!==null&&(x.lanes|=p);for(var E=!1,N=s.return;N!==null;)N.childLanes|=p,x=N.alternate,x!==null&&(x.childLanes|=p),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(E=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,E&&u!==null&&(E=31-ut(p),s=N.hiddenUpdates,x=s[E],x===null?s[E]=[u]:x.push(u),u.lane=p|536870912),N):null}function $g(s){if(50<Ph)throw Ph=0,$1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Kc={};function xX(s,u,p,x){this.tag=s,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(s,u,p,x){return new xX(s,u,p,x)}function Tw(s){return s=s.prototype,!(!s||!s.isReactComponent)}function zo(s,u){var p=s.alternate;return p===null?(p=ji(s.tag,u,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=u,p.type=s.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=s.flags&65011712,p.childLanes=s.childLanes,p.lanes=s.lanes,p.child=s.child,p.memoizedProps=s.memoizedProps,p.memoizedState=s.memoizedState,p.updateQueue=s.updateQueue,u=s.dependencies,p.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function oT(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 Bg(s,u,p,x,E,N){var M=0;if(x=s,typeof s=="function")Tw(s)&&(M=1);else if(typeof s=="string")M=EW(s,p,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=ji(31,p,u,E),s.elementType=L,s.lanes=N,s;case w:return fu(p.children,E,N,u);case S:M=8,E|=24;break;case j:return s=ji(12,p,u,E|2),s.elementType=j,s.lanes=N,s;case O:return s=ji(13,p,u,E),s.elementType=O,s.lanes=N,s;case A:return s=ji(19,p,u,E),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:M=10;break e;case C:M=9;break e;case k:M=11;break e;case T:M=14;break e;case P:M=16,x=null;break e}M=29,p=Error(r(130,s===null?"null":typeof s,"")),x=null}return u=ji(M,p,u,E),u.elementType=s,u.type=x,u.lanes=N,u}function fu(s,u,p,x){return s=ji(7,s,x,u),s.lanes=p,s}function Pw(s,u,p){return s=ji(6,s,null,u),s.lanes=p,s}function sT(s){var u=ji(18,null,null,0);return u.stateNode=s,u}function Mw(s,u,p){return u=ji(4,s.children!==null?s.children:[],s.key,u),u.lanes=p,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var lT=new WeakMap;function Ki(s,u){if(typeof s=="object"&&s!==null){var p=lT.get(s);return p!==void 0?p:(u={value:s,source:u,stack:Je(u)},lT.set(s,u),u)}return{value:s,source:u,stack:Je(u)}}var Yc=[],Gc=0,Fg=null,fh=0,Yi=[],Gi=0,qs=null,no=1,ro="";function $o(s,u){Yc[Gc++]=fh,Yc[Gc++]=Fg,Fg=s,fh=u}function uT(s,u,p){Yi[Gi++]=no,Yi[Gi++]=ro,Yi[Gi++]=qs,qs=s;var x=no;s=ro;var E=32-ut(x)-1;x&=~(1<<E),p+=1;var N=32-ut(u)+E;if(30<N){var M=E-E%5;N=(x&(1<<M)-1).toString(32),x>>=M,E-=M,no=1<<32-ut(u)+E|p<<E|x,ro=N+s}else no=1<<N|p<<E|x,ro=s}function Dw(s){s.return!==null&&($o(s,1),uT(s,1,0))}function Rw(s){for(;s===Fg;)Fg=Yc[--Gc],Yc[Gc]=null,fh=Yc[--Gc],Yc[Gc]=null;for(;s===qs;)qs=Yi[--Gi],Yi[Gi]=null,ro=Yi[--Gi],Yi[Gi]=null,no=Yi[--Gi],Yi[Gi]=null}function cT(s,u){Yi[Gi++]=no,Yi[Gi++]=ro,Yi[Gi++]=qs,no=u.id,ro=u.overflow,qs=s}var _r=null,mn=null,At=!1,Vs=null,Xi=!1,Iw=Error(r(519));function Ks(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dh(Ki(u,s)),Iw}function fT(s){var u=s.stateNode,p=s.type,x=s.memoizedProps;switch(u[Lt]=s,u[on]=x,p){case"dialog":wt("cancel",u),wt("close",u);break;case"iframe":case"object":case"embed":wt("load",u);break;case"video":case"audio":for(p=0;p<Dh.length;p++)wt(Dh[p],u);break;case"source":wt("error",u);break;case"img":case"image":case"link":wt("error",u),wt("load",u);break;case"details":wt("toggle",u);break;case"input":wt("invalid",u),kg(u,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":wt("invalid",u);break;case"textarea":wt("invalid",u),C2(u,x.value,x.defaultValue,x.children)}p=x.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||u.textContent===""+p||x.suppressHydrationWarning===!0||kM(u.textContent,p)?(x.popover!=null&&(wt("beforetoggle",u),wt("toggle",u)),x.onScroll!=null&&wt("scroll",u),x.onScrollEnd!=null&&wt("scrollend",u),x.onClick!=null&&(u.onclick=Io),u=!0):u=!1,u||Ks(s,!0)}function dT(s){for(_r=s.return;_r;)switch(_r.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:_r=_r.return}}function Xc(s){if(s!==_r)return!1;if(!At)return dT(s),At=!0,!1;var u=s.tag,p;if((p=u!==3&&u!==27)&&((p=u===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||eS(s.type,s.memoizedProps)),p=!p),p&&mn&&Ks(s),dT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=LM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));mn=LM(s)}else u===27?(u=mn,ol(s.type)?(s=aS,aS=null,mn=s):mn=u):mn=_r?Qi(s.stateNode.nextSibling):null;return!0}function du(){mn=_r=null,At=!1}function Lw(){var s=Vs;return s!==null&&(di===null?di=s:di.push.apply(di,s),Vs=null),s}function dh(s){Vs===null?Vs=[s]:Vs.push(s)}var zw=H(null),hu=null,Bo=null;function Ys(s,u,p){B(zw,u._currentValue),u._currentValue=p}function Fo(s){s._currentValue=zw.current,U(zw)}function $w(s,u,p){for(;s!==null;){var x=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),s===p)break;s=s.return}}function Bw(s,u,p,x){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var N=E.dependencies;if(N!==null){var M=E.child;N=N.firstContext;e:for(;N!==null;){var Y=N;N=E;for(var J=0;J<u.length;J++)if(Y.context===u[J]){N.lanes|=p,Y=N.alternate,Y!==null&&(Y.lanes|=p),$w(N.return,p,s),x||(M=null);break e}N=Y.next}}else if(E.tag===18){if(M=E.return,M===null)throw Error(r(341));M.lanes|=p,N=M.alternate,N!==null&&(N.lanes|=p),$w(M,p,s),M=null}else M=E.child;if(M!==null)M.return=E;else for(M=E;M!==null;){if(M===s){M=null;break}if(E=M.sibling,E!==null){E.return=M.return,M=E;break}M=M.return}E=M}}function Wc(s,u,p,x){s=null;for(var E=u,N=!1;E!==null;){if(!N){if((E.flags&524288)!==0)N=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var M=E.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var Y=E.type;Si(E.pendingProps.value,M.value)||(s!==null?s.push(Y):s=[Y])}}else if(E===ae.current){if(M=E.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push($h):s=[$h])}E=E.return}s!==null&&Bw(u,s,p,x),u.flags|=262144}function Ug(s){for(s=s.firstContext;s!==null;){if(!Si(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function mu(s){hu=s,Bo=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Cr(s){return hT(hu,s)}function Hg(s,u){return hu===null&&mu(s),hT(s,u)}function hT(s,u){var p=u._currentValue;if(u={context:u,memoizedValue:p,next:null},Bo===null){if(s===null)throw Error(r(308));Bo=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Bo=Bo.next=u;return p}var bX=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(p,x){s.push(x)}};this.abort=function(){u.aborted=!0,s.forEach(function(p){return p()})}},wX=e.unstable_scheduleCallback,SX=e.unstable_NormalPriority,qn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fw(){return{controller:new bX,data:new Map,refCount:0}}function hh(s){s.refCount--,s.refCount===0&&wX(SX,function(){s.controller.abort()})}var mh=null,Uw=0,Qc=0,Zc=null;function jX(s,u){if(mh===null){var p=mh=[];Uw=0,Qc=V1(),Zc={status:"pending",value:void 0,then:function(x){p.push(x)}}}return Uw++,u.then(mT,mT),u}function mT(){if(--Uw===0&&mh!==null){Zc!==null&&(Zc.status="fulfilled");var s=mh;mh=null,Qc=0,Zc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function EX(s,u){var p=[],x={status:"pending",value:null,reason:null,then:function(E){p.push(E)}};return s.then(function(){x.status="fulfilled",x.value=u;for(var E=0;E<p.length;E++)(0,p[E])(u)},function(E){for(x.status="rejected",x.reason=E,E=0;E<p.length;E++)(0,p[E])(void 0)}),x}var pT=z.S;z.S=function(s,u){ZP=It(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&jX(s,u),pT!==null&&pT(s,u)};var pu=H(null);function Hw(){var s=pu.current;return s!==null?s:sn.pooledCache}function qg(s,u){u===null?B(pu,pu.current):B(pu,u.pool)}function gT(){var s=Hw();return s===null?null:{parent:qn._currentValue,pool:s}}var Jc=Error(r(460)),qw=Error(r(474)),Vg=Error(r(542)),Kg={then:function(){}};function vT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function yT(s,u,p){switch(p=s[p],p===void 0?s.push(u):p!==u&&(u.then(Io,Io),u=p),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,bT(s),s;default:if(typeof u.status=="string")u.then(Io,Io);else{if(s=sn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(x){if(u.status==="pending"){var E=u;E.status="fulfilled",E.value=x}},function(x){if(u.status==="pending"){var E=u;E.status="rejected",E.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,bT(s),s}throw vu=u,Jc}}function gu(s){try{var u=s._init;return u(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(vu=p,Jc):p}}var vu=null;function xT(){if(vu===null)throw Error(r(459));var s=vu;return vu=null,s}function bT(s){if(s===Jc||s===Vg)throw Error(r(483))}var ef=null,ph=0;function Yg(s){var u=ph;return ph+=1,ef===null&&(ef=[]),yT(ef,s,u)}function gh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Gg(s,u){throw u.$$typeof===g?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function wT(s){function u(oe,ne){if(s){var ue=oe.deletions;ue===null?(oe.deletions=[ne],oe.flags|=16):ue.push(ne)}}function p(oe,ne){if(!s)return null;for(;ne!==null;)u(oe,ne),ne=ne.sibling;return null}function x(oe){for(var ne=new Map;oe!==null;)oe.key!==null?ne.set(oe.key,oe):ne.set(oe.index,oe),oe=oe.sibling;return ne}function E(oe,ne){return oe=zo(oe,ne),oe.index=0,oe.sibling=null,oe}function N(oe,ne,ue){return oe.index=ue,s?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<ne?(oe.flags|=67108866,ne):ue):(oe.flags|=67108866,ne)):(oe.flags|=1048576,ne)}function M(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function Y(oe,ne,ue,ye){return ne===null||ne.tag!==6?(ne=Pw(ue,oe.mode,ye),ne.return=oe,ne):(ne=E(ne,ue),ne.return=oe,ne)}function J(oe,ne,ue,ye){var Ge=ue.type;return Ge===w?ve(oe,ne,ue.props.children,ye,ue.key):ne!==null&&(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===P&&gu(Ge)===ne.type)?(ne=E(ne,ue.props),gh(ne,ue),ne.return=oe,ne):(ne=Bg(ue.type,ue.key,ue.props,null,oe.mode,ye),gh(ne,ue),ne.return=oe,ne)}function fe(oe,ne,ue,ye){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=Mw(ue,oe.mode,ye),ne.return=oe,ne):(ne=E(ne,ue.children||[]),ne.return=oe,ne)}function ve(oe,ne,ue,ye,Ge){return ne===null||ne.tag!==7?(ne=fu(ue,oe.mode,ye,Ge),ne.return=oe,ne):(ne=E(ne,ue),ne.return=oe,ne)}function be(oe,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Pw(""+ne,oe.mode,ue),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ue=Bg(ne.type,ne.key,ne.props,null,oe.mode,ue),gh(ue,ne),ue.return=oe,ue;case b:return ne=Mw(ne,oe.mode,ue),ne.return=oe,ne;case P:return ne=gu(ne),be(oe,ne,ue)}if(V(ne)||$(ne))return ne=fu(ne,oe.mode,ue,null),ne.return=oe,ne;if(typeof ne.then=="function")return be(oe,Yg(ne),ue);if(ne.$$typeof===_)return be(oe,Hg(oe,ne),ue);Gg(oe,ne)}return null}function de(oe,ne,ue,ye){var Ge=ne!==null?ne.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ge!==null?null:Y(oe,ne,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===Ge?J(oe,ne,ue,ye):null;case b:return ue.key===Ge?fe(oe,ne,ue,ye):null;case P:return ue=gu(ue),de(oe,ne,ue,ye)}if(V(ue)||$(ue))return Ge!==null?null:ve(oe,ne,ue,ye,null);if(typeof ue.then=="function")return de(oe,ne,Yg(ue),ye);if(ue.$$typeof===_)return de(oe,ne,Hg(oe,ue),ye);Gg(oe,ue)}return null}function he(oe,ne,ue,ye,Ge){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return oe=oe.get(ue)||null,Y(ne,oe,""+ye,Ge);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return oe=oe.get(ye.key===null?ue:ye.key)||null,J(ne,oe,ye,Ge);case b:return oe=oe.get(ye.key===null?ue:ye.key)||null,fe(ne,oe,ye,Ge);case P:return ye=gu(ye),he(oe,ne,ue,ye,Ge)}if(V(ye)||$(ye))return oe=oe.get(ue)||null,ve(ne,oe,ye,Ge,null);if(typeof ye.then=="function")return he(oe,ne,ue,Yg(ye),Ge);if(ye.$$typeof===_)return he(oe,ne,ue,Hg(ne,ye),Ge);Gg(ne,ye)}return null}function Le(oe,ne,ue,ye){for(var Ge=null,$t=null,qe=ne,gt=ne=0,Nt=null;qe!==null&&gt<ue.length;gt++){qe.index>gt?(Nt=qe,qe=null):Nt=qe.sibling;var Bt=de(oe,qe,ue[gt],ye);if(Bt===null){qe===null&&(qe=Nt);break}s&&qe&&Bt.alternate===null&&u(oe,qe),ne=N(Bt,ne,gt),$t===null?Ge=Bt:$t.sibling=Bt,$t=Bt,qe=Nt}if(gt===ue.length)return p(oe,qe),At&&$o(oe,gt),Ge;if(qe===null){for(;gt<ue.length;gt++)qe=be(oe,ue[gt],ye),qe!==null&&(ne=N(qe,ne,gt),$t===null?Ge=qe:$t.sibling=qe,$t=qe);return At&&$o(oe,gt),Ge}for(qe=x(qe);gt<ue.length;gt++)Nt=he(qe,oe,gt,ue[gt],ye),Nt!==null&&(s&&Nt.alternate!==null&&qe.delete(Nt.key===null?gt:Nt.key),ne=N(Nt,ne,gt),$t===null?Ge=Nt:$t.sibling=Nt,$t=Nt);return s&&qe.forEach(function(fl){return u(oe,fl)}),At&&$o(oe,gt),Ge}function rt(oe,ne,ue,ye){if(ue==null)throw Error(r(151));for(var Ge=null,$t=null,qe=ne,gt=ne=0,Nt=null,Bt=ue.next();qe!==null&&!Bt.done;gt++,Bt=ue.next()){qe.index>gt?(Nt=qe,qe=null):Nt=qe.sibling;var fl=de(oe,qe,Bt.value,ye);if(fl===null){qe===null&&(qe=Nt);break}s&&qe&&fl.alternate===null&&u(oe,qe),ne=N(fl,ne,gt),$t===null?Ge=fl:$t.sibling=fl,$t=fl,qe=Nt}if(Bt.done)return p(oe,qe),At&&$o(oe,gt),Ge;if(qe===null){for(;!Bt.done;gt++,Bt=ue.next())Bt=be(oe,Bt.value,ye),Bt!==null&&(ne=N(Bt,ne,gt),$t===null?Ge=Bt:$t.sibling=Bt,$t=Bt);return At&&$o(oe,gt),Ge}for(qe=x(qe);!Bt.done;gt++,Bt=ue.next())Bt=he(qe,oe,gt,Bt.value,ye),Bt!==null&&(s&&Bt.alternate!==null&&qe.delete(Bt.key===null?gt:Bt.key),ne=N(Bt,ne,gt),$t===null?Ge=Bt:$t.sibling=Bt,$t=Bt);return s&&qe.forEach(function(RW){return u(oe,RW)}),At&&$o(oe,gt),Ge}function Zt(oe,ne,ue,ye){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var Ge=ue.key;ne!==null;){if(ne.key===Ge){if(Ge=ue.type,Ge===w){if(ne.tag===7){p(oe,ne.sibling),ye=E(ne,ue.props.children),ye.return=oe,oe=ye;break e}}else if(ne.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===P&&gu(Ge)===ne.type){p(oe,ne.sibling),ye=E(ne,ue.props),gh(ye,ue),ye.return=oe,oe=ye;break e}p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ue.type===w?(ye=fu(ue.props.children,oe.mode,ye,ue.key),ye.return=oe,oe=ye):(ye=Bg(ue.type,ue.key,ue.props,null,oe.mode,ye),gh(ye,ue),ye.return=oe,oe=ye)}return M(oe);case b:e:{for(Ge=ue.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===ue.containerInfo&&ne.stateNode.implementation===ue.implementation){p(oe,ne.sibling),ye=E(ne,ue.children||[]),ye.return=oe,oe=ye;break e}else{p(oe,ne);break}else u(oe,ne);ne=ne.sibling}ye=Mw(ue,oe.mode,ye),ye.return=oe,oe=ye}return M(oe);case P:return ue=gu(ue),Zt(oe,ne,ue,ye)}if(V(ue))return Le(oe,ne,ue,ye);if($(ue)){if(Ge=$(ue),typeof Ge!="function")throw Error(r(150));return ue=Ge.call(ue),rt(oe,ne,ue,ye)}if(typeof ue.then=="function")return Zt(oe,ne,Yg(ue),ye);if(ue.$$typeof===_)return Zt(oe,ne,Hg(oe,ue),ye);Gg(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ne!==null&&ne.tag===6?(p(oe,ne.sibling),ye=E(ne,ue),ye.return=oe,oe=ye):(p(oe,ne),ye=Pw(ue,oe.mode,ye),ye.return=oe,oe=ye),M(oe)):p(oe,ne)}return function(oe,ne,ue,ye){try{ph=0;var Ge=Zt(oe,ne,ue,ye);return ef=null,Ge}catch(qe){if(qe===Jc||qe===Vg)throw qe;var $t=ji(29,qe,null,oe.mode);return $t.lanes=ye,$t.return=oe,$t}finally{}}}var yu=wT(!0),ST=wT(!1),Gs=!1;function Vw(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 Xs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ws(s,u,p){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Ht&2)!==0){var E=x.pending;return E===null?u.next=u:(u.next=E.next,E.next=u),x.pending=u,u=$g(s),aT(s,null,p),u}return zg(s,x,u,p),$g(s)}function vh(s,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,mr(s,p)}}function Yw(s,u){var p=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,p===x)){var E=null,N=null;if(p=p.firstBaseUpdate,p!==null){do{var M={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};N===null?E=N=M:N=N.next=M,p=p.next}while(p!==null);N===null?E=N=u:N=N.next=u}else E=N=u;p={baseState:x.baseState,firstBaseUpdate:E,lastBaseUpdate:N,shared:x.shared,callbacks:x.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=u:s.next=u,p.lastBaseUpdate=u}var Gw=!1;function yh(){if(Gw){var s=Zc;if(s!==null)throw s}}function xh(s,u,p,x){Gw=!1;var E=s.updateQueue;Gs=!1;var N=E.firstBaseUpdate,M=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var J=Y,fe=J.next;J.next=null,M===null?N=fe:M.next=fe,M=J;var ve=s.alternate;ve!==null&&(ve=ve.updateQueue,Y=ve.lastBaseUpdate,Y!==M&&(Y===null?ve.firstBaseUpdate=fe:Y.next=fe,ve.lastBaseUpdate=J))}if(N!==null){var be=E.baseState;M=0,ve=fe=J=null,Y=N;do{var de=Y.lane&-536870913,he=de!==Y.lane;if(he?(Ct&de)===de:(x&de)===de){de!==0&&de===Qc&&(Gw=!0),ve!==null&&(ve=ve.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Le=s,rt=Y;de=u;var Zt=p;switch(rt.tag){case 1:if(Le=rt.payload,typeof Le=="function"){be=Le.call(Zt,be,de);break e}be=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=rt.payload,de=typeof Le=="function"?Le.call(Zt,be,de):Le,de==null)break e;be=d({},be,de);break e;case 2:Gs=!0}}de=Y.callback,de!==null&&(s.flags|=64,he&&(s.flags|=8192),he=E.callbacks,he===null?E.callbacks=[de]:he.push(de))}else he={lane:de,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ve===null?(fe=ve=he,J=be):ve=ve.next=he,M|=de;if(Y=Y.next,Y===null){if(Y=E.shared.pending,Y===null)break;he=Y,Y=he.next,he.next=null,E.lastBaseUpdate=he,E.shared.pending=null}}while(!0);ve===null&&(J=be),E.baseState=J,E.firstBaseUpdate=fe,E.lastBaseUpdate=ve,N===null&&(E.shared.lanes=0),tl|=M,s.lanes=M,s.memoizedState=be}}function jT(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function ET(s,u){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)jT(p[s],u)}var tf=H(null),Xg=H(0);function _T(s,u){s=Wo,B(Xg,s),B(tf,u),Wo=s|u.baseLanes}function Xw(){B(Xg,Wo),B(tf,tf.current)}function Ww(){Wo=Xg.current,U(tf),U(Xg)}var Ei=H(null),Wi=null;function Qs(s){var u=s.alternate;B(Fn,Fn.current&1),B(Ei,s),Wi===null&&(u===null||tf.current!==null||u.memoizedState!==null)&&(Wi=s)}function Qw(s){B(Fn,Fn.current),B(Ei,s),Wi===null&&(Wi=s)}function CT(s){s.tag===22?(B(Fn,Fn.current),B(Ei,s),Wi===null&&(Wi=s)):Zs()}function Zs(){B(Fn,Fn.current),B(Ei,Ei.current)}function _i(s){U(Ei),Wi===s&&(Wi=null),U(Fn)}var Fn=H(0);function Wg(s){for(var u=s;u!==null;){if(u.tag===13){var p=u.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||rS(p)||iS(p)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Uo=0,ft=null,Wt=null,Vn=null,Qg=!1,nf=!1,xu=!1,Zg=0,bh=0,rf=null,_X=0;function Mn(){throw Error(r(321))}function Zw(s,u){if(u===null)return!1;for(var p=0;p<u.length&&p<s.length;p++)if(!Si(s[p],u[p]))return!1;return!0}function Jw(s,u,p,x,E,N){return Uo=N,ft=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=s===null||s.memoizedState===null?uP:m1,xu=!1,N=p(x,E),xu=!1,nf&&(N=kT(u,p,x,E)),NT(s),N}function NT(s){z.H=jh;var u=Wt!==null&&Wt.next!==null;if(Uo=0,Vn=Wt=ft=null,Qg=!1,bh=0,rf=null,u)throw Error(r(300));s===null||Kn||(s=s.dependencies,s!==null&&Ug(s)&&(Kn=!0))}function kT(s,u,p,x){ft=s;var E=0;do{if(nf&&(rf=null),bh=0,nf=!1,25<=E)throw Error(r(301));if(E+=1,Vn=Wt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}z.H=cP,N=u(p,x)}while(nf);return N}function CX(){var s=z.H,u=s.useState()[0];return u=typeof u.then=="function"?wh(u):u,s=s.useState()[0],(Wt!==null?Wt.memoizedState:null)!==s&&(ft.flags|=1024),u}function e1(){var s=Zg!==0;return Zg=0,s}function t1(s,u,p){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~p}function n1(s){if(Qg){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Qg=!1}Uo=0,Vn=Wt=ft=null,nf=!1,bh=Zg=0,rf=null}function Qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?ft.memoizedState=Vn=s:Vn=Vn.next=s,Vn}function Un(){if(Wt===null){var s=ft.alternate;s=s!==null?s.memoizedState:null}else s=Wt.next;var u=Vn===null?ft.memoizedState:Vn.next;if(u!==null)Vn=u,Wt=s;else{if(s===null)throw ft.alternate===null?Error(r(467)):Error(r(310));Wt=s,s={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Vn===null?ft.memoizedState=Vn=s:Vn=Vn.next=s}return Vn}function Jg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wh(s){var u=bh;return bh+=1,rf===null&&(rf=[]),s=yT(rf,s,u),u=ft,(Vn===null?u.memoizedState:Vn.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?uP:m1),s}function ev(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return wh(s);if(s.$$typeof===_)return Cr(s)}throw Error(r(438,String(s)))}function r1(s){var u=null,p=ft.updateQueue;if(p!==null&&(u=p.memoCache),u==null){var x=ft.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(E){return E.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),p===null&&(p=Jg(),ft.updateQueue=p),p.memoCache=u,p=u.data[u.index],p===void 0)for(p=u.data[u.index]=Array(s),x=0;x<s;x++)p[x]=I;return u.index++,p}function Ho(s,u){return typeof u=="function"?u(s):u}function tv(s){var u=Un();return i1(u,Wt,s)}function i1(s,u,p){var x=s.queue;if(x===null)throw Error(r(311));x.lastRenderedReducer=p;var E=s.baseQueue,N=x.pending;if(N!==null){if(E!==null){var M=E.next;E.next=N.next,N.next=M}u.baseQueue=E=N,x.pending=null}if(N=s.baseState,E===null)s.memoizedState=N;else{u=E.next;var Y=M=null,J=null,fe=u,ve=!1;do{var be=fe.lane&-536870913;if(be!==fe.lane?(Ct&be)===be:(Uo&be)===be){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}),be===Qc&&(ve=!0);else if((Uo&de)===de){fe=fe.next,de===Qc&&(ve=!0);continue}else be={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(Y=J=be,M=N):J=J.next=be,ft.lanes|=de,tl|=de;be=fe.action,xu&&p(N,be),N=fe.hasEagerState?fe.eagerState:p(N,be)}else de={lane:be,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(Y=J=de,M=N):J=J.next=de,ft.lanes|=be,tl|=be;fe=fe.next}while(fe!==null&&fe!==u);if(J===null?M=N:J.next=Y,!Si(N,s.memoizedState)&&(Kn=!0,ve&&(p=Zc,p!==null)))throw p;s.memoizedState=N,s.baseState=M,s.baseQueue=J,x.lastRenderedState=N}return E===null&&(x.lanes=0),[s.memoizedState,x.dispatch]}function a1(s){var u=Un(),p=u.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var x=p.dispatch,E=p.pending,N=u.memoizedState;if(E!==null){p.pending=null;var M=E=E.next;do N=s(N,M.action),M=M.next;while(M!==E);Si(N,u.memoizedState)||(Kn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),p.lastRenderedState=N}return[N,x]}function AT(s,u,p){var x=ft,E=Un(),N=At;if(N){if(p===void 0)throw Error(r(407));p=p()}else p=u();var M=!Si((Wt||E).memoizedState,p);if(M&&(E.memoizedState=p,Kn=!0),E=E.queue,l1(PT.bind(null,x,E,s),[s]),E.getSnapshot!==u||M||Vn!==null&&Vn.memoizedState.tag&1){if(x.flags|=2048,af(9,{destroy:void 0},TT.bind(null,x,E,p,u),null),sn===null)throw Error(r(349));N||(Uo&127)!==0||OT(x,u,p)}return p}function OT(s,u,p){s.flags|=16384,s={getSnapshot:u,value:p},u=ft.updateQueue,u===null?(u=Jg(),ft.updateQueue=u,u.stores=[s]):(p=u.stores,p===null?u.stores=[s]:p.push(s))}function TT(s,u,p,x){u.value=p,u.getSnapshot=x,MT(u)&&DT(s)}function PT(s,u,p){return p(function(){MT(u)&&DT(s)})}function MT(s){var u=s.getSnapshot;s=s.value;try{var p=u();return!Si(s,p)}catch{return!0}}function DT(s){var u=cu(s,2);u!==null&&hi(u,s,2)}function o1(s){var u=Qr();if(typeof s=="function"){var p=s;if(s=p(),xu){xt(!0);try{p()}finally{xt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:s},u}function RT(s,u,p,x){return s.baseState=p,i1(s,Wt,typeof x=="function"?x:Ho)}function NX(s,u,p,x,E){if(iv(s))throw Error(r(485));if(s=u.action,s!==null){var N={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){N.listeners.push(M)}};z.T!==null?p(!0):N.isTransition=!1,x(N),p=u.pending,p===null?(N.next=u.pending=N,IT(u,N)):(N.next=p.next,u.pending=p.next=N)}}function IT(s,u){var p=u.action,x=u.payload,E=s.state;if(u.isTransition){var N=z.T,M={};z.T=M;try{var Y=p(E,x),J=z.S;J!==null&&J(M,Y),LT(s,u,Y)}catch(fe){s1(s,u,fe)}finally{N!==null&&M.types!==null&&(N.types=M.types),z.T=N}}else try{N=p(E,x),LT(s,u,N)}catch(fe){s1(s,u,fe)}}function LT(s,u,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(x){zT(s,u,x)},function(x){return s1(s,u,x)}):zT(s,u,p)}function zT(s,u,p){u.status="fulfilled",u.value=p,$T(u),s.state=p,u=s.pending,u!==null&&(p=u.next,p===u?s.pending=null:(p=p.next,u.next=p,IT(s,p)))}function s1(s,u,p){var x=s.pending;if(s.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=p,$T(u),u=u.next;while(u!==x)}s.action=null}function $T(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function BT(s,u){return u}function FT(s,u){if(At){var p=sn.formState;if(p!==null){e:{var x=ft;if(At){if(mn){t:{for(var E=mn,N=Xi;E.nodeType!==8;){if(!N){E=null;break t}if(E=Qi(E.nextSibling),E===null){E=null;break t}}N=E.data,E=N==="F!"||N==="F"?E:null}if(E){mn=Qi(E.nextSibling),x=E.data==="F!";break e}}Ks(x)}x=!1}x&&(u=p[0])}}return p=Qr(),p.memoizedState=p.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:BT,lastRenderedState:u},p.queue=x,p=oP.bind(null,ft,x),x.dispatch=p,x=o1(!1),N=h1.bind(null,ft,!1,x.queue),x=Qr(),E={state:u,dispatch:null,action:s,pending:null},x.queue=E,p=NX.bind(null,ft,E,N,p),E.dispatch=p,x.memoizedState=s,[u,p,!1]}function UT(s){var u=Un();return HT(u,Wt,s)}function HT(s,u,p){if(u=i1(s,u,BT)[0],s=tv(Ho)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=wh(u)}catch(M){throw M===Jc?Vg:M}else x=u;u=Un();var E=u.queue,N=E.dispatch;return p!==u.memoizedState&&(ft.flags|=2048,af(9,{destroy:void 0},kX.bind(null,E,p),null)),[x,N,s]}function kX(s,u){s.action=u}function qT(s){var u=Un(),p=Wt;if(p!==null)return HT(u,p,s);Un(),u=u.memoizedState,p=Un();var x=p.queue.dispatch;return p.memoizedState=s,[u,x,!1]}function af(s,u,p,x){return s={tag:s,create:p,deps:x,inst:u,next:null},u=ft.updateQueue,u===null&&(u=Jg(),ft.updateQueue=u),p=u.lastEffect,p===null?u.lastEffect=s.next=s:(x=p.next,p.next=s,s.next=x,u.lastEffect=s),s}function VT(){return Un().memoizedState}function nv(s,u,p,x){var E=Qr();ft.flags|=s,E.memoizedState=af(1|u,{destroy:void 0},p,x===void 0?null:x)}function rv(s,u,p,x){var E=Un();x=x===void 0?null:x;var N=E.memoizedState.inst;Wt!==null&&x!==null&&Zw(x,Wt.memoizedState.deps)?E.memoizedState=af(u,N,p,x):(ft.flags|=s,E.memoizedState=af(1|u,N,p,x))}function KT(s,u){nv(8390656,8,s,u)}function l1(s,u){rv(2048,8,s,u)}function AX(s){ft.flags|=4;var u=ft.updateQueue;if(u===null)u=Jg(),ft.updateQueue=u,u.events=[s];else{var p=u.events;p===null?u.events=[s]:p.push(s)}}function YT(s){var u=Un().memoizedState;return AX({ref:u,nextImpl:s}),function(){if((Ht&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function GT(s,u){return rv(4,2,s,u)}function XT(s,u){return rv(4,4,s,u)}function WT(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 QT(s,u,p){p=p!=null?p.concat([s]):null,rv(4,4,WT.bind(null,u,s),p)}function u1(){}function ZT(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;return u!==null&&Zw(u,x[1])?x[0]:(p.memoizedState=[s,u],s)}function JT(s,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState;if(u!==null&&Zw(u,x[1]))return x[0];if(x=s(),xu){xt(!0);try{s()}finally{xt(!1)}}return p.memoizedState=[x,u],x}function c1(s,u,p){return p===void 0||(Uo&1073741824)!==0&&(Ct&261930)===0?s.memoizedState=u:(s.memoizedState=p,s=eM(),ft.lanes|=s,tl|=s,p)}function eP(s,u,p,x){return Si(p,u)?p:tf.current!==null?(s=c1(s,p,x),Si(s,u)||(Kn=!0),s):(Uo&42)===0||(Uo&1073741824)!==0&&(Ct&261930)===0?(Kn=!0,s.memoizedState=p):(s=eM(),ft.lanes|=s,tl|=s,u)}function tP(s,u,p,x,E){var N=q.p;q.p=N!==0&&8>N?N:8;var M=z.T,Y={};z.T=Y,h1(s,!1,u,p);try{var J=E(),fe=z.S;if(fe!==null&&fe(Y,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=EX(J,x);Sh(s,u,ve,ki(s))}else Sh(s,u,x,ki(s))}catch(be){Sh(s,u,{then:function(){},status:"rejected",reason:be},ki())}finally{q.p=N,M!==null&&Y.types!==null&&(M.types=Y.types),z.T=M}}function OX(){}function f1(s,u,p,x){if(s.tag!==5)throw Error(r(476));var E=nP(s).queue;tP(s,E,u,G,p===null?OX:function(){return rP(s),p(x)})}function nP(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:G},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:p},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function rP(s){var u=nP(s);u.next===null&&(u=s.alternate.memoizedState),Sh(s,u.next.queue,{},ki())}function d1(){return Cr($h)}function iP(){return Un().memoizedState}function aP(){return Un().memoizedState}function TX(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var p=ki();s=Xs(p);var x=Ws(u,s,p);x!==null&&(hi(x,u,p),vh(x,u,p)),u={cache:Fw()},s.payload=u;return}u=u.return}}function PX(s,u,p){var x=ki();p={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},iv(s)?sP(u,p):(p=Ow(s,u,p,x),p!==null&&(hi(p,s,x),lP(p,u,x)))}function oP(s,u,p){var x=ki();Sh(s,u,p,x)}function Sh(s,u,p,x){var E={lane:x,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(iv(s))sP(u,E);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var M=u.lastRenderedState,Y=N(M,p);if(E.hasEagerState=!0,E.eagerState=Y,Si(Y,M))return zg(s,u,E,0),sn===null&&Lg(),!1}catch{}finally{}if(p=Ow(s,u,E,x),p!==null)return hi(p,s,x),lP(p,u,x),!0}return!1}function h1(s,u,p,x){if(x={lane:2,revertLane:V1(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},iv(s)){if(u)throw Error(r(479))}else u=Ow(s,p,x,2),u!==null&&hi(u,s,2)}function iv(s){var u=s.alternate;return s===ft||u!==null&&u===ft}function sP(s,u){nf=Qg=!0;var p=s.pending;p===null?u.next=u:(u.next=p.next,p.next=u),s.pending=u}function lP(s,u,p){if((p&4194048)!==0){var x=u.lanes;x&=s.pendingLanes,p|=x,u.lanes=p,mr(s,p)}}var jh={readContext:Cr,use:ev,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};jh.useEffectEvent=Mn;var uP={readContext:Cr,use:ev,useCallback:function(s,u){return Qr().memoizedState=[s,u===void 0?null:u],s},useContext:Cr,useEffect:KT,useImperativeHandle:function(s,u,p){p=p!=null?p.concat([s]):null,nv(4194308,4,WT.bind(null,u,s),p)},useLayoutEffect:function(s,u){return nv(4194308,4,s,u)},useInsertionEffect:function(s,u){nv(4,2,s,u)},useMemo:function(s,u){var p=Qr();u=u===void 0?null:u;var x=s();if(xu){xt(!0);try{s()}finally{xt(!1)}}return p.memoizedState=[x,u],x},useReducer:function(s,u,p){var x=Qr();if(p!==void 0){var E=p(u);if(xu){xt(!0);try{p(u)}finally{xt(!1)}}}else E=u;return x.memoizedState=x.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},x.queue=s,s=s.dispatch=PX.bind(null,ft,s),[x.memoizedState,s]},useRef:function(s){var u=Qr();return s={current:s},u.memoizedState=s},useState:function(s){s=o1(s);var u=s.queue,p=oP.bind(null,ft,u);return u.dispatch=p,[s.memoizedState,p]},useDebugValue:u1,useDeferredValue:function(s,u){var p=Qr();return c1(p,s,u)},useTransition:function(){var s=o1(!1);return s=tP.bind(null,ft,s.queue,!0,!1),Qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,p){var x=ft,E=Qr();if(At){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),sn===null)throw Error(r(349));(Ct&127)!==0||OT(x,u,p)}E.memoizedState=p;var N={value:p,getSnapshot:u};return E.queue=N,KT(PT.bind(null,x,N,s),[s]),x.flags|=2048,af(9,{destroy:void 0},TT.bind(null,x,N,p,u),null),p},useId:function(){var s=Qr(),u=sn.identifierPrefix;if(At){var p=ro,x=no;p=(x&~(1<<32-ut(x)-1)).toString(32)+p,u="_"+u+"R_"+p,p=Zg++,0<p&&(u+="H"+p.toString(32)),u+="_"}else p=_X++,u="_"+u+"r_"+p.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:d1,useFormState:FT,useActionState:FT,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=h1.bind(null,ft,!0,p),p.dispatch=u,[s,u]},useMemoCache:r1,useCacheRefresh:function(){return Qr().memoizedState=TX.bind(null,ft)},useEffectEvent:function(s){var u=Qr(),p={impl:s};return u.memoizedState=p,function(){if((Ht&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},m1={readContext:Cr,use:ev,useCallback:ZT,useContext:Cr,useEffect:l1,useImperativeHandle:QT,useInsertionEffect:GT,useLayoutEffect:XT,useMemo:JT,useReducer:tv,useRef:VT,useState:function(){return tv(Ho)},useDebugValue:u1,useDeferredValue:function(s,u){var p=Un();return eP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=tv(Ho)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:wh(s),u]},useSyncExternalStore:AT,useId:iP,useHostTransitionStatus:d1,useFormState:UT,useActionState:UT,useOptimistic:function(s,u){var p=Un();return RT(p,Wt,s,u)},useMemoCache:r1,useCacheRefresh:aP};m1.useEffectEvent=YT;var cP={readContext:Cr,use:ev,useCallback:ZT,useContext:Cr,useEffect:l1,useImperativeHandle:QT,useInsertionEffect:GT,useLayoutEffect:XT,useMemo:JT,useReducer:a1,useRef:VT,useState:function(){return a1(Ho)},useDebugValue:u1,useDeferredValue:function(s,u){var p=Un();return Wt===null?c1(p,s,u):eP(p,Wt.memoizedState,s,u)},useTransition:function(){var s=a1(Ho)[0],u=Un().memoizedState;return[typeof s=="boolean"?s:wh(s),u]},useSyncExternalStore:AT,useId:iP,useHostTransitionStatus:d1,useFormState:qT,useActionState:qT,useOptimistic:function(s,u){var p=Un();return Wt!==null?RT(p,Wt,s,u):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:r1,useCacheRefresh:aP};cP.useEffectEvent=YT;function p1(s,u,p,x){u=s.memoizedState,p=p(x,u),p=p==null?u:d({},u,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var g1={enqueueSetState:function(s,u,p){s=s._reactInternals;var x=ki(),E=Xs(x);E.payload=u,p!=null&&(E.callback=p),u=Ws(s,E,x),u!==null&&(hi(u,s,x),vh(u,s,x))},enqueueReplaceState:function(s,u,p){s=s._reactInternals;var x=ki(),E=Xs(x);E.tag=1,E.payload=u,p!=null&&(E.callback=p),u=Ws(s,E,x),u!==null&&(hi(u,s,x),vh(u,s,x))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var p=ki(),x=Xs(p);x.tag=2,u!=null&&(x.callback=u),u=Ws(s,x,p),u!==null&&(hi(u,s,p),vh(u,s,p))}};function fP(s,u,p,x,E,N,M){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,N,M):u.prototype&&u.prototype.isPureReactComponent?!uh(p,x)||!uh(E,N):!0}function dP(s,u,p,x){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(p,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(p,x),u.state!==s&&g1.enqueueReplaceState(u,u.state,null)}function bu(s,u){var p=u;if("ref"in u){p={};for(var x in u)x!=="ref"&&(p[x]=u[x])}if(s=s.defaultProps){p===u&&(p=d({},p));for(var E in s)p[E]===void 0&&(p[E]=s[E])}return p}function hP(s){Ig(s)}function mP(s){console.error(s)}function pP(s){Ig(s)}function av(s,u){try{var p=s.onUncaughtError;p(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function gP(s,u,p){try{var x=s.onCaughtError;x(p.value,{componentStack:p.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function v1(s,u,p){return p=Xs(p),p.tag=3,p.payload={element:null},p.callback=function(){av(s,u)},p}function vP(s){return s=Xs(s),s.tag=3,s}function yP(s,u,p,x){var E=p.type.getDerivedStateFromError;if(typeof E=="function"){var N=x.value;s.payload=function(){return E(N)},s.callback=function(){gP(u,p,x)}}var M=p.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(s.callback=function(){gP(u,p,x),typeof E!="function"&&(nl===null?nl=new Set([this]):nl.add(this));var Y=x.stack;this.componentDidCatch(x.value,{componentStack:Y!==null?Y:""})})}function MX(s,u,p,x,E){if(p.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=p.alternate,u!==null&&Wc(u,p,E,!0),p=Ei.current,p!==null){switch(p.tag){case 31:case 13:return Wi===null?vv():p.alternate===null&&Dn===0&&(Dn=3),p.flags&=-257,p.flags|=65536,p.lanes=E,x===Kg?p.flags|=16384:(u=p.updateQueue,u===null?p.updateQueue=new Set([x]):u.add(x),U1(s,x,E)),!1;case 22:return p.flags|=65536,x===Kg?p.flags|=16384:(u=p.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},p.updateQueue=u):(p=u.retryQueue,p===null?u.retryQueue=new Set([x]):p.add(x)),U1(s,x,E)),!1}throw Error(r(435,p.tag))}return U1(s,x,E),vv(),!1}if(At)return u=Ei.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=E,x!==Iw&&(s=Error(r(422),{cause:x}),dh(Ki(s,p)))):(x!==Iw&&(u=Error(r(423),{cause:x}),dh(Ki(u,p))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,x=Ki(x,p),E=v1(s.stateNode,x,E),Yw(s,E),Dn!==4&&(Dn=2)),!1;var N=Error(r(520),{cause:x});if(N=Ki(N,p),Th===null?Th=[N]:Th.push(N),Dn!==4&&(Dn=2),u===null)return!0;x=Ki(x,p),p=u;do{switch(p.tag){case 3:return p.flags|=65536,s=E&-E,p.lanes|=s,s=v1(p.stateNode,x,s),Yw(p,s),!1;case 1:if(u=p.type,N=p.stateNode,(p.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(nl===null||!nl.has(N))))return p.flags|=65536,E&=-E,p.lanes|=E,E=vP(E),yP(E,s,p,x),Yw(p,E),!1}p=p.return}while(p!==null);return!1}var y1=Error(r(461)),Kn=!1;function Nr(s,u,p,x){u.child=s===null?ST(u,null,p,x):yu(u,s.child,p,x)}function xP(s,u,p,x,E){p=p.render;var N=u.ref;if("ref"in x){var M={};for(var Y in x)Y!=="ref"&&(M[Y]=x[Y])}else M=x;return mu(u),x=Jw(s,u,p,M,N,E),Y=e1(),s!==null&&!Kn?(t1(s,u,E),qo(s,u,E)):(At&&Y&&Dw(u),u.flags|=1,Nr(s,u,x,E),u.child)}function bP(s,u,p,x,E){if(s===null){var N=p.type;return typeof N=="function"&&!Tw(N)&&N.defaultProps===void 0&&p.compare===null?(u.tag=15,u.type=N,wP(s,u,N,x,E)):(s=Bg(p.type,null,x,u,u.mode,E),s.ref=u.ref,s.return=u,u.child=s)}if(N=s.child,!C1(s,E)){var M=N.memoizedProps;if(p=p.compare,p=p!==null?p:uh,p(M,x)&&s.ref===u.ref)return qo(s,u,E)}return u.flags|=1,s=zo(N,x),s.ref=u.ref,s.return=u,u.child=s}function wP(s,u,p,x,E){if(s!==null){var N=s.memoizedProps;if(uh(N,x)&&s.ref===u.ref)if(Kn=!1,u.pendingProps=x=N,C1(s,E))(s.flags&131072)!==0&&(Kn=!0);else return u.lanes=s.lanes,qo(s,u,E)}return x1(s,u,p,x,E)}function SP(s,u,p,x){var E=x.children,N=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|p:p,s!==null){for(x=u.child=s.child,E=0;x!==null;)E=E|x.lanes|x.childLanes,x=x.sibling;x=E&~N}else x=0,u.child=null;return jP(s,u,N,p,x)}if((p&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&qg(u,N!==null?N.cachePool:null),N!==null?_T(u,N):Xw(),CT(u);else return x=u.lanes=536870912,jP(s,u,N!==null?N.baseLanes|p:p,p,x)}else N!==null?(qg(u,N.cachePool),_T(u,N),Zs(),u.memoizedState=null):(s!==null&&qg(u,null),Xw(),Zs());return Nr(s,u,E,p),u.child}function Eh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function jP(s,u,p,x,E){var N=Hw();return N=N===null?null:{parent:qn._currentValue,pool:N},u.memoizedState={baseLanes:p,cachePool:N},s!==null&&qg(u,null),Xw(),CT(u),s!==null&&Wc(s,u,x,!0),u.childLanes=E,null}function ov(s,u){return u=lv({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function EP(s,u,p){return yu(u,s.child,null,p),s=ov(u,u.pendingProps),s.flags|=2,_i(u),u.memoizedState=null,s}function DX(s,u,p){var x=u.pendingProps,E=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(At){if(x.mode==="hidden")return s=ov(u,x),u.lanes=536870912,Eh(null,s);if(Qw(u),(s=mn)?(s=IM(s,Xi),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:qs!==null?{id:no,overflow:ro}:null,retryLane:536870912,hydrationErrors:null},p=sT(s),p.return=u,u.child=p,_r=u,mn=null)):s=null,s===null)throw Ks(u);return u.lanes=536870912,null}return ov(u,x)}var N=s.memoizedState;if(N!==null){var M=N.dehydrated;if(Qw(u),E)if(u.flags&256)u.flags&=-257,u=EP(s,u,p);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Kn||Wc(s,u,p,!1),E=(p&s.childLanes)!==0,Kn||E){if(x=sn,x!==null&&(M=er(x,p),M!==0&&M!==N.retryLane))throw N.retryLane=M,cu(s,M),hi(x,s,M),y1;vv(),u=EP(s,u,p)}else s=N.treeContext,mn=Qi(M.nextSibling),_r=u,At=!0,Vs=null,Xi=!1,s!==null&&cT(u,s),u=ov(u,x),u.flags|=4096;return u}return s=zo(s.child,{mode:x.mode,children:x.children}),s.ref=u.ref,u.child=s,s.return=u,s}function sv(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 x1(s,u,p,x,E){return mu(u),p=Jw(s,u,p,x,void 0,E),x=e1(),s!==null&&!Kn?(t1(s,u,E),qo(s,u,E)):(At&&x&&Dw(u),u.flags|=1,Nr(s,u,p,E),u.child)}function _P(s,u,p,x,E,N){return mu(u),u.updateQueue=null,p=kT(u,x,p,E),NT(s),x=e1(),s!==null&&!Kn?(t1(s,u,N),qo(s,u,N)):(At&&x&&Dw(u),u.flags|=1,Nr(s,u,p,N),u.child)}function CP(s,u,p,x,E){if(mu(u),u.stateNode===null){var N=Kc,M=p.contextType;typeof M=="object"&&M!==null&&(N=Cr(M)),N=new p(x,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=g1,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=x,N.state=u.memoizedState,N.refs={},Vw(u),M=p.contextType,N.context=typeof M=="object"&&M!==null?Cr(M):Kc,N.state=u.memoizedState,M=p.getDerivedStateFromProps,typeof M=="function"&&(p1(u,p,M,x),N.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(M=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),M!==N.state&&g1.enqueueReplaceState(N,N.state,null),xh(u,x,N,E),yh(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(s===null){N=u.stateNode;var Y=u.memoizedProps,J=bu(p,Y);N.props=J;var fe=N.context,ve=p.contextType;M=Kc,typeof ve=="object"&&ve!==null&&(M=Cr(ve));var be=p.getDerivedStateFromProps;ve=typeof be=="function"||typeof N.getSnapshotBeforeUpdate=="function",Y=u.pendingProps!==Y,ve||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y||fe!==M)&&dP(u,N,x,M),Gs=!1;var de=u.memoizedState;N.state=de,xh(u,x,N,E),yh(),fe=u.memoizedState,Y||de!==fe||Gs?(typeof be=="function"&&(p1(u,p,be,x),fe=u.memoizedState),(J=Gs||fP(u,p,J,x,de,fe,M))?(ve||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=fe),N.props=x,N.state=fe,N.context=M,x=J):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{N=u.stateNode,Kw(s,u),M=u.memoizedProps,ve=bu(p,M),N.props=ve,be=u.pendingProps,de=N.context,fe=p.contextType,J=Kc,typeof fe=="object"&&fe!==null&&(J=Cr(fe)),Y=p.getDerivedStateFromProps,(fe=typeof Y=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M!==be||de!==J)&&dP(u,N,x,J),Gs=!1,de=u.memoizedState,N.state=de,xh(u,x,N,E),yh();var he=u.memoizedState;M!==be||de!==he||Gs||s!==null&&s.dependencies!==null&&Ug(s.dependencies)?(typeof Y=="function"&&(p1(u,p,Y,x),he=u.memoizedState),(ve=Gs||fP(u,p,ve,x,de,he,J)||s!==null&&s.dependencies!==null&&Ug(s.dependencies))?(fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(x,he,J),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(x,he,J)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||M===s.memoizedProps&&de===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&de===s.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=he),N.props=x,N.state=he,N.context=J,x=ve):(typeof N.componentDidUpdate!="function"||M===s.memoizedProps&&de===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===s.memoizedProps&&de===s.memoizedState||(u.flags|=1024),x=!1)}return N=x,sv(s,u),x=(u.flags&128)!==0,N||x?(N=u.stateNode,p=x&&typeof p.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,s!==null&&x?(u.child=yu(u,s.child,null,E),u.child=yu(u,null,p,E)):Nr(s,u,p,E),u.memoizedState=N.state,s=u.child):s=qo(s,u,E),s}function NP(s,u,p,x){return du(),u.flags|=256,Nr(s,u,p,x),u.child}var b1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function w1(s){return{baseLanes:s,cachePool:gT()}}function S1(s,u,p){return s=s!==null?s.childLanes&~p:0,u&&(s|=Ni),s}function kP(s,u,p){var x=u.pendingProps,E=!1,N=(u.flags&128)!==0,M;if((M=N)||(M=s!==null&&s.memoizedState===null?!1:(Fn.current&2)!==0),M&&(E=!0,u.flags&=-129),M=(u.flags&32)!==0,u.flags&=-33,s===null){if(At){if(E?Qs(u):Zs(),(s=mn)?(s=IM(s,Xi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:qs!==null?{id:no,overflow:ro}:null,retryLane:536870912,hydrationErrors:null},p=sT(s),p.return=u,u.child=p,_r=u,mn=null)):s=null,s===null)throw Ks(u);return iS(s)?u.lanes=32:u.lanes=536870912,null}var Y=x.children;return x=x.fallback,E?(Zs(),E=u.mode,Y=lv({mode:"hidden",children:Y},E),x=fu(x,E,p,null),Y.return=u,x.return=u,Y.sibling=x,u.child=Y,x=u.child,x.memoizedState=w1(p),x.childLanes=S1(s,M,p),u.memoizedState=b1,Eh(null,x)):(Qs(u),j1(u,Y))}var J=s.memoizedState;if(J!==null&&(Y=J.dehydrated,Y!==null)){if(N)u.flags&256?(Qs(u),u.flags&=-257,u=E1(s,u,p)):u.memoizedState!==null?(Zs(),u.child=s.child,u.flags|=128,u=null):(Zs(),Y=x.fallback,E=u.mode,x=lv({mode:"visible",children:x.children},E),Y=fu(Y,E,p,null),Y.flags|=2,x.return=u,Y.return=u,x.sibling=Y,u.child=x,yu(u,s.child,null,p),x=u.child,x.memoizedState=w1(p),x.childLanes=S1(s,M,p),u.memoizedState=b1,u=Eh(null,x));else if(Qs(u),iS(Y)){if(M=Y.nextSibling&&Y.nextSibling.dataset,M)var fe=M.dgst;M=fe,x=Error(r(419)),x.stack="",x.digest=M,dh({value:x,source:null,stack:null}),u=E1(s,u,p)}else if(Kn||Wc(s,u,p,!1),M=(p&s.childLanes)!==0,Kn||M){if(M=sn,M!==null&&(x=er(M,p),x!==0&&x!==J.retryLane))throw J.retryLane=x,cu(s,x),hi(M,s,x),y1;rS(Y)||vv(),u=E1(s,u,p)}else rS(Y)?(u.flags|=192,u.child=s.child,u=null):(s=J.treeContext,mn=Qi(Y.nextSibling),_r=u,At=!0,Vs=null,Xi=!1,s!==null&&cT(u,s),u=j1(u,x.children),u.flags|=4096);return u}return E?(Zs(),Y=x.fallback,E=u.mode,J=s.child,fe=J.sibling,x=zo(J,{mode:"hidden",children:x.children}),x.subtreeFlags=J.subtreeFlags&65011712,fe!==null?Y=zo(fe,Y):(Y=fu(Y,E,p,null),Y.flags|=2),Y.return=u,x.return=u,x.sibling=Y,u.child=x,Eh(null,x),x=u.child,Y=s.child.memoizedState,Y===null?Y=w1(p):(E=Y.cachePool,E!==null?(J=qn._currentValue,E=E.parent!==J?{parent:J,pool:J}:E):E=gT(),Y={baseLanes:Y.baseLanes|p,cachePool:E}),x.memoizedState=Y,x.childLanes=S1(s,M,p),u.memoizedState=b1,Eh(s.child,x)):(Qs(u),p=s.child,s=p.sibling,p=zo(p,{mode:"visible",children:x.children}),p.return=u,p.sibling=null,s!==null&&(M=u.deletions,M===null?(u.deletions=[s],u.flags|=16):M.push(s)),u.child=p,u.memoizedState=null,p)}function j1(s,u){return u=lv({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function lv(s,u){return s=ji(22,s,null,u),s.lanes=0,s}function E1(s,u,p){return yu(u,s.child,null,p),s=j1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function AP(s,u,p){s.lanes|=u;var x=s.alternate;x!==null&&(x.lanes|=u),$w(s.return,u,p)}function _1(s,u,p,x,E,N){var M=s.memoizedState;M===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:p,tailMode:E,treeForkCount:N}:(M.isBackwards=u,M.rendering=null,M.renderingStartTime=0,M.last=x,M.tail=p,M.tailMode=E,M.treeForkCount=N)}function OP(s,u,p){var x=u.pendingProps,E=x.revealOrder,N=x.tail;x=x.children;var M=Fn.current,Y=(M&2)!==0;if(Y?(M=M&1|2,u.flags|=128):M&=1,B(Fn,M),Nr(s,u,x,p),x=At?fh:0,!Y&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&AP(s,p,u);else if(s.tag===19)AP(s,p,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(p=u.child,E=null;p!==null;)s=p.alternate,s!==null&&Wg(s)===null&&(E=p),p=p.sibling;p=E,p===null?(E=u.child,u.child=null):(E=p.sibling,p.sibling=null),_1(u,!1,E,p,N,x);break;case"backwards":case"unstable_legacy-backwards":for(p=null,E=u.child,u.child=null;E!==null;){if(s=E.alternate,s!==null&&Wg(s)===null){u.child=E;break}s=E.sibling,E.sibling=p,p=E,E=s}_1(u,!0,p,null,N,x);break;case"together":_1(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function qo(s,u,p){if(s!==null&&(u.dependencies=s.dependencies),tl|=u.lanes,(p&u.childLanes)===0)if(s!==null){if(Wc(s,u,p,!1),(p&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,p=zo(s,s.pendingProps),u.child=p,p.return=u;s.sibling!==null;)s=s.sibling,p=p.sibling=zo(s,s.pendingProps),p.return=u;p.sibling=null}return u.child}function C1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Ug(s)))}function RX(s,u,p){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),Ys(u,qn,s.memoizedState.cache),du();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:Ys(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Qw(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(Qs(u),u.flags|=128,null):(p&u.child.childLanes)!==0?kP(s,u,p):(Qs(u),s=qo(s,u,p),s!==null?s.sibling:null);Qs(u);break;case 19:var E=(s.flags&128)!==0;if(x=(p&u.childLanes)!==0,x||(Wc(s,u,p,!1),x=(p&u.childLanes)!==0),E){if(x)return OP(s,u,p);u.flags|=128}if(E=u.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(Fn,Fn.current),x)break;return null;case 22:return u.lanes=0,SP(s,u,p,u.pendingProps);case 24:Ys(u,qn,s.memoizedState.cache)}return qo(s,u,p)}function TP(s,u,p){if(s!==null)if(s.memoizedProps!==u.pendingProps)Kn=!0;else{if(!C1(s,p)&&(u.flags&128)===0)return Kn=!1,RX(s,u,p);Kn=(s.flags&131072)!==0}else Kn=!1,At&&(u.flags&1048576)!==0&&uT(u,fh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(s=gu(u.elementType),u.type=s,typeof s=="function")Tw(s)?(x=bu(s,x),u.tag=1,u=CP(null,u,s,x,p)):(u.tag=0,u=x1(null,u,s,x,p));else{if(s!=null){var E=s.$$typeof;if(E===k){u.tag=11,u=xP(null,u,s,x,p);break e}else if(E===T){u.tag=14,u=bP(null,u,s,x,p);break e}}throw u=D(s)||s,Error(r(306,u,""))}}return u;case 0:return x1(s,u,u.type,u.pendingProps,p);case 1:return x=u.type,E=bu(x,u.pendingProps),CP(s,u,x,E,p);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));x=u.pendingProps;var N=u.memoizedState;E=N.element,Kw(s,u),xh(u,x,null,p);var M=u.memoizedState;if(x=M.cache,Ys(u,qn,x),x!==N.cache&&Bw(u,[qn],p,!0),yh(),x=M.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:M.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=NP(s,u,x,p);break e}else if(x!==E){E=Ki(Error(r(424)),u),dh(E),u=NP(s,u,x,p);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(mn=Qi(s.firstChild),_r=u,At=!0,Vs=null,Xi=!0,p=ST(u,null,x,p),u.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(du(),x===E){u=qo(s,u,p);break e}Nr(s,u,x,p)}u=u.child}return u;case 26:return sv(s,u),s===null?(p=UM(u.type,null,u.pendingProps,null))?u.memoizedState=p:At||(p=u.type,s=u.pendingProps,x=Ev(te.current).createElement(p),x[Lt]=u,x[on]=s,kr(x,p,s),Hn(x),u.stateNode=x):u.memoizedState=UM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&At&&(x=u.stateNode=$M(u.type,u.pendingProps,te.current),_r=u,Xi=!0,E=mn,ol(u.type)?(aS=E,mn=Qi(x.firstChild)):mn=E),Nr(s,u,u.pendingProps.children,p),sv(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&At&&((E=x=mn)&&(x=fW(x,u.type,u.pendingProps,Xi),x!==null?(u.stateNode=x,_r=u,mn=Qi(x.firstChild),Xi=!1,E=!0):E=!1),E||Ks(u)),se(u),E=u.type,N=u.pendingProps,M=s!==null?s.memoizedProps:null,x=N.children,eS(E,N)?x=null:M!==null&&eS(E,M)&&(u.flags|=32),u.memoizedState!==null&&(E=Jw(s,u,CX,null,null,p),$h._currentValue=E),sv(s,u),Nr(s,u,x,p),u.child;case 6:return s===null&&At&&((s=p=mn)&&(p=dW(p,u.pendingProps,Xi),p!==null?(u.stateNode=p,_r=u,mn=null,s=!0):s=!1),s||Ks(u)),null;case 13:return kP(s,u,p);case 4:return re(u,u.stateNode.containerInfo),x=u.pendingProps,s===null?u.child=yu(u,null,x,p):Nr(s,u,x,p),u.child;case 11:return xP(s,u,u.type,u.pendingProps,p);case 7:return Nr(s,u,u.pendingProps,p),u.child;case 8:return Nr(s,u,u.pendingProps.children,p),u.child;case 12:return Nr(s,u,u.pendingProps.children,p),u.child;case 10:return x=u.pendingProps,Ys(u,u.type,x.value),Nr(s,u,x.children,p),u.child;case 9:return E=u.type._context,x=u.pendingProps.children,mu(u),E=Cr(E),x=x(E),u.flags|=1,Nr(s,u,x,p),u.child;case 14:return bP(s,u,u.type,u.pendingProps,p);case 15:return wP(s,u,u.type,u.pendingProps,p);case 19:return OP(s,u,p);case 31:return DX(s,u,p);case 22:return SP(s,u,p,u.pendingProps);case 24:return mu(u),x=Cr(qn),s===null?(E=Hw(),E===null&&(E=sn,N=Fw(),E.pooledCache=N,N.refCount++,N!==null&&(E.pooledCacheLanes|=p),E=N),u.memoizedState={parent:x,cache:E},Vw(u),Ys(u,qn,E)):((s.lanes&p)!==0&&(Kw(s,u),xh(u,null,null,p),yh()),E=s.memoizedState,N=u.memoizedState,E.parent!==x?(E={parent:x,cache:x},u.memoizedState=E,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=E),Ys(u,qn,x)):(x=N.cache,Ys(u,qn,x),x!==E.cache&&Bw(u,[qn],p,!0))),Nr(s,u,u.pendingProps.children,p),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Vo(s){s.flags|=4}function N1(s,u,p,x,E){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(iM())s.flags|=8192;else throw vu=Kg,qw}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,!YM(u))if(iM())s.flags|=8192;else throw vu=Kg,qw}function uv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Ze():536870912,s.lanes|=u,uf|=u)}function _h(s,u){if(!At)switch(s.tailMode){case"hidden":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s.tail=null:p.sibling=null;break;case"collapsed":p=s.tail;for(var x=null;p!==null;)p.alternate!==null&&(x=p),p=p.sibling;x===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:x.sibling=null}}function pn(s){var u=s.alternate!==null&&s.alternate.child===s.child,p=0,x=0;if(u)for(var E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags&65011712,x|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)p|=E.lanes|E.childLanes,x|=E.subtreeFlags,x|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=x,s.childLanes=p,u}function IX(s,u,p){var x=u.pendingProps;switch(Rw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(u),null;case 1:return pn(u),null;case 3:return p=u.stateNode,x=null,s!==null&&(x=s.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),Fo(qn),ee(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Xc(u)?Vo(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Lw())),pn(u),null;case 26:var E=u.type,N=u.memoizedState;return s===null?(Vo(u),N!==null?(pn(u),PP(u,N)):(pn(u),N1(u,E,null,x,p))):N?N!==s.memoizedState?(Vo(u),pn(u),PP(u,N)):(pn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==x&&Vo(u),pn(u),N1(u,E,s,x,p)),null;case 27:if(ge(u),p=te.current,E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}s=Q.current,Xc(u)?fT(u):(s=$M(E,x,p),u.stateNode=s,Vo(u))}return pn(u),null;case 5:if(ge(u),E=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(!x){if(u.stateNode===null)throw Error(r(166));return pn(u),null}if(N=Q.current,Xc(u))fT(u);else{var M=Ev(te.current);switch(N){case 1:N=M.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:N=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":N=M.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":N=M.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":N=M.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof x.is=="string"?M.createElement("select",{is:x.is}):M.createElement("select"),x.multiple?N.multiple=!0:x.size&&(N.size=x.size);break;default:N=typeof x.is=="string"?M.createElement(E,{is:x.is}):M.createElement(E)}}N[Lt]=u,N[on]=x;e:for(M=u.child;M!==null;){if(M.tag===5||M.tag===6)N.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===u)break e;for(;M.sibling===null;){if(M.return===null||M.return===u)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}u.stateNode=N;e:switch(kr(N,E,x),E){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Vo(u)}}return pn(u),N1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,p),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==x&&Vo(u);else{if(typeof x!="string"&&u.stateNode===null)throw Error(r(166));if(s=te.current,Xc(u)){if(s=u.stateNode,p=u.memoizedProps,x=null,E=_r,E!==null)switch(E.tag){case 27:case 5:x=E.memoizedProps}s[Lt]=u,s=!!(s.nodeValue===p||x!==null&&x.suppressHydrationWarning===!0||kM(s.nodeValue,p)),s||Ks(u,!0)}else s=Ev(s).createTextNode(x),s[Lt]=u,u.stateNode=s}return pn(u),null;case 31:if(p=u.memoizedState,s===null||s.memoizedState!==null){if(x=Xc(u),p!==null){if(s===null){if(!x)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Lt]=u}else du(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),s=!1}else p=Lw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return u.flags&256?(_i(u),u):(_i(u),null);if((u.flags&128)!==0)throw Error(r(558))}return pn(u),null;case 13:if(x=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=Xc(u),x!==null&&x.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[Lt]=u}else du(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;pn(u),E=!1}else E=Lw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return u.flags&256?(_i(u),u):(_i(u),null)}return _i(u),(u.flags&128)!==0?(u.lanes=p,u):(p=x!==null,s=s!==null&&s.memoizedState!==null,p&&(x=u.child,E=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(E=x.alternate.memoizedState.cachePool.pool),N=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(N=x.memoizedState.cachePool.pool),N!==E&&(x.flags|=2048)),p!==s&&p&&(u.child.flags|=8192),uv(u,u.updateQueue),pn(u),null);case 4:return ee(),s===null&&X1(u.stateNode.containerInfo),pn(u),null;case 10:return Fo(u.type),pn(u),null;case 19:if(U(Fn),x=u.memoizedState,x===null)return pn(u),null;if(E=(u.flags&128)!==0,N=x.rendering,N===null)if(E)_h(x,!1);else{if(Dn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(N=Wg(s),N!==null){for(u.flags|=128,_h(x,!1),s=N.updateQueue,u.updateQueue=s,uv(u,s),u.subtreeFlags=0,s=p,p=u.child;p!==null;)oT(p,s),p=p.sibling;return B(Fn,Fn.current&1|2),At&&$o(u,x.treeForkCount),u.child}s=s.sibling}x.tail!==null&&It()>mv&&(u.flags|=128,E=!0,_h(x,!1),u.lanes=4194304)}else{if(!E)if(s=Wg(N),s!==null){if(u.flags|=128,E=!0,s=s.updateQueue,u.updateQueue=s,uv(u,s),_h(x,!0),x.tail===null&&x.tailMode==="hidden"&&!N.alternate&&!At)return pn(u),null}else 2*It()-x.renderingStartTime>mv&&p!==536870912&&(u.flags|=128,E=!0,_h(x,!1),u.lanes=4194304);x.isBackwards?(N.sibling=u.child,u.child=N):(s=x.last,s!==null?s.sibling=N:u.child=N,x.last=N)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=It(),s.sibling=null,p=Fn.current,B(Fn,E?p&1|2:p&1),At&&$o(u,x.treeForkCount),s):(pn(u),null);case 22:case 23:return _i(u),Ww(),x=u.memoizedState!==null,s!==null?s.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(p&536870912)!==0&&(u.flags&128)===0&&(pn(u),u.subtreeFlags&6&&(u.flags|=8192)):pn(u),p=u.updateQueue,p!==null&&uv(u,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048),s!==null&&U(pu),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),Fo(qn),pn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function LX(s,u){switch(Rw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Fo(qn),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return ge(u),null;case 31:if(u.memoizedState!==null){if(_i(u),u.alternate===null)throw Error(r(340));du()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(_i(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));du()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(Fn),null;case 4:return ee(),null;case 10:return Fo(u.type),null;case 22:case 23:return _i(u),Ww(),s!==null&&U(pu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Fo(qn),null;case 25:return null;default:return null}}function MP(s,u){switch(Rw(u),u.tag){case 3:Fo(qn),ee();break;case 26:case 27:case 5:ge(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&_i(u);break;case 13:_i(u);break;case 19:U(Fn);break;case 10:Fo(u.type);break;case 22:case 23:_i(u),Ww(),s!==null&&U(pu);break;case 24:Fo(qn)}}function Ch(s,u){try{var p=u.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var E=x.next;p=E;do{if((p.tag&s)===s){x=void 0;var N=p.create,M=p.inst;x=N(),M.destroy=x}p=p.next}while(p!==E)}}catch(Y){Gt(u,u.return,Y)}}function Js(s,u,p){try{var x=u.updateQueue,E=x!==null?x.lastEffect:null;if(E!==null){var N=E.next;x=N;do{if((x.tag&s)===s){var M=x.inst,Y=M.destroy;if(Y!==void 0){M.destroy=void 0,E=u;var J=p,fe=Y;try{fe()}catch(ve){Gt(E,J,ve)}}}x=x.next}while(x!==N)}}catch(ve){Gt(u,u.return,ve)}}function DP(s){var u=s.updateQueue;if(u!==null){var p=s.stateNode;try{ET(u,p)}catch(x){Gt(s,s.return,x)}}}function RP(s,u,p){p.props=bu(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(x){Gt(s,u,x)}}function Nh(s,u){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var x=s.stateNode;break;case 30:x=s.stateNode;break;default:x=s.stateNode}typeof p=="function"?s.refCleanup=p(x):p.current=x}}catch(E){Gt(s,u,E)}}function io(s,u){var p=s.ref,x=s.refCleanup;if(p!==null)if(typeof x=="function")try{x()}catch(E){Gt(s,u,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(E){Gt(s,u,E)}else p.current=null}function IP(s){var u=s.type,p=s.memoizedProps,x=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&x.focus();break e;case"img":p.src?x.src=p.src:p.srcSet&&(x.srcset=p.srcSet)}}catch(E){Gt(s,s.return,E)}}function k1(s,u,p){try{var x=s.stateNode;aW(x,s.type,p,u),x[on]=u}catch(E){Gt(s,s.return,E)}}function LP(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ol(s.type)||s.tag===4}function A1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||LP(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ol(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function O1(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(s),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=Io));else if(x!==4&&(x===27&&ol(s.type)&&(p=s.stateNode,u=null),s=s.child,s!==null))for(O1(s,u,p),s=s.sibling;s!==null;)O1(s,u,p),s=s.sibling}function cv(s,u,p){var x=s.tag;if(x===5||x===6)s=s.stateNode,u?p.insertBefore(s,u):p.appendChild(s);else if(x!==4&&(x===27&&ol(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(cv(s,u,p),s=s.sibling;s!==null;)cv(s,u,p),s=s.sibling}function zP(s){var u=s.stateNode,p=s.memoizedProps;try{for(var x=s.type,E=u.attributes;E.length;)u.removeAttributeNode(E[0]);kr(u,x,p),u[Lt]=s,u[on]=p}catch(N){Gt(s,s.return,N)}}var Ko=!1,Yn=!1,T1=!1,$P=typeof WeakSet=="function"?WeakSet:Set,pr=null;function zX(s,u){if(s=s.containerInfo,Z1=Tv,s=Q2(s),Ew(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var x=p.getSelection&&p.getSelection();if(x&&x.rangeCount!==0){p=x.anchorNode;var E=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{p.nodeType,N.nodeType}catch{p=null;break e}var M=0,Y=-1,J=-1,fe=0,ve=0,be=s,de=null;t:for(;;){for(var he;be!==p||E!==0&&be.nodeType!==3||(Y=M+E),be!==N||x!==0&&be.nodeType!==3||(J=M+x),be.nodeType===3&&(M+=be.nodeValue.length),(he=be.firstChild)!==null;)de=be,be=he;for(;;){if(be===s)break t;if(de===p&&++fe===E&&(Y=M),de===N&&++ve===x&&(J=M),(he=be.nextSibling)!==null)break;be=de,de=be.parentNode}be=he}p=Y===-1||J===-1?null:{start:Y,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(J1={focusedElem:s,selectionRange:p},Tv=!1,pr=u;pr!==null;)if(u=pr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,pr=s;else for(;pr!==null;){switch(u=pr,N=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)E=s[p],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,p=u,E=N.memoizedProps,N=N.memoizedState,x=p.stateNode;try{var Le=bu(p.type,E);s=x.getSnapshotBeforeUpdate(Le,N),x.__reactInternalSnapshotBeforeUpdate=s}catch(rt){Gt(p,p.return,rt)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,p=s.nodeType,p===9)nS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":nS(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,pr=s;break}pr=u.return}}function BP(s,u,p){var x=p.flags;switch(p.tag){case 0:case 11:case 15:Go(s,p),x&4&&Ch(5,p);break;case 1:if(Go(s,p),x&4)if(s=p.stateNode,u===null)try{s.componentDidMount()}catch(M){Gt(p,p.return,M)}else{var E=bu(p.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(E,u,s.__reactInternalSnapshotBeforeUpdate)}catch(M){Gt(p,p.return,M)}}x&64&&DP(p),x&512&&Nh(p,p.return);break;case 3:if(Go(s,p),x&64&&(s=p.updateQueue,s!==null)){if(u=null,p.child!==null)switch(p.child.tag){case 27:case 5:u=p.child.stateNode;break;case 1:u=p.child.stateNode}try{ET(s,u)}catch(M){Gt(p,p.return,M)}}break;case 27:u===null&&x&4&&zP(p);case 26:case 5:Go(s,p),u===null&&x&4&&IP(p),x&512&&Nh(p,p.return);break;case 12:Go(s,p);break;case 31:Go(s,p),x&4&&HP(s,p);break;case 13:Go(s,p),x&4&&qP(s,p),x&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=YX.bind(null,p),hW(s,p))));break;case 22:if(x=p.memoizedState!==null||Ko,!x){u=u!==null&&u.memoizedState!==null||Yn,E=Ko;var N=Yn;Ko=x,(Yn=u)&&!N?Xo(s,p,(p.subtreeFlags&8772)!==0):Go(s,p),Ko=E,Yn=N}break;case 30:break;default:Go(s,p)}}function FP(s){var u=s.alternate;u!==null&&(s.alternate=null,FP(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Jd(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var bn=null,ui=!1;function Yo(s,u,p){for(p=p.child;p!==null;)UP(s,u,p),p=p.sibling}function UP(s,u,p){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(je,p)}catch{}switch(p.tag){case 26:Yn||io(p,u),Yo(s,u,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Yn||io(p,u);var x=bn,E=ui;ol(p.type)&&(bn=p.stateNode,ui=!1),Yo(s,u,p),Ih(p.stateNode),bn=x,ui=E;break;case 5:Yn||io(p,u);case 6:if(x=bn,E=ui,bn=null,Yo(s,u,p),bn=x,ui=E,bn!==null)if(ui)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(p.stateNode)}catch(N){Gt(p,u,N)}else try{bn.removeChild(p.stateNode)}catch(N){Gt(p,u,N)}break;case 18:bn!==null&&(ui?(s=bn,DM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),vf(s)):DM(bn,p.stateNode));break;case 4:x=bn,E=ui,bn=p.stateNode.containerInfo,ui=!0,Yo(s,u,p),bn=x,ui=E;break;case 0:case 11:case 14:case 15:Js(2,p,u),Yn||Js(4,p,u),Yo(s,u,p);break;case 1:Yn||(io(p,u),x=p.stateNode,typeof x.componentWillUnmount=="function"&&RP(p,u,x)),Yo(s,u,p);break;case 21:Yo(s,u,p);break;case 22:Yn=(x=Yn)||p.memoizedState!==null,Yo(s,u,p),Yn=x;break;default:Yo(s,u,p)}}function HP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{vf(s)}catch(p){Gt(u,u.return,p)}}}function qP(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{vf(s)}catch(p){Gt(u,u.return,p)}}function $X(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new $P),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new $P),u;default:throw Error(r(435,s.tag))}}function fv(s,u){var p=$X(s);u.forEach(function(x){if(!p.has(x)){p.add(x);var E=GX.bind(null,s,x);x.then(E,E)}})}function ci(s,u){var p=u.deletions;if(p!==null)for(var x=0;x<p.length;x++){var E=p[x],N=s,M=u,Y=M;e:for(;Y!==null;){switch(Y.tag){case 27:if(ol(Y.type)){bn=Y.stateNode,ui=!1;break e}break;case 5:bn=Y.stateNode,ui=!1;break e;case 3:case 4:bn=Y.stateNode.containerInfo,ui=!0;break e}Y=Y.return}if(bn===null)throw Error(r(160));UP(N,M,E),bn=null,ui=!1,N=E.alternate,N!==null&&(N.return=null),E.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)VP(u,s),u=u.sibling}var Ma=null;function VP(s,u){var p=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ci(u,s),fi(s),x&4&&(Js(3,s,s.return),Ch(3,s),Js(5,s,s.return));break;case 1:ci(u,s),fi(s),x&512&&(Yn||p===null||io(p,p.return)),x&64&&Ko&&(s=s.updateQueue,s!==null&&(x=s.callbacks,x!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?x:p.concat(x))));break;case 26:var E=Ma;if(ci(u,s),fi(s),x&512&&(Yn||p===null||io(p,p.return)),x&4){var N=p!==null?p.memoizedState:null;if(x=s.memoizedState,p===null)if(x===null)if(s.stateNode===null){e:{x=s.type,p=s.memoizedProps,E=E.ownerDocument||E;t:switch(x){case"title":N=E.getElementsByTagName("title")[0],(!N||N[iu]||N[Lt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=E.createElement(x),E.head.insertBefore(N,E.querySelector("head > title"))),kr(N,x,p),N[Lt]=s,Hn(N),x=N;break e;case"link":var M=VM("link","href",E).get(x+(p.href||""));if(M){for(var Y=0;Y<M.length;Y++)if(N=M[Y],N.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&N.getAttribute("rel")===(p.rel==null?null:p.rel)&&N.getAttribute("title")===(p.title==null?null:p.title)&&N.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){M.splice(Y,1);break t}}N=E.createElement(x),kr(N,x,p),E.head.appendChild(N);break;case"meta":if(M=VM("meta","content",E).get(x+(p.content||""))){for(Y=0;Y<M.length;Y++)if(N=M[Y],N.getAttribute("content")===(p.content==null?null:""+p.content)&&N.getAttribute("name")===(p.name==null?null:p.name)&&N.getAttribute("property")===(p.property==null?null:p.property)&&N.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&N.getAttribute("charset")===(p.charSet==null?null:p.charSet)){M.splice(Y,1);break t}}N=E.createElement(x),kr(N,x,p),E.head.appendChild(N);break;default:throw Error(r(468,x))}N[Lt]=s,Hn(N),x=N}s.stateNode=x}else KM(E,s.type,s.stateNode);else s.stateNode=qM(E,x,s.memoizedProps);else N!==x?(N===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):N.count--,x===null?KM(E,s.type,s.stateNode):qM(E,x,s.memoizedProps)):x===null&&s.stateNode!==null&&k1(s,s.memoizedProps,p.memoizedProps)}break;case 27:ci(u,s),fi(s),x&512&&(Yn||p===null||io(p,p.return)),p!==null&&x&4&&k1(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ci(u,s),fi(s),x&512&&(Yn||p===null||io(p,p.return)),s.flags&32){E=s.stateNode;try{$c(E,"")}catch(Le){Gt(s,s.return,Le)}}x&4&&s.stateNode!=null&&(E=s.memoizedProps,k1(s,E,p!==null?p.memoizedProps:E)),x&1024&&(T1=!0);break;case 6:if(ci(u,s),fi(s),x&4){if(s.stateNode===null)throw Error(r(162));x=s.memoizedProps,p=s.stateNode;try{p.nodeValue=x}catch(Le){Gt(s,s.return,Le)}}break;case 3:if(Nv=null,E=Ma,Ma=_v(u.containerInfo),ci(u,s),Ma=E,fi(s),x&4&&p!==null&&p.memoizedState.isDehydrated)try{vf(u.containerInfo)}catch(Le){Gt(s,s.return,Le)}T1&&(T1=!1,KP(s));break;case 4:x=Ma,Ma=_v(s.stateNode.containerInfo),ci(u,s),fi(s),Ma=x;break;case 12:ci(u,s),fi(s);break;case 31:ci(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 13:ci(u,s),fi(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(hv=It()),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 22:E=s.memoizedState!==null;var J=p!==null&&p.memoizedState!==null,fe=Ko,ve=Yn;if(Ko=fe||E,Yn=ve||J,ci(u,s),Yn=ve,Ko=fe,fi(s),x&8192)e:for(u=s.stateNode,u._visibility=E?u._visibility&-2:u._visibility|1,E&&(p===null||J||Ko||Yn||wu(s)),p=null,u=s;;){if(u.tag===5||u.tag===26){if(p===null){J=p=u;try{if(N=J.stateNode,E)M=N.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{Y=J.stateNode;var be=J.memoizedProps.style,de=be!=null&&be.hasOwnProperty("display")?be.display:null;Y.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Le){Gt(J,J.return,Le)}}}else if(u.tag===6){if(p===null){J=u;try{J.stateNode.nodeValue=E?"":J.memoizedProps}catch(Le){Gt(J,J.return,Le)}}}else if(u.tag===18){if(p===null){J=u;try{var he=J.stateNode;E?RM(he,!0):RM(J.stateNode,!1)}catch(Le){Gt(J,J.return,Le)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}x&4&&(x=s.updateQueue,x!==null&&(p=x.retryQueue,p!==null&&(x.retryQueue=null,fv(s,p))));break;case 19:ci(u,s),fi(s),x&4&&(x=s.updateQueue,x!==null&&(s.updateQueue=null,fv(s,x)));break;case 30:break;case 21:break;default:ci(u,s),fi(s)}}function fi(s){var u=s.flags;if(u&2){try{for(var p,x=s.return;x!==null;){if(LP(x)){p=x;break}x=x.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var E=p.stateNode,N=A1(s);cv(s,N,E);break;case 5:var M=p.stateNode;p.flags&32&&($c(M,""),p.flags&=-33);var Y=A1(s);cv(s,Y,M);break;case 3:case 4:var J=p.stateNode.containerInfo,fe=A1(s);O1(s,fe,J);break;default:throw Error(r(161))}}catch(ve){Gt(s,s.return,ve)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function KP(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;KP(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Go(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)BP(s,u.alternate,u),u=u.sibling}function wu(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Js(4,u,u.return),wu(u);break;case 1:io(u,u.return);var p=u.stateNode;typeof p.componentWillUnmount=="function"&&RP(u,u.return,p),wu(u);break;case 27:Ih(u.stateNode);case 26:case 5:io(u,u.return),wu(u);break;case 22:u.memoizedState===null&&wu(u);break;case 30:wu(u);break;default:wu(u)}s=s.sibling}}function Xo(s,u,p){for(p=p&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,E=s,N=u,M=N.flags;switch(N.tag){case 0:case 11:case 15:Xo(E,N,p),Ch(4,N);break;case 1:if(Xo(E,N,p),x=N,E=x.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(fe){Gt(x,x.return,fe)}if(x=N,E=x.updateQueue,E!==null){var Y=x.stateNode;try{var J=E.shared.hiddenCallbacks;if(J!==null)for(E.shared.hiddenCallbacks=null,E=0;E<J.length;E++)jT(J[E],Y)}catch(fe){Gt(x,x.return,fe)}}p&&M&64&&DP(N),Nh(N,N.return);break;case 27:zP(N);case 26:case 5:Xo(E,N,p),p&&x===null&&M&4&&IP(N),Nh(N,N.return);break;case 12:Xo(E,N,p);break;case 31:Xo(E,N,p),p&&M&4&&HP(E,N);break;case 13:Xo(E,N,p),p&&M&4&&qP(E,N);break;case 22:N.memoizedState===null&&Xo(E,N,p),Nh(N,N.return);break;case 30:break;default:Xo(E,N,p)}u=u.sibling}}function P1(s,u){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&hh(p))}function M1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&hh(s))}function Da(s,u,p,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)YP(s,u,p,x),u=u.sibling}function YP(s,u,p,x){var E=u.flags;switch(u.tag){case 0:case 11:case 15:Da(s,u,p,x),E&2048&&Ch(9,u);break;case 1:Da(s,u,p,x);break;case 3:Da(s,u,p,x),E&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&hh(s)));break;case 12:if(E&2048){Da(s,u,p,x),s=u.stateNode;try{var N=u.memoizedProps,M=N.id,Y=N.onPostCommit;typeof Y=="function"&&Y(M,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(J){Gt(u,u.return,J)}}else Da(s,u,p,x);break;case 31:Da(s,u,p,x);break;case 13:Da(s,u,p,x);break;case 23:break;case 22:N=u.stateNode,M=u.alternate,u.memoizedState!==null?N._visibility&2?Da(s,u,p,x):kh(s,u):N._visibility&2?Da(s,u,p,x):(N._visibility|=2,of(s,u,p,x,(u.subtreeFlags&10256)!==0||!1)),E&2048&&P1(M,u);break;case 24:Da(s,u,p,x),E&2048&&M1(u.alternate,u);break;default:Da(s,u,p,x)}}function of(s,u,p,x,E){for(E=E&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=s,M=u,Y=p,J=x,fe=M.flags;switch(M.tag){case 0:case 11:case 15:of(N,M,Y,J,E),Ch(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?of(N,M,Y,J,E):kh(N,M):(ve._visibility|=2,of(N,M,Y,J,E)),E&&fe&2048&&P1(M.alternate,M);break;case 24:of(N,M,Y,J,E),E&&fe&2048&&M1(M.alternate,M);break;default:of(N,M,Y,J,E)}u=u.sibling}}function kh(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var p=s,x=u,E=x.flags;switch(x.tag){case 22:kh(p,x),E&2048&&P1(x.alternate,x);break;case 24:kh(p,x),E&2048&&M1(x.alternate,x);break;default:kh(p,x)}u=u.sibling}}var Ah=8192;function sf(s,u,p){if(s.subtreeFlags&Ah)for(s=s.child;s!==null;)GP(s,u,p),s=s.sibling}function GP(s,u,p){switch(s.tag){case 26:sf(s,u,p),s.flags&Ah&&s.memoizedState!==null&&_W(p,Ma,s.memoizedState,s.memoizedProps);break;case 5:sf(s,u,p);break;case 3:case 4:var x=Ma;Ma=_v(s.stateNode.containerInfo),sf(s,u,p),Ma=x;break;case 22:s.memoizedState===null&&(x=s.alternate,x!==null&&x.memoizedState!==null?(x=Ah,Ah=16777216,sf(s,u,p),Ah=x):sf(s,u,p));break;default:sf(s,u,p)}}function XP(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Oh(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];pr=x,QP(x,s)}XP(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)WP(s),s=s.sibling}function WP(s){switch(s.tag){case 0:case 11:case 15:Oh(s),s.flags&2048&&Js(9,s,s.return);break;case 3:Oh(s);break;case 12:Oh(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,dv(s)):Oh(s);break;default:Oh(s)}}function dv(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];pr=x,QP(x,s)}XP(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Js(8,u,u.return),dv(u);break;case 22:p=u.stateNode,p._visibility&2&&(p._visibility&=-3,dv(u));break;default:dv(u)}s=s.sibling}}function QP(s,u){for(;pr!==null;){var p=pr;switch(p.tag){case 0:case 11:case 15:Js(8,p,u);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var x=p.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:hh(p.memoizedState.cache)}if(x=p.child,x!==null)x.return=p,pr=x;else e:for(p=s;pr!==null;){x=pr;var E=x.sibling,N=x.return;if(FP(x),x===p){pr=null;break e}if(E!==null){E.return=N,pr=E;break e}pr=N}}}var BX={getCacheForType:function(s){var u=Cr(qn),p=u.data.get(s);return p===void 0&&(p=s(),u.data.set(s,p)),p},cacheSignal:function(){return Cr(qn).controller.signal}},FX=typeof WeakMap=="function"?WeakMap:Map,Ht=0,sn=null,bt=null,Ct=0,Yt=0,Ci=null,el=!1,lf=!1,D1=!1,Wo=0,Dn=0,tl=0,Su=0,R1=0,Ni=0,uf=0,Th=null,di=null,I1=!1,hv=0,ZP=0,mv=1/0,pv=null,nl=null,tr=0,rl=null,cf=null,Qo=0,L1=0,z1=null,JP=null,Ph=0,$1=null;function ki(){return(Ht&2)!==0&&Ct!==0?Ct&-Ct:z.T!==null?V1():Is()}function eM(){if(Ni===0)if((Ct&536870912)===0||At){var s=Dr;Dr<<=1,(Dr&3932160)===0&&(Dr=262144),Ni=s}else Ni=536870912;return s=Ei.current,s!==null&&(s.flags|=32),Ni}function hi(s,u,p){(s===sn&&(Yt===2||Yt===9)||s.cancelPendingCommit!==null)&&(ff(s,0),il(s,Ct,Ni,!1)),_t(s,p),((Ht&2)===0||s!==sn)&&(s===sn&&((Ht&2)===0&&(Su|=p),Dn===4&&il(s,Ct,Ni,!1)),ao(s))}function tM(s,u,p){if((Ht&6)!==0)throw Error(r(327));var x=!p&&(u&127)===0&&(u&s.expiredLanes)===0||qt(s,u),E=x?qX(s,u):F1(s,u,!0),N=x;do{if(E===0){lf&&!x&&il(s,u,0,!1);break}else{if(p=s.current.alternate,N&&!UX(p)){E=F1(s,u,!1),N=!1;continue}if(E===2){if(N=u,s.errorRecoveryDisabledLanes&N)var M=0;else M=s.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){u=M;e:{var Y=s;E=Th;var J=Y.current.memoizedState.isDehydrated;if(J&&(ff(Y,M).flags|=256),M=F1(Y,M,!1),M!==2){if(D1&&!J){Y.errorRecoveryDisabledLanes|=N,Su|=N,E=4;break e}N=di,di=E,N!==null&&(di===null?di=N:di.push.apply(di,N))}E=M}if(N=!1,E!==2)continue}}if(E===1){ff(s,0),il(s,u,0,!0);break}e:{switch(x=s,N=E,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:il(x,u,Ni,!el);break e;case 2:di=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(E=hv+300-It(),10<E)){if(il(x,u,Ni,!el),Qe(x,0,!0)!==0)break e;Qo=u,x.timeoutHandle=PM(nM.bind(null,x,p,di,pv,I1,u,Ni,Su,uf,el,N,"Throttled",-0,0),E);break e}nM(x,p,di,pv,I1,u,Ni,Su,uf,el,N,null,-0,0)}}break}while(!0);ao(s)}function nM(s,u,p,x,E,N,M,Y,J,fe,ve,be,de,he){if(s.timeoutHandle=-1,be=u.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Io},GP(u,N,be);var Le=(N&62914560)===N?hv-It():(N&4194048)===N?ZP-It():0;if(Le=CW(be,Le),Le!==null){Qo=N,s.cancelPendingCommit=Le(cM.bind(null,s,u,N,p,x,E,M,Y,J,ve,be,null,de,he)),il(s,N,M,!fe);return}}cM(s,u,N,p,x,E,M,Y,J)}function UX(s){for(var u=s;;){var p=u.tag;if((p===0||p===11||p===15)&&u.flags&16384&&(p=u.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var x=0;x<p.length;x++){var E=p[x],N=E.getSnapshot;E=E.value;try{if(!Si(N(),E))return!1}catch{return!1}}if(p=u.child,u.subtreeFlags&16384&&p!==null)p.return=u,u=p;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function il(s,u,p,x){u&=~R1,u&=~Su,s.suspendedLanes|=u,s.pingedLanes&=~u,x&&(s.warmLanes|=u),x=s.expirationTimes;for(var E=u;0<E;){var N=31-ut(E),M=1<<N;x[N]=-1,E&=~M}p!==0&&Xr(s,p,u)}function gv(){return(Ht&6)===0?(Mh(0),!1):!0}function B1(){if(bt!==null){if(Yt===0)var s=bt.return;else s=bt,Bo=hu=null,n1(s),ef=null,ph=0,s=bt;for(;s!==null;)MP(s.alternate,s),s=s.return;bt=null}}function ff(s,u){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,lW(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Qo=0,B1(),sn=s,bt=p=zo(s.current,null),Ct=u,Yt=0,Ci=null,el=!1,lf=qt(s,u),D1=!1,uf=Ni=R1=Su=tl=Dn=0,di=Th=null,I1=!1,(u&8)!==0&&(u|=u&32);var x=s.entangledLanes;if(x!==0)for(s=s.entanglements,x&=u;0<x;){var E=31-ut(x),N=1<<E;u|=s[E],x&=~N}return Wo=u,Lg(),p}function rM(s,u){ft=null,z.H=jh,u===Jc||u===Vg?(u=xT(),Yt=3):u===qw?(u=xT(),Yt=4):Yt=u===y1?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Ci=u,bt===null&&(Dn=1,av(s,Ki(u,s.current)))}function iM(){var s=Ei.current;return s===null?!0:(Ct&4194048)===Ct?Wi===null:(Ct&62914560)===Ct||(Ct&536870912)!==0?s===Wi:!1}function aM(){var s=z.H;return z.H=jh,s===null?jh:s}function oM(){var s=z.A;return z.A=BX,s}function vv(){Dn=4,el||(Ct&4194048)!==Ct&&Ei.current!==null||(lf=!0),(tl&134217727)===0&&(Su&134217727)===0||sn===null||il(sn,Ct,Ni,!1)}function F1(s,u,p){var x=Ht;Ht|=2;var E=aM(),N=oM();(sn!==s||Ct!==u)&&(pv=null,ff(s,u)),u=!1;var M=Dn;e:do try{if(Yt!==0&&bt!==null){var Y=bt,J=Ci;switch(Yt){case 8:B1(),M=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(u=!0);var fe=Yt;if(Yt=0,Ci=null,df(s,Y,J,fe),p&&lf){M=0;break e}break;default:fe=Yt,Yt=0,Ci=null,df(s,Y,J,fe)}}HX(),M=Dn;break}catch(ve){rM(s,ve)}while(!0);return u&&s.shellSuspendCounter++,Bo=hu=null,Ht=x,z.H=E,z.A=N,bt===null&&(sn=null,Ct=0,Lg()),M}function HX(){for(;bt!==null;)sM(bt)}function qX(s,u){var p=Ht;Ht|=2;var x=aM(),E=oM();sn!==s||Ct!==u?(pv=null,mv=It()+500,ff(s,u)):lf=qt(s,u);e:do try{if(Yt!==0&&bt!==null){u=bt;var N=Ci;t:switch(Yt){case 1:Yt=0,Ci=null,df(s,u,N,1);break;case 2:case 9:if(vT(N)){Yt=0,Ci=null,lM(u);break}u=function(){Yt!==2&&Yt!==9||sn!==s||(Yt=7),ao(s)},N.then(u,u);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:vT(N)?(Yt=0,Ci=null,lM(u)):(Yt=0,Ci=null,df(s,u,N,7));break;case 5:var M=null;switch(bt.tag){case 26:M=bt.memoizedState;case 5:case 27:var Y=bt;if(M?YM(M):Y.stateNode.complete){Yt=0,Ci=null;var J=Y.sibling;if(J!==null)bt=J;else{var fe=Y.return;fe!==null?(bt=fe,yv(fe)):bt=null}break t}}Yt=0,Ci=null,df(s,u,N,5);break;case 6:Yt=0,Ci=null,df(s,u,N,6);break;case 8:B1(),Dn=6;break e;default:throw Error(r(462))}}VX();break}catch(ve){rM(s,ve)}while(!0);return Bo=hu=null,z.H=x,z.A=E,Ht=p,bt!==null?0:(sn=null,Ct=0,Lg(),Dn)}function VX(){for(;bt!==null&&!Et();)sM(bt)}function sM(s){var u=TP(s.alternate,s,Wo);s.memoizedProps=s.pendingProps,u===null?yv(s):bt=u}function lM(s){var u=s,p=u.alternate;switch(u.tag){case 15:case 0:u=_P(p,u,u.pendingProps,u.type,void 0,Ct);break;case 11:u=_P(p,u,u.pendingProps,u.type.render,u.ref,Ct);break;case 5:n1(u);default:MP(p,u),u=bt=oT(u,Wo),u=TP(p,u,Wo)}s.memoizedProps=s.pendingProps,u===null?yv(s):bt=u}function df(s,u,p,x){Bo=hu=null,n1(u),ef=null,ph=0;var E=u.return;try{if(MX(s,E,u,p,Ct)){Dn=1,av(s,Ki(p,s.current)),bt=null;return}}catch(N){if(E!==null)throw bt=E,N;Dn=1,av(s,Ki(p,s.current)),bt=null;return}u.flags&32768?(At||x===1?s=!0:lf||(Ct&536870912)!==0?s=!1:(el=s=!0,(x===2||x===9||x===3||x===6)&&(x=Ei.current,x!==null&&x.tag===13&&(x.flags|=16384))),uM(u,s)):yv(u)}function yv(s){var u=s;do{if((u.flags&32768)!==0){uM(u,el);return}s=u.return;var p=IX(u.alternate,u,Wo);if(p!==null){bt=p;return}if(u=u.sibling,u!==null){bt=u;return}bt=u=s}while(u!==null);Dn===0&&(Dn=5)}function uM(s,u){do{var p=LX(s.alternate,s);if(p!==null){p.flags&=32767,bt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!u&&(s=s.sibling,s!==null)){bt=s;return}bt=s=p}while(s!==null);Dn=6,bt=null}function cM(s,u,p,x,E,N,M,Y,J){s.cancelPendingCommit=null;do xv();while(tr!==0);if((Ht&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=Aw,Pn(s,p,N,M,Y,J),s===sn&&(bt=sn=null,Ct=0),cf=u,rl=s,Qo=p,L1=N,z1=E,JP=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,XX(Me,function(){return pM(),null})):(s.callbackNode=null,s.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=z.T,z.T=null,E=q.p,q.p=2,M=Ht,Ht|=4;try{zX(s,u,p)}finally{Ht=M,q.p=E,z.T=x}}tr=1,fM(),dM(),hM()}}function fM(){if(tr===1){tr=0;var s=rl,u=cf,p=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||p){p=z.T,z.T=null;var x=q.p;q.p=2;var E=Ht;Ht|=4;try{VP(u,s);var N=J1,M=Q2(s.containerInfo),Y=N.focusedElem,J=N.selectionRange;if(M!==Y&&Y&&Y.ownerDocument&&W2(Y.ownerDocument.documentElement,Y)){if(J!==null&&Ew(Y)){var fe=J.start,ve=J.end;if(ve===void 0&&(ve=fe),"selectionStart"in Y)Y.selectionStart=fe,Y.selectionEnd=Math.min(ve,Y.value.length);else{var be=Y.ownerDocument||document,de=be&&be.defaultView||window;if(de.getSelection){var he=de.getSelection(),Le=Y.textContent.length,rt=Math.min(J.start,Le),Zt=J.end===void 0?rt:Math.min(J.end,Le);!he.extend&&rt>Zt&&(M=Zt,Zt=rt,rt=M);var oe=X2(Y,rt),ne=X2(Y,Zt);if(oe&&ne&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==ne.node||he.focusOffset!==ne.offset)){var ue=be.createRange();ue.setStart(oe.node,oe.offset),he.removeAllRanges(),rt>Zt?(he.addRange(ue),he.extend(ne.node,ne.offset)):(ue.setEnd(ne.node,ne.offset),he.addRange(ue))}}}}for(be=[],he=Y;he=he.parentNode;)he.nodeType===1&&be.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<be.length;Y++){var ye=be[Y];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Tv=!!Z1,J1=Z1=null}finally{Ht=E,q.p=x,z.T=p}}s.current=u,tr=2}}function dM(){if(tr===2){tr=0;var s=rl,u=cf,p=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||p){p=z.T,z.T=null;var x=q.p;q.p=2;var E=Ht;Ht|=4;try{BP(s,u.alternate,u)}finally{Ht=E,q.p=x,z.T=p}}tr=3}}function hM(){if(tr===4||tr===3){tr=0,Kt();var s=rl,u=cf,p=Qo,x=JP;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?tr=5:(tr=0,cf=rl=null,mM(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(nl=null),Wr(p),u=u.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(je,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=z.T,E=q.p,q.p=2,z.T=null;try{for(var N=s.onRecoverableError,M=0;M<x.length;M++){var Y=x[M];N(Y.value,{componentStack:Y.stack})}}finally{z.T=u,q.p=E}}(Qo&3)!==0&&xv(),ao(s),E=s.pendingLanes,(p&261930)!==0&&(E&42)!==0?s===$1?Ph++:(Ph=0,$1=s):Ph=0,Mh(0)}}function mM(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,hh(u)))}function xv(){return fM(),dM(),hM(),pM()}function pM(){if(tr!==5)return!1;var s=rl,u=L1;L1=0;var p=Wr(Qo),x=z.T,E=q.p;try{q.p=32>p?32:p,z.T=null,p=z1,z1=null;var N=rl,M=Qo;if(tr=0,cf=rl=null,Qo=0,(Ht&6)!==0)throw Error(r(331));var Y=Ht;if(Ht|=4,WP(N.current),YP(N,N.current,M,p),Ht=Y,Mh(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(je,N)}catch{}return!0}finally{q.p=E,z.T=x,mM(s,u)}}function gM(s,u,p){u=Ki(p,u),u=v1(s.stateNode,u,2),s=Ws(s,u,2),s!==null&&(_t(s,2),ao(s))}function Gt(s,u,p){if(s.tag===3)gM(s,s,p);else for(;u!==null;){if(u.tag===3){gM(u,s,p);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(nl===null||!nl.has(x))){s=Ki(p,s),p=vP(2),x=Ws(u,p,2),x!==null&&(yP(p,x,u,s),_t(x,2),ao(x));break}}u=u.return}}function U1(s,u,p){var x=s.pingCache;if(x===null){x=s.pingCache=new FX;var E=new Set;x.set(u,E)}else E=x.get(u),E===void 0&&(E=new Set,x.set(u,E));E.has(p)||(D1=!0,E.add(p),s=KX.bind(null,s,u,p),u.then(s,s))}function KX(s,u,p){var x=s.pingCache;x!==null&&x.delete(u),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,sn===s&&(Ct&p)===p&&(Dn===4||Dn===3&&(Ct&62914560)===Ct&&300>It()-hv?(Ht&2)===0&&ff(s,0):R1|=p,uf===Ct&&(uf=0)),ao(s)}function vM(s,u){u===0&&(u=Ze()),s=cu(s,u),s!==null&&(_t(s,u),ao(s))}function YX(s){var u=s.memoizedState,p=0;u!==null&&(p=u.retryLane),vM(s,p)}function GX(s,u){var p=0;switch(s.tag){case 31:case 13:var x=s.stateNode,E=s.memoizedState;E!==null&&(p=E.retryLane);break;case 19:x=s.stateNode;break;case 22:x=s.stateNode._retryCache;break;default:throw Error(r(314))}x!==null&&x.delete(u),vM(s,p)}function XX(s,u){return zt(s,u)}var bv=null,hf=null,H1=!1,wv=!1,q1=!1,al=0;function ao(s){s!==hf&&s.next===null&&(hf===null?bv=hf=s:hf=hf.next=s),wv=!0,H1||(H1=!0,QX())}function Mh(s,u){if(!q1&&wv){q1=!0;do for(var p=!1,x=bv;x!==null;){if(s!==0){var E=x.pendingLanes;if(E===0)var N=0;else{var M=x.suspendedLanes,Y=x.pingedLanes;N=(1<<31-ut(42|s)+1)-1,N&=E&~(M&~Y),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(p=!0,wM(x,N))}else N=Ct,N=Qe(x,x===sn?N:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(N&3)===0||qt(x,N)||(p=!0,wM(x,N));x=x.next}while(p);q1=!1}}function WX(){yM()}function yM(){wv=H1=!1;var s=0;al!==0&&sW()&&(s=al);for(var u=It(),p=null,x=bv;x!==null;){var E=x.next,N=xM(x,u);N===0?(x.next=null,p===null?bv=E:p.next=E,E===null&&(hf=p)):(p=x,(s!==0||(N&3)!==0)&&(wv=!0)),x=E}tr!==0&&tr!==5||Mh(s),al!==0&&(al=0)}function xM(s,u){for(var p=s.suspendedLanes,x=s.pingedLanes,E=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var M=31-ut(N),Y=1<<M,J=E[M];J===-1?((Y&p)===0||(Y&x)!==0)&&(E[M]=me(Y,u)):J<=u&&(s.expiredLanes|=Y),N&=~Y}if(u=sn,p=Ct,p=Qe(s,s===u?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x=s.callbackNode,p===0||s===u&&(Yt===2||Yt===9)||s.cancelPendingCommit!==null)return x!==null&&x!==null&&mt(x),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||qt(s,p)){if(u=p&-p,u===s.callbackPriority)return u;switch(x!==null&&mt(x),Wr(p)){case 2:case 8:p=xe;break;case 32:p=Me;break;case 268435456:p=tt;break;default:p=Me}return x=bM.bind(null,s),p=zt(p,x),s.callbackPriority=u,s.callbackNode=p,u}return x!==null&&x!==null&&mt(x),s.callbackPriority=2,s.callbackNode=null,2}function bM(s,u){if(tr!==0&&tr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(xv()&&s.callbackNode!==p)return null;var x=Ct;return x=Qe(s,s===sn?x:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),x===0?null:(tM(s,x,u),xM(s,It()),s.callbackNode!=null&&s.callbackNode===p?bM.bind(null,s):null)}function wM(s,u){if(xv())return null;tM(s,u,!0)}function QX(){uW(function(){(Ht&6)!==0?zt(ce,WX):yM()})}function V1(){if(al===0){var s=Qc;s===0&&(s=Gr,Gr<<=1,(Gr&261888)===0&&(Gr=256)),al=s}return al}function SM(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ag(""+s)}function jM(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 ZX(s,u,p,x,E){if(u==="submit"&&p&&p.stateNode===E){var N=SM((E[on]||null).action),M=x.submitter;M&&(u=(u=M[on]||null)?SM(u.formAction):M.getAttribute("formAction"),u!==null&&(N=u,M=null));var Y=new Mg("action","action",null,x,E);s.push({event:Y,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(al!==0){var J=M?jM(E,M):new FormData(E);f1(p,{pending:!0,data:J,method:E.method,action:N},null,J)}}else typeof N=="function"&&(Y.preventDefault(),J=M?jM(E,M):new FormData(E),f1(p,{pending:!0,data:J,method:E.method,action:N},N,J))},currentTarget:E}]})}}for(var K1=0;K1<kw.length;K1++){var Y1=kw[K1],JX=Y1.toLowerCase(),eW=Y1[0].toUpperCase()+Y1.slice(1);Pa(JX,"on"+eW)}Pa(eT,"onAnimationEnd"),Pa(tT,"onAnimationIteration"),Pa(nT,"onAnimationStart"),Pa("dblclick","onDoubleClick"),Pa("focusin","onFocus"),Pa("focusout","onBlur"),Pa(gX,"onTransitionRun"),Pa(vX,"onTransitionStart"),Pa(yX,"onTransitionCancel"),Pa(rT,"onTransitionEnd"),Fs("onMouseEnter",["mouseout","mouseover"]),Fs("onMouseLeave",["mouseout","mouseover"]),Fs("onPointerEnter",["pointerout","pointerover"]),Fs("onPointerLeave",["pointerout","pointerover"]),Do("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Do("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Do("onBeforeInput",["compositionend","keypress","textInput","paste"]),Do("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Do("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dh="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(" "),tW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dh));function EM(s,u){u=(u&4)!==0;for(var p=0;p<s.length;p++){var x=s[p],E=x.event;x=x.listeners;e:{var N=void 0;if(u)for(var M=x.length-1;0<=M;M--){var Y=x[M],J=Y.instance,fe=Y.currentTarget;if(Y=Y.listener,J!==N&&E.isPropagationStopped())break e;N=Y,E.currentTarget=fe;try{N(E)}catch(ve){Ig(ve)}E.currentTarget=null,N=J}else for(M=0;M<x.length;M++){if(Y=x[M],J=Y.instance,fe=Y.currentTarget,Y=Y.listener,J!==N&&E.isPropagationStopped())break e;N=Y,E.currentTarget=fe;try{N(E)}catch(ve){Ig(ve)}E.currentTarget=null,N=J}}}}function wt(s,u){var p=u[to];p===void 0&&(p=u[to]=new Set);var x=s+"__bubble";p.has(x)||(_M(u,s,2,!1),p.add(x))}function G1(s,u,p){var x=0;u&&(x|=4),_M(p,s,x,u)}var Sv="_reactListening"+Math.random().toString(36).slice(2);function X1(s){if(!s[Sv]){s[Sv]=!0,jg.forEach(function(p){p!=="selectionchange"&&(tW.has(p)||G1(p,!1,s),G1(p,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[Sv]||(u[Sv]=!0,G1("selectionchange",!1,u))}}function _M(s,u,p,x){switch(eD(u)){case 2:var E=AW;break;case 8:E=OW;break;default:E=cS}p=E.bind(null,u,p,s),E=void 0,!pw||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(E=!0),x?E!==void 0?s.addEventListener(u,p,{capture:!0,passive:E}):s.addEventListener(u,p,!0):E!==void 0?s.addEventListener(u,p,{passive:E}):s.addEventListener(u,p,!1)}function W1(s,u,p,x,E){var N=x;if((u&1)===0&&(u&2)===0&&x!==null)e:for(;;){if(x===null)return;var M=x.tag;if(M===3||M===4){var Y=x.stateNode.containerInfo;if(Y===E)break;if(M===4)for(M=x.return;M!==null;){var J=M.tag;if((J===3||J===4)&&M.stateNode.containerInfo===E)return;M=M.return}for(;Y!==null;){if(M=Ls(Y),M===null)return;if(J=M.tag,J===5||J===6||J===26||J===27){x=N=M;continue e}Y=Y.parentNode}}x=x.return}O2(function(){var fe=N,ve=hw(p),be=[];e:{var de=iT.get(s);if(de!==void 0){var he=Mg,Le=s;switch(s){case"keypress":if(Tg(p)===0)break e;case"keydown":case"keyup":he=GG;break;case"focusin":Le="focus",he=xw;break;case"focusout":Le="blur",he=xw;break;case"beforeblur":case"afterblur":he=xw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=M2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=IG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=QG;break;case eT:case tT:case nT:he=$G;break;case rT:he=JG;break;case"scroll":case"scrollend":he=DG;break;case"wheel":he=tX;break;case"copy":case"cut":case"paste":he=FG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=R2;break;case"toggle":case"beforetoggle":he=rX}var rt=(u&4)!==0,Zt=!rt&&(s==="scroll"||s==="scrollend"),oe=rt?de!==null?de+"Capture":null:de;rt=[];for(var ne=fe,ue;ne!==null;){var ye=ne;if(ue=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ue===null||oe===null||(ye=nh(ne,oe),ye!=null&&rt.push(Rh(ne,ye,ue))),Zt)break;ne=ne.return}0<rt.length&&(de=new he(de,Le,null,p,ve),be.push({event:de,listeners:rt}))}}if((u&7)===0){e:{if(de=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",de&&p!==dw&&(Le=p.relatedTarget||p.fromElement)&&(Ls(Le)||Le[Oa]))break e;if((he||de)&&(de=ve.window===ve?ve:(de=ve.ownerDocument)?de.defaultView||de.parentWindow:window,he?(Le=p.relatedTarget||p.toElement,he=fe,Le=Le?Ls(Le):null,Le!==null&&(Zt=a(Le),rt=Le.tag,Le!==Zt||rt!==5&&rt!==27&&rt!==6)&&(Le=null)):(he=null,Le=fe),he!==Le)){if(rt=M2,ye="onMouseLeave",oe="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(rt=R2,ye="onPointerLeave",oe="onPointerEnter",ne="pointer"),Zt=he==null?de:$s(he),ue=Le==null?de:$s(Le),de=new rt(ye,ne+"leave",he,p,ve),de.target=Zt,de.relatedTarget=ue,ye=null,Ls(ve)===fe&&(rt=new rt(oe,ne+"enter",Le,p,ve),rt.target=ue,rt.relatedTarget=Zt,ye=rt),Zt=ye,he&&Le)t:{for(rt=nW,oe=he,ne=Le,ue=0,ye=oe;ye;ye=rt(ye))ue++;ye=0;for(var Ge=ne;Ge;Ge=rt(Ge))ye++;for(;0<ue-ye;)oe=rt(oe),ue--;for(;0<ye-ue;)ne=rt(ne),ye--;for(;ue--;){if(oe===ne||ne!==null&&oe===ne.alternate){rt=oe;break t}oe=rt(oe),ne=rt(ne)}rt=null}else rt=null;he!==null&&CM(be,de,he,rt,!1),Le!==null&&Zt!==null&&CM(be,Zt,Le,rt,!0)}}e:{if(de=fe?$s(fe):window,he=de.nodeName&&de.nodeName.toLowerCase(),he==="select"||he==="input"&&de.type==="file")var $t=H2;else if(F2(de))if(q2)$t=hX;else{$t=fX;var qe=cX}else he=de.nodeName,!he||he.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?fe&&fw(fe.elementType)&&($t=H2):$t=dX;if($t&&($t=$t(s,fe))){U2(be,$t,p,ve);break e}qe&&qe(s,de,fe),s==="focusout"&&fe&&de.type==="number"&&fe.memoizedProps.value!=null&&th(de,"number",de.value)}switch(qe=fe?$s(fe):window,s){case"focusin":(F2(qe)||qe.contentEditable==="true")&&(Hc=qe,_w=fe,ch=null);break;case"focusout":ch=_w=Hc=null;break;case"mousedown":Cw=!0;break;case"contextmenu":case"mouseup":case"dragend":Cw=!1,Z2(be,p,ve);break;case"selectionchange":if(pX)break;case"keydown":case"keyup":Z2(be,p,ve)}var gt;if(ww)e:{switch(s){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Uc?$2(s,p)&&(Nt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(Nt="onCompositionStart");Nt&&(I2&&p.locale!=="ko"&&(Uc||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Uc&&(gt=T2()):(Hs=ve,gw="value"in Hs?Hs.value:Hs.textContent,Uc=!0)),qe=jv(fe,Nt),0<qe.length&&(Nt=new D2(Nt,s,null,p,ve),be.push({event:Nt,listeners:qe}),gt?Nt.data=gt:(gt=B2(p),gt!==null&&(Nt.data=gt)))),(gt=aX?oX(s,p):sX(s,p))&&(Nt=jv(fe,"onBeforeInput"),0<Nt.length&&(qe=new D2("onBeforeInput","beforeinput",null,p,ve),be.push({event:qe,listeners:Nt}),qe.data=gt)),ZX(be,s,fe,p,ve)}EM(be,u)})}function Rh(s,u,p){return{instance:s,listener:u,currentTarget:p}}function jv(s,u){for(var p=u+"Capture",x=[];s!==null;){var E=s,N=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||N===null||(E=nh(s,p),E!=null&&x.unshift(Rh(s,E,N)),E=nh(s,u),E!=null&&x.push(Rh(s,E,N))),s.tag===3)return x;s=s.return}return[]}function nW(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function CM(s,u,p,x,E){for(var N=u._reactName,M=[];p!==null&&p!==x;){var Y=p,J=Y.alternate,fe=Y.stateNode;if(Y=Y.tag,J!==null&&J===x)break;Y!==5&&Y!==26&&Y!==27||fe===null||(J=fe,E?(fe=nh(p,N),fe!=null&&M.unshift(Rh(p,fe,J))):E||(fe=nh(p,N),fe!=null&&M.push(Rh(p,fe,J)))),p=p.return}M.length!==0&&s.push({event:u,listeners:M})}var rW=/\r\n?/g,iW=/\u0000|\uFFFD/g;function NM(s){return(typeof s=="string"?s:""+s).replace(rW,`
`).replace(iW,"")}function kM(s,u){return u=NM(u),NM(s)===u}function Qt(s,u,p,x,E,N){switch(p){case"children":typeof x=="string"?u==="body"||u==="textarea"&&x===""||$c(s,x):(typeof x=="number"||typeof x=="bigint")&&u!=="body"&&$c(s,""+x);break;case"className":zc(s,"class",x);break;case"tabIndex":zc(s,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":zc(s,p,x);break;case"style":k2(s,x,N);break;case"data":if(u!=="object"){zc(s,"data",x);break}case"src":case"href":if(x===""&&(u!=="a"||p!=="href")){s.removeAttribute(p);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Ag(""+x),s.setAttribute(p,x);break;case"action":case"formAction":if(typeof x=="function"){s.setAttribute(p,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(p==="formAction"?(u!=="input"&&Qt(s,u,"name",E.name,E,null),Qt(s,u,"formEncType",E.formEncType,E,null),Qt(s,u,"formMethod",E.formMethod,E,null),Qt(s,u,"formTarget",E.formTarget,E,null)):(Qt(s,u,"encType",E.encType,E,null),Qt(s,u,"method",E.method,E,null),Qt(s,u,"target",E.target,E,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){s.removeAttribute(p);break}x=Ag(""+x),s.setAttribute(p,x);break;case"onClick":x!=null&&(s.onclick=Io);break;case"onScroll":x!=null&&wt("scroll",s);break;case"onScrollEnd":x!=null&&wt("scrollend",s);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"multiple":s.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":s.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){s.removeAttribute("xlink:href");break}p=Ag(""+x),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""+x):s.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,""):s.removeAttribute(p);break;case"capture":case"download":x===!0?s.setAttribute(p,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?s.setAttribute(p,x):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?s.setAttribute(p,x):s.removeAttribute(p);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?s.removeAttribute(p):s.setAttribute(p,x);break;case"popover":wt("beforetoggle",s),wt("toggle",s),Lc(s,"popover",x);break;case"xlinkActuate":Ta(s,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":Ta(s,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":Ta(s,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":Ta(s,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":Ta(s,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":Ta(s,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Lc(s,"is",x);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=PG.get(p)||p,Lc(s,p,x))}}function Q1(s,u,p,x,E,N){switch(p){case"style":k2(s,x,N);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(r(61));if(p=x.__html,p!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof x=="string"?$c(s,x):(typeof x=="number"||typeof x=="bigint")&&$c(s,""+x);break;case"onScroll":x!=null&&wt("scroll",s);break;case"onScrollEnd":x!=null&&wt("scrollend",s);break;case"onClick":x!=null&&(s.onclick=Io);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Eg.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(E=p.endsWith("Capture"),u=p.slice(2,E?p.length-7:void 0),N=s[on]||null,N=N!=null?N[p]:null,typeof N=="function"&&s.removeEventListener(u,N,E),typeof x=="function")){typeof N!="function"&&N!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(u,x,E);break e}p in s?s[p]=x:x===!0?s.setAttribute(p,""):Lc(s,p,x)}}}function kr(s,u,p){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",s),wt("load",s);var x=!1,E=!1,N;for(N in p)if(p.hasOwnProperty(N)){var M=p[N];if(M!=null)switch(N){case"src":x=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,N,M,p,null)}}E&&Qt(s,u,"srcSet",p.srcSet,p,null),x&&Qt(s,u,"src",p.src,p,null);return;case"input":wt("invalid",s);var Y=N=M=E=null,J=null,fe=null;for(x in p)if(p.hasOwnProperty(x)){var ve=p[x];if(ve!=null)switch(x){case"name":E=ve;break;case"type":M=ve;break;case"checked":J=ve;break;case"defaultChecked":fe=ve;break;case"value":N=ve;break;case"defaultValue":Y=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,u));break;default:Qt(s,u,x,ve,p,null)}}kg(s,N,Y,J,fe,M,E,!1);return;case"select":wt("invalid",s),x=M=N=null;for(E in p)if(p.hasOwnProperty(E)&&(Y=p[E],Y!=null))switch(E){case"value":N=Y;break;case"defaultValue":M=Y;break;case"multiple":x=Y;default:Qt(s,u,E,Y,p,null)}u=N,p=M,s.multiple=!!x,u!=null?Ro(s,!!x,u,!1):p!=null&&Ro(s,!!x,p,!0);return;case"textarea":wt("invalid",s),N=E=x=null;for(M in p)if(p.hasOwnProperty(M)&&(Y=p[M],Y!=null))switch(M){case"value":x=Y;break;case"defaultValue":E=Y;break;case"children":N=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:Qt(s,u,M,Y,p,null)}C2(s,x,E,N);return;case"option":for(J in p)if(p.hasOwnProperty(J)&&(x=p[J],x!=null))switch(J){case"selected":s.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:Qt(s,u,J,x,p,null)}return;case"dialog":wt("beforetoggle",s),wt("toggle",s),wt("cancel",s),wt("close",s);break;case"iframe":case"object":wt("load",s);break;case"video":case"audio":for(x=0;x<Dh.length;x++)wt(Dh[x],s);break;case"image":wt("error",s),wt("load",s);break;case"details":wt("toggle",s);break;case"embed":case"source":case"link":wt("error",s),wt("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)&&(x=p[fe],x!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Qt(s,u,fe,x,p,null)}return;default:if(fw(u)){for(ve in p)p.hasOwnProperty(ve)&&(x=p[ve],x!==void 0&&Q1(s,u,ve,x,p,void 0));return}}for(Y in p)p.hasOwnProperty(Y)&&(x=p[Y],x!=null&&Qt(s,u,Y,x,p,null))}function aW(s,u,p,x){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,N=null,M=null,Y=null,J=null,fe=null,ve=null;for(he in p){var be=p[he];if(p.hasOwnProperty(he)&&be!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=be;default:x.hasOwnProperty(he)||Qt(s,u,he,null,x,be)}}for(var de in x){var he=x[de];if(be=p[de],x.hasOwnProperty(de)&&(he!=null||be!=null))switch(de){case"type":N=he;break;case"name":E=he;break;case"checked":fe=he;break;case"defaultChecked":ve=he;break;case"value":M=he;break;case"defaultValue":Y=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,u));break;default:he!==be&&Qt(s,u,de,he,x,be)}}ou(s,M,Y,J,fe,ve,N,E);return;case"select":he=M=Y=de=null;for(N in p)if(J=p[N],p.hasOwnProperty(N)&&J!=null)switch(N){case"value":break;case"multiple":he=J;default:x.hasOwnProperty(N)||Qt(s,u,N,null,x,J)}for(E in x)if(N=x[E],J=p[E],x.hasOwnProperty(E)&&(N!=null||J!=null))switch(E){case"value":de=N;break;case"defaultValue":Y=N;break;case"multiple":M=N;default:N!==J&&Qt(s,u,E,N,x,J)}u=Y,p=M,x=he,de!=null?Ro(s,!!p,de,!1):!!x!=!!p&&(u!=null?Ro(s,!!p,u,!0):Ro(s,!!p,p?[]:"",!1));return;case"textarea":he=de=null;for(Y in p)if(E=p[Y],p.hasOwnProperty(Y)&&E!=null&&!x.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:Qt(s,u,Y,null,x,E)}for(M in x)if(E=x[M],N=p[M],x.hasOwnProperty(M)&&(E!=null||N!=null))switch(M){case"value":de=E;break;case"defaultValue":he=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==N&&Qt(s,u,M,E,x,N)}_2(s,de,he);return;case"option":for(var Le in p)if(de=p[Le],p.hasOwnProperty(Le)&&de!=null&&!x.hasOwnProperty(Le))switch(Le){case"selected":s.selected=!1;break;default:Qt(s,u,Le,null,x,de)}for(J in x)if(de=x[J],he=p[J],x.hasOwnProperty(J)&&de!==he&&(de!=null||he!=null))switch(J){case"selected":s.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Qt(s,u,J,de,x,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var rt in p)de=p[rt],p.hasOwnProperty(rt)&&de!=null&&!x.hasOwnProperty(rt)&&Qt(s,u,rt,null,x,de);for(fe in x)if(de=x[fe],he=p[fe],x.hasOwnProperty(fe)&&de!==he&&(de!=null||he!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,u));break;default:Qt(s,u,fe,de,x,he)}return;default:if(fw(u)){for(var Zt in p)de=p[Zt],p.hasOwnProperty(Zt)&&de!==void 0&&!x.hasOwnProperty(Zt)&&Q1(s,u,Zt,void 0,x,de);for(ve in x)de=x[ve],he=p[ve],!x.hasOwnProperty(ve)||de===he||de===void 0&&he===void 0||Q1(s,u,ve,de,x,he);return}}for(var oe in p)de=p[oe],p.hasOwnProperty(oe)&&de!=null&&!x.hasOwnProperty(oe)&&Qt(s,u,oe,null,x,de);for(be in x)de=x[be],he=p[be],!x.hasOwnProperty(be)||de===he||de==null&&he==null||Qt(s,u,be,de,x,he)}function AM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oW(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,p=performance.getEntriesByType("resource"),x=0;x<p.length;x++){var E=p[x],N=E.transferSize,M=E.initiatorType,Y=E.duration;if(N&&Y&&AM(M)){for(M=0,Y=E.responseEnd,x+=1;x<p.length;x++){var J=p[x],fe=J.startTime;if(fe>Y)break;var ve=J.transferSize,be=J.initiatorType;ve&&AM(be)&&(J=J.responseEnd,M+=ve*(J<Y?1:(Y-fe)/(J-fe)))}if(--x,u+=8*(N+M)/(E.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Z1=null,J1=null;function Ev(s){return s.nodeType===9?s:s.ownerDocument}function OM(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 TM(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 eS(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 tS=null;function sW(){var s=window.event;return s&&s.type==="popstate"?s===tS?!1:(tS=s,!0):(tS=null,!1)}var PM=typeof setTimeout=="function"?setTimeout:void 0,lW=typeof clearTimeout=="function"?clearTimeout:void 0,MM=typeof Promise=="function"?Promise:void 0,uW=typeof queueMicrotask=="function"?queueMicrotask:typeof MM<"u"?function(s){return MM.resolve(null).then(s).catch(cW)}:PM;function cW(s){setTimeout(function(){throw s})}function ol(s){return s==="head"}function DM(s,u){var p=u,x=0;do{var E=p.nextSibling;if(s.removeChild(p),E&&E.nodeType===8)if(p=E.data,p==="/$"||p==="/&"){if(x===0){s.removeChild(E),vf(u);return}x--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")x++;else if(p==="html")Ih(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,Ih(p);for(var N=p.firstChild;N;){var M=N.nextSibling,Y=N.nodeName;N[iu]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&N.rel.toLowerCase()==="stylesheet"||p.removeChild(N),N=M}}else p==="body"&&Ih(s.ownerDocument.body);p=E}while(p);vf(u)}function RM(s,u){var p=s;s=0;do{var x=p.nextSibling;if(p.nodeType===1?u?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(u?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),x&&x.nodeType===8)if(p=x.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=x}while(p)}function nS(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":nS(p),Jd(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function fW(s,u,p,x){for(;s.nodeType===1;){var E=p;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!x&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(x){if(!s[iu])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var N=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=Qi(s.nextSibling),s===null)break}return null}function dW(s,u,p){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=Qi(s.nextSibling),s===null))return null;return s}function IM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Qi(s.nextSibling),s===null))return null;return s}function rS(s){return s.data==="$?"||s.data==="$~"}function iS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function hW(s,u){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||p.readyState!=="loading")u();else{var x=function(){u(),p.removeEventListener("DOMContentLoaded",x)};p.addEventListener("DOMContentLoaded",x),s._reactRetry=x}}function Qi(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var aS=null;function LM(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(u===0)return Qi(s.nextSibling);u--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||u++}s=s.nextSibling}return null}function zM(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 $M(s,u,p){switch(u=Ev(p),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ih(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Jd(s)}var Zi=new Map,BM=new Set;function _v(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Zo=q.d;q.d={f:mW,r:pW,D:gW,C:vW,L:yW,m:xW,X:wW,S:bW,M:SW};function mW(){var s=Zo.f(),u=gv();return s||u}function pW(s){var u=zs(s);u!==null&&u.tag===5&&u.type==="form"?rP(u):Zo.r(s)}var mf=typeof document>"u"?null:document;function FM(s,u,p){var x=mf;if(x&&typeof u=="string"&&u){var E=si(u);E='link[rel="'+s+'"][href="'+E+'"]',typeof p=="string"&&(E+='[crossorigin="'+p+'"]'),BM.has(E)||(BM.add(E),s={rel:s,crossOrigin:p,href:u},x.querySelector(E)===null&&(u=x.createElement("link"),kr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function gW(s){Zo.D(s),FM("dns-prefetch",s,null)}function vW(s,u){Zo.C(s,u),FM("preconnect",s,u)}function yW(s,u,p){Zo.L(s,u,p);var x=mf;if(x&&s&&u){var E='link[rel="preload"][as="'+si(u)+'"]';u==="image"&&p&&p.imageSrcSet?(E+='[imagesrcset="'+si(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(E+='[imagesizes="'+si(p.imageSizes)+'"]')):E+='[href="'+si(s)+'"]';var N=E;switch(u){case"style":N=pf(s);break;case"script":N=gf(s)}Zi.has(N)||(s=d({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:s,as:u},p),Zi.set(N,s),x.querySelector(E)!==null||u==="style"&&x.querySelector(Lh(N))||u==="script"&&x.querySelector(zh(N))||(u=x.createElement("link"),kr(u,"link",s),Hn(u),x.head.appendChild(u)))}}function xW(s,u){Zo.m(s,u);var p=mf;if(p&&s){var x=u&&typeof u.as=="string"?u.as:"script",E='link[rel="modulepreload"][as="'+si(x)+'"][href="'+si(s)+'"]',N=E;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=gf(s)}if(!Zi.has(N)&&(s=d({rel:"modulepreload",href:s},u),Zi.set(N,s),p.querySelector(E)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(zh(N)))return}x=p.createElement("link"),kr(x,"link",s),Hn(x),p.head.appendChild(x)}}}function bW(s,u,p){Zo.S(s,u,p);var x=mf;if(x&&s){var E=Bs(x).hoistableStyles,N=pf(s);u=u||"default";var M=E.get(N);if(!M){var Y={loading:0,preload:null};if(M=x.querySelector(Lh(N)))Y.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":u},p),(p=Zi.get(N))&&oS(s,p);var J=M=x.createElement("link");Hn(J),kr(J,"link",s),J._p=new Promise(function(fe,ve){J.onload=fe,J.onerror=ve}),J.addEventListener("load",function(){Y.loading|=1}),J.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Cv(M,u,x)}M={type:"stylesheet",instance:M,count:1,state:Y},E.set(N,M)}}}function wW(s,u){Zo.X(s,u);var p=mf;if(p&&s){var x=Bs(p).hoistableScripts,E=gf(s),N=x.get(E);N||(N=p.querySelector(zh(E)),N||(s=d({src:s,async:!0},u),(u=Zi.get(E))&&sS(s,u),N=p.createElement("script"),Hn(N),kr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(E,N))}}function SW(s,u){Zo.M(s,u);var p=mf;if(p&&s){var x=Bs(p).hoistableScripts,E=gf(s),N=x.get(E);N||(N=p.querySelector(zh(E)),N||(s=d({src:s,async:!0,type:"module"},u),(u=Zi.get(E))&&sS(s,u),N=p.createElement("script"),Hn(N),kr(N,"link",s),p.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},x.set(E,N))}}function UM(s,u,p,x){var E=(E=te.current)?_v(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=pf(p.href),p=Bs(E).hoistableStyles,x=p.get(u),x||(x={type:"style",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=pf(p.href);var N=Bs(E).hoistableStyles,M=N.get(s);if(M||(E=E.ownerDocument||E,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,M),(N=E.querySelector(Lh(s)))&&!N._p&&(M.instance=N,M.state.loading=5),Zi.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Zi.set(s,p),N||jW(E,s,p,M.state))),u&&x===null)throw Error(r(528,""));return M}if(u&&x!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=gf(p),p=Bs(E).hoistableScripts,x=p.get(u),x||(x={type:"script",instance:null,count:0,state:null},p.set(u,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function pf(s){return'href="'+si(s)+'"'}function Lh(s){return'link[rel="stylesheet"]['+s+"]"}function HM(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function jW(s,u,p,x){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?x.loading=1:(u=s.createElement("link"),x.preload=u,u.addEventListener("load",function(){return x.loading|=1}),u.addEventListener("error",function(){return x.loading|=2}),kr(u,"link",p),Hn(u),s.head.appendChild(u))}function gf(s){return'[src="'+si(s)+'"]'}function zh(s){return"script[async]"+s}function qM(s,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var x=s.querySelector('style[data-href~="'+si(p.href)+'"]');if(x)return u.instance=x,Hn(x),x;var E=d({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return x=(s.ownerDocument||s).createElement("style"),Hn(x),kr(x,"style",E),Cv(x,p.precedence,s),u.instance=x;case"stylesheet":E=pf(p.href);var N=s.querySelector(Lh(E));if(N)return u.state.loading|=4,u.instance=N,Hn(N),N;x=HM(p),(E=Zi.get(E))&&oS(x,E),N=(s.ownerDocument||s).createElement("link"),Hn(N);var M=N;return M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),kr(N,"link",x),u.state.loading|=4,Cv(N,p.precedence,s),u.instance=N;case"script":return N=gf(p.src),(E=s.querySelector(zh(N)))?(u.instance=E,Hn(E),E):(x=p,(E=Zi.get(N))&&(x=d({},p),sS(x,E)),s=s.ownerDocument||s,E=s.createElement("script"),Hn(E),kr(E,"link",x),s.head.appendChild(E),u.instance=E);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(x=u.instance,u.state.loading|=4,Cv(x,p.precedence,s));return u.instance}function Cv(s,u,p){for(var x=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=x.length?x[x.length-1]:null,N=E,M=0;M<x.length;M++){var Y=x[M];if(Y.dataset.precedence===u)N=Y;else if(N!==E)break}N?N.parentNode.insertBefore(s,N.nextSibling):(u=p.nodeType===9?p.head:p,u.insertBefore(s,u.firstChild))}function oS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function sS(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var Nv=null;function VM(s,u,p){if(Nv===null){var x=new Map,E=Nv=new Map;E.set(p,x)}else E=Nv,x=E.get(p),x||(x=new Map,E.set(p,x));if(x.has(s))return x;for(x.set(s,null),p=p.getElementsByTagName(s),E=0;E<p.length;E++){var N=p[E];if(!(N[iu]||N[Lt]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var M=N.getAttribute(u)||"";M=s+M;var Y=x.get(M);Y?Y.push(N):x.set(M,[N])}}return x}function KM(s,u,p){s=s.ownerDocument||s,s.head.insertBefore(p,u==="title"?s.querySelector("head > title"):null)}function EW(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 YM(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function _W(s,u,p,x){if(p.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var E=pf(x.href),N=u.querySelector(Lh(E));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=kv.bind(s),u.then(s,s)),p.state.loading|=4,p.instance=N,Hn(N);return}N=u.ownerDocument||u,x=HM(x),(E=Zi.get(E))&&oS(x,E),N=N.createElement("link"),Hn(N);var M=N;M._p=new Promise(function(Y,J){M.onload=Y,M.onerror=J}),kr(N,"link",x),p.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=kv.bind(s),u.addEventListener("load",p),u.addEventListener("error",p))}}var lS=0;function CW(s,u){return s.stylesheets&&s.count===0&&Ov(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var x=setTimeout(function(){if(s.stylesheets&&Ov(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+u);0<s.imgBytes&&lS===0&&(lS=62500*oW());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Ov(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>lS?50:800)+u);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(x),clearTimeout(E)}}:null}function kv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ov(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Av=null;function Ov(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Av=new Map,u.forEach(NW,s),Av=null,kv.call(s))}function NW(s,u){if(!(u.state.loading&4)){var p=Av.get(s);if(p)var x=p.get(null);else{p=new Map,Av.set(s,p);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<E.length;N++){var M=E[N];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(p.set(M.dataset.precedence,M),x=M)}x&&p.set(null,x)}E=u.instance,M=E.getAttribute("data-precedence"),N=p.get(M)||x,N===x&&p.set(null,E),p.set(M,E),this.count++,x=kv.bind(this),E.addEventListener("load",x),E.addEventListener("error",x),N?N.parentNode.insertBefore(E,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),u.state.loading|=4}}var $h={$$typeof:_,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function kW(s,u,p,x,E,N,M,Y,J){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=x,this.onUncaughtError=E,this.onCaughtError=N,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function GM(s,u,p,x,E,N,M,Y,J,fe,ve,be){return s=new kW(s,u,p,M,J,fe,ve,be,Y),u=1,N===!0&&(u|=24),N=ji(3,null,null,u),s.current=N,N.stateNode=s,u=Fw(),u.refCount++,s.pooledCache=u,u.refCount++,N.memoizedState={element:x,isDehydrated:p,cache:u},Vw(N),s}function XM(s){return s?(s=Kc,s):Kc}function WM(s,u,p,x,E,N){E=XM(E),x.context===null?x.context=E:x.pendingContext=E,x=Xs(u),x.payload={element:p},N=N===void 0?null:N,N!==null&&(x.callback=N),p=Ws(s,x,u),p!==null&&(hi(p,s,u),vh(p,s,u))}function QM(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<u?p:u}}function uS(s,u){QM(s,u),(s=s.alternate)&&QM(s,u)}function ZM(s){if(s.tag===13||s.tag===31){var u=cu(s,67108864);u!==null&&hi(u,s,67108864),uS(s,67108864)}}function JM(s){if(s.tag===13||s.tag===31){var u=ki();u=eo(u);var p=cu(s,u);p!==null&&hi(p,s,u),uS(s,u)}}var Tv=!0;function AW(s,u,p,x){var E=z.T;z.T=null;var N=q.p;try{q.p=2,cS(s,u,p,x)}finally{q.p=N,z.T=E}}function OW(s,u,p,x){var E=z.T;z.T=null;var N=q.p;try{q.p=8,cS(s,u,p,x)}finally{q.p=N,z.T=E}}function cS(s,u,p,x){if(Tv){var E=fS(x);if(E===null)W1(s,u,x,Pv,p),tD(s,x);else if(PW(E,s,u,p,x))x.stopPropagation();else if(tD(s,x),u&4&&-1<TW.indexOf(s)){for(;E!==null;){var N=zs(E);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var M=Er(N.pendingLanes);if(M!==0){var Y=N;for(Y.pendingLanes|=2,Y.entangledLanes|=2;M;){var J=1<<31-ut(M);Y.entanglements[1]|=J,M&=~J}ao(N),(Ht&6)===0&&(mv=It()+500,Mh(0))}}break;case 31:case 13:Y=cu(N,2),Y!==null&&hi(Y,N,2),gv(),uS(N,2)}if(N=fS(x),N===null&&W1(s,u,x,Pv,p),N===E)break;E=N}E!==null&&x.stopPropagation()}else W1(s,u,x,null,p)}}function fS(s){return s=hw(s),dS(s)}var Pv=null;function dS(s){if(Pv=null,s=Ls(s),s!==null){var u=a(s);if(u===null)s=null;else{var p=u.tag;if(p===13){if(s=o(u),s!==null)return s;s=null}else if(p===31){if(s=l(u),s!==null)return s;s=null}else if(p===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Pv=s,null}function eD(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(fn()){case ce:return 2;case xe:return 8;case Me:case et:return 32;case tt:return 268435456;default:return 32}default:return 32}}var hS=!1,sl=null,ll=null,ul=null,Bh=new Map,Fh=new Map,cl=[],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 tD(s,u){switch(s){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":ll=null;break;case"mouseover":case"mouseout":ul=null;break;case"pointerover":case"pointerout":Bh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fh.delete(u.pointerId)}}function Uh(s,u,p,x,E,N){return s===null||s.nativeEvent!==N?(s={blockedOn:u,domEventName:p,eventSystemFlags:x,nativeEvent:N,targetContainers:[E]},u!==null&&(u=zs(u),u!==null&&ZM(u)),s):(s.eventSystemFlags|=x,u=s.targetContainers,E!==null&&u.indexOf(E)===-1&&u.push(E),s)}function PW(s,u,p,x,E){switch(u){case"focusin":return sl=Uh(sl,s,u,p,x,E),!0;case"dragenter":return ll=Uh(ll,s,u,p,x,E),!0;case"mouseover":return ul=Uh(ul,s,u,p,x,E),!0;case"pointerover":var N=E.pointerId;return Bh.set(N,Uh(Bh.get(N)||null,s,u,p,x,E)),!0;case"gotpointercapture":return N=E.pointerId,Fh.set(N,Uh(Fh.get(N)||null,s,u,p,x,E)),!0}return!1}function nD(s){var u=Ls(s.target);if(u!==null){var p=a(u);if(p!==null){if(u=p.tag,u===13){if(u=o(p),u!==null){s.blockedOn=u,pe(s.priority,function(){JM(p)});return}}else if(u===31){if(u=l(p),u!==null){s.blockedOn=u,pe(s.priority,function(){JM(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 Mv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var p=fS(s.nativeEvent);if(p===null){p=s.nativeEvent;var x=new p.constructor(p.type,p);dw=x,p.target.dispatchEvent(x),dw=null}else return u=zs(p),u!==null&&ZM(u),s.blockedOn=p,!1;u.shift()}return!0}function rD(s,u,p){Mv(s)&&p.delete(u)}function MW(){hS=!1,sl!==null&&Mv(sl)&&(sl=null),ll!==null&&Mv(ll)&&(ll=null),ul!==null&&Mv(ul)&&(ul=null),Bh.forEach(rD),Fh.forEach(rD)}function Dv(s,u){s.blockedOn===u&&(s.blockedOn=null,hS||(hS=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,MW)))}var Rv=null;function iD(s){Rv!==s&&(Rv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rv===s&&(Rv=null);for(var u=0;u<s.length;u+=3){var p=s[u],x=s[u+1],E=s[u+2];if(typeof x!="function"){if(dS(x||p)===null)continue;break}var N=zs(p);N!==null&&(s.splice(u,3),u-=3,f1(N,{pending:!0,data:E,method:p.method,action:x},x,E))}}))}function vf(s){function u(J){return Dv(J,s)}sl!==null&&Dv(sl,s),ll!==null&&Dv(ll,s),ul!==null&&Dv(ul,s),Bh.forEach(u),Fh.forEach(u);for(var p=0;p<cl.length;p++){var x=cl[p];x.blockedOn===s&&(x.blockedOn=null)}for(;0<cl.length&&(p=cl[0],p.blockedOn===null);)nD(p),p.blockedOn===null&&cl.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(x=0;x<p.length;x+=3){var E=p[x],N=p[x+1],M=E[on]||null;if(typeof N=="function")M||iD(p);else if(M){var Y=null;if(N&&N.hasAttribute("formAction")){if(E=N,M=N[on]||null)Y=M.formAction;else if(dS(E)!==null)continue}else Y=M.action;typeof Y=="function"?p[x+1]=Y:(p.splice(x,3),x-=3),iD(p)}}}function aD(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(M){return E=M})},focusReset:"manual",scroll:"manual"})}function u(){E!==null&&(E(),E=null),x||setTimeout(p,20)}function p(){if(!x&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(p,100),function(){x=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),E!==null&&(E(),E=null)}}}function mS(s){this._internalRoot=s}Iv.prototype.render=mS.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var p=u.current,x=ki();WM(p,x,s,u,null,null)},Iv.prototype.unmount=mS.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;WM(s.current,2,null,s,null,null),gv(),u[Oa]=null}};function Iv(s){this._internalRoot=s}Iv.prototype.unstable_scheduleHydration=function(s){if(s){var u=Is();s={blockedOn:null,target:s,priority:u};for(var p=0;p<cl.length&&u!==0&&u<cl[p].priority;p++);cl.splice(p,0,s),p===0&&nD(s)}};var oD=t.version;if(oD!=="19.2.4")throw Error(r(527,oD,"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?m(s):null,s=s===null?null:s.stateNode,s};var DW={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lv.isDisabled&&Lv.supportsFiber)try{je=Lv.inject(DW),st=Lv}catch{}}return qh.createRoot=function(s,u){if(!i(s))throw Error(r(299));var p=!1,x="",E=hP,N=mP,M=pP;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(M=u.onRecoverableError)),u=GM(s,1,!1,null,null,p,x,null,E,N,M,aD),s[Oa]=u.current,X1(s),new mS(u)},qh.hydrateRoot=function(s,u,p){if(!i(s))throw Error(r(299));var x=!1,E="",N=hP,M=mP,Y=pP,J=null;return p!=null&&(p.unstable_strictMode===!0&&(x=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onUncaughtError!==void 0&&(N=p.onUncaughtError),p.onCaughtError!==void 0&&(M=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError),p.formState!==void 0&&(J=p.formState)),u=GM(s,1,!0,u,p??null,x,E,J,N,M,Y,aD),u.context=XM(null),p=u.current,x=ki(),x=eo(x),E=Xs(x),E.callback=null,Ws(p,E,x),p=x,u.current.lanes=p,_t(u,p),ao(u),s[Oa]=u.current,X1(s),new Iv(u)},qh.version="19.2.4",qh}var vD;function KW(){if(vD)return xS.exports;vD=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(),xS.exports=VW(),xS.exports}var YW=KW();/**
 * 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 yD="popstate";function xD(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function GW(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 e_("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:Pm(i)}return WW(t,n,null,e)}function xn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ca(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XW(){return Math.random().toString(36).substring(2,10)}function bD(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 e_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Md(t):t,state:n,key:t&&t.key||r||XW(),unstable_mask:i}}function Pm({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Md(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 WW(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",c=null,f=m();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function m(){return(o.state||{idx:null}).idx}function d(){l="POP";let S=m(),j=S==null?null:S-f;f=S,c&&c({action:l,location:w.location,delta:j})}function g(S,j){l="PUSH";let C=xD(S)?S:e_(w.location,S,j);f=m()+1;let _=bD(C,f),k=w.createHref(C.unstable_mask||C);try{o.pushState(_,"",k)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(k)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,j){l="REPLACE";let C=xD(S)?S:e_(w.location,S,j);f=m();let _=bD(C,f),k=w.createHref(C.unstable_mask||C);o.replaceState(_,"",k),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return QW(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(yD,d),c=S,()=>{i.removeEventListener(yD,d),c=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let j=b(S);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:g,replace:v,go(S){return o.go(S)}};return w}function QW(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Pm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function L$(e,t,n="/"){return ZW(e,t,n,!1)}function ZW(e,t,n,r){let i=typeof t=="string"?Md(t):t,a=ps(i.pathname||"/",n);if(a==null)return null;let o=z$(e);JW(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let f=B$(a);l=lQ(o[c],f,r)}return l}function z$(e,t=[],n=[],r="",i=!1){let a=(o,l,c=i,f)=>{let m={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&c)return;xn(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let d=bo([r,m.relativePath]),g=n.concat(m);o.children&&o.children.length>0&&(xn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),z$(o.children,t,g,d,c)),!(o.path==null&&!o.index)&&t.push({path:d,score:oQ(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 $$(o.path))a(o,l,!0,f)}),t}function $$(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=$$(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 JW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var eQ=/^:[\w-]+$/,tQ=3,nQ=2,rQ=1,iQ=10,aQ=-2,wD=e=>e==="*";function oQ(e,t){let n=e.split("/"),r=n.length;return n.some(wD)&&(r+=aQ),t&&(r+=nQ),n.filter(i=>!wD(i)).reduce((i,a)=>i+(eQ.test(a)?tQ:a===""?rQ:iQ),r)}function sQ(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 lQ(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,m=a==="/"?t:t.slice(a.length)||"/",d=Mm({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},m),g=c.route;if(!d&&f&&n&&!r[r.length-1].route.index&&(d=Mm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:bo([a,d.pathname]),pathnameBase:hQ(bo([a,d.pathnameBase])),route:g}),d.pathnameBase!=="/"&&(a=bo([a,d.pathnameBase]))}return o}function Mm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=uQ(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:m,isOptional:d},g)=>{if(m==="*"){let b=l[g]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[g];return d&&!v?f[m]=void 0:f[m]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:o,pattern:e}}function uQ(e,t=!1,n=!0){ca(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c,f,m)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let d=m.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 B$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ca(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ps(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var cQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function fQ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Md(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=SD(n.substring(1),"/"):a=SD(n,t)):a=t,{pathname:a,search:mQ(r),hash:pQ(i)}}function SD(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 jS(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 dQ(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gN(e){let t=dQ(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function h0(e,t,n,r=!1){let i;typeof e=="string"?i=Md(e):(i={...e},xn(!i.pathname||!i.pathname.includes("?"),jS("?","pathname","search",i)),xn(!i.pathname||!i.pathname.includes("#"),jS("#","pathname","hash",i)),xn(!i.search||!i.search.includes("#"),jS("#","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=fQ(i,l),f=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||m)&&(c.pathname+="/"),c}var bo=e=>e.join("/").replace(/\/\/+/g,"/"),hQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,gQ=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 vQ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function yQ(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var F$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function U$(e,t){let n=e;if(typeof n!="string"||!cQ.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(F$)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=ps(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{ca(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var H$=["POST","PUT","PATCH","DELETE"];new Set(H$);var xQ=["GET",...H$];new Set(xQ);var Dd=y.createContext(null);Dd.displayName="DataRouter";var m0=y.createContext(null);m0.displayName="DataRouterState";var bQ=y.createContext(!1),q$=y.createContext({isTransitioning:!1});q$.displayName="ViewTransition";var wQ=y.createContext(new Map);wQ.displayName="Fetchers";var SQ=y.createContext(null);SQ.displayName="Await";var qi=y.createContext(null);qi.displayName="Navigation";var xp=y.createContext(null);xp.displayName="Location";var ba=y.createContext({outlet:null,matches:[],isDataRoute:!1});ba.displayName="Route";var vN=y.createContext(null);vN.displayName="RouteError";var V$="REACT_ROUTER_ERROR",jQ="REDIRECT",EQ="ROUTE_ERROR_RESPONSE";function _Q(e){if(e.startsWith(`${V$}:${jQ}:{`))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 CQ(e){if(e.startsWith(`${V$}:${EQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new gQ(t.status,t.statusText,t.data)}catch{}}function NQ(e,{relative:t}={}){xn(_c(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(qi),{hash:i,pathname:a,search:o}=wp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:bo([n,a])),r.createHref({pathname:l,search:o,hash:i})}function _c(){return y.useContext(xp)!=null}function wa(){return xn(_c(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(xp).location}function ES(e){xn(_c(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=wa();return y.useMemo(()=>Mm(e,B$(t)),[t,e])}var K$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Y$(e){y.useContext(qi).static||y.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=y.useContext(ba);return e?UQ():kQ()}function kQ(){xn(_c(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Dd),{basename:t,navigator:n}=y.useContext(qi),{matches:r}=y.useContext(ba),{pathname:i}=wa(),a=JSON.stringify(gN(r)),o=y.useRef(!1);return Y$(()=>{o.current=!0}),y.useCallback((c,f={})=>{if(ca(o.current,K$),!o.current)return;if(typeof c=="number"){n.go(c);return}let m=h0(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:bo([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,a,i,e])}var AQ=y.createContext(null);function OQ(e){let t=y.useContext(ba).outlet;return y.useMemo(()=>t&&y.createElement(AQ.Provider,{value:e},t),[t,e])}function bp(){let{matches:e}=y.useContext(ba),t=e[e.length-1];return t?t.params:{}}function wp(e,{relative:t}={}){let{matches:n}=y.useContext(ba),{pathname:r}=wa(),i=JSON.stringify(gN(n));return y.useMemo(()=>h0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function TQ(e,t){return G$(e,t)}function G$(e,t,n){var S;xn(_c(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(qi),{matches:i}=y.useContext(ba),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let j=f&&f.path||"";W$(l,!f||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let m=wa(),d;if(t){let j=typeof t=="string"?Md(t):t;xn(c==="/"||((S=j.pathname)==null?void 0:S.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${j.pathname}" was given in the \`location\` prop.`),d=j}else d=m;let g=d.pathname||"/",v=g;if(c!=="/"){let j=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=L$(e,{pathname:v});ca(f||b!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),ca(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=IQ(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},o,j.params),pathname:bo([c,r.encodeLocation?r.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:bo([c,r.encodeLocation?r.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),i,n);return t&&w?y.createElement(xp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},w):w}function PQ(){let e=FQ(),t=vQ(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,o)}var MQ=y.createElement(PQ,null),X$=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=CQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(ba.Provider,{value:this.props.routeContext},y.createElement(vN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(DQ,{error:e},t):t}};X$.contextType=bQ;var _S=new WeakMap;function DQ({children:e,error:t}){let{basename:n}=y.useContext(qi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=_Q(t.digest);if(r){let i=_S.get(t);if(i)throw i;let a=U$(r.location,n);if(F$&&!_S.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 _S.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function RQ({routeContext:e,match:t,children:n}){let r=y.useContext(Dd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(ba.Provider,{value:e},n)}function IQ(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r==null?void 0:r.errors;if(a!=null){let m=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);xn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let m=0;m<i.length;m++){let d=i[m];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=m),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?(m,d)=>{var g,v;c(m,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:yQ(r.matches),errorInfo:d})}:void 0;return i.reduceRight((m,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||MQ,o&&(l<0&&g===0?(W$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===g&&(b=!0,S=d.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,g+1)),C=()=>{let _;return v?_=w:b?_=S:d.route.Component?_=y.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=m,y.createElement(RQ,{match:d,routeContext:{outlet:m,matches:j,isDataRoute:r!=null},children:_})};return r&&(d.route.ErrorBoundary||d.route.errorElement||g===0)?y.createElement(X$,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:f}):C()},null)}function yN(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function LQ(e){let t=y.useContext(Dd);return xn(t,yN(e)),t}function zQ(e){let t=y.useContext(m0);return xn(t,yN(e)),t}function $Q(e){let t=y.useContext(ba);return xn(t,yN(e)),t}function xN(e){let t=$Q(e),n=t.matches[t.matches.length-1];return xn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function BQ(){return xN("useRouteId")}function FQ(){var r;let e=y.useContext(vN),t=zQ("useRouteError"),n=xN("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function UQ(){let{router:e}=LQ("useNavigate"),t=xN("useNavigate"),n=y.useRef(!1);return Y$(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{ca(n.current,K$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var jD={};function W$(e,t,n){!t&&!jD[e]&&(jD[e]=!0,ca(!1,n))}y.memo(HQ);function HQ({routes:e,future:t,state:n,isStatic:r,onError:i}){return G$(e,void 0,{state:n,isStatic:r,onError:i})}function ED({to:e,replace:t,state:n,relative:r}){xn(_c(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(qi);ca(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(ba),{pathname:o}=wa(),l=Sa(),c=h0(e,gN(a),o,r==="path"),f=JSON.stringify(c);return y.useEffect(()=>{l(JSON.parse(f),{replace:t,state:n,relative:r})},[l,f,r,t,n]),null}function qQ(e){return OQ(e.context)}function gr(e){xn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function VQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){xn(!_c(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[l,i,a,o]);typeof n=="string"&&(n=Md(n));let{pathname:f="/",search:m="",hash:d="",state:g=null,key:v="default",unstable_mask:b}=n,w=y.useMemo(()=>{let S=ps(f,l);return S==null?null:{location:{pathname:S,search:m,hash:d,state:g,key:v,unstable_mask:b},navigationType:r}},[l,f,m,d,g,v,r,b]);return ca(w!=null,`<Router basename="${l}"> is not able to match the URL "${f}${m}${d}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(qi.Provider,{value:c},y.createElement(xp.Provider,{children:t,value:w}))}function KQ({children:e,location:t}){return TQ(t_(e),t)}function t_(e,t=[]){let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let a=[...t,i];if(r.type===y.Fragment){n.push.apply(n,t_(r.props.children,a));return}xn(r.type===gr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),xn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=t_(r.props.children,a)),n.push(o)}),n}var Ey="get",_y="application/x-www-form-urlencoded";function p0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function YQ(e){return p0(e)&&e.tagName.toLowerCase()==="button"}function GQ(e){return p0(e)&&e.tagName.toLowerCase()==="form"}function XQ(e){return p0(e)&&e.tagName.toLowerCase()==="input"}function WQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QQ(e,t){return e.button===0&&(!t||t==="_self")&&!WQ(e)}function n_(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 ZQ(e,t){let n=n_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var $v=null;function JQ(){if($v===null)try{new FormData(document.createElement("form"),0),$v=!1}catch{$v=!0}return $v}var eZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function CS(e){return e!=null&&!eZ.has(e)?(ca(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_y}"`),null):e}function tZ(e,t){let n,r,i,a,o;if(GQ(e)){let l=e.getAttribute("action");r=l?ps(l,t):null,n=e.getAttribute("method")||Ey,i=CS(e.getAttribute("enctype"))||_y,a=new FormData(e)}else if(YQ(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?ps(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Ey,i=CS(e.getAttribute("formenctype"))||CS(l.getAttribute("enctype"))||_y,a=new FormData(l,e),!JQ()){let{name:f,type:m,value:d}=e;if(m==="image"){let g=f?`${f}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else f&&a.append(f,d)}}else{if(p0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ey,r=null,i=_y,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 bN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nZ(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ps(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function rZ(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 iZ(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 aZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await rZ(a,n);return o.links?o.links():[]}return[]}));return uZ(r.flat(1).filter(iZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function _D(e,t,n,r,i,a){let o=(c,f)=>n[f]?c.route.id!==n[f].route.id:!0,l=(c,f)=>{var m;return n[f].pathname!==c.pathname||((m=n[f].route.path)==null?void 0:m.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 m=r.routes[c.route.id];if(!m||!m.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 oZ(e,t,{includeHydrateFallback:n}={}){return sZ(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 sZ(e){return[...new Set(e)]}function lZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function uZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(lZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function Q$(){let e=y.useContext(Dd);return bN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cZ(){let e=y.useContext(m0);return bN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wN=y.createContext(void 0);wN.displayName="FrameworkContext";function Z$(){let e=y.useContext(wN);return bN(e,"You must render this element inside a <HydratedRouter> element"),e}function fZ(e,t){let n=y.useContext(wN),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:f,onMouseLeave:m,onTouchStart:d}=t,g=y.useRef(null);y.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=j=>{j.forEach(C=>{o(C.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return g.current&&S.observe(g.current),()=>{S.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let v=()=>{i(!0)},b=()=>{i(!1),o(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:Vh(l,v),onBlur:Vh(c,b),onMouseEnter:Vh(f,v),onMouseLeave:Vh(m,b),onTouchStart:Vh(d,v)}]:[!1,g,{}]}function Vh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dZ({page:e,...t}){let{router:n}=Q$(),r=y.useMemo(()=>L$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(mZ,{page:e,matches:r,...t}):null}function hZ(e){let{manifest:t,routeModules:n}=Z$(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return aZ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function mZ({page:e,matches:t,...n}){let r=wa(),{future:i,manifest:a,routeModules:o}=Z$(),{basename:l}=Q$(),{loaderData:c,matches:f}=cZ(),m=y.useMemo(()=>_D(e,t,f,a,r,"data"),[e,t,f,a,r]),d=y.useMemo(()=>_D(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(C=>{var k;let _=a.routes[C.route.id];!_||!_.hasLoader||(!m.some(O=>O.route.id===C.route.id)&&C.route.id in c&&((k=o[C.route.id])!=null&&k.shouldRevalidate)||_.hasClientLoader?S=!0:w.add(C.route.id))}),w.size===0)return[];let j=nZ(e,l,i.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&j.searchParams.set("_routes",t.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[j.pathname+j.search]},[l,i.unstable_trailingSlashAwareDataRequests,c,r,a,m,t,e,o]),v=y.useMemo(()=>oZ(d,a),[d,a]),b=hZ(d);return y.createElement(y.Fragment,null,g.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>y.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function pZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var gZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gZ&&(window.__reactRouterVersion="7.13.1")}catch{}function vZ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=y.useRef();i.current==null&&(i.current=GW({window:r,v5Compat:!0}));let a=i.current,[o,l]=y.useState({action:a.action,location:a.location}),c=y.useCallback(f=>{n===!1?l(f):y.startTransition(()=>l(f))},[n]);return y.useLayoutEffect(()=>a.listen(c),[a,c]),y.createElement(VQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var J$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:c,target:f,to:m,preventScrollReset:d,viewTransition:g,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:j,unstable_useTransitions:C}=y.useContext(qi),_=typeof m=="string"&&J$.test(m),k=U$(m,S);m=k.to;let O=NQ(m,{relative:i}),A=wa(),T=null;if(l){let V=h0(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:bo([S,V.pathname])),T=j.createHref(V)}let[P,L,I]=fZ(r,b),F=bZ(m,{replace:o,unstable_mask:l,state:c,target:f,preventScrollReset:d,relative:i,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function $(V){t&&t(V),V.defaultPrevented||F(V)}let X=!(k.isExternal||a),D=y.createElement("a",{...b,...I,href:(X?T:void 0)||k.absoluteURL||O,onClick:X?$:t,ref:pZ(w,L),target:f,"data-discover":!_&&n==="render"?"true":void 0});return P&&!_?y.createElement(y.Fragment,null,D,y.createElement(dZ,{page:O})):D});lr.displayName="Link";var Cy=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:c,...f},m){let d=wp(o,{relative:f.relative}),g=wa(),v=y.useContext(m0),{navigator:b,basename:w}=y.useContext(qi),S=v!=null&&CZ(d)&&l===!0,j=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,C=g.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),_=_?_.toLowerCase():null,j=j.toLowerCase()),_&&w&&(_=ps(_,w)||_);const k=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let O=C===j||!i&&C.startsWith(j)&&C.charAt(k)==="/",A=_!=null&&(_===j||!i&&_.startsWith(j)&&_.charAt(j.length)==="/"),T={isActive:O,isPending:A,isTransitioning:S},P=O?t:void 0,L;typeof r=="function"?L=r(T):L=[r,O?"active":null,A?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let I=typeof a=="function"?a(T):a;return y.createElement(lr,{...f,"aria-current":P,className:L,ref:m,style:I,to:o,viewTransition:l},typeof c=="function"?c(T):c)});Cy.displayName="NavLink";var yZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Ey,action:l,onSubmit:c,relative:f,preventScrollReset:m,viewTransition:d,unstable_defaultShouldRevalidate:g,...v},b)=>{let{unstable_useTransitions:w}=y.useContext(qi),S=EZ(),j=_Z(l,{relative:f}),C=o.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&J$.test(l),k=O=>{if(c&&c(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,T=(A==null?void 0:A.getAttribute("formmethod"))||o,P=()=>S(A||O.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:f,preventScrollReset:m,viewTransition:d,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>P()):P()};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?c:k,...v,"data-discover":!_&&e==="render"?"true":void 0})});yZ.displayName="Form";function xZ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function eB(e){let t=y.useContext(Dd);return xn(t,xZ(e)),t}function bZ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let m=Sa(),d=wa(),g=wp(e,{relative:o});return y.useCallback(v=>{if(QQ(v,t)){v.preventDefault();let b=n!==void 0?n:Pm(d)===Pm(g),w=()=>m(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?y.startTransition(()=>w()):w()}},[d,m,g,n,r,i,t,e,a,o,l,c,f])}function wZ(e){ca(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(n_(e)),n=y.useRef(!1),r=wa(),i=y.useMemo(()=>ZQ(r.search,n.current?null:t.current),[r.search]),a=Sa(),o=y.useCallback((l,c)=>{const f=n_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+f,c)},[a,i]);return[i,o]}var SZ=0,jZ=()=>`__${String(++SZ)}__`;function EZ(){let{router:e}=eB("useSubmit"),{basename:t}=y.useContext(qi),n=BQ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:l,method:c,encType:f,formData:m,body:d}=tZ(a,t);if(o.navigate===!1){let g=o.fetcherKey||jZ();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:m,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:m,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 _Z(e,{relative:t}={}){let{basename:n}=y.useContext(qi),r=y.useContext(ba);xn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...wp(e||".",{relative:t})},o=wa();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(d=>d).forEach(d=>l.append("index",d));let m=l.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:bo([n,a.pathname])),Pm(a)}function CZ(e,{relative:t}={}){let n=y.useContext(q$);xn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=eB("useViewTransitionState"),i=wp(e,{relative:t});if(!n.isTransitioning)return!1;let a=ps(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ps(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Mm(i.pathname,o)!=null||Mm(i.pathname,a)!=null}var Xl=I$();const tB=Hi(Xl);var Cc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},NZ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_l,mN,E$,kZ=(E$=class{constructor(){De(this,_l,NZ);De(this,mN,!1)}setTimeoutProvider(e){Ne(this,_l,e)}setTimeout(e,t){return W(this,_l).setTimeout(e,t)}clearTimeout(e){W(this,_l).clearTimeout(e)}setInterval(e,t){return W(this,_l).setInterval(e,t)}clearInterval(e){W(this,_l).clearInterval(e)}},_l=new WeakMap,mN=new WeakMap,E$),Iu=new kZ;function AZ(e){setTimeout(e,0)}var tc=typeof window>"u"||"Deno"in globalThis;function Br(){}function OZ(e,t){return typeof e=="function"?e(t):e}function r_(e){return typeof e=="number"&&e>=0&&e!==1/0}function nB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Il(e,t){return typeof e=="function"?e(t):e}function aa(e,t){return typeof e=="function"?e(t):e}function CD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==SN(o,t.options))return!1}else if(!Dm(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 ND(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(nc(t.options.mutationKey)!==nc(a))return!1}else if(!Dm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function SN(e,t){return((t==null?void 0:t.queryKeyHashFn)||nc)(e)}function nc(e){return JSON.stringify(e,(t,n)=>i_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Dm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dm(e[n],t[n])):!1}var TZ=Object.prototype.hasOwnProperty;function jN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=kD(e)&&kD(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 m=0;m<l;m++){const d=r?m:o[m],g=e[d],v=t[d];if(g===v){c[d]=g,(r?m<a:TZ.call(e,d))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[d]=v;continue}const b=jN(g,v,n+1);c[d]=b,b===g&&f++}return a===l&&f===a?e:c}function Rm(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 kD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function i_(e){if(!AD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!AD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function AD(e){return Object.prototype.toString.call(e)==="[object Object]"}function PZ(e){return new Promise(t=>{Iu.setTimeout(t,e)})}function a_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jN(e,t):t}function MZ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function DZ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var EN=Symbol();function rB(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===EN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _N(e,t){return typeof e=="function"?e(...t):!!e}function RZ(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Fu,Cl,Yf,_$,IZ=(_$=class extends Cc{constructor(){super();De(this,Fu);De(this,Cl);De(this,Yf);Ne(this,Yf,t=>{if(!tc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Cl)||this.setEventListener(W(this,Yf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Cl))==null||t.call(this),Ne(this,Cl,void 0))}setEventListener(t){var n;Ne(this,Yf,t),(n=W(this,Cl))==null||n.call(this),Ne(this,Cl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Fu)!==t&&(Ne(this,Fu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Fu)=="boolean"?W(this,Fu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Fu=new WeakMap,Cl=new WeakMap,Yf=new WeakMap,_$),CN=new IZ;function o_(){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 LZ=AZ;function zZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=LZ;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var zn=zZ(),Gf,Nl,Xf,C$,$Z=(C$=class extends Cc{constructor(){super();De(this,Gf,!0);De(this,Nl);De(this,Xf);Ne(this,Xf,t=>{if(!tc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Nl)||this.setEventListener(W(this,Xf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Nl))==null||t.call(this),Ne(this,Nl,void 0))}setEventListener(t){var n;Ne(this,Xf,t),(n=W(this,Nl))==null||n.call(this),Ne(this,Nl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Gf)!==t&&(Ne(this,Gf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Gf)}},Gf=new WeakMap,Nl=new WeakMap,Xf=new WeakMap,C$),Uy=new $Z;function BZ(e){return Math.min(1e3*2**e,3e4)}function iB(e){return(e??"online")==="online"?Uy.isOnline():!0}var s_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function aB(e){let t=!1,n=0,r;const i=o_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const j=new s_(w);g(j),(S=e.onCancel)==null||S.call(e,j)}},l=()=>{t=!0},c=()=>{t=!1},f=()=>CN.isFocused()&&(e.networkMode==="always"||Uy.isOnline())&&e.canRun(),m=()=>iB(e.networkMode)&&e.canRun(),d=w=>{a()||(r==null||r(),i.resolve(w))},g=w=>{a()||(r==null||r(),i.reject(w))},v=()=>new Promise(w=>{var S;r=j=>{(a()||f())&&w(j)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(a())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(j){w=Promise.reject(j)}Promise.resolve(w).then(d).catch(j=>{var A;if(a())return;const C=e.retry??(tc?0:3),_=e.retryDelay??BZ,k=typeof _=="function"?_(n,j):_,O=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,j);if(t||!O){g(j);return}n++,(A=e.onFail)==null||A.call(e,n,j),PZ(k).then(()=>f()?void 0:v()).then(()=>{t?g(j):b()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:c,canStart:m,start:()=>(m()?b():v().then(b),i)}}var Uu,N$,oB=(N$=class{constructor(){De(this,Uu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),r_(this.gcTime)&&Ne(this,Uu,Iu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tc?1/0:300*1e3))}clearGcTimeout(){W(this,Uu)&&(Iu.clearTimeout(W(this,Uu)),Ne(this,Uu,void 0))}},Uu=new WeakMap,N$),Hu,Wf,ra,qu,vr,cp,Vu,La,ts,k$,FZ=(k$=class extends oB{constructor(t){super();De(this,La);De(this,Hu);De(this,Wf);De(this,ra);De(this,qu);De(this,vr);De(this,cp);De(this,Vu);Ne(this,Vu,!1),Ne(this,cp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ne(this,qu,t.client),Ne(this,ra,W(this,qu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ne(this,Hu,TD(this.options)),this.state=t.state??W(this,Hu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,vr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,cp),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=TD(this.options);n.data!==void 0&&(this.setState(OD(n.data,n.dataUpdatedAt)),Ne(this,Hu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ra).remove(this)}setData(t,n){const r=a_(this.state.data,t,this.options);return at(this,La,ts).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){at(this,La,ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,vr))==null?void 0:r.promise;return(i=W(this,vr))==null||i.cancel(t),n?n.then(Br).catch(Br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Hu))}isActive(){return this.observers.some(t=>aa(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===EN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Il(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!nB(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,vr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,ra).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,vr)&&(W(this,Vu)?W(this,vr).cancel({revert:!0}):W(this,vr).cancelRetry()),this.scheduleGc()),W(this,ra).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,La,ts).call(this,{type:"invalidate"})}async fetch(t,n){var c,f,m,d,g,v,b,w,S,j,C,_;if(this.state.fetchStatus!=="idle"&&((c=W(this,vr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,vr))return W(this,vr).continueRetry(),W(this,vr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(O=>O.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Ne(this,Vu,!0),r.signal)})},a=()=>{const k=rB(this.options,n),A=(()=>{const T={client:W(this,qu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ne(this,Vu,!1),this.options.persister?this.options.persister(k,A,this):k(A)},l=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,qu),state:this.state,fetchFn:a};return i(k),k})();(f=this.options.behavior)==null||f.onFetch(l,this),Ne(this,Wf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=l.fetchOptions)==null?void 0:m.meta))&&at(this,La,ts).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Ne(this,vr,aB({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof s_&&k.revert&&this.setState({...W(this,Wf),fetchStatus:"idle"}),r.abort()},onFail:(k,O)=>{at(this,La,ts).call(this,{type:"failed",failureCount:k,error:O})},onPause:()=>{at(this,La,ts).call(this,{type:"pause"})},onContinue:()=>{at(this,La,ts).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await W(this,vr).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(v=(g=W(this,ra).config).onSuccess)==null||v.call(g,k,this),(w=(b=W(this,ra).config).onSettled)==null||w.call(b,k,this.state.error,this),k}catch(k){if(k instanceof s_){if(k.silent)return W(this,vr).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw at(this,La,ts).call(this,{type:"error",error:k}),(j=(S=W(this,ra).config).onError)==null||j.call(S,k,this),(_=(C=W(this,ra).config).onSettled)==null||_.call(C,this.state.data,k,this),k}finally{this.scheduleGc()}}},Hu=new WeakMap,Wf=new WeakMap,ra=new WeakMap,qu=new WeakMap,vr=new WeakMap,cp=new WeakMap,Vu=new WeakMap,La=new WeakSet,ts=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...sB(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...OD(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ne(this,Wf,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),zn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ra).notify({query:this,type:"updated",action:t})})},k$);function sB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function OD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function TD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var pi,Ot,fp,Zr,Ku,Qf,rs,kl,dp,Zf,Jf,Yu,Gu,Al,ed,Vt,pm,l_,u_,c_,f_,d_,h_,m_,lB,A$,g0=(A$=class extends Cc{constructor(t,n){super();De(this,Vt);De(this,pi);De(this,Ot);De(this,fp);De(this,Zr);De(this,Ku);De(this,Qf);De(this,rs);De(this,kl);De(this,dp);De(this,Zf);De(this,Jf);De(this,Yu);De(this,Gu);De(this,Al);De(this,ed,new Set);this.options=n,Ne(this,pi,t),Ne(this,kl,null),Ne(this,rs,o_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Ot).addObserver(this),PD(W(this,Ot),this.options)?at(this,Vt,pm).call(this):this.updateResult(),at(this,Vt,f_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return p_(W(this,Ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return p_(W(this,Ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Vt,d_).call(this),at(this,Vt,h_).call(this),W(this,Ot).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,Ot);if(this.options=W(this,pi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof aa(this.options.enabled,W(this,Ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Vt,m_).call(this),W(this,Ot).setOptions(this.options),n._defaulted&&!Rm(this.options,n)&&W(this,pi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Ot),observer:this});const i=this.hasListeners();i&&MD(W(this,Ot),r,this.options,n)&&at(this,Vt,pm).call(this),this.updateResult(),i&&(W(this,Ot)!==r||aa(this.options.enabled,W(this,Ot))!==aa(n.enabled,W(this,Ot))||Il(this.options.staleTime,W(this,Ot))!==Il(n.staleTime,W(this,Ot)))&&at(this,Vt,l_).call(this);const a=at(this,Vt,u_).call(this);i&&(W(this,Ot)!==r||aa(this.options.enabled,W(this,Ot))!==aa(n.enabled,W(this,Ot))||a!==W(this,Al))&&at(this,Vt,c_).call(this,a)}getOptimisticResult(t){const n=W(this,pi).getQueryCache().build(W(this,pi),t),r=this.createResult(n,t);return HZ(this,r)&&(Ne(this,Zr,r),Ne(this,Qf,this.options),Ne(this,Ku,W(this,Ot).state)),r}getCurrentResult(){return W(this,Zr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,rs).status==="pending"&&W(this,rs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,ed).add(t)}getCurrentQuery(){return W(this,Ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,pi).defaultQueryOptions(t),r=W(this,pi).getQueryCache().build(W(this,pi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return at(this,Vt,pm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Zr)))}createResult(t,n){var L;const r=W(this,Ot),i=this.options,a=W(this,Zr),o=W(this,Ku),l=W(this,Qf),f=t!==r?t.state:W(this,fp),{state:m}=t;let d={...m},g=!1,v;if(n._optimisticResults){const I=this.hasListeners(),F=!I&&PD(t,n),$=I&&MD(t,r,n,i);(F||$)&&(d={...d,...sB(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=d;v=d.data;let j=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let I;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=a.data,j=!0):I=typeof n.placeholderData=="function"?n.placeholderData((L=W(this,Jf))==null?void 0:L.state.data,W(this,Jf)):n.placeholderData,I!==void 0&&(S="success",v=a_(a==null?void 0:a.data,I,n),g=!0)}if(n.select&&v!==void 0&&!j)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,dp))v=W(this,Zf);else try{Ne(this,dp,n.select),v=n.select(v),v=a_(a==null?void 0:a.data,v,n),Ne(this,Zf,v),Ne(this,kl,null)}catch(I){Ne(this,kl,I)}W(this,kl)&&(b=W(this,kl),v=W(this,Zf),w=Date.now(),S="error");const C=d.fetchStatus==="fetching",_=S==="pending",k=S==="error",O=_&&C,A=v!==void 0,P={status:S,fetchStatus:d.fetchStatus,isPending:_,isSuccess:S==="success",isError:k,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!_,isLoadingError:k&&!A,isPaused:d.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:k&&A,isStale:NN(t,n),refetch:this.refetch,promise:W(this,rs),isEnabled:aa(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=P.data!==void 0,F=P.status==="error"&&!I,$=V=>{F?V.reject(P.error):I&&V.resolve(P.data)},X=()=>{const V=Ne(this,rs,P.promise=o_());$(V)},D=W(this,rs);switch(D.status){case"pending":t.queryHash===r.queryHash&&$(D);break;case"fulfilled":(F||P.data!==D.value)&&X();break;case"rejected":(!F||P.error!==D.reason)&&X();break}}return P}updateResult(){const t=W(this,Zr),n=this.createResult(W(this,Ot),this.options);if(Ne(this,Ku,W(this,Ot).state),Ne(this,Qf,this.options),W(this,Ku).data!==void 0&&Ne(this,Jf,W(this,Ot)),Rm(n,t))return;Ne(this,Zr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,ed).size)return!0;const o=new Set(a??W(this,ed));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Zr)).some(l=>{const c=l;return W(this,Zr)[c]!==t[c]&&o.has(c)})};at(this,Vt,lB).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Vt,f_).call(this)}},pi=new WeakMap,Ot=new WeakMap,fp=new WeakMap,Zr=new WeakMap,Ku=new WeakMap,Qf=new WeakMap,rs=new WeakMap,kl=new WeakMap,dp=new WeakMap,Zf=new WeakMap,Jf=new WeakMap,Yu=new WeakMap,Gu=new WeakMap,Al=new WeakMap,ed=new WeakMap,Vt=new WeakSet,pm=function(t){at(this,Vt,m_).call(this);let n=W(this,Ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Br)),n},l_=function(){at(this,Vt,d_).call(this);const t=Il(this.options.staleTime,W(this,Ot));if(tc||W(this,Zr).isStale||!r_(t))return;const r=nB(W(this,Zr).dataUpdatedAt,t)+1;Ne(this,Yu,Iu.setTimeout(()=>{W(this,Zr).isStale||this.updateResult()},r))},u_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Ot)):this.options.refetchInterval)??!1},c_=function(t){at(this,Vt,h_).call(this),Ne(this,Al,t),!(tc||aa(this.options.enabled,W(this,Ot))===!1||!r_(W(this,Al))||W(this,Al)===0)&&Ne(this,Gu,Iu.setInterval(()=>{(this.options.refetchIntervalInBackground||CN.isFocused())&&at(this,Vt,pm).call(this)},W(this,Al)))},f_=function(){at(this,Vt,l_).call(this),at(this,Vt,c_).call(this,at(this,Vt,u_).call(this))},d_=function(){W(this,Yu)&&(Iu.clearTimeout(W(this,Yu)),Ne(this,Yu,void 0))},h_=function(){W(this,Gu)&&(Iu.clearInterval(W(this,Gu)),Ne(this,Gu,void 0))},m_=function(){const t=W(this,pi).getQueryCache().build(W(this,pi),this.options);if(t===W(this,Ot))return;const n=W(this,Ot);Ne(this,Ot,t),Ne(this,fp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},lB=function(t){zn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Zr))}),W(this,pi).getQueryCache().notify({query:W(this,Ot),type:"observerResultsUpdated"})})},A$);function UZ(e,t){return aa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function PD(e,t){return UZ(e,t)||e.state.data!==void 0&&p_(e,t,t.refetchOnMount)}function p_(e,t,n){if(aa(t.enabled,e)!==!1&&Il(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&NN(e,t)}return!1}function MD(e,t,n,r){return(e!==t||aa(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&NN(e,n)}function NN(e,t){return aa(t.enabled,e)!==!1&&e.isStaleByTime(Il(t.staleTime,e))}function HZ(e,t){return!Rm(e.getCurrentResult(),t)}function Hy(e){return{onFetch:(t,n)=>{var m,d,g,v,b;const r=t.options,i=(g=(d=(m=t.fetchOptions)==null?void 0:m.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=_=>{RZ(_,()=>t.signal,()=>w=!0)},j=rB(t.options,t.fetchOptions),C=async(_,k,O)=>{if(w)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const T=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:k,direction:O?"backward":"forward",meta:t.options.meta};return S(F),F})(),P=await j(T),{maxPages:L}=t.options,I=O?DZ:MZ;return{pages:I(_.pages,P,L),pageParams:I(_.pageParams,k,L)}};if(i&&a.length){const _=i==="backward",k=_?uB:g_,O={pages:a,pageParams:o},A=k(r,O);l=await C(O,A,_)}else{const _=e??a.length;do{const k=c===0?o[0]??r.initialPageParam:g_(r,l);if(c>0&&k==null)break;l=await C(l,k),c++}while(c<_)}return l};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function g_(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 uB(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 qZ(e,t){return t?g_(e,t)!=null:!1}function VZ(e,t){return!t||!e.getPreviousPageParam?!1:uB(e,t)!=null}var KZ=class extends g0{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:Hy()})}getOptimisticResult(e){return e.behavior=Hy(),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",m=i&&c==="forward",d=o&&c==="backward",g=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:qZ(t,n.data),hasPreviousPage:VZ(t,n.data),isFetchNextPageError:f,isFetchingNextPage:m,isFetchPreviousPageError:d,isFetchingPreviousPage:g,isRefetchError:l&&!f&&!d,isRefetching:a&&!m&&!g}}},hp,fo,zr,Xu,ho,yl,O$,YZ=(O$=class extends oB{constructor(t){super();De(this,ho);De(this,hp);De(this,fo);De(this,zr);De(this,Xu);Ne(this,hp,t.client),this.mutationId=t.mutationId,Ne(this,zr,t.mutationCache),Ne(this,fo,[]),this.state=t.state||cB(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,fo).includes(t)||(W(this,fo).push(t),this.clearGcTimeout(),W(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ne(this,fo,W(this,fo).filter(n=>n!==t)),this.scheduleGc(),W(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,fo).length||(this.state.status==="pending"?this.scheduleGc():W(this,zr).remove(this))}continue(){var t;return((t=W(this,Xu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,f,m,d,g,v,b,w,S,j,C,_,k,O,A,T;const n=()=>{at(this,ho,yl).call(this,{type:"continue"})},r={client:W(this,hp),meta:this.options.meta,mutationKey:this.options.mutationKey};Ne(this,Xu,aB({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,L)=>{at(this,ho,yl).call(this,{type:"failed",failureCount:P,error:L})},onPause:()=>{at(this,ho,yl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,zr).canRun(this)}));const i=this.state.status==="pending",a=!W(this,Xu).canStart();try{if(i)n();else{at(this,ho,yl).call(this,{type:"pending",variables:t,isPaused:a}),W(this,zr).config.onMutate&&await W(this,zr).config.onMutate(t,this,r);const L=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));L!==this.state.context&&at(this,ho,yl).call(this,{type:"pending",context:L,variables:t,isPaused:a})}const P=await W(this,Xu).start();return await((f=(c=W(this,zr).config).onSuccess)==null?void 0:f.call(c,P,t,this.state.context,this,r)),await((d=(m=this.options).onSuccess)==null?void 0:d.call(m,P,t,this.state.context,r)),await((v=(g=W(this,zr).config).onSettled)==null?void 0:v.call(g,P,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,P,null,t,this.state.context,r)),at(this,ho,yl).call(this,{type:"success",data:P}),P}catch(P){try{await((j=(S=W(this,zr).config).onError)==null?void 0:j.call(S,P,t,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((_=(C=this.options).onError)==null?void 0:_.call(C,P,t,this.state.context,r))}catch(L){Promise.reject(L)}try{await((O=(k=W(this,zr).config).onSettled)==null?void 0:O.call(k,void 0,P,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((T=(A=this.options).onSettled)==null?void 0:T.call(A,void 0,P,t,this.state.context,r))}catch(L){Promise.reject(L)}throw at(this,ho,yl).call(this,{type:"error",error:P}),P}finally{W(this,zr).runNext(this)}}},hp=new WeakMap,fo=new WeakMap,zr=new WeakMap,Xu=new WeakMap,ho=new WeakSet,yl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zn.batch(()=>{W(this,fo).forEach(r=>{r.onMutationUpdate(t)}),W(this,zr).notify({mutation:this,type:"updated",action:t})})},O$);function cB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var is,za,mp,T$,GZ=(T$=class extends Cc{constructor(t={}){super();De(this,is);De(this,za);De(this,mp);this.config=t,Ne(this,is,new Set),Ne(this,za,new Map),Ne(this,mp,0)}build(t,n,r){const i=new YZ({client:t,mutationCache:this,mutationId:++zv(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,is).add(t);const n=Bv(t);if(typeof n=="string"){const r=W(this,za).get(n);r?r.push(t):W(this,za).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,is).delete(t)){const n=Bv(t);if(typeof n=="string"){const r=W(this,za).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,za).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Bv(t);if(typeof n=="string"){const r=W(this,za).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=Bv(t);if(typeof n=="string"){const i=(r=W(this,za).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zn.batch(()=>{W(this,is).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,is).clear(),W(this,za).clear()})}getAll(){return Array.from(W(this,is))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ND(n,r))}findAll(t={}){return this.getAll().filter(n=>ND(t,n))}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Br))))}},is=new WeakMap,za=new WeakMap,mp=new WeakMap,T$);function Bv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var as,Ol,gi,os,ms,Ny,v_,P$,XZ=(P$=class extends Cc{constructor(n,r){super();De(this,ms);De(this,as);De(this,Ol);De(this,gi);De(this,os);Ne(this,as,n),this.setOptions(r),this.bindMethods(),at(this,ms,Ny).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,as).defaultMutationOptions(n),Rm(this.options,r)||W(this,as).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,gi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&nc(r.mutationKey)!==nc(this.options.mutationKey)?this.reset():((i=W(this,gi))==null?void 0:i.state.status)==="pending"&&W(this,gi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,gi))==null||n.removeObserver(this)}onMutationUpdate(n){at(this,ms,Ny).call(this),at(this,ms,v_).call(this,n)}getCurrentResult(){return W(this,Ol)}reset(){var n;(n=W(this,gi))==null||n.removeObserver(this),Ne(this,gi,void 0),at(this,ms,Ny).call(this),at(this,ms,v_).call(this)}mutate(n,r){var i;return Ne(this,os,r),(i=W(this,gi))==null||i.removeObserver(this),Ne(this,gi,W(this,as).getMutationCache().build(W(this,as),this.options)),W(this,gi).addObserver(this),W(this,gi).execute(n)}},as=new WeakMap,Ol=new WeakMap,gi=new WeakMap,os=new WeakMap,ms=new WeakSet,Ny=function(){var r;const n=((r=W(this,gi))==null?void 0:r.state)??cB();Ne(this,Ol,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},v_=function(n){zn.batch(()=>{var r,i,a,o,l,c,f,m;if(W(this,os)&&this.hasListeners()){const d=W(this,Ol).variables,g=W(this,Ol).context,v={client:W(this,as),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,os)).onSuccess)==null||i.call(r,n.data,d,g,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,os)).onSettled)==null||o.call(a,n.data,null,d,g,v)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=W(this,os)).onError)==null||c.call(l,n.error,d,g,v)}catch(b){Promise.reject(b)}try{(m=(f=W(this,os)).onSettled)==null||m.call(f,void 0,n.error,d,g,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(W(this,Ol))})})},P$);function DD(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function WZ(e,t,n){const r=e.slice(0);return r[t]=n,r}var td,Oi,nd,rd,ia,Tl,pp,gp,vp,yp,Mr,y_,x_,b_,w_,S_,M$,QZ=(M$=class extends Cc{constructor(t,n,r){super();De(this,Mr);De(this,td);De(this,Oi);De(this,nd);De(this,rd);De(this,ia);De(this,Tl);De(this,pp);De(this,gp);De(this,vp);De(this,yp,[]);Ne(this,td,t),Ne(this,rd,r),Ne(this,nd,[]),Ne(this,ia,[]),Ne(this,Oi,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ia).forEach(t=>{t.subscribe(n=>{at(this,Mr,w_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,ia).forEach(t=>{t.destroy()})}setQueries(t,n){Ne(this,nd,t),Ne(this,rd,n),zn.batch(()=>{const r=W(this,ia),i=at(this,Mr,b_).call(this,W(this,nd));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,m=f?!0:o.some((d,g)=>{const v=W(this,Oi)[g];return!v||!Rm(d,v)});!f&&!m||(f&&(Ne(this,yp,i),Ne(this,ia,a)),Ne(this,Oi,o),this.hasListeners()&&(f&&(DD(r,a).forEach(d=>{d.destroy()}),DD(a,r).forEach(d=>{d.subscribe(g=>{at(this,Mr,w_).call(this,d,g)})})),at(this,Mr,S_).call(this)))})}getCurrentResult(){return W(this,Oi)}getQueries(){return W(this,ia).map(t=>t.getCurrentQuery())}getObservers(){return W(this,ia)}getOptimisticResult(t,n){const r=at(this,Mr,b_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>at(this,Mr,x_).call(this,o??i,n,a),()=>at(this,Mr,y_).call(this,i,r)]}},td=new WeakMap,Oi=new WeakMap,nd=new WeakMap,rd=new WeakMap,ia=new WeakMap,Tl=new WeakMap,pp=new WeakMap,gp=new WeakMap,vp=new WeakMap,yp=new WeakMap,Mr=new WeakSet,y_=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)})})})},x_=function(t,n,r){if(n){const i=W(this,vp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Tl)||W(this,Oi)!==W(this,gp)||a||n!==W(this,pp))&&(Ne(this,pp,n),Ne(this,gp,W(this,Oi)),r!==void 0&&Ne(this,vp,r),Ne(this,Tl,jN(W(this,Tl),n(t)))),W(this,Tl)}return t},b_=function(t){const n=new Map;W(this,ia).forEach(i=>{const a=i.options.queryHash;if(!a)return;const o=n.get(a);o?o.push(i):n.set(a,[i])});const r=[];return t.forEach(i=>{var c;const a=W(this,td).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new g0(W(this,td),a);r.push({defaultedQueryOptions:a,observer:l})}),r},w_=function(t,n){const r=W(this,ia).indexOf(t);r!==-1&&(Ne(this,Oi,WZ(W(this,Oi),r,n)),at(this,Mr,S_).call(this))},S_=function(){var t;if(this.hasListeners()){const n=W(this,Tl),r=at(this,Mr,y_).call(this,W(this,Oi),W(this,yp)),i=at(this,Mr,x_).call(this,r,(t=W(this,rd))==null?void 0:t.combine);n!==i&&zn.batch(()=>{this.listeners.forEach(a=>{a(W(this,Oi))})})}},M$),mo,D$,ZZ=(D$=class extends Cc{constructor(t={}){super();De(this,mo);this.config=t,Ne(this,mo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??SN(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,mo).has(t.queryHash)||(W(this,mo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,mo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,mo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,mo).get(t)}getAll(){return[...W(this,mo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>CD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>CD(t,r)):n}notify(t){zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mo=new WeakMap,D$),Rn,Pl,Ml,id,ad,Dl,od,sd,R$,JZ=(R$=class{constructor(e={}){De(this,Rn);De(this,Pl);De(this,Ml);De(this,id);De(this,ad);De(this,Dl);De(this,od);De(this,sd);Ne(this,Rn,e.queryCache||new ZZ),Ne(this,Pl,e.mutationCache||new GZ),Ne(this,Ml,e.defaultOptions||{}),Ne(this,id,new Map),Ne(this,ad,new Map),Ne(this,Dl,0)}mount(){zv(this,Dl)._++,W(this,Dl)===1&&(Ne(this,od,CN.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Rn).onFocus())})),Ne(this,sd,Uy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,Rn).onOnline())})))}unmount(){var e,t;zv(this,Dl)._--,W(this,Dl)===0&&((e=W(this,od))==null||e.call(this),Ne(this,od,void 0),(t=W(this,sd))==null||t.call(this),Ne(this,sd,void 0))}isFetching(e){return W(this,Rn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Pl).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,Rn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,Rn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Il(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,Rn).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,Rn).get(r.queryHash),a=i==null?void 0:i.state.data,o=OZ(t,a);if(o!==void 0)return W(this,Rn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return zn.batch(()=>W(this,Rn).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,Rn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,Rn);zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,Rn);return zn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zn.batch(()=>W(this,Rn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Br).catch(Br)}invalidateQueries(e,t={}){return zn.batch(()=>(W(this,Rn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=zn.batch(()=>W(this,Rn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,Rn).build(this,t);return n.isStaleByTime(Il(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Br).catch(Br)}fetchInfiniteQuery(e){return e.behavior=Hy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=Hy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Uy.isOnline()?W(this,Pl).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Rn)}getMutationCache(){return W(this,Pl)}getDefaultOptions(){return W(this,Ml)}setDefaultOptions(e){Ne(this,Ml,e)}setQueryDefaults(e,t){W(this,id).set(nc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,id).values()],n={};return t.forEach(r=>{Dm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,ad).set(nc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,ad).values()],n={};return t.forEach(r=>{Dm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Ml).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=SN(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===EN&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Ml).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,Rn).clear(),W(this,Pl).clear()}},Rn=new WeakMap,Pl=new WeakMap,Ml=new WeakMap,id=new WeakMap,ad=new WeakMap,Dl=new WeakMap,od=new WeakMap,sd=new WeakMap,R$),fB=y.createContext(void 0),lt=e=>{const t=y.useContext(fB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},eJ=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(fB.Provider,{value:e,children:t})),dB=y.createContext(!1),hB=()=>y.useContext(dB);dB.Provider;function tJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nJ=y.createContext(tJ()),mB=()=>y.useContext(nJ),pB=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?_N(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},gB=e=>{y.useEffect(()=>{e.clearReset()},[e])},vB=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||_N(n,[e.error,r])),yB=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))}},rJ=(e,t)=>e.isLoading&&e.isFetching&&!t,j_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,E_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function iJ({queries:e,...t},n){const r=lt(),i=hB(),a=mB(),o=y.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{yB(w);const S=r.getQueryCache().get(w.queryHash);pB(w,a,S)}),gB(a);const[l]=y.useState(()=>new QZ(r,o,t)),[c,f,m]=l.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;y.useSyncExternalStore(y.useCallback(w=>d?l.subscribe(zn.batchCalls(w)):Br,[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>j_(o[S],w))?c.flatMap((w,S)=>{const j=o[S];if(j&&j_(j,w)){const C=new g0(r,j);return E_(j,C,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const j=o[S];return j&&vB({result:w,errorResetBoundary:a,throwOnError:j.throwOnError,query:r.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(b!=null&&b.error)throw b.error;return f(m())}function xB(e,t,n){var g,v,b,w;const r=hB(),i=mB(),a=lt(),o=a.defaultQueryOptions(e);(v=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||v.call(g,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",yB(o),pB(o,i,l),gB(i);const c=!a.getQueryCache().get(o.queryHash),[f]=y.useState(()=>new t(a,o)),m=f.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const j=d?f.subscribe(zn.batchCalls(S)):Br;return f.updateResult(),j},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(o)},[o,f]),j_(o,m))throw E_(o,f,i);if(vB({result:m,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw m.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,o,m),o.experimental_prefetchInRender&&!tc&&rJ(m,r)){const S=c?E_(o,f,i):l==null?void 0:l.promise;S==null||S.catch(Br).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?m:f.trackResult(m)}function On(e,t){return xB(e,g0)}function jt(e,t){const n=lt(),[r]=y.useState(()=>new XZ(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const i=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(zn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch(Br)},[r]);if(i.error&&_N(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function aJ(e,t){return xB(e,KZ)}var oJ=(e,t,n,r,i,a,o,l)=>{let c=document.documentElement,f=["light","dark"];function m(v){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&a?i.map(j=>a[j]||j):i;w?(c.classList.remove(...S),c.classList.add(a&&a[v]?a[v]:v)):c.setAttribute(b,v)}),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)m(r);else try{let v=localStorage.getItem(t)||n,b=o&&v==="system"?g():v;m(b)}catch{}},RD=["light","dark"],bB="(prefers-color-scheme: dark)",sJ=typeof window>"u",kN=y.createContext(void 0),lJ={setTheme:e=>{},themes:[]},AN=()=>{var e;return(e=y.useContext(kN))!=null?e:lJ},uJ=e=>y.useContext(kN)?y.createElement(y.Fragment,null,e.children):y.createElement(fJ,{...e}),cJ=["light","dark"],fJ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=cJ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:f,nonce:m,scriptProps:d})=>{let[g,v]=y.useState(()=>hJ(i,o)),[b,w]=y.useState(()=>g==="system"?NS():g),S=c?Object.values(c):a,j=y.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=NS());let T=c?c[A]:A,P=t?mJ(m):null,L=document.documentElement,I=F=>{F==="class"?(L.classList.remove(...S),T&&L.classList.add(T)):F.startsWith("data-")&&(T?L.setAttribute(F,T):L.removeAttribute(F))};if(Array.isArray(l)?l.forEach(I):I(l),r){let F=RD.includes(o)?o:null,$=RD.includes(A)?A:F;L.style.colorScheme=$}P==null||P()},[m]),C=y.useCallback(O=>{let A=typeof O=="function"?O(g):O;v(A);try{localStorage.setItem(i,A)}catch{}},[g]),_=y.useCallback(O=>{let A=NS(O);w(A),g==="system"&&n&&!e&&j("system")},[g,e]);y.useEffect(()=>{let O=window.matchMedia(bB);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),y.useEffect(()=>{let O=A=>{A.key===i&&(A.newValue?v(A.newValue):C(o))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[C]),y.useEffect(()=>{j(e??g)},[e,g]);let k=y.useMemo(()=>({theme:g,setTheme:C,forcedTheme:e,resolvedTheme:g==="system"?b:g,themes:n?[...a,"system"]:a,systemTheme:n?b:void 0}),[g,C,e,b,n,a]);return y.createElement(kN.Provider,{value:k},y.createElement(dJ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:m,scriptProps:d}),f)},dJ=y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:c,scriptProps:f})=>{let m=JSON.stringify([n,t,a,e,l,o,r,i]).slice(1,-1);return y.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${oJ.toString()})(${m})`}})}),hJ=(e,t)=>{if(sJ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},mJ=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)}},NS=e=>(e||(e=window.matchMedia(bB)),e.matches?"dark":"light");function ID(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gs(...e){return t=>{let n=!1;const r=e.map(i=>{const a=ID(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():ID(e[i],null)}}}}function kt(...e){return y.useCallback(gs(...e),e)}function rc(e){const t=pJ(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,l=y.Children.toArray(a),c=l.find(vJ);if(c){const f=c.props.children,m=l.map(d=>d===c?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:d);return h.jsx(t,{...o,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var ON=rc("Slot");function pJ(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=xJ(i),l=yJ(a,i.props);return i.type!==y.Fragment&&(l.ref=r?gs(r,o):o),y.cloneElement(i,l)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wB=Symbol("radix.slottable");function gJ(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wB,t}function vJ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wB}function yJ(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 xJ(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 bJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=bJ.reduce((e,t)=>{const n=rc(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function SB(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}var jB=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"}),wJ="VisuallyHidden",EB=y.forwardRef((e,t)=>h.jsx(Ve.span,{...e,ref:t,style:{...jB,...e.style}}));EB.displayName=wJ;var SJ=EB;function jJ(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return h.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Wa(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const f=d=>{var j;const{scope:g,children:v,...b}=d,w=((j=g==null?void 0:g[e])==null?void 0:j[c])||l,S=y.useMemo(()=>b,Object.values(b));return h.jsx(w.Provider,{value:S,children:v})};f.displayName=a+"Provider";function m(d,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,b=y.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[f,m]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,EJ(i,...t)]}function EJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:f})=>{const d=c(a)[`__scope${f}`];return{...l,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function TN(e){const t=e+"CollectionProvider",[n,r]=Wa(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:j}=w,C=Ce.useRef(null),_=Ce.useRef(new Map).current;return h.jsx(i,{scope:S,itemMap:_,collectionRef:C,children:j})};o.displayName=t;const l=e+"CollectionSlot",c=rc(l),f=Ce.forwardRef((w,S)=>{const{scope:j,children:C}=w,_=a(l,j),k=kt(S,_.collectionRef);return h.jsx(c,{ref:k,children:C})});f.displayName=l;const m=e+"CollectionItemSlot",d="data-radix-collection-item",g=rc(m),v=Ce.forwardRef((w,S)=>{const{scope:j,children:C,..._}=w,k=Ce.useRef(null),O=kt(S,k),A=a(m,j);return Ce.useEffect(()=>(A.itemMap.set(k,{ref:k,..._}),()=>void A.itemMap.delete(k))),h.jsx(g,{[d]:"",ref:O,children:C})});v.displayName=m;function b(w){const S=a(e+"CollectionConsumer",w);return Ce.useCallback(()=>{const C=S.collectionRef.current;if(!C)return[];const _=Array.from(C.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:f,ItemSlot:v},b,r]}function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var wr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},_J=pN[" useInsertionEffect ".trim().toString()]||wr;function Bl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=CJ({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const d=m.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.`),m.current=l},[l,r])}const f=y.useCallback(m=>{var d;if(l){const g=NJ(m)?m(e):m;g!==e&&((d=o.current)==null||d.call(o,g))}else a(m)},[l,e,a,o]);return[c,f]}function CJ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return _J(()=>{a.current=t},[t]),y.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function NJ(e){return typeof e=="function"}function kJ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=AJ(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=kt(r.ref,OJ(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};qr.displayName="Presence";function AJ(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=kJ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Fv(r.current);a.current=l==="mounted"?f:"none"},[l]),wr(()=>{const f=r.current,m=i.current;if(m!==e){const g=a.current,v=Fv(f);e?c("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(m&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),wr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,d=v=>{const w=Fv(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=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Fv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Fv(e){return(e==null?void 0:e.animationName)||"none"}function OJ(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=pN[" useId ".trim().toString()]||(()=>{}),PJ=0;function br(e){const[t,n]=y.useState(TJ());return wr(()=>{n(r=>r??String(PJ++))},[e]),e||(t?`radix-${t}`:"")}var v0="Collapsible",[MJ]=Wa(v0),[DJ,PN]=MJ(v0),_B=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,f]=Bl({prop:r,defaultProp:i??!1,onChange:o,caller:v0});return h.jsx(DJ,{scope:n,disabled:a,contentId:br(),open:c,onOpenToggle:y.useCallback(()=>f(m=>!m),[f]),children:h.jsx(Ve.div,{"data-state":DN(c),"data-disabled":a?"":void 0,...l,ref:t})})});_B.displayName=v0;var CB="CollapsibleTrigger",NB=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=PN(CB,n);return h.jsx(Ve.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":DN(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ae(e.onClick,i.onOpenToggle)})});NB.displayName=CB;var MN="CollapsibleContent",kB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=PN(MN,e.__scopeCollapsible);return h.jsx(qr,{present:n||i.open,children:({present:a})=>h.jsx(RJ,{...r,ref:t,present:a})})});kB.displayName=MN;var RJ=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=PN(MN,n),[l,c]=y.useState(r),f=y.useRef(null),m=kt(t,f),d=y.useRef(0),g=d.current,v=y.useRef(0),b=v.current,w=o.open||l,S=y.useRef(w),j=y.useRef(void 0);return y.useEffect(()=>{const C=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(C)},[]),wr(()=>{const C=f.current;if(C){j.current=j.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const _=C.getBoundingClientRect();d.current=_.height,v.current=_.width,S.current||(C.style.transitionDuration=j.current.transitionDuration,C.style.animationName=j.current.animationName),c(r)}},[o.open,r]),h.jsx(Ve.div,{"data-state":DN(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...a,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&i})});function DN(e){return e?"open":"closed"}var IJ=_B,LJ=y.createContext(void 0);function Sp(e){const t=y.useContext(LJ);return e||t||"ltr"}function Tr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function zJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var $J="DismissableLayer",__="dismissableLayer.update",BJ="dismissableLayer.pointerDownOutside",FJ="dismissableLayer.focusOutside",LD,AB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,f=y.useContext(AB),[m,d]=y.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),b=kt(t,T=>d(T)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(S),C=m?w.indexOf(m):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,k=C>=j,O=qJ(T=>{const P=T.target,L=[...f.branches].some(I=>I.contains(P));!k||L||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},g),A=VJ(T=>{const P=T.target;[...f.branches].some(I=>I.contains(P))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},g);return zJ(T=>{C===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(LD=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),zD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=LD)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),zD())},[m,f]),y.useEffect(()=>{const T=()=>v({});return document.addEventListener(__,T),()=>document.removeEventListener(__,T)},[]),h.jsx(Ve.div,{...c,ref:b,style:{pointerEvents:_?k?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,O.onPointerDownCapture)})});jp.displayName=$J;var UJ="DismissableLayerBranch",HJ=y.forwardRef((e,t)=>{const n=y.useContext(AB),r=y.useRef(null),i=kt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(Ve.div,{...e,ref:i})});HJ.displayName=UJ;function qJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){OB(BJ,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 VJ(e,t=globalThis==null?void 0:globalThis.document){const n=Tr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&OB(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 zD(){const e=new CustomEvent(__);document.dispatchEvent(e)}function OB(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?SB(i,a):i.dispatchEvent(a)}var kS="focusScope.autoFocusOnMount",AS="focusScope.autoFocusOnUnmount",$D={bubbles:!1,cancelable:!0},KJ="FocusScope",y0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),f=Tr(i),m=Tr(a),d=y.useRef(null),g=kt(t,w=>c(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(_){if(v.paused||!l)return;const k=_.target;l.contains(k)?d.current=k:xl(d.current,{select:!0})},S=function(_){if(v.paused||!l)return;const k=_.relatedTarget;k!==null&&(l.contains(k)||xl(d.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&xl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const C=new MutationObserver(j);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),C.disconnect()}}},[r,l,v.paused]),y.useEffect(()=>{if(l){FD.add(v);const w=document.activeElement;if(!l.contains(w)){const j=new CustomEvent(kS,$D);l.addEventListener(kS,f),l.dispatchEvent(j),j.defaultPrevented||(YJ(ZJ(TB(l)),{select:!0}),document.activeElement===w&&xl(l))}return()=>{l.removeEventListener(kS,f),setTimeout(()=>{const j=new CustomEvent(AS,$D);l.addEventListener(AS,m),l.dispatchEvent(j),j.defaultPrevented||xl(w??document.body,{select:!0}),l.removeEventListener(AS,m),FD.remove(v)},0)}}},[l,f,m,v]);const b=y.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if(S&&j){const C=w.currentTarget,[_,k]=GJ(C);_&&k?!w.shiftKey&&j===k?(w.preventDefault(),n&&xl(_,{select:!0})):w.shiftKey&&j===_&&(w.preventDefault(),n&&xl(k,{select:!0})):j===C&&w.preventDefault()}},[n,r,v.paused]);return h.jsx(Ve.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});y0.displayName=KJ;function YJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xl(r,{select:t}),document.activeElement!==n)return}function GJ(e){const t=TB(e),n=BD(t,e),r=BD(t.reverse(),e);return[n,r]}function TB(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 BD(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 WJ(e){return e instanceof HTMLInputElement&&"select"in e}function xl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WJ(e)&&t&&e.select()}}var FD=QJ();function QJ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=UD(e,t),e.unshift(t)},remove(t){var n;e=UD(e,t),(n=e[0])==null||n.resume()}}}function UD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ZJ(e){return e.filter(t=>t.tagName!=="A")}var JJ="Portal",Ep=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=y.useState(!1);wr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?tB.createPortal(h.jsx(Ve.div,{...r,ref:t}),o):null});Ep.displayName=JJ;var OS=0;function RN(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??HD()),document.body.insertAdjacentElement("beforeend",e[1]??HD()),OS++,()=>{OS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),OS--}},[])}function HD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var go=function(){return go=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},go.apply(this,arguments)};function PB(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 eee(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 ky="right-scroll-bar-position",Ay="width-before-scroll-bar",tee="with-scroll-bars-hidden",nee="--removed-body-scroll-bar-size";function TS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ree(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var iee=typeof window<"u"?y.useLayoutEffect:y.useEffect,qD=new WeakMap;function aee(e,t){var n=ree(null,function(r){return e.forEach(function(i){return TS(i,r)})});return iee(function(){var r=qD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||TS(l,null)}),a.forEach(function(l){i.has(l)||TS(l,o)})}qD.set(n,e)},[e]),n}function oee(e){return e}function see(e,t){t===void 0&&(t=oee);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var m=o;o=[],m.forEach(a)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(m){o.push(m),f()},filter:function(m){return o=o.filter(m),n}}}};return i}function lee(e){e===void 0&&(e={});var t=see(null);return t.options=go({async:!0,ssr:!1},e),t}var MB=function(e){var t=e.sideCar,n=PB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,go({},n))};MB.isSideCarExport=!0;function uee(e,t){return e.useMedium(t),MB}var DB=lee(),PS=function(){},x0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:PS,onWheelCapture:PS,onTouchMoveCapture:PS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,f=e.removeScrollBar,m=e.enabled,d=e.shards,g=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,_=e.gapMode,k=PB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=aee([n,t]),T=go(go({},k),i);return y.createElement(y.Fragment,null,m&&y.createElement(O,{sideCar:DB,removeScrollBar:f,shards:d,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:_}),o?y.cloneElement(y.Children.only(l),go(go({},T),{ref:A})):y.createElement(C,go({},T,{className:c,ref:A}),l))});x0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};x0.classNames={fullWidth:Ay,zeroRight:ky};var cee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cee();return t&&e.setAttribute("nonce",t),e}function dee(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fee())&&(dee(t,n),hee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pee=function(){var e=mee();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},RB=function(){var e=pee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},gee={left:0,top:0,right:0,gap:0},MS=function(e){return parseInt(e||"",10)||0},vee=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[MS(n),MS(r),MS(i)]},yee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gee;var t=vee(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])}},xee=RB(),Bf="data-scroll-locked",bee=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(tee,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Bf,`] {
    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(ky,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(Ay,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(ky," .").concat(ky,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Ay," .").concat(Ay,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Bf,`] {
    `).concat(nee,": ").concat(l,`px;
  }
`)},VD=function(){var e=parseInt(document.body.getAttribute(Bf)||"0",10);return isFinite(e)?e:0},wee=function(){y.useEffect(function(){return document.body.setAttribute(Bf,(VD()+1).toString()),function(){var e=VD()-1;e<=0?document.body.removeAttribute(Bf):document.body.setAttribute(Bf,e.toString())}},[])},See=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;wee();var a=y.useMemo(function(){return yee(i)},[i]);return y.createElement(xee,{styles:bee(a,!t,i,n?"":"!important")})},C_=!1;if(typeof window<"u")try{var Uv=Object.defineProperty({},"passive",{get:function(){return C_=!0,!0}});window.addEventListener("test",Uv,Uv),window.removeEventListener("test",Uv,Uv)}catch{C_=!1}var yf=C_?{passive:!1}:!1,jee=function(e){return e.tagName==="TEXTAREA"},IB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jee(e)&&n[t]==="visible")},Eee=function(e){return IB(e,"overflowY")},_ee=function(e){return IB(e,"overflowX")},KD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=LB(e,r);if(i){var a=zB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Nee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},LB=function(e,t){return e==="v"?Eee(t):_ee(t)},zB=function(e,t){return e==="v"?Cee(t):Nee(t)},kee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Aee=function(e,t,n,r,i){var a=kee(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),f=!1,m=o>0,d=0,g=0;do{if(!l)break;var v=zB(e,l),b=v[0],w=v[1],S=v[2],j=w-S-a*b;(b||j)&&LB(e,l)&&(d+=j,g+=b);var C=l.parentNode;l=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(m&&Math.abs(d)<1||!m&&Math.abs(g)<1)&&(f=!0),f},Hv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YD=function(e){return[e.deltaX,e.deltaY]},GD=function(e){return e&&"current"in e?e.current:e},Oee=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;}
`)},Pee=0,xf=[];function Mee(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Pee++)[0],a=y.useState(RB)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=eee([e.lockRef.current],(e.shards||[]).map(GD),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var j=Hv(w),C=n.current,_="deltaX"in w?w.deltaX:C[0]-j[0],k="deltaY"in w?w.deltaY:C[1]-j[1],O,A=w.target,T=Math.abs(_)>Math.abs(k)?"h":"v";if("touches"in w&&T==="h"&&A.type==="range")return!1;var P=window.getSelection(),L=P&&P.anchorNode,I=L?L===A||L.contains(A):!1;if(I)return!1;var F=KD(T,A);if(!F)return!0;if(F?O=T:(O=T==="v"?"h":"v",F=KD(T,A)),!F)return!1;if(!r.current&&"changedTouches"in w&&(_||k)&&(r.current=O),!O)return!0;var $=r.current||O;return Aee($,S,w,$==="h"?_:k)},[]),c=y.useCallback(function(w){var S=w;if(!(!xf.length||xf[xf.length-1]!==a)){var j="deltaY"in S?YD(S):Hv(S),C=t.current.filter(function(O){return O.name===S.type&&(O.target===S.target||S.target===O.shadowParent)&&Oee(O.delta,j)})[0];if(C&&C.should){S.cancelable&&S.preventDefault();return}if(!C){var _=(o.current.shards||[]).map(GD).filter(Boolean).filter(function(O){return O.contains(S.target)}),k=_.length>0?l(S,_[0]):!o.current.noIsolation;k&&S.cancelable&&S.preventDefault()}}},[]),f=y.useCallback(function(w,S,j,C){var _={name:w,delta:S,target:j,should:C,shadowParent:Dee(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(k){return k!==_})},1)},[]),m=y.useCallback(function(w){n.current=Hv(w),r.current=void 0},[]),d=y.useCallback(function(w){f(w.type,YD(w),w.target,l(w,e.lockRef.current))},[]),g=y.useCallback(function(w){f(w.type,Hv(w),w.target,l(w,e.lockRef.current))},[]);y.useEffect(function(){return xf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:g}),document.addEventListener("wheel",c,yf),document.addEventListener("touchmove",c,yf),document.addEventListener("touchstart",m,yf),function(){xf=xf.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,yf),document.removeEventListener("touchmove",c,yf),document.removeEventListener("touchstart",m,yf)}},[]);var v=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(a,{styles:Tee(i)}):null,v?y.createElement(See,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ree=uee(DB,Mee);var b0=y.forwardRef(function(e,t){return y.createElement(x0,go({},e,{ref:t,sideCar:Ree}))});b0.classNames=x0.classNames;var Iee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bf=new WeakMap,qv=new WeakMap,Vv={},DS=0,$B=function(e){return e&&(e.host||$B(e.parentNode))},Lee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$B(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})},zee=function(e,t,n,r){var i=Lee(t,Array.isArray(e)?e:[e]);Vv[n]||(Vv[n]=new WeakMap);var a=Vv[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 m=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(g){if(l.has(g))m(g);else try{var v=g.getAttribute(r),b=v!==null&&v!=="false",w=(bf.get(g)||0)+1,S=(a.get(g)||0)+1;bf.set(g,w),a.set(g,S),o.push(g),w===1&&b&&qv.set(g,!0),S===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return m(t),l.clear(),DS++,function(){o.forEach(function(d){var g=bf.get(d)-1,v=a.get(d)-1;bf.set(d,g),a.set(d,v),g||(qv.has(d)||d.removeAttribute(r),qv.delete(d)),v||d.removeAttribute(n)}),DS--,DS||(bf=new WeakMap,bf=new WeakMap,qv=new WeakMap,Vv={})}},IN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Iee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),zee(r,i,n,"aria-hidden")):function(){return null}},w0="Dialog",[BB]=Wa(w0),[$ee,Qa]=BB(w0),FB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[f,m]=Bl({prop:r,defaultProp:i??!1,onChange:a,caller:w0});return h.jsx($ee,{scope:t,triggerRef:l,contentRef:c,contentId:br(),titleId:br(),descriptionId:br(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(d=>!d),[m]),modal:o,children:n})};FB.displayName=w0;var UB="DialogTrigger",Bee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qa(UB,n),a=kt(t,i.triggerRef);return h.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":$N(i.open),...r,ref:a,onClick:Ae(e.onClick,i.onOpenToggle)})});Bee.displayName=UB;var LN="DialogPortal",[Fee,HB]=BB(LN,{forceMount:void 0}),qB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Qa(LN,t);return h.jsx(Fee,{scope:t,forceMount:n,children:y.Children.map(r,o=>h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:o})}))})};qB.displayName=LN;var qy="DialogOverlay",VB=y.forwardRef((e,t)=>{const n=HB(qy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qa(qy,e.__scopeDialog);return a.modal?h.jsx(qr,{present:r||a.open,children:h.jsx(Hee,{...i,ref:t})}):null});VB.displayName=qy;var Uee=rc("DialogOverlay.RemoveScroll"),Hee=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qa(qy,n);return h.jsx(b0,{as:Uee,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Ve.div,{"data-state":$N(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ic="DialogContent",KB=y.forwardRef((e,t)=>{const n=HB(ic,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qa(ic,e.__scopeDialog);return h.jsx(qr,{present:r||a.open,children:a.modal?h.jsx(qee,{...i,ref:t}):h.jsx(Vee,{...i,ref:t})})});KB.displayName=ic;var qee=y.forwardRef((e,t)=>{const n=Qa(ic,e.__scopeDialog),r=y.useRef(null),i=kt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return IN(a)},[]),h.jsx(YB,{...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())})}),Vee=y.forwardRef((e,t)=>{const n=Qa(ic,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return h.jsx(YB,{...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()}})}),YB=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Qa(ic,n),c=y.useRef(null),f=kt(t,c);return RN(),h.jsxs(h.Fragment,{children:[h.jsx(y0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:h.jsx(jp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":$N(l.open),...o,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Kee,{titleId:l.titleId}),h.jsx(Gee,{contentRef:c,descriptionId:l.descriptionId})]})]})}),zN="DialogTitle",GB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qa(zN,n);return h.jsx(Ve.h2,{id:i.titleId,...r,ref:t})});GB.displayName=zN;var XB="DialogDescription",WB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qa(XB,n);return h.jsx(Ve.p,{id:i.descriptionId,...r,ref:t})});WB.displayName=XB;var QB="DialogClose",ZB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qa(QB,n);return h.jsx(Ve.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>i.onOpenChange(!1))})});ZB.displayName=QB;function $N(e){return e?"open":"closed"}var JB="DialogTitleWarning",[Z5e,e6]=jJ(JB,{contentName:ic,titleName:zN,docsSlug:"dialog"}),Kee=({titleId:e})=>{const t=e6(JB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

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

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Yee="DialogDescriptionWarning",Gee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${e6(Yee).contentName}}.`;return y.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},BN=FB,FN=qB,UN=VB,HN=KB,t6=GB,n6=WB,qN=ZB,RS={exports:{}},IS={};/**
 * @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 XD;function Xee(){if(XD)return IS;XD=1;var e=Pd();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 m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return IS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,IS}var WD;function Wee(){return WD||(WD=1,RS.exports=Xee()),RS.exports}function Qee(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Zee(e){const[t,n]=y.useState(void 0);return wr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,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 Jee=["top","right","bottom","left"],Fl=Math.min,Ti=Math.max,Vy=Math.round,Kv=Math.floor,wo=e=>({x:e,y:e}),ete={left:"right",right:"left",bottom:"top",top:"bottom"};function N_(e,t,n){return Ti(e,Fl(t,n))}function vs(e,t){return typeof e=="function"?e(t):e}function ys(e){return e.split("-")[0]}function Rd(e){return e.split("-")[1]}function VN(e){return e==="x"?"y":"x"}function KN(e){return e==="y"?"height":"width"}function vo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function YN(e){return VN(vo(e))}function tte(e,t,n){n===void 0&&(n=!1);const r=Rd(e),i=YN(e),a=KN(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Ky(o)),[o,Ky(o)]}function nte(e){const t=Ky(e);return[k_(e),t,k_(t)]}function k_(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const QD=["left","right"],ZD=["right","left"],rte=["top","bottom"],ite=["bottom","top"];function ate(e,t,n){switch(e){case"top":case"bottom":return n?t?ZD:QD:t?QD:ZD;case"left":case"right":return t?rte:ite;default:return[]}}function ote(e,t,n,r){const i=Rd(e);let a=ate(ys(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(k_)))),a}function Ky(e){const t=ys(e);return ete[t]+e.slice(t.length)}function ste(e){return{top:0,right:0,bottom:0,left:0,...e}}function r6(e){return typeof e!="number"?ste(e):{top:e,right:e,bottom:e,left:e}}function Yy(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 JD(e,t,n){let{reference:r,floating:i}=e;const a=vo(t),o=YN(t),l=KN(o),c=ys(t),f=a==="y",m=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:m,y:r.y-i.height};break;case"bottom":v={x:m,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Rd(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 lte(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:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:v=0}=vs(t,e),b=r6(v),S=l[g?d==="floating"?"reference":"floating":d],j=Yy(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:m,strategy:c})),C=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),k=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},O=Yy(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:_,strategy:c}):C);return{top:(j.top-O.top+b.top)/k.y,bottom:(O.bottom-j.bottom+b.bottom)/k.y,left:(j.left-O.left+b.left)/k.x,right:(O.right-j.right+b.right)/k.x}}const ute=50,cte=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:lte},c=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:d}=JD(f,r,c),g=r,v=0;const b={};for(let w=0;w<a.length;w++){const S=a[w];if(!S)continue;const{name:j,fn:C}=S,{x:_,y:k,data:O,reset:A}=await C({x:m,y:d,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:f,platform:l,elements:{reference:e,floating:t}});m=_??m,d=k??d,b[j]={...b[j],...O},A&&v<ute&&(v++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(f=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:m,y:d}=JD(f,g,c)),w=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:b}},fte=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:m=0}=vs(e,t)||{};if(f==null)return{};const d=r6(m),g={x:n,y:r},v=YN(i),b=KN(v),w=await o.getDimensions(f),S=v==="y",j=S?"top":"left",C=S?"bottom":"right",_=S?"clientHeight":"clientWidth",k=a.reference[b]+a.reference[v]-g[v]-a.floating[b],O=g[v]-a.reference[v],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=A?A[_]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[_]||a.floating[b]);const P=k/2-O/2,L=T/2-w[b]/2-1,I=Fl(d[j],L),F=Fl(d[C],L),$=I,X=T-w[b]-F,D=T/2-w[b]/2+P,V=N_($,D,X),z=!c.arrow&&Rd(i)!=null&&D!==V&&a.reference[b]/2-(D<$?I:F)-w[b]/2<0,q=z?D<$?D-$:D-X:0;return{[v]:g[v]+q,data:{[v]:V,centerOffset:D-V-q,...z&&{alignmentOffset:q}},reset:z}}}),dte=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:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=vs(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const j=ys(i),C=vo(l),_=ys(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(f.floating)),O=g||(_||!w?[Ky(l)]:nte(l)),A=b!=="none";!g&&A&&O.push(...ote(l,w,b,k));const T=[l,...O],P=await c.detectOverflow(t,S),L=[];let I=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&L.push(P[j]),d){const D=tte(i,o,k);L.push(P[D[0]],P[D[1]])}if(I=[...I,{placement:i,overflows:L}],!L.every(D=>D<=0)){var F,$;const D=(((F=a.flip)==null?void 0:F.index)||0)+1,V=T[D];if(V&&(!(d==="alignment"?C!==vo(V):!1)||I.every(G=>vo(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:D,overflows:I},reset:{placement:V}};let z=($=I.filter(q=>q.overflows[0]<=0).sort((q,G)=>q.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!z)switch(v){case"bestFit":{var X;const q=(X=I.filter(G=>{if(A){const K=vo(G.placement);return K===C||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,R)=>K+R,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:X[0];q&&(z=q);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function eR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tR(e){return Jee.some(t=>e[t]>=0)}const hte=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=vs(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=eR(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:tR(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=eR(o,n.floating);return{data:{escapedOffsets:l,escaped:tR(l)}}}default:return{}}}}},i6=new Set(["left","top"]);async function mte(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ys(n),l=Rd(n),c=vo(n)==="y",f=i6.has(o)?-1:1,m=a&&c?-1:1,d=vs(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{x:v*m,y:g*f}:{x:g*f,y:v*m}}const pte=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 mte(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}}}}},gte=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:j=>{let{x:C,y:_}=j;return{x:C,y:_}}},...f}=vs(e,t),m={x:n,y:r},d=await a.detectOverflow(t,f),g=vo(ys(i)),v=VN(g);let b=m[v],w=m[g];if(o){const j=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=b+d[j],k=b-d[C];b=N_(_,b,k)}if(l){const j=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=w+d[j],k=w-d[C];w=N_(_,w,k)}const S=c.fn({...t,[v]:b,[g]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[g]:l}}}}}},vte=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=vs(e,t),m={x:n,y:r},d=vo(i),g=VN(d);let v=m[g],b=m[d];const w=vs(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const _=g==="y"?"height":"width",k=a.reference[g]-a.floating[_]+S.mainAxis,O=a.reference[g]+a.reference[_]-S.mainAxis;v<k?v=k:v>O&&(v=O)}if(f){var j,C;const _=g==="y"?"width":"height",k=i6.has(ys(i)),O=a.reference[d]-a.floating[_]+(k&&((j=o.offset)==null?void 0:j[d])||0)+(k?0:S.crossAxis),A=a.reference[d]+a.reference[_]+(k?0:((C=o.offset)==null?void 0:C[d])||0)-(k?S.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[g]:v,[d]:b}}}},yte=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...f}=vs(e,t),m=await o.detectOverflow(t,f),d=ys(i),g=Rd(i),v=vo(i)==="y",{width:b,height:w}=a.floating;let S,j;d==="top"||d==="bottom"?(S=d,j=g===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=d,S=g==="end"?"top":"bottom");const C=w-m.top-m.bottom,_=b-m.left-m.right,k=Fl(w-m[S],C),O=Fl(b-m[j],_),A=!t.middlewareData.shift;let T=k,P=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),A&&!g){const I=Ti(m.left,0),F=Ti(m.right,0),$=Ti(m.top,0),X=Ti(m.bottom,0);v?P=b-2*(I!==0||F!==0?I+F:Ti(m.left,m.right)):T=w-2*($!==0||X!==0?$+X:Ti(m.top,m.bottom))}await c({...t,availableWidth:P,availableHeight:T});const L=await o.getDimensions(l.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function S0(){return typeof window<"u"}function Id(e){return a6(e)?(e.nodeName||"").toLowerCase():"#document"}function Ri(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oo(e){var t;return(t=(a6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function a6(e){return S0()?e instanceof Node||e instanceof Ri(e).Node:!1}function Ya(e){return S0()?e instanceof Element||e instanceof Ri(e).Element:!1}function _s(e){return S0()?e instanceof HTMLElement||e instanceof Ri(e).HTMLElement:!1}function nR(e){return!S0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ri(e).ShadowRoot}function _p(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function xte(e){return/^(table|td|th)$/.test(Id(e))}function j0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const bte=/transform|translate|scale|rotate|perspective|filter/,wte=/paint|layout|strict|content/,ju=e=>!!e&&e!=="none";let LS;function GN(e){const t=Ya(e)?Ga(e):e;return ju(t.transform)||ju(t.translate)||ju(t.scale)||ju(t.rotate)||ju(t.perspective)||!XN()&&(ju(t.backdropFilter)||ju(t.filter))||bte.test(t.willChange||"")||wte.test(t.contain||"")}function Ste(e){let t=Ul(e);for(;_s(t)&&!ld(t);){if(GN(t))return t;if(j0(t))return null;t=Ul(t)}return null}function XN(){return LS==null&&(LS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),LS}function ld(e){return/^(html|body|#document)$/.test(Id(e))}function Ga(e){return Ri(e).getComputedStyle(e)}function E0(e){return Ya(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ul(e){if(Id(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nR(e)&&e.host||Oo(e);return nR(t)?t.host:t}function o6(e){const t=Ul(e);return ld(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&_p(t)?t:o6(t)}function Im(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=o6(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Ri(i);if(a){const l=A_(o);return t.concat(o,o.visualViewport||[],_p(i)?i:[],l&&n?Im(l):[])}else return t.concat(i,Im(i,[],n))}function A_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function s6(e){const t=Ga(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=_s(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Vy(n)!==a||Vy(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function WN(e){return Ya(e)?e:e.contextElement}function Ff(e){const t=WN(e);if(!_s(t))return wo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=s6(t);let o=(a?Vy(n.width):n.width)/r,l=(a?Vy(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const jte=wo(0);function l6(e){const t=Ri(e);return!XN()||!t.visualViewport?jte:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ete(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ri(e)?!1:t}function ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=WN(e);let o=wo(1);t&&(r?Ya(r)&&(o=Ff(r)):o=Ff(e));const l=Ete(a,n,r)?l6(a):wo(0);let c=(i.left+l.x)/o.x,f=(i.top+l.y)/o.y,m=i.width/o.x,d=i.height/o.y;if(a){const g=Ri(a),v=r&&Ya(r)?Ri(r):r;let b=g,w=A_(b);for(;w&&r&&v!==b;){const S=Ff(w),j=w.getBoundingClientRect(),C=Ga(w),_=j.left+(w.clientLeft+parseFloat(C.paddingLeft))*S.x,k=j.top+(w.clientTop+parseFloat(C.paddingTop))*S.y;c*=S.x,f*=S.y,m*=S.x,d*=S.y,c+=_,f+=k,b=Ri(w),w=A_(b)}}return Yy({width:m,height:d,x:c,y:f})}function _0(e,t){const n=E0(e).scrollLeft;return t?t.left+n:ac(Oo(e)).left+n}function u6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function _te(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Oo(r),l=t?j0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},f=wo(1);const m=wo(0),d=_s(r);if((d||!d&&!a)&&((Id(r)!=="body"||_p(o))&&(c=E0(r)),d)){const v=ac(r);f=Ff(r),m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}const g=o&&!d&&!a?u6(o,c):wo(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-c.scrollTop*f.y+m.y+g.y}}function Cte(e){return Array.from(e.getClientRects())}function Nte(e){const t=Oo(e),n=E0(e),r=e.ownerDocument.body,i=Ti(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ti(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+_0(e);const l=-n.scrollTop;return Ga(r).direction==="rtl"&&(o+=Ti(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const rR=25;function kte(e,t){const n=Ri(e),r=Oo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const m=XN();(!m||m&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const f=_0(r);if(f<=0){const m=r.ownerDocument,d=m.body,g=getComputedStyle(d),v=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-v);b<=rR&&(a-=b)}else f<=rR&&(a+=f);return{width:a,height:o,x:l,y:c}}function Ate(e,t){const n=ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_s(e)?Ff(e):wo(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 iR(e,t,n){let r;if(t==="viewport")r=kte(e,n);else if(t==="document")r=Nte(Oo(e));else if(Ya(t))r=Ate(t,n);else{const i=l6(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Yy(r)}function c6(e,t){const n=Ul(e);return n===t||!Ya(n)||ld(n)?!1:Ga(n).position==="fixed"||c6(n,t)}function Ote(e,t){const n=t.get(e);if(n)return n;let r=Im(e,[],!1).filter(l=>Ya(l)&&Id(l)!=="body"),i=null;const a=Ga(e).position==="fixed";let o=a?Ul(e):e;for(;Ya(o)&&!ld(o);){const l=Ga(o),c=GN(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||_p(o)&&!c&&c6(e,o))?r=r.filter(m=>m!==o):i=l,o=Ul(o)}return t.set(e,r),r}function Tte(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?j0(t)?[]:Ote(t,this._c):[].concat(n),r],l=iR(t,o[0],i);let c=l.top,f=l.right,m=l.bottom,d=l.left;for(let g=1;g<o.length;g++){const v=iR(t,o[g],i);c=Ti(v.top,c),f=Fl(v.right,f),m=Fl(v.bottom,m),d=Ti(v.left,d)}return{width:f-d,height:m-c,x:d,y:c}}function Pte(e){const{width:t,height:n}=s6(e);return{width:t,height:n}}function Mte(e,t,n){const r=_s(t),i=Oo(t),a=n==="fixed",o=ac(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=wo(0);function f(){c.x=_0(i)}if(r||!r&&!a)if((Id(t)!=="body"||_p(i))&&(l=E0(t)),r){const v=ac(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else i&&f();a&&!r&&i&&f();const m=i&&!r&&!a?u6(i,l):wo(0),d=o.left+l.scrollLeft-c.x-m.x,g=o.top+l.scrollTop-c.y-m.y;return{x:d,y:g,width:o.width,height:o.height}}function zS(e){return Ga(e).position==="static"}function aR(e,t){if(!_s(e)||Ga(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Oo(e)===n&&(n=n.ownerDocument.body),n}function f6(e,t){const n=Ri(e);if(j0(e))return n;if(!_s(e)){let i=Ul(e);for(;i&&!ld(i);){if(Ya(i)&&!zS(i))return i;i=Ul(i)}return n}let r=aR(e,t);for(;r&&xte(r)&&zS(r);)r=aR(r,t);return r&&ld(r)&&zS(r)&&!GN(r)?n:r||Ste(e)||n}const Dte=async function(e){const t=this.getOffsetParent||f6,n=this.getDimensions,r=await n(e.floating);return{reference:Mte(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Rte(e){return Ga(e).direction==="rtl"}const Ite={convertOffsetParentRelativeRectToViewportRelativeRect:_te,getDocumentElement:Oo,getClippingRect:Tte,getOffsetParent:f6,getElementRects:Dte,getClientRects:Cte,getDimensions:Pte,getScale:Ff,isElement:Ya,isRTL:Rte};function d6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lte(e,t){let n=null,r;const i=Oo(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const f=e.getBoundingClientRect(),{left:m,top:d,width:g,height:v}=f;if(l||t(),!g||!v)return;const b=Kv(d),w=Kv(i.clientWidth-(m+g)),S=Kv(i.clientHeight-(d+v)),j=Kv(m),_={rootMargin:-b+"px "+-w+"px "+-S+"px "+-j+"px",threshold:Ti(0,Fl(1,c))||1};let k=!0;function O(A){const T=A[0].intersectionRatio;if(T!==c){if(!k)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!d6(f,e.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(O,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return o(!0),a}function zte(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=WN(e),m=i||a?[...f?Im(f):[],...t?Im(t):[]]:[];m.forEach(j=>{i&&j.addEventListener("scroll",n,{passive:!0}),a&&j.addEventListener("resize",n)});const d=f&&l?Lte(f,n):null;let g=-1,v=null;o&&(v=new ResizeObserver(j=>{let[C]=j;C&&C.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),f&&!c&&v.observe(f),t&&v.observe(t));let b,w=c?ac(e):null;c&&S();function S(){const j=ac(e);w&&!d6(w,j)&&n(),w=j,b=requestAnimationFrame(S)}return n(),()=>{var j;m.forEach(C=>{i&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),d==null||d(),(j=v)==null||j.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const $te=pte,Bte=gte,Fte=dte,Ute=yte,Hte=hte,oR=fte,qte=vte,Vte=(e,t,n)=>{const r=new Map,i={platform:Ite,...n},a={...i.platform,_c:r};return cte(e,t,{...i,platform:a})};var Kte=typeof document<"u",Yte=function(){},Oy=Kte?y.useLayoutEffect:Yte;function Gy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gy(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Gy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function h6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sR(e,t){const n=h6(e);return Math.round(t*n)/n}function $S(e){const t=y.useRef(e);return Oy(()=>{t.current=e}),t}function Gte(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,[m,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=y.useState(r);Gy(g,r)||v(r);const[b,w]=y.useState(null),[S,j]=y.useState(null),C=y.useCallback(G=>{G!==A.current&&(A.current=G,w(G))},[]),_=y.useCallback(G=>{G!==T.current&&(T.current=G,j(G))},[]),k=a||b,O=o||S,A=y.useRef(null),T=y.useRef(null),P=y.useRef(m),L=c!=null,I=$S(c),F=$S(i),$=$S(f),X=y.useCallback(()=>{if(!A.current||!T.current)return;const G={placement:t,strategy:n,middleware:g};F.current&&(G.platform=F.current),Vte(A.current,T.current,G).then(K=>{const R={...K,isPositioned:$.current!==!1};D.current&&!Gy(P.current,R)&&(P.current=R,Xl.flushSync(()=>{d(R)}))})},[g,t,n,F,$]);Oy(()=>{f===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(G=>({...G,isPositioned:!1})))},[f]);const D=y.useRef(!1);Oy(()=>(D.current=!0,()=>{D.current=!1}),[]),Oy(()=>{if(k&&(A.current=k),O&&(T.current=O),k&&O){if(I.current)return I.current(k,O,X);X()}},[k,O,X,I,L]);const V=y.useMemo(()=>({reference:A,floating:T,setReference:C,setFloating:_}),[C,_]),z=y.useMemo(()=>({reference:k,floating:O}),[k,O]),q=y.useMemo(()=>{const G={position:n,left:0,top:0};if(!z.floating)return G;const K=sR(z.floating,m.x),R=sR(z.floating,m.y);return l?{...G,transform:"translate("+K+"px, "+R+"px)",...h6(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:R}},[n,l,z.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:X,refs:V,elements:z,floatingStyles:q}),[m,X,V,z,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?oR({element:r.current,padding:i}).fn(n):{}:r?oR({element:r,padding:i}).fn(n):{}}}},Wte=(e,t)=>{const n=$te(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qte=(e,t)=>{const n=Bte(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zte=(e,t)=>({fn:qte(e).fn,options:[e,t]}),Jte=(e,t)=>{const n=Fte(e);return{name:n.name,fn:n.fn,options:[e,t]}},ene=(e,t)=>{const n=Ute(e);return{name:n.name,fn:n.fn,options:[e,t]}},tne=(e,t)=>{const n=Hte(e);return{name:n.name,fn:n.fn,options:[e,t]}},nne=(e,t)=>{const n=Xte(e);return{name:n.name,fn:n.fn,options:[e,t]}};var rne="Arrow",m6=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return h.jsx(Ve.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});m6.displayName=rne;var ine=m6,QN="Popper",[p6,Ld]=Wa(QN),[ane,g6]=p6(QN),v6=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return h.jsx(ane,{scope:t,anchor:r,onAnchorChange:i,children:n})};v6.displayName=QN;var y6="PopperAnchor",x6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=g6(y6,n),o=y.useRef(null),l=kt(t,o),c=y.useRef(null);return y.useEffect(()=>{const f=c.current;c.current=(r==null?void 0:r.current)||o.current,f!==c.current&&a.onAnchorChange(c.current)}),r?null:h.jsx(Ve.div,{...i,ref:l})});x6.displayName=y6;var ZN="PopperContent",[one,sne]=p6(ZN),b6=y.forwardRef((e,t)=>{var ae,re,ee,se,ge,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=g6(ZN,n),[j,C]=y.useState(null),_=kt(t,Se=>C(Se)),[k,O]=y.useState(null),A=Zee(k),T=(A==null?void 0:A.width)??0,P=(A==null?void 0:A.height)??0,L=r+(a!=="center"?"-"+a:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},F=Array.isArray(f)?f:[f],$=F.length>0,X={padding:I,boundary:F.filter(une),altBoundary:$},{refs:D,floatingStyles:V,placement:z,isPositioned:q,middlewareData:G}=Gte({strategy:"fixed",placement:L,whileElementsMounted:(...Se)=>zte(...Se,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[Wte({mainAxis:i+P,alignmentAxis:o}),c&&Qte({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Zte():void 0,...X}),c&&Jte({...X}),ene({...X,apply:({elements:Se,rects:Ee,availableWidth:He,availableHeight:ke})=>{const{width:it,height:Je}=Ee.reference,We=Se.floating.style;We.setProperty("--radix-popper-available-width",`${He}px`),We.setProperty("--radix-popper-available-height",`${ke}px`),We.setProperty("--radix-popper-anchor-width",`${it}px`),We.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),k&&nne({element:k,padding:l}),cne({arrowWidth:T,arrowHeight:P}),g&&tne({strategy:"referenceHidden",...X})]}),[K,R]=j6(z),H=Tr(b);wr(()=>{q&&(H==null||H())},[q,H]);const U=(ae=G.arrow)==null?void 0:ae.x,B=(re=G.arrow)==null?void 0:re.y,Q=((ee=G.arrow)==null?void 0:ee.centerOffset)!==0,[Z,te]=y.useState();return wr(()=>{j&&te(window.getComputedStyle(j).zIndex)},[j]),h.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(se=G.transformOrigin)==null?void 0:se.x,(ge=G.transformOrigin)==null?void 0:ge.y].join(" "),...((ie=G.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(one,{scope:n,placedSide:K,onArrowChange:O,arrowX:U,arrowY:B,shouldHideArrow:Q,children:h.jsx(Ve.div,{"data-side":K,"data-align":R,...w,ref:_,style:{...w.style,animation:q?void 0:"none"}})})})});b6.displayName=ZN;var w6="PopperArrow",lne={top:"bottom",right:"left",bottom:"top",left:"right"},S6=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=sne(w6,r),o=lne[a.placedSide];return h.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:h.jsx(ine,{...i,ref:n,style:{...i.style,display:"block"}})})});S6.displayName=w6;function une(e){return e!==null}var cne=e=>({name:"transformOrigin",options:e,fn(t){var S,j,C;const{placement:n,rects:r,middlewareData:i}=t,o=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[f,m]=j6(n),d={start:"0%",center:"50%",end:"100%"}[m],g=(((j=i.arrow)==null?void 0:j.x)??0)+l/2,v=(((C=i.arrow)==null?void 0:C.y)??0)+c/2;let b="",w="";return 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 j6(e){const[t,n="center"]=e.split("-");return[t,n]}var JN=v6,ek=x6,tk=b6,nk=S6,BS="rovingFocusGroup.onEntryFocus",fne={bubbles:!1,cancelable:!0},Cp="RovingFocusGroup",[O_,E6,dne]=TN(Cp),[hne,C0]=Wa(Cp,[dne]),[mne,pne]=hne(Cp),_6=y.forwardRef((e,t)=>h.jsx(O_.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(O_.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(gne,{...e,ref:t})})}));_6.displayName=Cp;var gne=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...d}=e,g=y.useRef(null),v=kt(t,g),b=Sp(a),[w,S]=Bl({prop:o,defaultProp:l??null,onChange:c,caller:Cp}),[j,C]=y.useState(!1),_=Tr(f),k=E6(n),O=y.useRef(!1),[A,T]=y.useState(0);return y.useEffect(()=>{const P=g.current;if(P)return P.addEventListener(BS,_),()=>P.removeEventListener(BS,_)},[_]),h.jsx(mne,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:y.useCallback(P=>S(P),[S]),onItemShiftTab:y.useCallback(()=>C(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:y.useCallback(()=>T(P=>P-1),[]),children:h.jsx(Ve.div,{tabIndex:j||A===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{O.current=!0}),onFocus:Ae(e.onFocus,P=>{const L=!O.current;if(P.target===P.currentTarget&&L&&!j){const I=new CustomEvent(BS,fne);if(P.currentTarget.dispatchEvent(I),!I.defaultPrevented){const F=k().filter(z=>z.focusable),$=F.find(z=>z.active),X=F.find(z=>z.id===w),V=[$,X,...F].filter(Boolean).map(z=>z.ref.current);k6(V,m)}}O.current=!1}),onBlur:Ae(e.onBlur,()=>C(!1))})})}),C6="RovingFocusGroupItem",N6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=br(),f=a||c,m=pne(C6,n),d=m.currentTabStopId===f,g=E6(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),h.jsx(O_.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:h.jsx(Ve.span,{tabIndex:d?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Ae(e.onMouseDown,S=>{r?m.onItemFocus(f):S.preventDefault()}),onFocus:Ae(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ae(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=xne(S,m.orientation,m.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let _=g().filter(k=>k.focusable).map(k=>k.ref.current);if(j==="last")_.reverse();else if(j==="prev"||j==="next"){j==="prev"&&_.reverse();const k=_.indexOf(S.currentTarget);_=m.loop?bne(_,k+1):_.slice(k+1)}setTimeout(()=>k6(_))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:w!=null}):o})})});N6.displayName=C6;var vne={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function xne(e,t,n){const r=yne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return vne[r]}function k6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A6=_6,O6=N6,T_=["Enter"," "],wne=["ArrowDown","PageUp","Home"],T6=["ArrowUp","PageDown","End"],Sne=[...wne,...T6],jne={ltr:[...T_,"ArrowRight"],rtl:[...T_,"ArrowLeft"]},Ene={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Np="Menu",[Lm,_ne,Cne]=TN(Np),[Nc,P6]=Wa(Np,[Cne,Ld,C0]),N0=Ld(),M6=C0(),[Nne,kc]=Nc(Np),[kne,kp]=Nc(Np),D6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=N0(t),[c,f]=y.useState(null),m=y.useRef(!1),d=Tr(a),g=Sp(i);return y.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),h.jsx(JN,{...l,children:h.jsx(Nne,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:f,children:h.jsx(kne,{scope:t,onClose:y.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:m,dir:g,modal:o,children:r})})})};D6.displayName=Np;var Ane="MenuAnchor",rk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=N0(n);return h.jsx(ek,{...i,...r,ref:t})});rk.displayName=Ane;var ik="MenuPortal",[One,R6]=Nc(ik,{forceMount:void 0}),I6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=kc(ik,t);return h.jsx(One,{scope:t,forceMount:n,children:h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:r})})})};I6.displayName=ik;var ua="MenuContent",[Tne,ak]=Nc(ua),L6=y.forwardRef((e,t)=>{const n=R6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=kp(ua,e.__scopeMenu);return h.jsx(Lm.Provider,{scope:e.__scopeMenu,children:h.jsx(qr,{present:r||a.open,children:h.jsx(Lm.Slot,{scope:e.__scopeMenu,children:o.modal?h.jsx(Pne,{...i,ref:t}):h.jsx(Mne,{...i,ref:t})})})})}),Pne=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu),r=y.useRef(null),i=kt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return IN(a)},[]),h.jsx(ok,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Mne=y.forwardRef((e,t)=>{const n=kc(ua,e.__scopeMenu);return h.jsx(ok,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Dne=rc("MenuContent.ScrollLock"),ok=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:g,onDismiss:v,disableOutsideScroll:b,...w}=e,S=kc(ua,n),j=kp(ua,n),C=N0(n),_=M6(n),k=_ne(n),[O,A]=y.useState(null),T=y.useRef(null),P=kt(t,T,S.onContentChange),L=y.useRef(0),I=y.useRef(""),F=y.useRef(0),$=y.useRef(null),X=y.useRef("right"),D=y.useRef(0),V=b?b0:y.Fragment,z=b?{as:Dne,allowPinchZoom:!0}:void 0,q=K=>{var ae,re;const R=I.current+K,H=k().filter(ee=>!ee.disabled),U=document.activeElement,B=(ae=H.find(ee=>ee.ref.current===U))==null?void 0:ae.textValue,Q=H.map(ee=>ee.textValue),Z=Kne(Q,R,B),te=(re=H.find(ee=>ee.textValue===Z))==null?void 0:re.ref.current;(function ee(se){I.current=se,window.clearTimeout(L.current),se!==""&&(L.current=window.setTimeout(()=>ee(""),1e3))})(R),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(L.current),[]),RN();const G=y.useCallback(K=>{var H,U;return X.current===((H=$.current)==null?void 0:H.side)&&Gne(K,(U=$.current)==null?void 0:U.area)},[]);return h.jsx(Tne,{scope:n,searchRef:I,onItemEnter:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),onItemLeave:y.useCallback(K=>{var R;G(K)||((R=T.current)==null||R.focus(),A(null))},[G]),onTriggerLeave:y.useCallback(K=>{G(K)&&K.preventDefault()},[G]),pointerGraceTimerRef:F,onPointerGraceIntentChange:y.useCallback(K=>{$.current=K},[]),children:h.jsx(V,{...z,children:h.jsx(y0,{asChild:!0,trapped:i,onMountAutoFocus:Ae(a,K=>{var R;K.preventDefault(),(R=T.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:g,onDismiss:v,children:h.jsx(A6,{asChild:!0,..._,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Ae(c,K=>{j.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(tk,{role:"menu","aria-orientation":"vertical","data-state":J6(S.open),"data-radix-menu-content":"",dir:j.dir,...C,...w,ref:P,style:{outline:"none",...w.style},onKeyDown:Ae(w.onKeyDown,K=>{const H=K.target.closest("[data-radix-menu-content]")===K.currentTarget,U=K.ctrlKey||K.altKey||K.metaKey,B=K.key.length===1;H&&(K.key==="Tab"&&K.preventDefault(),!U&&B&&q(K.key));const Q=T.current;if(K.target!==Q||!Sne.includes(K.key))return;K.preventDefault();const te=k().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);T6.includes(K.key)&&te.reverse(),qne(te)}),onBlur:Ae(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(L.current),I.current="")}),onPointerMove:Ae(e.onPointerMove,zm(K=>{const R=K.target,H=D.current!==K.clientX;if(K.currentTarget.contains(R)&&H){const U=K.clientX>D.current?"right":"left";X.current=U,D.current=K.clientX}}))})})})})})})});L6.displayName=ua;var Rne="MenuGroup",sk=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{role:"group",...r,ref:t})});sk.displayName=Rne;var Ine="MenuLabel",z6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{...r,ref:t})});z6.displayName=Ine;var Xy="MenuItem",lR="menu.itemSelect",k0=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=kp(Xy,e.__scopeMenu),l=ak(Xy,e.__scopeMenu),c=kt(t,a),f=y.useRef(!1),m=()=>{const d=a.current;if(!n&&d){const g=new CustomEvent(lR,{bubbles:!0,cancelable:!0});d.addEventListener(lR,v=>r==null?void 0:r(v),{once:!0}),SB(d,g),g.defaultPrevented?f.current=!1:o.onClose()}};return h.jsx($6,{...i,ref:c,disabled:n,onClick:Ae(e.onClick,m),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===" "||T_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});k0.displayName=Xy;var $6=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ak(Xy,n),l=M6(n),c=y.useRef(null),f=kt(t,c),[m,d]=y.useState(!1),[g,v]=y.useState("");return y.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),h.jsx(Lm.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:h.jsx(O6,{asChild:!0,...l,focusable:!r,children:h.jsx(Ve.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:Ae(e.onPointerMove,zm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,zm(b=>o.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>d(!0)),onBlur:Ae(e.onBlur,()=>d(!1))})})})}),Lne="MenuCheckboxItem",B6=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(V6,{scope:e.__scopeMenu,checked:n,children:h.jsx(k0,{role:"menuitemcheckbox","aria-checked":Wy(n)?"mixed":n,...i,ref:t,"data-state":uk(n),onSelect:Ae(i.onSelect,()=>r==null?void 0:r(Wy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});B6.displayName=Lne;var F6="MenuRadioGroup",[zne,$ne]=Nc(F6,{value:void 0,onValueChange:()=>{}}),U6=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Tr(r);return h.jsx(zne,{scope:e.__scopeMenu,value:n,onValueChange:a,children:h.jsx(sk,{...i,ref:t})})});U6.displayName=F6;var H6="MenuRadioItem",q6=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=$ne(H6,e.__scopeMenu),a=n===i.value;return h.jsx(V6,{scope:e.__scopeMenu,checked:a,children:h.jsx(k0,{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})})})});q6.displayName=H6;var lk="MenuItemIndicator",[V6,Bne]=Nc(lk,{checked:!1}),K6=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=Bne(lk,n);return h.jsx(qr,{present:r||Wy(a.checked)||a.checked===!0,children:h.jsx(Ve.span,{...i,ref:t,"data-state":uk(a.checked)})})});K6.displayName=lk;var Fne="MenuSeparator",Y6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Y6.displayName=Fne;var Une="MenuArrow",G6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=N0(n);return h.jsx(nk,{...i,...r,ref:t})});G6.displayName=Une;var Hne="MenuSub",[J5e,X6]=Nc(Hne),gm="MenuSubTrigger",W6=y.forwardRef((e,t)=>{const n=kc(gm,e.__scopeMenu),r=kp(gm,e.__scopeMenu),i=X6(gm,e.__scopeMenu),a=ak(gm,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),h.jsx(rk,{asChild:!0,...f,children:h.jsx($6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":J6(n.open),...e,ref:gs(t,i.onTriggerChange),onClick:d=>{var g;(g=e.onClick)==null||g.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,zm(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ae(e.onPointerLeave,zm(d=>{var v,b;m();const g=(v=n.content)==null?void 0:v.getBoundingClientRect();if(g){const w=(b=n.content)==null?void 0:b.dataset.side,S=w==="right",j=S?-5:5,C=g[S?"left":"right"],_=g[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+j,y:d.clientY},{x:C,y:g.top},{x:_,y:g.top},{x:_,y:g.bottom},{x:C,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,d=>{var v;const g=a.searchRef.current!=="";e.disabled||g&&d.key===" "||jne[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});W6.displayName=gm;var Q6="MenuSubContent",Z6=y.forwardRef((e,t)=>{const n=R6(ua,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=kc(ua,e.__scopeMenu),o=kp(ua,e.__scopeMenu),l=X6(Q6,e.__scopeMenu),c=y.useRef(null),f=kt(t,c);return h.jsx(Lm.Provider,{scope:e.__scopeMenu,children:h.jsx(qr,{present:r||a.open,children:h.jsx(Lm.Slot,{scope:e.__scopeMenu,children:h.jsx(ok,{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:m=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,m=>{m.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,m=>{o.onClose(),m.preventDefault()}),onKeyDown:Ae(e.onKeyDown,m=>{var v;const d=m.currentTarget.contains(m.target),g=Ene[o.dir].includes(m.key);d&&g&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),m.preventDefault())})})})})})});Z6.displayName=Q6;function J6(e){return e?"open":"closed"}function Wy(e){return e==="indeterminate"}function uk(e){return Wy(e)?"indeterminate":e?"checked":"unchecked"}function qne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Vne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Kne(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=Vne(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 Yne(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,m=l.y,d=c.x,g=c.y;m>r!=g>r&&n<(d-f)*(r-m)/(g-m)+f&&(i=!i)}return i}function Gne(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Yne(n,t)}function zm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Xne=D6,Wne=rk,Qne=I6,Zne=L6,Jne=sk,ere=z6,tre=k0,nre=B6,rre=U6,ire=q6,are=K6,ore=Y6,sre=G6,lre=W6,ure=Z6,A0="DropdownMenu",[cre]=Wa(A0,[P6]),ii=P6(),[fre,e8]=cre(A0),t8=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=ii(t),f=y.useRef(null),[m,d]=Bl({prop:i,defaultProp:a??!1,onChange:o,caller:A0});return h.jsx(fre,{scope:t,triggerId:br(),triggerRef:f,contentId:br(),open:m,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(g=>!g),[d]),modal:l,children:h.jsx(Xne,{...c,open:m,onOpenChange:d,dir:r,modal:l,children:n})})};t8.displayName=A0;var n8="DropdownMenuTrigger",r8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=e8(n8,n),o=ii(n);return h.jsx(Wne,{asChild:!0,...o,children:h.jsx(Ve.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:gs(t,a.triggerRef),onPointerDown: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())})})})});r8.displayName=n8;var dre="DropdownMenuPortal",i8=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ii(t);return h.jsx(Qne,{...r,...n})};i8.displayName=dre;var a8="DropdownMenuContent",o8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=e8(a8,n),a=ii(n),o=y.useRef(!1);return h.jsx(Zne,{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,m=c.button===2||f;(!i.modal||m)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});o8.displayName=a8;var hre="DropdownMenuGroup",mre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(Jne,{...i,...r,ref:t})});mre.displayName=hre;var pre="DropdownMenuLabel",gre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ere,{...i,...r,ref:t})});gre.displayName=pre;var vre="DropdownMenuItem",s8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(tre,{...i,...r,ref:t})});s8.displayName=vre;var yre="DropdownMenuCheckboxItem",l8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(nre,{...i,...r,ref:t})});l8.displayName=yre;var xre="DropdownMenuRadioGroup",bre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(rre,{...i,...r,ref:t})});bre.displayName=xre;var wre="DropdownMenuRadioItem",Sre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ire,{...i,...r,ref:t})});Sre.displayName=wre;var jre="DropdownMenuItemIndicator",u8=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(are,{...i,...r,ref:t})});u8.displayName=jre;var Ere="DropdownMenuSeparator",_re=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ore,{...i,...r,ref:t})});_re.displayName=Ere;var Cre="DropdownMenuArrow",Nre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(sre,{...i,...r,ref:t})});Nre.displayName=Cre;var kre="DropdownMenuSubTrigger",Are=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(lre,{...i,...r,ref:t})});Are.displayName=kre;var Ore="DropdownMenuSubContent",Tre=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ii(n);return h.jsx(ure,{...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=Ore;var Pre=t8,Mre=r8,Dre=i8,Rre=o8,Ire=s8,Lre=l8,zre=u8,$re="Label",c8=y.forwardRef((e,t)=>h.jsx(Ve.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));c8.displayName=$re;var Bre=c8;function P_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Fre(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ck="ScrollArea",[f8]=Wa(ck),[Ure,ja]=f8(ck),d8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=y.useState(null),[f,m]=y.useState(null),[d,g]=y.useState(null),[v,b]=y.useState(null),[w,S]=y.useState(null),[j,C]=y.useState(0),[_,k]=y.useState(0),[O,A]=y.useState(!1),[T,P]=y.useState(!1),L=kt(t,F=>c(F)),I=Sp(i);return h.jsx(Ure,{scope:n,type:r,dir:I,scrollHideDelay:a,scrollArea:l,viewport:f,onViewportChange:m,content:d,onContentChange:g,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:C,onCornerHeightChange:k,children:h.jsx(Ve.div,{dir:I,...o,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});d8.displayName=ck;var h8="ScrollAreaViewport",m8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=ja(h8,n),l=y.useRef(null),c=kt(t,l,o.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),h.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});m8.displayName=h8;var To="ScrollAreaScrollbar",p8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ja(To,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return y.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?h.jsx(Hre,{...r,ref:t,forceMount:n}):i.type==="scroll"?h.jsx(qre,{...r,ref:t,forceMount:n}):i.type==="auto"?h.jsx(g8,{...r,ref:t,forceMount:n}):i.type==="always"?h.jsx(fk,{...r,ref:t}):null});p8.displayName=To;var Hre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ja(To,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const f=()=>{window.clearTimeout(c),o(!0)},m=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(qr,{present:n||a,children:h.jsx(g8,{"data-state":a?"visible":"hidden",...r,ref:t})})}),qre=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ja(To,e.__scopeScrollArea),a=e.orientation==="horizontal",o=T0(()=>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 y.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,c]),y.useEffect(()=>{const f=i.viewport,m=a?"scrollLeft":"scrollTop";if(f){let d=f[m];const g=()=>{const v=f[m];d!==v&&(c("SCROLL"),o()),d=v};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,a,c,o]),h.jsx(qr,{present:n||l!=="hidden",children:h.jsx(fk,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),g8=y.forwardRef((e,t)=>{const n=ja(To,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=T0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?f:m)}},10);return ud(n.viewport,c),ud(n.content,c),h.jsx(qr,{present:r||a,children:h.jsx(fk,{"data-state":a?"visible":"hidden",...i,ref:t})})}),fk=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ja(To,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[l,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=w8(l.viewport,l.content),m={...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 Wre(g,o.current,l,v)}return n==="horizontal"?h.jsx(Vre,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollLeft,v=uR(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"?h.jsx(Kre,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const g=i.viewport.scrollTop,v=uR(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}),Vre=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ja(To,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),f=kt(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),h.jsx(y8,{"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":O0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),j8(g,d)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Zy(o.paddingLeft),paddingEnd:Zy(o.paddingRight)}})}})}),Kre=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=ja(To,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),f=kt(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),h.jsx(y8,{"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":O0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(a.viewport){const g=a.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),j8(g,d)&&m.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Zy(o.paddingTop),paddingEnd:Zy(o.paddingBottom)}})}})}),[Yre,v8]=f8(To),y8=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:f,onWheelScroll:m,onResize:d,...g}=e,v=ja(To,n),[b,w]=y.useState(null),S=kt(t,L=>w(L)),j=y.useRef(null),C=y.useRef(""),_=v.viewport,k=r.content-r.viewport,O=Tr(m),A=Tr(c),T=T0(d,10);function P(L){if(j.current){const I=L.clientX-j.current.left,F=L.clientY-j.current.top;f({x:I,y:F})}}return y.useEffect(()=>{const L=I=>{const F=I.target;(b==null?void 0:b.contains(F))&&O(I,k)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[_,b,k,O]),y.useEffect(A,[r,A]),ud(b,T),ud(v.content,T),h.jsx(Yre,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Tr(a),onThumbPointerUp:Tr(o),onThumbPositionChange:A,onThumbPointerDown:Tr(l),children:h.jsx(Ve.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:Ae(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),j.current=b.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),P(L))}),onPointerMove:Ae(e.onPointerMove,P),onPointerUp:Ae(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),Qy="ScrollAreaThumb",x8=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=v8(Qy,e.__scopeScrollArea);return h.jsx(qr,{present:n||i.hasThumb,children:h.jsx(Gre,{ref:t,...r})})}),Gre=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=ja(Qy,n),o=v8(Qy,n),{onThumbPositionChange:l}=o,c=kt(t,d=>o.onThumbChange(d)),f=y.useRef(void 0),m=T0(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const d=a.viewport;if(d){const g=()=>{if(m(),!f.current){const v=Qre(d,l);f.current=v,l()}};return l(),d.addEventListener("scroll",g),()=>d.removeEventListener("scroll",g)}},[a.viewport,m,l]),h.jsx(Ve.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture: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)})});x8.displayName=Qy;var dk="ScrollAreaCorner",b8=y.forwardRef((e,t)=>{const n=ja(dk,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(Xre,{...e,ref:t}):null});b8.displayName=dk;var Xre=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ja(dk,n),[a,o]=y.useState(0),[l,c]=y.useState(0),f=!!(a&&l);return ud(i.scrollbarX,()=>{var d;const m=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(m),c(m)}),ud(i.scrollbarY,()=>{var d;const m=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(m),o(m)}),f?h.jsx(Ve.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zy(e){return e?parseInt(e,10):0}function w8(e,t){const n=e/t;return isNaN(n)?0:n}function O0(e){const t=w8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Wre(e,t,n,r="ltr"){const i=O0(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,d=r==="ltr"?[0,m]:[m*-1,0];return S8([c,f],d)(e)}function uR(e,t,n="ltr"){const r=O0(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=P_(e,c);return S8([0,o],[0,l])(f)}function S8(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 j8(e,t){return e>0&&e<t}var Qre=(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 T0(e,t){const n=Tr(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ud(e,t){const n=Tr(t);wr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Zre=d8,Jre=m8,eie=b8,tie=[" ","Enter","ArrowUp","ArrowDown"],nie=[" ","Enter"],oc="Select",[P0,M0,rie]=TN(oc),[zd]=Wa(oc,[rie,Ld]),D0=Ld(),[iie,Wl]=zd(oc),[aie,oie]=zd(oc),E8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:f,name:m,autoComplete:d,disabled:g,required:v,form:b}=e,w=D0(t),[S,j]=y.useState(null),[C,_]=y.useState(null),[k,O]=y.useState(!1),A=Sp(f),[T,P]=Bl({prop:r,defaultProp:i??!1,onChange:a,caller:oc}),[L,I]=Bl({prop:o,defaultProp:l,onChange:c,caller:oc}),F=y.useRef(null),$=S?b||!!S.closest("form"):!0,[X,D]=y.useState(new Set),V=Array.from(X).map(z=>z.props.value).join(";");return h.jsx(JN,{...w,children:h.jsxs(iie,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:C,onValueNodeChange:_,valueNodeHasChildren:k,onValueNodeHasChildrenChange:O,contentId:br(),value:L,onValueChange:I,open:T,onOpenChange:P,dir:A,triggerPointerDownPosRef:F,disabled:g,children:[h.jsx(P0.Provider,{scope:t,children:h.jsx(aie,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(z=>{D(q=>new Set(q).add(z))},[]),onNativeOptionRemove:y.useCallback(z=>{D(q=>{const G=new Set(q);return G.delete(z),G})},[]),children:n})}),$?h.jsxs(K8,{"aria-hidden":!0,required:v,tabIndex:-1,name:m,autoComplete:d,value:L,onChange:z=>I(z.target.value),disabled:g,form:b,children:[L===void 0?h.jsx("option",{value:""}):null,Array.from(X)]},V):null]})})};E8.displayName=oc;var _8="SelectTrigger",C8=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=D0(n),o=Wl(_8,n),l=o.disabled||r,c=kt(t,o.onTriggerChange),f=M0(n),m=y.useRef("touch"),[d,g,v]=G8(w=>{const S=f().filter(_=>!_.disabled),j=S.find(_=>_.value===o.value),C=X8(S,w,j);C!==void 0&&o.onValueChange(C.value)}),b=w=>{l||(o.onOpenChange(!0),v()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return h.jsx(ek,{asChild:!0,...a,children:h.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Y8(o.value)?"":void 0,...i,ref:c,onClick:Ae(i.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:Ae(i.onPointerDown,w=>{m.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:Ae(i.onKeyDown,w=>{const S=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(S&&w.key===" ")&&tie.includes(w.key)&&(b(),w.preventDefault())})})})});C8.displayName=_8;var N8="SelectValue",k8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Wl(N8,n),{onValueNodeHasChildrenChange:f}=c,m=a!==void 0,d=kt(t,c.onValueNodeChange);return wr(()=>{f(m)},[f,m]),h.jsx(Ve.span,{...l,ref:d,style:{pointerEvents:"none"},children:Y8(c.value)?h.jsx(h.Fragment,{children:o}):a})});k8.displayName=N8;var sie="SelectIcon",A8=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return h.jsx(Ve.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});A8.displayName=sie;var lie="SelectPortal",O8=e=>h.jsx(Ep,{asChild:!0,...e});O8.displayName=lie;var sc="SelectContent",T8=y.forwardRef((e,t)=>{const n=Wl(sc,e.__scopeSelect),[r,i]=y.useState();if(wr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Xl.createPortal(h.jsx(P8,{scope:e.__scopeSelect,children:h.jsx(P0.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),a):null}return h.jsx(M8,{...e,ref:t})});T8.displayName=sc;var Ia=10,[P8,Ql]=zd(sc),uie="SelectContentImpl",cie=rc("SelectContent.RemoveScroll"),M8=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:d,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...j}=e,C=Wl(sc,n),[_,k]=y.useState(null),[O,A]=y.useState(null),T=kt(t,ae=>k(ae)),[P,L]=y.useState(null),[I,F]=y.useState(null),$=M0(n),[X,D]=y.useState(!1),V=y.useRef(!1);y.useEffect(()=>{if(_)return IN(_)},[_]),RN();const z=y.useCallback(ae=>{const[re,...ee]=$().map(ie=>ie.ref.current),[se]=ee.slice(-1),ge=document.activeElement;for(const ie of ae)if(ie===ge||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===re&&O&&(O.scrollTop=0),ie===se&&O&&(O.scrollTop=O.scrollHeight),ie==null||ie.focus(),document.activeElement!==ge))return},[$,O]),q=y.useCallback(()=>z([P,_]),[z,P,_]);y.useEffect(()=>{X&&q()},[X,q]);const{onOpenChange:G,triggerPointerDownPosRef:K}=C;y.useEffect(()=>{if(_){let ae={x:0,y:0};const re=se=>{var ge,ie;ae={x:Math.abs(Math.round(se.pageX)-(((ge=K.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=K.current)==null?void 0:ie.y)??0))}},ee=se=>{ae.x<=10&&ae.y<=10?se.preventDefault():_.contains(se.target)||G(!1),document.removeEventListener("pointermove",re),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[_,G,K]),y.useEffect(()=>{const ae=()=>G(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[G]);const[R,H]=G8(ae=>{const re=$().filter(ge=>!ge.disabled),ee=re.find(ge=>ge.ref.current===document.activeElement),se=X8(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),U=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&(L(ae),se&&(V.current=!0))},[C.value]),B=y.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=y.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(C.value!==void 0&&C.value===re||se)&&F(ae)},[C.value]),Z=r==="popper"?M_:D8,te=Z===M_?{side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:d,collisionBoundary:g,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return h.jsx(P8,{scope:n,content:_,viewport:O,onViewportChange:A,itemRefCallback:U,selectedItem:P,onItemLeave:B,itemTextRefCallback:Q,focusSelectedItem:q,selectedItemText:I,position:r,isPositioned:X,searchRef:R,children:h.jsx(b0,{as:cie,allowPinchZoom:!0,children:h.jsx(y0,{asChild:!0,trapped:C.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ae(i,ae=>{var re;(re=C.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:h.jsx(Z,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ae=>ae.preventDefault(),...j,...te,onPlaced:()=>D(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(j.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let se=$().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const ge=ae.target,ie=se.indexOf(ge);se=se.slice(ie+1)}setTimeout(()=>z(se)),ae.preventDefault()}})})})})})})});M8.displayName=uie;var fie="SelectItemAlignedPosition",D8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Wl(sc,n),o=Ql(sc,n),[l,c]=y.useState(null),[f,m]=y.useState(null),d=kt(t,T=>m(T)),g=M0(n),v=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:j,focusSelectedItem:C}=o,_=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&w&&S&&j){const T=a.trigger.getBoundingClientRect(),P=f.getBoundingClientRect(),L=a.valueNode.getBoundingClientRect(),I=j.getBoundingClientRect();if(a.dir!=="rtl"){const ge=I.left-P.left,ie=L.left-ge,Se=T.left-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),ke=window.innerWidth-Ia,it=P_(ie,[Ia,Math.max(Ia,ke-He)]);l.style.minWidth=Ee+"px",l.style.left=it+"px"}else{const ge=P.right-I.right,ie=window.innerWidth-L.right-ge,Se=window.innerWidth-T.right-ie,Ee=T.width+Se,He=Math.max(Ee,P.width),ke=window.innerWidth-Ia,it=P_(ie,[Ia,Math.max(Ia,ke-He)]);l.style.minWidth=Ee+"px",l.style.right=it+"px"}const F=g(),$=window.innerHeight-Ia*2,X=w.scrollHeight,D=window.getComputedStyle(f),V=parseInt(D.borderTopWidth,10),z=parseInt(D.paddingTop,10),q=parseInt(D.borderBottomWidth,10),G=parseInt(D.paddingBottom,10),K=V+z+X+G+q,R=Math.min(S.offsetHeight*5,K),H=window.getComputedStyle(w),U=parseInt(H.paddingTop,10),B=parseInt(H.paddingBottom,10),Q=T.top+T.height/2-Ia,Z=$-Q,te=S.offsetHeight/2,ae=S.offsetTop+te,re=V+z+ae,ee=K-re;if(re<=Q){const ge=F.length>0&&S===F[F.length-1].ref.current;l.style.bottom="0px";const ie=f.clientHeight-w.offsetTop-w.offsetHeight,Se=Math.max(Z,te+(ge?B:0)+ie+q),Ee=re+Se;l.style.height=Ee+"px"}else{const ge=F.length>0&&S===F[0].ref.current;l.style.top="0px";const Se=Math.max(Q,V+w.offsetTop+(ge?U:0)+te)+ee;l.style.height=Se+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${Ia}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[g,a.trigger,a.valueNode,l,f,w,S,j,a.dir,r]);wr(()=>_(),[_]);const[k,O]=y.useState();wr(()=>{f&&O(window.getComputedStyle(f).zIndex)},[f]);const A=y.useCallback(T=>{T&&b.current===!0&&(_(),C==null||C(),b.current=!1)},[_,C]);return h.jsx(hie,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:h.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:h.jsx(Ve.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});D8.displayName=fie;var die="SelectPopperPosition",M_=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ia,...a}=e,o=D0(n);return h.jsx(tk,{...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)"}})});M_.displayName=die;var[hie,hk]=zd(sc,{}),D_="SelectViewport",R8=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Ql(D_,n),o=hk(D_,n),l=kt(t,a.onViewportChange),c=y.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(P0.Slot,{scope:n,children:h.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ae(i.onScroll,f=>{const m=f.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=o;if(g!=null&&g.current&&d){const v=Math.abs(c.current-m.scrollTop);if(v>0){const b=window.innerHeight-Ia*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),j=Math.max(w,S);if(j<b){const C=j+v,_=Math.min(b,C),k=C-_;d.style.height=_+"px",d.style.bottom==="0px"&&(m.scrollTop=k>0?k:0,d.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});R8.displayName=D_;var I8="SelectGroup",[mie,pie]=zd(I8),gie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=br();return h.jsx(mie,{scope:n,id:i,children:h.jsx(Ve.div,{role:"group","aria-labelledby":i,...r,ref:t})})});gie.displayName=I8;var L8="SelectLabel",vie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pie(L8,n);return h.jsx(Ve.div,{id:i.id,...r,ref:t})});vie.displayName=L8;var Jy="SelectItem",[yie,z8]=zd(Jy),$8=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Wl(Jy,n),c=Ql(Jy,n),f=l.value===r,[m,d]=y.useState(a??""),[g,v]=y.useState(!1),b=kt(t,C=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,C,r,i)}),w=br(),S=y.useRef("touch"),j=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(yie,{scope:n,value:r,disabled:i,textId:w,isSelected:f,onItemTextChange:y.useCallback(C=>{d(_=>_||((C==null?void 0:C.textContent)??"").trim())},[]),children:h.jsx(P0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:h.jsx(Ve.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:Ae(o.onFocus,()=>v(!0)),onBlur:Ae(o.onBlur,()=>v(!1)),onClick:Ae(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Ae(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Ae(o.onPointerDown,C=>{S.current=C.pointerType}),onPointerMove:Ae(o.onPointerMove,C=>{var _;S.current=C.pointerType,i?(_=c.onItemLeave)==null||_.call(c):S.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,C=>{var _;C.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:Ae(o.onKeyDown,C=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(nie.includes(C.key)&&j(),C.key===" "&&C.preventDefault())})})})})});$8.displayName=Jy;var vm="SelectItemText",B8=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Wl(vm,n),l=Ql(vm,n),c=z8(vm,n),f=oie(vm,n),[m,d]=y.useState(null),g=kt(t,j=>d(j),c.onItemTextChange,j=>{var C;return(C=l.itemTextRefCallback)==null?void 0:C.call(l,j,c.value,c.disabled)}),v=m==null?void 0:m.textContent,b=y.useMemo(()=>h.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=f;return wr(()=>(w(b),()=>S(b)),[w,S,b]),h.jsxs(h.Fragment,{children:[h.jsx(Ve.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Xl.createPortal(a.children,o.valueNode):null]})});B8.displayName=vm;var F8="SelectItemIndicator",U8=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return z8(F8,n).isSelected?h.jsx(Ve.span,{"aria-hidden":!0,...r,ref:t}):null});U8.displayName=F8;var R_="SelectScrollUpButton",H8=y.forwardRef((e,t)=>{const n=Ql(R_,e.__scopeSelect),r=hk(R_,e.__scopeSelect),[i,a]=y.useState(!1),o=kt(t,r.onScrollButtonChange);return wr(()=>{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?h.jsx(V8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});H8.displayName=R_;var I_="SelectScrollDownButton",q8=y.forwardRef((e,t)=>{const n=Ql(I_,e.__scopeSelect),r=hk(I_,e.__scopeSelect),[i,a]=y.useState(!1),o=kt(t,r.onScrollButtonChange);return wr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<f;a(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?h.jsx(V8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});q8.displayName=I_;var V8=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Ql("SelectScrollButton",n),o=y.useRef(null),l=M0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),wr(()=>{var m;const f=l().find(d=>d.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),h.jsx(Ve.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ae(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(i.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(i.onPointerLeave,()=>{c()})})}),xie="SelectSeparator",bie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(Ve.div,{"aria-hidden":!0,...r,ref:t})});bie.displayName=xie;var L_="SelectArrow",wie=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=D0(n),a=Wl(L_,n),o=Ql(L_,n);return a.open&&o.position==="popper"?h.jsx(nk,{...i,...r,ref:t}):null});wie.displayName=L_;var Sie="SelectBubbleInput",K8=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=kt(r,i),o=Qee(t);return y.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&m){const d=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(d)}},[o,t]),h.jsx(Ve.select,{...n,style:{...jB,...n.style},ref:a,defaultValue:t})});K8.displayName=Sie;function Y8(e){return e===""||e===void 0}function G8(e){const t=Tr(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const l=n.current+o;t(l),(function c(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function X8(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=jie(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 jie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Eie=E8,_ie=C8,Cie=k8,Nie=A8,kie=O8,Aie=T8,Oie=R8,Tie=$8,Pie=B8,Mie=U8,Die=H8,Rie=q8,Iie="Separator",cR="horizontal",Lie=["horizontal","vertical"],W8=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=cR,...i}=e,a=zie(r)?r:cR,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return h.jsx(Ve.div,{"data-orientation":a,...l,...i,ref:t})});W8.displayName=Iie;function zie(e){return Lie.includes(e)}var $ie=W8,R0="Tabs",[Bie]=Wa(R0,[C0]),Q8=C0(),[Fie,mk]=Bie(R0),Z8=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...f}=e,m=Sp(l),[d,g]=Bl({prop:r,onChange:i,defaultProp:a??"",caller:R0});return h.jsx(Fie,{scope:n,baseId:br(),value:d,onValueChange:g,orientation:o,dir:m,activationMode:c,children:h.jsx(Ve.div,{dir:m,"data-orientation":o,...f,ref:t})})});Z8.displayName=R0;var J8="TabsList",eF=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=mk(J8,n),o=Q8(n);return h.jsx(A6,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:h.jsx(Ve.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});eF.displayName=J8;var tF="TabsTrigger",nF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=mk(tF,n),l=Q8(n),c=aF(o.baseId,r),f=oF(o.baseId,r),m=r===o.value;return h.jsx(O6,{asChild:!0,...l,focusable:!i,active:m,children:h.jsx(Ve.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"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";!m&&!i&&d&&o.onValueChange(r)})})})});nF.displayName=tF;var rF="TabsContent",iF=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=mk(rF,n),c=aF(l.baseId,r),f=oF(l.baseId,r),m=r===l.value,d=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(g)},[]),h.jsx(qr,{present:i||m,children:({present:g})=>h.jsx(Ve.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:g&&a})})});iF.displayName=rF;function aF(e,t){return`${e}-trigger-${t}`}function oF(e,t){return`${e}-content-${t}`}var Uie=Z8,Hie=eF,qie=nF,Vie=iF,[I0]=Wa("Tooltip",[Ld]),L0=Ld(),sF="TooltipProvider",Kie=700,z_="tooltip.open",[Yie,pk]=I0(sF),lF=e=>{const{__scopeTooltip:t,delayDuration:n=Kie,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),l=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),h.jsx(Yie,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:y.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:a})};lF.displayName=sF;var $m="Tooltip",[Gie,Ap]=I0($m),uF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=pk($m,e.__scopeTooltip),f=L0(t),[m,d]=y.useState(null),g=br(),v=y.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=y.useRef(!1),[j,C]=Bl({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(z_))):c.onClose(),a==null||a(T)},caller:$m}),_=y.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),k=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,C(!0)},[C]),O=y.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C(!1)},[C]),A=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,C(!0),v.current=0},w)},[w,C]);return y.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),h.jsx(JN,{...f,children:h.jsx(Gie,{scope:t,contentId:g,open:j,stateAttribute:_,trigger:m,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?A():k()},[c.isOpenDelayedRef,A,k]),onTriggerLeave:y.useCallback(()=>{b?O():(window.clearTimeout(v.current),v.current=0)},[O,b]),onOpen:k,onClose:O,disableHoverableContent:b,children:n})})};uF.displayName=$m;var $_="TooltipTrigger",cF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ap($_,n),a=pk($_,n),o=L0(n),l=y.useRef(null),c=kt(t,l,i.onTriggerChange),f=y.useRef(!1),m=y.useRef(!1),d=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(ek,{asChild:!0,...o,children:h.jsx(Ve.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{i.onTriggerLeave(),m.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)})})});cF.displayName=$_;var gk="TooltipPortal",[Xie,Wie]=I0(gk,{forceMount:void 0}),fF=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ap(gk,t);return h.jsx(Xie,{scope:t,forceMount:n,children:h.jsx(qr,{present:n||a.open,children:h.jsx(Ep,{asChild:!0,container:i,children:r})})})};fF.displayName=gk;var cd="TooltipContent",dF=y.forwardRef((e,t)=>{const n=Wie(cd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=Ap(cd,e.__scopeTooltip);return h.jsx(qr,{present:r||o.open,children:o.disableHoverableContent?h.jsx(hF,{side:i,...a,ref:t}):h.jsx(Qie,{side:i,...a,ref:t})})}),Qie=y.forwardRef((e,t)=>{const n=Ap(cd,e.__scopeTooltip),r=pk(cd,e.__scopeTooltip),i=y.useRef(null),a=kt(t,i),[o,l]=y.useState(null),{trigger:c,onClose:f}=n,m=i.current,{onPointerInTransitChange:d}=r,g=y.useCallback(()=>{l(null),d(!1)},[d]),v=y.useCallback((b,w)=>{const S=b.currentTarget,j={x:b.clientX,y:b.clientY},C=tae(j,S.getBoundingClientRect()),_=nae(j,C),k=rae(w.getBoundingClientRect()),O=aae([..._,...k]);l(O),d(!0)},[d]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(c&&m){const b=S=>v(S,m),w=S=>v(S,c);return c.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[c,m,v,g]),y.useEffect(()=>{if(o){const b=w=>{const S=w.target,j={x:w.clientX,y:w.clientY},C=(c==null?void 0:c.contains(S))||(m==null?void 0:m.contains(S)),_=!iae(j,o);C?g():_&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,m,o,f,g]),h.jsx(hF,{...e,ref:a})}),[Zie,Jie]=I0($m,{isInside:!1}),eae=gJ("TooltipContent"),hF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=Ap(cd,n),f=L0(n),{onClose:m}=c;return y.useEffect(()=>(document.addEventListener(z_,m),()=>document.removeEventListener(z_,m)),[m]),y.useEffect(()=>{if(c.trigger){const d=g=>{const v=g.target;v!=null&&v.contains(c.trigger)&&m()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,m]),h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:m,children:h.jsxs(tk,{"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:[h.jsx(eae,{children:r}),h.jsx(Zie,{scope:n,isInside:!0,children:h.jsx(SJ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});dF.displayName=cd;var mF="TooltipArrow",pF=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=L0(n);return Jie(mF,n).isInside?null:h.jsx(nk,{...i,...r,ref:t})});pF.displayName=mF;function tae(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 nae(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 rae(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 iae(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,m=l.y,d=c.x,g=c.y;m>r!=g>r&&n<(d-f)*(r-m)/(g-m)+f&&(i=!i)}return i}function aae(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),oae(t)}function oae(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 sae=lF,lae=uF,uae=cF,cae=fF,fae=dF,dae=pF;function gF(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=gF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=gF(e))&&(r&&(r+=" "),r+=t);return r}const hae=(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},mae=(e,t)=>({classGroupId:e,validator:t}),vF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ex="-",fR=[],pae="arbitrary..",gae=e=>{const t=yae(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return vae(o);const l=o.split(ex),c=l[0]===""&&l.length>1?1:0;return yF(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],f=n[o];return c?f?hae(f,c):c:f||fR}return n[o]||fR}}},yF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=yF(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const l=t===0?e.join(ex):e.slice(t).join(ex),c=o.length;for(let f=0;f<c;f++){const m=o[f];if(m.validator(l))return m.classGroupId}},vae=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?pae+r:void 0})(),yae=e=>{const{theme:t,classGroups:n}=e;return xae(n,t)},xae=(e,t)=>{const n=vF();for(const r in e){const i=e[r];vk(i,n,r,t)}return n},vk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];bae(o,t,n,r)}},bae=(e,t,n,r)=>{if(typeof e=="string"){wae(e,t,n);return}if(typeof e=="function"){Sae(e,t,n,r);return}jae(e,t,n,r)},wae=(e,t,n)=>{const r=e===""?t:xF(t,e);r.classGroupId=n},Sae=(e,t,n,r)=>{if(Eae(e)){vk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mae(n,e))},jae=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];vk(c,xF(t,l),n,r)}},xF=(e,t)=>{let n=e;const r=t.split(ex),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=vF(),n.nextPart.set(o,l)),n=l}return n},Eae=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_ae=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)}}},B_="!",dR=":",Cae=[],hR=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Nae=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,c=0,f;const m=i.length;for(let w=0;w<m;w++){const S=i[w];if(o===0&&l===0){if(S===dR){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(B_)?(g=d.slice(0,-1),v=!0):d.startsWith(B_)&&(g=d.slice(1),v=!0);const b=f&&f>c?f-c:void 0;return hR(a,v,g,b)};if(t){const i=t+dR,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):hR(Cae,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},kae=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}},Aae=e=>({cache:_ae(e.cacheSize),parseClassName:Nae(e),sortModifiers:kae(e),...gae(e)}),Oae=/\s+/,Tae=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(Oae);let c="";for(let f=l.length-1;f>=0;f-=1){const m=l[f],{isExternal:d,modifiers:g,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(d){c=m+(c.length>0?" "+c:c);continue}let S=!!w,j=r(S?b.substring(0,w):b);if(!j){if(!S){c=m+(c.length>0?" "+c:c);continue}if(j=r(b),!j){c=m+(c.length>0?" "+c:c);continue}S=!1}const C=g.length===0?"":g.length===1?g[0]:a(g).join(":"),_=v?C+B_:C,k=_+j;if(o.indexOf(k)>-1)continue;o.push(k);const O=i(j,S);for(let A=0;A<O.length;++A){const T=O[A];o.push(_+T)}c=m+(c.length>0?" "+c:c)}return c},Pae=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=bF(n))&&(i&&(i+=" "),i+=r);return i},bF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bF(e[r]))&&(n&&(n+=" "),n+=t);return n},Mae=(e,...t)=>{let n,r,i,a;const o=c=>{const f=t.reduce((m,d)=>d(m),e());return n=Aae(f),r=n.cache.get,i=n.cache.set,a=l,l(c)},l=c=>{const f=r(c);if(f)return f;const m=Tae(c,n);return i(c,m),m};return a=o,(...c)=>a(Pae(...c))},Dae=[],nr=e=>{const t=n=>n[e]||Dae;return t.isThemeGetter=!0,t},wF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,SF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rae=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Iae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lae=/\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$/,zae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$ae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=e=>Rae.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),hl=e=>!!e&&Number.isInteger(Number(e)),FS=e=>e.endsWith("%")&&yt(e.slice(0,-1)),Jo=e=>Iae.test(e),jF=()=>!0,Fae=e=>Lae.test(e)&&!zae.test(e),yk=()=>!1,Uae=e=>$ae.test(e),Hae=e=>Bae.test(e),qae=e=>!Be(e)&&!Ue(e),Vae=e=>Zl(e,CF,yk),Be=e=>wF.test(e),Eu=e=>Zl(e,NF,Fae),mR=e=>Zl(e,Jae,yt),Kae=e=>Zl(e,AF,jF),Yae=e=>Zl(e,kF,yk),pR=e=>Zl(e,EF,yk),Gae=e=>Zl(e,_F,Hae),Yv=e=>Zl(e,OF,Uae),Ue=e=>SF.test(e),Kh=e=>Ac(e,NF),Xae=e=>Ac(e,kF),gR=e=>Ac(e,EF),Wae=e=>Ac(e,CF),Qae=e=>Ac(e,_F),Gv=e=>Ac(e,OF,!0),Zae=e=>Ac(e,AF,!0),Zl=(e,t,n)=>{const r=wF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ac=(e,t,n=!1)=>{const r=SF.exec(e);return r?r[1]?t(r[1]):n:!1},EF=e=>e==="position"||e==="percentage",_F=e=>e==="image"||e==="url",CF=e=>e==="length"||e==="size"||e==="bg-size",NF=e=>e==="length",Jae=e=>e==="number",kF=e=>e==="family-name",AF=e=>e==="number"||e==="weight",OF=e=>e==="shadow",eoe=()=>{const e=nr("color"),t=nr("font"),n=nr("text"),r=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),l=nr("container"),c=nr("spacing"),f=nr("radius"),m=nr("shadow"),d=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),b=nr("blur"),w=nr("perspective"),S=nr("aspect"),j=nr("ease"),C=nr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...k(),Ue,Be],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[Ue,Be,c],L=()=>[dl,"full","auto",...P()],I=()=>[hl,"none","subgrid",Ue,Be],F=()=>["auto",{span:["full",hl,Ue,Be]},hl,Ue,Be],$=()=>[hl,"auto",Ue,Be],X=()=>["auto","min","max","fr",Ue,Be],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...P()],q=()=>[dl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],G=()=>[dl,"screen","full","dvw","lvw","svw","min","max","fit",...P()],K=()=>[dl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],R=()=>[e,Ue,Be],H=()=>[...k(),gR,pR,{position:[Ue,Be]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",Wae,Vae,{size:[Ue,Be]}],Q=()=>[FS,Kh,Eu],Z=()=>["","none","full",f,Ue,Be],te=()=>["",yt,Kh,Eu],ae=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[yt,FS,gR,pR],se=()=>["","none",b,Ue,Be],ge=()=>["none",yt,Ue,Be],ie=()=>["none",yt,Ue,Be],Se=()=>[yt,Ue,Be],Ee=()=>[dl,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[jF],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[qae],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",yt],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dl,Be,Ue,S]}],container:["container"],columns:[{columns:[yt,Be,Ue,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[hl,"auto",Ue,Be]}],basis:[{basis:[dl,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,dl,"auto","initial","none",Be]}],grow:[{grow:["",yt,Ue,Be]}],shrink:[{shrink:["",yt,Ue,Be]}],order:[{order:[hl,"first","last","none",Ue,Be]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...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,Kh,Eu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Zae,Kae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",FS,Be]}],"font-family":[{font:[Xae,Yae,t]}],"font-features":[{"font-features":[Be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ue,Be]}],"line-clamp":[{"line-clamp":[yt,"none",Ue,mR]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Ue,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Ue,Eu]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[yt,"auto",Ue,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hl,Ue,Be],radial:["",Ue,Be],conic:[hl,Ue,Be]},Qae,Gae]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Ue,Be]}],"outline-w":[{outline:["",yt,Kh,Eu]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",m,Gv,Yv]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Gv,Yv]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[yt,Eu]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",g,Gv,Yv]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[yt,Ue,Be]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[yt]}],"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":[Ue,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":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":k()}],"mask-image-conic-pos":[{"mask-conic":[yt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Be]}],filter:[{filter:["","none",Ue,Be]}],blur:[{blur:se()}],brightness:[{brightness:[yt,Ue,Be]}],contrast:[{contrast:[yt,Ue,Be]}],"drop-shadow":[{"drop-shadow":["","none",v,Gv,Yv]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",yt,Ue,Be]}],"hue-rotate":[{"hue-rotate":[yt,Ue,Be]}],invert:[{invert:["",yt,Ue,Be]}],saturate:[{saturate:[yt,Ue,Be]}],sepia:[{sepia:["",yt,Ue,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Be]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Ue,Be]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Ue,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Ue,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Ue,Be]}],"backdrop-invert":[{"backdrop-invert":["",yt,Ue,Be]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Ue,Be]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Ue,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Ue,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Ue,Be]}],ease:[{ease:["linear","initial",j,Ue,Be]}],delay:[{delay:[yt,Ue,Be]}],animate:[{animate:["none",C,Ue,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ue,Be]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[Ue,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent: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",Ue,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue,Be]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[yt,Kh,Eu,mR]}],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"]}},toe=Mae(eoe);function Te(...e){return toe(Rt(e))}function xk({delayDuration:e=0,...t}){return h.jsx(sae,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function TF({...e}){return h.jsx(lae,{"data-slot":"tooltip",...e})}function PF({...e}){return h.jsx(uae,{"data-slot":"tooltip-trigger",...e})}function MF({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(cae,{children:h.jsxs(fae,{"data-slot":"tooltip-content",sideOffset:t,className:Te("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[n,h.jsx(dae,{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 DF=(...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 noe=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 roe=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 vR=e=>{const t=roe(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 ioe={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 aoe=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 ooe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>y.createElement("svg",{ref:c,...ioe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:DF("lucide",i),...!a&&!aoe(l)&&{"aria-hidden":"true"},...l},[...o.map(([f,m])=>y.createElement(f,m)),...Array.isArray(a)?a:[a]]));/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ye=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(ooe,{ref:a,iconNode:t,className:DF(`lucide-${noe(vR(e))}`,`lucide-${e}`,r),...i}));return n.displayName=vR(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 soe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],RF=Ye("arrow-down",soe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const loe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],z0=Ye("arrow-left",loe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uoe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],yR=Ye("arrow-up-right",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 coe=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]],Op=Ye("bot-message-square",coe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const foe=[["path",{d:"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"}]],IF=Ye("bot",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 doe=[["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"}]],LF=Ye("brain",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 hoe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],moe=Ye("calendar-clock",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=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bk=Ye("check",poe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const goe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fd=Ye("chevron-down",goe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const voe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],yoe=Ye("chevron-left",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=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tp=Ye("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],woe=Ye("chevron-up",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 Soe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],joe=Ye("chevrons-up-down",Soe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eoe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],fa=Ye("circle-alert",Eoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _oe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pp=Ye("circle-check",_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 Coe=[["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"}]],$0=Ye("circle-x",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 Noe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],koe=Ye("clock",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 Aoe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],tx=Ye("corner-down-left",Aoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ooe=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Mp=Ye("download",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 Toe=[["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"}]],B0=Ye("external-link",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:"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"}]],Moe=Ye("eye-off",Poe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Doe=[["path",{d:"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"}]],Roe=Ye("eye",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:"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"}]],F_=Ye("folder-kanban",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=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],zoe=Ye("folder-up",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 $oe=[["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"}]],Boe=Ye("folder",$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:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Uoe=Ye("history",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"}]],qoe=Ye("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 Voe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Koe=Ye("info",Voe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yoe=[["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"}]],Goe=Ye("key-round",Yoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xoe=[["rect",{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"}]],zF=Ye("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 Woe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pr=Ye("loader-circle",Woe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qoe=[["path",{d:"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"}]],Dp=Ye("message-square",Qoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zoe=[["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"}]],Joe=Ye("monitor",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 ese=[["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"}]],$F=Ye("moon",ese);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tse=[["path",{d:"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"}]],BF=Ye("octagon-x",tse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nse=[["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"}]],wk=Ye("paperclip",nse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rse=[["rect",{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"}]],FF=Ye("pause",rse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ise=[["path",{d:"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"}]],Rp=Ye("pencil",ise);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ase=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ip=Ye("play",ase);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ose=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],sse=Ye("plug",ose);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lse=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lc=Ye("plus",lse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const use=[["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"}]],UF=Ye("save",use);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cse=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],fse=Ye("scroll-text",cse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dse=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Sk=Ye("search",dse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hse=[["path",{d:"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"}]],mse=Ye("send",hse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pse=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],gse=Ye("settings-2",pse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vse=[["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"}]],F0=Ye("settings",vse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yse=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],jk=Ye("square",yse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xse=[["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"}]],HF=Ye("sun",xse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bse=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],wse=Ye("terminal",bse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sse=[["path",{d:"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"}]],Ea=Ye("trash-2",Sse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jse=[["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"}]],Ese=Ye("triangle-alert",jse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _se=[["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"}]],U0=Ye("upload",_se);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cse=[["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"}]],qF=Ye("users",Cse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nse=[["path",{d:"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"}]],VF=Ye("wrench",Nse);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kse=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=Ye("x",kse);function Ase(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 Ose=e=>{switch(e){case"success":return Mse;case"info":return Rse;case"warning":return Dse;case"error":return Ise;default:return null}},Tse=Array(12).fill(0),Pse=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},Tse.map((n,r)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Mse=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Dse=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Rse=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Ise=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Lse=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zse=()=>{const[e,t]=Ce.useState(document.hidden);return Ce.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let U_=1;class $se{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:U_++,o=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:l,title:r}):c):this.addToast({title:r,...i,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const l=i.then(async f=>{if(o=["resolve",f],Ce.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(Fse(f)&&!f.ok){a=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:g,...b})}else if(f instanceof Error){a=!1;const d=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:g,...b})}else if(n.success!==void 0){a=!1;const d=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!Ce.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:g,...b})}}).catch(async f=>{if(o=["reject",f],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(f):n.error,d=typeof n.description=="function"?await n.description(f):n.description,v=typeof m=="object"&&!Ce.isValidElement(m)?m:{message:m};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,m)=>l.then(()=>o[0]==="reject"?m(o[1]):f(o[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||U_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const vi=new $se,Bse=(e,t)=>{const n=(t==null?void 0:t.id)||U_++;return vi.addToast({title:e,...t,id:n}),n},Fse=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Use=Bse,Hse=()=>vi.toasts,qse=()=>vi.getActiveToasts(),dt=Object.assign(Use,{success:vi.success,info:vi.info,warning:vi.warning,error:vi.error,custom:vi.custom,message:vi.message,promise:vi.promise,dismiss:vi.dismiss,loading:vi.loading},{getHistory:Hse,getToasts:qse});Ase("[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 Xv(e){return e.label!==void 0}const Vse=3,Kse="24px",Yse="16px",xR=4e3,Gse=356,Xse=14,Wse=45,Qse=200;function oo(...e){return e.filter(Boolean).join(" ")}function Zse(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Jse=e=>{var t,n,r,i,a,o,l,c,f;const{invert:m,toast:d,unstyled:g,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:j,toasts:C,expanded:_,removeToast:k,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:P,actionButtonStyle:L,className:I="",descriptionClassName:F="",duration:$,position:X,gap:D,expandByDefault:V,classNames:z,icons:q,closeButtonAriaLabel:G="Close toast"}=e,[K,R]=Ce.useState(null),[H,U]=Ce.useState(null),[B,Q]=Ce.useState(!1),[Z,te]=Ce.useState(!1),[ae,re]=Ce.useState(!1),[ee,se]=Ce.useState(!1),[ge,ie]=Ce.useState(!1),[Se,Ee]=Ce.useState(0),[He,ke]=Ce.useState(0),it=Ce.useRef(d.duration||$||xR),Je=Ce.useRef(null),We=Ce.useRef(null),zt=j===0,mt=j+1<=w,Et=d.type,Kt=d.dismissible!==!1,It=d.className||"",fn=d.descriptionClassName||"",ce=Ce.useMemo(()=>S.findIndex(Qe=>Qe.toastId===d.id)||0,[S,d.id]),xe=Ce.useMemo(()=>{var Qe;return(Qe=d.closeButton)!=null?Qe:A},[d.closeButton,A]),Me=Ce.useMemo(()=>d.duration||$||xR,[d.duration,$]),et=Ce.useRef(0),tt=Ce.useRef(0),Xt=Ce.useRef(0),nn=Ce.useRef(null),[je,st]=X.split("-"),xt=Ce.useMemo(()=>S.reduce((Qe,qt,me)=>me>=ce?Qe:Qe+qt.height,0),[S,ce]),ut=zse(),Bn=d.invert||m,rn=Et==="loading";tt.current=Ce.useMemo(()=>ce*D+xt,[ce,xt]),Ce.useEffect(()=>{it.current=Me},[Me]),Ce.useEffect(()=>{Q(!0)},[]),Ce.useEffect(()=>{const Qe=We.current;if(Qe){const qt=Qe.getBoundingClientRect().height;return ke(qt),b(me=>[{toastId:d.id,height:qt,position:d.position},...me]),()=>b(me=>me.filter(Ze=>Ze.toastId!==d.id))}},[b,d.id]),Ce.useLayoutEffect(()=>{if(!B)return;const Qe=We.current,qt=Qe.style.height;Qe.style.height="auto";const me=Qe.getBoundingClientRect().height;Qe.style.height=qt,ke(me),b(Ze=>Ze.find(_t=>_t.toastId===d.id)?Ze.map(_t=>_t.toastId===d.id?{..._t,height:me}:_t):[{toastId:d.id,height:me,position:d.position},...Ze])},[B,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const hr=Ce.useCallback(()=>{te(!0),Ee(tt.current),b(Qe=>Qe.filter(qt=>qt.toastId!==d.id)),setTimeout(()=>{k(d)},Qse)},[d,k,b,tt]);Ce.useEffect(()=>{if(d.promise&&Et==="loading"||d.duration===1/0||d.type==="loading")return;let Qe;return _||v||ut?(()=>{if(Xt.current<et.current){const Ze=new Date().getTime()-et.current;it.current=it.current-Ze}Xt.current=new Date().getTime()})():(()=>{it.current!==1/0&&(et.current=new Date().getTime(),Qe=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),hr()},it.current))})(),()=>clearTimeout(Qe)},[_,v,d,Et,ut,hr]),Ce.useEffect(()=>{d.delete&&(hr(),d.onDismiss==null||d.onDismiss.call(d,d))},[hr,d.delete]);function Gr(){var Qe;if(q!=null&&q.loading){var qt;return Ce.createElement("div",{className:oo(z==null?void 0:z.loader,d==null||(qt=d.classNames)==null?void 0:qt.loader,"sonner-loader"),"data-visible":Et==="loading"},q.loading)}return Ce.createElement(Pse,{className:oo(z==null?void 0:z.loader,d==null||(Qe=d.classNames)==null?void 0:Qe.loader),visible:Et==="loading"})}const Dr=d.icon||(q==null?void 0:q[Et])||Ose(Et);var ai,Er;return Ce.createElement("li",{tabIndex:0,ref:We,className:oo(I,It,z==null?void 0:z.toast,d==null||(t=d.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[Et],d==null||(n=d.classNames)==null?void 0:n[Et]),"data-sonner-toast":"","data-rich-colors":(ai=d.richColors)!=null?ai:O,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":B,"data-promise":!!d.promise,"data-swiped":ge,"data-removed":Z,"data-visible":mt,"data-y-position":je,"data-x-position":st,"data-index":j,"data-front":zt,"data-swiping":ae,"data-dismissible":Kt,"data-type":Et,"data-invert":Bn,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(_||V&&B),"data-testid":d.testId,style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${Z?Se:tt.current}px`,"--initial-height":V?"auto":`${He}px`,...T,...d.style},onDragEnd:()=>{re(!1),R(null),nn.current=null},onPointerDown:Qe=>{Qe.button!==2&&(rn||!Kt||(Je.current=new Date,Ee(tt.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(re(!0),nn.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,qt,me;if(ee||!Kt)return;nn.current=null;const Ze=Number(((Qe=We.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),an=Number(((qt=We.current)==null?void 0:qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((me=Je.current)==null?void 0:me.getTime()),Pn=K==="x"?Ze:an,Xr=Math.abs(Pn)/_t;if(Math.abs(Pn)>=Wse||Xr>.11){Ee(tt.current),d.onDismiss==null||d.onDismiss.call(d,d),U(K==="x"?Ze>0?"right":"left":an>0?"down":"up"),hr(),se(!0);return}else{var mr,er;(mr=We.current)==null||mr.style.setProperty("--swipe-amount-x","0px"),(er=We.current)==null||er.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),R(null)},onPointerMove:Qe=>{var qt,me,Ze;if(!nn.current||!Kt||((qt=window.getSelection())==null?void 0:qt.toString().length)>0)return;const _t=Qe.clientY-nn.current.y,Pn=Qe.clientX-nn.current.x;var Xr;const mr=(Xr=e.swipeDirections)!=null?Xr:Zse(X);!K&&(Math.abs(Pn)>1||Math.abs(_t)>1)&&R(Math.abs(Pn)>Math.abs(_t)?"x":"y");let er={x:0,y:0};const eo=Wr=>1/(1.5+Math.abs(Wr)/20);if(K==="y"){if(mr.includes("top")||mr.includes("bottom"))if(mr.includes("top")&&_t<0||mr.includes("bottom")&&_t>0)er.y=_t;else{const Wr=_t*eo(_t);er.y=Math.abs(Wr)<Math.abs(_t)?Wr:_t}}else if(K==="x"&&(mr.includes("left")||mr.includes("right")))if(mr.includes("left")&&Pn<0||mr.includes("right")&&Pn>0)er.x=Pn;else{const Wr=Pn*eo(Pn);er.x=Math.abs(Wr)<Math.abs(Pn)?Wr:Pn}(Math.abs(er.x)>0||Math.abs(er.y)>0)&&ie(!0),(me=We.current)==null||me.style.setProperty("--swipe-amount-x",`${er.x}px`),(Ze=We.current)==null||Ze.style.setProperty("--swipe-amount-y",`${er.y}px`)}},xe&&!d.jsx&&Et!=="loading"?Ce.createElement("button",{"aria-label":G,"data-disabled":rn,"data-close-button":!0,onClick:rn||!Kt?()=>{}:()=>{hr(),d.onDismiss==null||d.onDismiss.call(d,d)},className:oo(z==null?void 0:z.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Er=q==null?void 0:q.close)!=null?Er:Lse):null,(Et||d.icon||d.promise)&&d.icon!==null&&((q==null?void 0:q[Et])!==null||d.icon)?Ce.createElement("div",{"data-icon":"",className:oo(z==null?void 0:z.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Gr():null,d.type!=="loading"?Dr:null):null,Ce.createElement("div",{"data-content":"",className:oo(z==null?void 0:z.content,d==null||(a=d.classNames)==null?void 0:a.content)},Ce.createElement("div",{"data-title":"",className:oo(z==null?void 0:z.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ce.createElement("div",{"data-description":"",className:oo(F,fn,z==null?void 0:z.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),Ce.isValidElement(d.cancel)?d.cancel:d.cancel&&Xv(d.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||P,onClick:Qe=>{Xv(d.cancel)&&Kt&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Qe),hr())},className:oo(z==null?void 0:z.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,Ce.isValidElement(d.action)?d.action:d.action&&Xv(d.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||L,onClick:Qe=>{Xv(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Qe),!Qe.defaultPrevented&&hr())},className:oo(z==null?void 0:z.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function bR(){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 ele(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?Yse:Kse;function c(f){["top","right","bottom","left"].forEach(m=>{n[`${o}-${m}`]=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 tle=Ce.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:m,mobileOffset:d,theme:g="light",richColors:v,duration:b,style:w,visibleToasts:S=Vse,toastOptions:j,dir:C=bR(),gap:_=Xse,icons:k,containerAriaLabel:O="Notifications"}=t,[A,T]=Ce.useState([]),P=Ce.useMemo(()=>r?A.filter(B=>B.toasterId===r):A.filter(B=>!B.toasterId),[A,r]),L=Ce.useMemo(()=>Array.from(new Set([a].concat(P.filter(B=>B.position).map(B=>B.position)))),[P,a]),[I,F]=Ce.useState([]),[$,X]=Ce.useState(!1),[D,V]=Ce.useState(!1),[z,q]=Ce.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Ce.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=Ce.useRef(null),H=Ce.useRef(!1),U=Ce.useCallback(B=>{T(Q=>{var Z;return(Z=Q.find(te=>te.id===B.id))!=null&&Z.delete||vi.dismiss(B.id),Q.filter(({id:te})=>te!==B.id)})},[]);return Ce.useEffect(()=>vi.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(Z=>Z.id===B.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{tB.flushSync(()=>{T(Q=>{const Z=Q.findIndex(te=>te.id===B.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...B},...Q.slice(Z+1)]:[B,...Q]})})})}),[A]),Ce.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{q(Z?"dark":"light")}catch(te){console.error(te)}})}},[g]),Ce.useEffect(()=>{A.length<=1&&X(!1)},[A]),Ce.useEffect(()=>{const B=Q=>{var Z;if(o.every(re=>Q[re]||Q.code===re)){var ae;X(!0),(ae=G.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===G.current||(Z=G.current)!=null&&Z.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),Ce.useEffect(()=>{if(G.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,H.current=!1)}},[G.current]),Ce.createElement("section",{ref:n,"aria-label":`${O} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((B,Q)=>{var Z;const[te,ae]=B.split("-");return P.length?Ce.createElement("ol",{key:B,dir:C==="auto"?bR():C,tabIndex:-1,ref:G,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":te,"data-x-position":ae,style:{"--front-toast-height":`${((Z=I[0])==null?void 0:Z.height)||0}px`,"--width":`${Gse}px`,"--gap":`${_}px`,...w,...ele(m,d)},onBlur:re=>{H.current&&!re.currentTarget.contains(re.relatedTarget)&&(H.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H.current||(H.current=!0,R.current=re.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{D||X(!1)},onDragEnd:()=>X(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},P.filter(re=>!re.position&&Q===0||re.position===B).map((re,ee)=>{var se,ge;return Ce.createElement(Jse,{key:re.id,icons:k,index:ee,toast:re,defaultRichColors:v,duration:(se=j==null?void 0:j.duration)!=null?se:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:i,visibleToasts:S,closeButton:(ge=j==null?void 0:j.closeButton)!=null?ge:c,interacting:D,position:B,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,closeButtonAriaLabel:j==null?void 0:j.closeButtonAriaLabel,removeToast:U,toasts:P.filter(ie=>ie.position==re.position),heights:I.filter(ie=>ie.position==re.position),setHeights:F,expandByDefault:l,gap:_,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),nle=({...e})=>{const{theme:t="system"}=AN();return h.jsx(tle,{theme:t,className:"toaster group",icons:{success:h.jsx(Pp,{className:"size-4"}),info:h.jsx(Koe,{className:"size-4"}),warning:h.jsx(Ese,{className:"size-4"}),error:h.jsx(BF,{className:"size-4"}),loading:h.jsx(Pr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},rle=new JZ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),KF="/api";class YF extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Yh(e,t){const n=`${KF}${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 YF(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function ile(e,t){const n=`${KF}${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 YF(a.status,a.statusText,o)}return a.json()}const Pe={get:e=>Yh(e),post:(e,t)=>Yh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Yh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Yh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Yh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),ile(e,n)}},Oe={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],stats:(e,t)=>["projects",e,"stats",t],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,n)=>["projects",e,"resources",t,n],resourceConfig:(e,t,n)=>["projects",e,"resources",t,n,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"],runs:["schedules","runs"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]},integrations:{all:["integrations"],detail:e=>["integrations",e],config:e=>["integrations",e,"config"]}};function Oc(){return On({queryKey:Oe.projects.all,queryFn:()=>Pe.get("/projects")})}function Ek(e,t){return On({queryKey:Oe.projects.detail(e),queryFn:()=>Pe.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function H0(e){return On({queryKey:Oe.projects.files(e),queryFn:()=>Pe.get(`/projects/${e}/files`)})}function _k(e,t){return On({queryKey:Oe.projects.config(e),queryFn:()=>Pe.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function nx(e,t){return aJ({queryKey:Oe.conversations.detail(e),queryFn:({pageParam:n})=>Pe.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},getNextPageParam:()=>null,...t})}function ale(e=10){return On({queryKey:["conversations","recent",e],queryFn:()=>Pe.get(`/conversations/recent?limit=${e}`)})}function q0(){return On({queryKey:["imu","conversations"],queryFn:()=>Pe.get("/imu/conversations")})}function Ck(e,t=1,n=20){return On({queryKey:[...Oe.conversations.all(e),t,n],queryFn:()=>Pe.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function GF(){const e=lt();return jt({mutationFn:t=>Pe.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.conversations.all(n.project_id)})}})}function XF(e){const t=lt();return jt({mutationFn:n=>Pe.post(`/conversations/${e}/tasks`,n),onSuccess:(n,r)=>{n.queued&&t.setQueryData(Oe.conversations.detail(e),i=>{if(!i)return i;const a=i.pages.map((o,l)=>{if(l!==i.pages.length-1)return o;const c=o.pending_task||"",f=c?`${c}

${r.task}`:r.task;return{...o,pending_task:f}});return{...i,pages:a}}),t.invalidateQueries({queryKey:Oe.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["imu","conversations"]})}})}function Nk(e){const t=lt();return jt({mutationFn:({conversationId:n,title:r})=>Pe.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:Oe.conversations.all(e)}),t.invalidateQueries({queryKey:Oe.conversations.detail(r)})}})}function WF(e){const t=lt();return jt({mutationFn:()=>Pe.delete(`/conversations/${e}/pending_task`),onSuccess:()=>{t.invalidateQueries({queryKey:Oe.conversations.detail(e)})}})}function QF(){const e=lt();return jt({mutationFn:()=>Pe.post("/imu/conversations",{}),onSuccess:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function kk(){const e=lt();return jt({mutationFn:({conversationId:t,title:n})=>Pe.patch(`/conversations/${t}`,{title:n}),onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["imu","conversations"]}),e.invalidateQueries({queryKey:Oe.conversations.detail(n)})}})}function ZF(){const e=lt();return jt({mutationFn:t=>Pe.delete(`/conversations/${t}`),onMutate:async t=>{await e.cancelQueries({queryKey:["imu","conversations"]});const n=e.getQueryData(["imu","conversations"]);return e.setQueryData(["imu","conversations"],r=>r&&r.filter(i=>i.id!==t)),e.removeQueries({queryKey:Oe.conversations.detail(t)}),{previous:n}},onError:(t,n,r)=>{r!=null&&r.previous&&e.setQueryData(["imu","conversations"],r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:["imu","conversations"]})}})}function JF(e){const t=lt();return jt({mutationFn:n=>Pe.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:Oe.conversations.all(e)});const r=t.getQueryData(Oe.conversations.all(e));return t.setQueryData(Oe.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),t.removeQueries({queryKey:Oe.conversations.detail(n)}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(Oe.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:Oe.conversations.all(e)})}})}function Xe({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:Te("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}const ole=500;function sle({onCommandPalette:e,onShortcutsHelp:t}){const n=Sa(),r=y.useRef(null),i=y.useRef(void 0);y.useEffect(()=>{function a(o){const l=o.target;if(!(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)){if((o.metaKey||o.ctrlKey)&&o.key==="k"){o.preventDefault(),e();return}if(!(o.metaKey||o.ctrlKey||o.altKey)){if(o.key==="?"){o.preventDefault(),t();return}if(r.current==="g"){if(r.current=null,clearTimeout(i.current),o.key==="d"){o.preventDefault(),n("/");return}if(o.key==="p"){o.preventDefault(),n("/projects");return}}if(o.key==="g"){r.current="g",i.current=setTimeout(()=>{r.current=null},ole);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function eU(e){const t=e?"?"+new URLSearchParams(e).toString():"";return On({queryKey:Oe.sessions.all(e),queryFn:()=>Pe.get(`/sessions${t}`)})}function Ak(){return eU({status:"running",per_page:"50"})}function lle(){return eU({per_page:"10"})}function tU(e,t=1,n=20){return On({queryKey:[...Oe.projects.sessions(e),t,n],queryFn:()=>Pe.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function ule(e,t,n){return On({queryKey:Oe.sessions.detail(e,t),queryFn:()=>Pe.get(`/projects/${e}/sessions/${t}`),...n})}var wR=1,cle=.9,fle=.8,dle=.17,US=.1,HS=.999,hle=.9999,mle=.99,ple=/[\\\/_+.#"@\[\(\{&]/,gle=/[\\\/_+.#"@\[\(\{&]/g,vle=/[\s-]/,nU=/[\s-]/g;function H_(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?wR:mle;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),f=n.indexOf(c,i),m=0,d,g,v,b;f>=0;)d=H_(e,t,n,r,f+1,a+1,o),d>m&&(f===i?d*=wR:ple.test(e.charAt(f-1))?(d*=fle,v=e.slice(i,f-1).match(gle),v&&i>0&&(d*=Math.pow(HS,v.length))):vle.test(e.charAt(f-1))?(d*=cle,b=e.slice(i,f-1).match(nU),b&&i>0&&(d*=Math.pow(HS,b.length))):(d*=dle,i>0&&(d*=Math.pow(HS,f-i))),e.charAt(f)!==t.charAt(a)&&(d*=hle)),(d<US&&n.charAt(f-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(f-1)!==r.charAt(a))&&(g=H_(e,t,n,r,f+1,a+2,o),g*US>d&&(d=g*US)),d>m&&(m=d),f=n.indexOf(c,f+1);return o[l]=m,m}function SR(e){return e.toLowerCase().replace(nU," ")}function yle(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,H_(e,t,SR(e),SR(t),0,0,{})}var Gh='[cmdk-group=""]',qS='[cmdk-group-items=""]',xle='[cmdk-group-heading=""]',rU='[cmdk-item=""]',jR=`${rU}:not([aria-disabled="true"])`,q_="cmdk-item-select",Pf="data-value",ble=(e,t,n)=>yle(e,t,n),iU=y.createContext(void 0),Lp=()=>y.useContext(iU),aU=y.createContext(void 0),Ok=()=>y.useContext(aU),oU=y.createContext(void 0),sU=y.forwardRef((e,t)=>{let n=Mf(()=>{var U,B;return{search:"",value:(B=(U=e.value)!=null?U:e.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Mf(()=>new Set),i=Mf(()=>new Map),a=Mf(()=>new Map),o=Mf(()=>new Set),l=lU(e),{label:c,children:f,value:m,onValueChange:d,filter:g,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...j}=e,C=br(),_=br(),k=br(),O=y.useRef(null),A=Tle();cc(()=>{if(m!==void 0){let U=m.trim();n.current.value=U,T.emit()}},[m]),cc(()=>{A(6,X)},[]);let T=y.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>n.current,setState:(U,B,Q)=>{var Z,te,ae,re;if(!Object.is(n.current[U],B)){if(n.current[U]=B,U==="search")$(),I(),A(1,F);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(k);ee?ee.focus():(Z=document.getElementById(C))==null||Z.focus()}if(A(7,()=>{var ee;n.current.selectedItemId=(ee=D())==null?void 0:ee.id,T.emit()}),Q||A(5,X),((te=l.current)==null?void 0:te.value)!==void 0){let ee=B??"";(re=(ae=l.current).onValueChange)==null||re.call(ae,ee);return}}T.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),P=y.useMemo(()=>({value:(U,B,Q)=>{var Z;B!==((Z=a.current.get(U))==null?void 0:Z.value)&&(a.current.set(U,{value:B,keywords:Q}),n.current.filtered.items.set(U,L(B,Q)),A(2,()=>{I(),T.emit()}))},item:(U,B)=>(r.current.add(U),B&&(i.current.has(B)?i.current.get(B).add(U):i.current.set(B,new Set([U]))),A(3,()=>{$(),I(),n.current.value||F(),T.emit()}),()=>{a.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=D();A(4,()=>{$(),(Q==null?void 0:Q.getAttribute("id"))===U&&F(),T.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{a.current.delete(U),i.current.delete(U)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:C,inputId:k,labelId:_,listInnerRef:O}),[]);function L(U,B){var Q,Z;let te=(Z=(Q=l.current)==null?void 0:Q.filter)!=null?Z:ble;return U?te(U,n.current.search,B):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let U=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(Z=>{let te=i.current.get(Z),ae=0;te.forEach(re=>{let ee=U.get(re);ae=Math.max(ee,ae)}),B.push([Z,ae])});let Q=O.current;V().sort((Z,te)=>{var ae,re;let ee=Z.getAttribute("id"),se=te.getAttribute("id");return((ae=U.get(se))!=null?ae:0)-((re=U.get(ee))!=null?re:0)}).forEach(Z=>{let te=Z.closest(qS);te?te.appendChild(Z.parentElement===te?Z:Z.closest(`${qS} > *`)):Q.appendChild(Z.parentElement===Q?Z:Z.closest(`${qS} > *`))}),B.sort((Z,te)=>te[1]-Z[1]).forEach(Z=>{var te;let ae=(te=O.current)==null?void 0:te.querySelector(`${Gh}[${Pf}="${encodeURIComponent(Z[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function F(){let U=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),B=U==null?void 0:U.getAttribute(Pf);T.setState("value",B||void 0)}function $(){var U,B,Q,Z;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ae of r.current){let re=(B=(U=a.current.get(ae))==null?void 0:U.value)!=null?B:"",ee=(Z=(Q=a.current.get(ae))==null?void 0:Q.keywords)!=null?Z:[],se=L(re,ee);n.current.filtered.items.set(ae,se),se>0&&te++}for(let[ae,re]of i.current)for(let ee of re)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=te}function X(){var U,B,Q;let Z=D();Z&&(((U=Z.parentElement)==null?void 0:U.firstChild)===Z&&((Q=(B=Z.closest(Gh))==null?void 0:B.querySelector(xle))==null||Q.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function D(){var U;return(U=O.current)==null?void 0:U.querySelector(`${rU}[aria-selected="true"]`)}function V(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(jR))||[])}function z(U){let B=V()[U];B&&T.setState("value",B.getAttribute(Pf))}function q(U){var B;let Q=D(),Z=V(),te=Z.findIndex(re=>re===Q),ae=Z[te+U];(B=l.current)!=null&&B.loop&&(ae=te+U<0?Z[Z.length-1]:te+U===Z.length?Z[0]:Z[te+U]),ae&&T.setState("value",ae.getAttribute(Pf))}function G(U){let B=D(),Q=B==null?void 0:B.closest(Gh),Z;for(;Q&&!Z;)Q=U>0?Ale(Q,Gh):Ole(Q,Gh),Z=Q==null?void 0:Q.querySelector(jR);Z?T.setState("value",Z.getAttribute(Pf)):q(U)}let K=()=>z(V().length-1),R=U=>{U.preventDefault(),U.metaKey?K():U.altKey?G(1):q(1)},H=U=>{U.preventDefault(),U.metaKey?z(0):U.altKey?G(-1):q(-1)};return y.createElement(Ve.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:U=>{var B;(B=j.onKeyDown)==null||B.call(j,U);let Q=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Q))switch(U.key){case"n":case"j":{S&&U.ctrlKey&&R(U);break}case"ArrowDown":{R(U);break}case"p":case"k":{S&&U.ctrlKey&&H(U);break}case"ArrowUp":{H(U);break}case"Home":{U.preventDefault(),z(0);break}case"End":{U.preventDefault(),K();break}case"Enter":{U.preventDefault();let Z=D();if(Z){let te=new Event(q_);Z.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:Mle},c),V0(e,U=>y.createElement(aU.Provider,{value:T},y.createElement(iU.Provider,{value:P},U))))}),wle=y.forwardRef((e,t)=>{var n,r;let i=br(),a=y.useRef(null),o=y.useContext(oU),l=Lp(),c=lU(e),f=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;cc(()=>{if(!f)return l.item(i,o==null?void 0:o.id)},[f]);let m=uU(i,a,[e.value,e.children,a],e.keywords),d=Ok(),g=Hl(A=>A.value&&A.value===m.current),v=Hl(A=>f||l.filter()===!1?!0:A.search?A.filtered.items.get(i)>0:!0);y.useEffect(()=>{let A=a.current;if(!(!A||e.disabled))return A.addEventListener(q_,b),()=>A.removeEventListener(q_,b)},[v,e.onSelect,e.disabled]);function b(){var A,T;w(),(T=(A=c.current).onSelect)==null||T.call(A,m.current)}function w(){d.setState("value",m.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:C,forceMount:_,keywords:k,...O}=e;return y.createElement(Ve.div,{ref:gs(a,t),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:b},e.children)}),Sle=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=br(),l=y.useRef(null),c=y.useRef(null),f=br(),m=Lp(),d=Hl(v=>i||m.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);cc(()=>m.group(o),[]),uU(o,l,[e.value,e.heading,c]);let g=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(Ve.div,{ref:gs(l,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&y.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),V0(e,v=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(oU.Provider,{value:g},v))))}),jle=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Hl(o=>!o.search);return!n&&!a?null:y.createElement(Ve.div,{ref:gs(i,t),...r,"cmdk-separator":"",role:"separator"})}),Ele=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Ok(),o=Hl(f=>f.search),l=Hl(f=>f.selectedItemId),c=Lp();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(Ve.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:f=>{i||a.setState("search",f.target.value),n==null||n(f.target.value)}})}),_le=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),l=Hl(f=>f.selectedItemId),c=Lp();return y.useEffect(()=>{if(o.current&&a.current){let f=o.current,m=a.current,d,g=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let v=f.offsetHeight;m.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(d),g.unobserve(f)}}},[]),y.createElement(Ve.div,{ref:gs(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},V0(e,f=>y.createElement("div",{ref:gs(o,c.listInnerRef),"cmdk-list-sizer":""},f)))}),Cle=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return y.createElement(BN,{open:n,onOpenChange:r},y.createElement(FN,{container:o},y.createElement(UN,{"cmdk-overlay":"",className:i}),y.createElement(HN,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(sU,{ref:t,...l}))))}),Nle=y.forwardRef((e,t)=>Hl(n=>n.filtered.count===0)?y.createElement(Ve.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kle=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(Ve.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},V0(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),$d=Object.assign(sU,{List:_le,Item:wle,Input:Ele,Group:Sle,Separator:jle,Dialog:Cle,Empty:Nle,Loading:kle});function Ale(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ole(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function lU(e){let t=y.useRef(e);return cc(()=>{t.current=e}),t}var cc=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Mf(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Hl(e){let t=Ok(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function uU(e,t,n,r=[]){let i=y.useRef(),a=Lp();return cc(()=>{var o;let l=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.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(Pf,l),i.current=l}),i}var Tle=()=>{let[e,t]=y.useState(),n=Mf(()=>new Map);return cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Ple(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function V0({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(Ple(t),{ref:t.ref},n(t.props.children)):n(t)}var Mle={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ER=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_R=Rt,K0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return _R(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 m=n==null?void 0:n[f],d=a==null?void 0:a[f];if(m===null)return null;const g=ER(m)||ER(d);return i[f][g]}),l=n&&Object.entries(n).reduce((f,m)=>{let[d,g]=m;return g===void 0||(f[d]=g),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:d,className:g,...v}=m;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...a,...l}[w]):{...a,...l}[w]===S})?[...f,d,g]:f},[]);return _R(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Dle=K0("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 we({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?ON:"button";return h.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:Te(Dle({variant:t,size:n,className:e})),...i})}function _a({...e}){return h.jsx(BN,{"data-slot":"dialog",...e})}function Rle({...e}){return h.jsx(FN,{"data-slot":"dialog-portal",...e})}function Ile({className:e,...t}){return h.jsx(UN,{"data-slot":"dialog-overlay",className:Te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function Ca({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(Rle,{"data-slot":"dialog-portal",children:[h.jsx(Ile,{}),h.jsxs(HN,{"data-slot":"dialog-content",className:Te("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&h.jsxs(qN,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(uc,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Na({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:Te("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Y0({className:e,showCloseButton:t=!1,children:n,...r}){return h.jsxs("div",{"data-slot":"dialog-footer",className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&h.jsx(qN,{asChild:!0,children:h.jsx(we,{variant:"outline",children:"Close"})})]})}function ka({className:e,...t}){return h.jsx(t6,{"data-slot":"dialog-title",className:Te("text-lg leading-none font-semibold",e),...t})}function G0({className:e,...t}){return h.jsx(n6,{"data-slot":"dialog-description",className:Te("text-sm text-muted-foreground",e),...t})}function Lle({className:e,...t}){return h.jsx($d,{"data-slot":"command",className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function zle({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return h.jsxs(_a,{...a,children:[h.jsxs(Na,{className:"sr-only",children:[h.jsx(ka,{children:e}),h.jsx(G0,{children:t})]}),h.jsx(Ca,{className:Te("overflow-hidden p-0",r),showCloseButton:i,children:h.jsx(Lle,{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 $le({className:e,...t}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(Sk,{className:"size-4 shrink-0 opacity-50"}),h.jsx($d.Input,{"data-slot":"command-input",className:Te("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Ble({className:e,...t}){return h.jsx($d.List,{"data-slot":"command-list",className:Te("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Fle({...e}){return h.jsx($d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Xh({className:e,...t}){return h.jsx($d.Group,{"data-slot":"command-group",className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function Ra({className:e,...t}){return h.jsx($d.Item,{"data-slot":"command-item",className:Te("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function CR({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:Te("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function Ule({open:e,onOpenChange:t}){var f;const n=Sa(),{setTheme:r}=AN(),i=Oc(),a=Ak(),o=i.data??[],l=((f=a.data)==null?void 0:f.items)??[],c=m=>{t(!1),n(m)};return h.jsxs(zle,{open:e,onOpenChange:t,showCloseButton:!1,children:[h.jsx($le,{placeholder:"Type a command or search..."}),h.jsxs(Ble,{children:[h.jsx(Fle,{children:"No results found."}),h.jsxs(Xh,{heading:"Navigation",children:[h.jsxs(Ra,{onSelect:()=>c("/"),children:[h.jsx(zF,{}),"Dashboard",h.jsx(CR,{children:"G D"})]}),h.jsxs(Ra,{onSelect:()=>c("/projects"),children:[h.jsx(F_,{}),"Projects",h.jsx(CR,{children:"G P"})]})]}),o.length>0&&h.jsx(Xh,{heading:"Projects",children:o.map(m=>h.jsxs(Ra,{onSelect:()=>c(`/projects/${m.id}`),children:[h.jsx(F_,{}),m.display_name]},m.id))}),l.length>0&&h.jsx(Xh,{heading:"Running Sessions",children:l.map(m=>h.jsxs(Ra,{onSelect:()=>c(`/projects/${m.project_id}/sessions/${m.run_id}`),children:[h.jsx(Ip,{}),m.role," (",m.run_id.slice(0,8),")"]},m.run_id))}),h.jsxs(Xh,{heading:"Resources",children:[h.jsxs(Ra,{onSelect:()=>c("/resources/roles"),children:[h.jsx(qF,{}),"Roles"]}),h.jsxs(Ra,{onSelect:()=>c("/resources/skills"),children:[h.jsx(VF,{}),"Skills"]}),h.jsxs(Ra,{onSelect:()=>c("/resources/agents"),children:[h.jsx(IF,{}),"Agents"]}),h.jsxs(Ra,{onSelect:()=>c("/resources/memories"),children:[h.jsx(LF,{}),"Memory"]})]}),h.jsxs(Xh,{heading:"Theme",children:[h.jsxs(Ra,{onSelect:()=>{r("light"),t(!1)},children:[h.jsx(HF,{}),"Light"]}),h.jsxs(Ra,{onSelect:()=>{r("dark"),t(!1)},children:[h.jsx($F,{}),"Dark"]}),h.jsxs(Ra,{onSelect:()=>{r("system"),t(!1)},children:[h.jsx(Joe,{}),"System"]})]})]})]})}const Hle=[{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 qle({open:e,onOpenChange:t}){return h.jsx(_a,{open:e,onOpenChange:t,children:h.jsxs(Ca,{className:"max-w-sm",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Keyboard Shortcuts"})}),h.jsx("div",{className:"space-y-2",children:Hle.map(n=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsx("span",{className:"text-muted-foreground",children:n.description}),h.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>h.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:r},r))})]},n.description))})]})})}function Vle({...e}){return h.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Kle({className:e,...t}){return h.jsx("ol",{"data-slot":"breadcrumb-list",className:Te("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function Yle({className:e,...t}){return h.jsx("li",{"data-slot":"breadcrumb-item",className:Te("inline-flex items-center gap-1.5",e),...t})}function Gle({asChild:e,className:t,...n}){const r=e?ON:"a";return h.jsx(r,{"data-slot":"breadcrumb-link",className:Te("transition-colors hover:text-foreground",t),...n})}function Xle({className:e,...t}){return h.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Te("font-normal text-foreground",e),...t})}function Wle({children:e,className:t,...n}){return h.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Te("[&>svg]:size-3.5",t),...n,children:e??h.jsx(Tp,{})})}function dd({...e}){return h.jsx(Pre,{"data-slot":"dropdown-menu",...e})}function hd({...e}){return h.jsx(Mre,{"data-slot":"dropdown-menu-trigger",...e})}function md({className:e,sideOffset:t=4,...n}){return h.jsx(Dre,{children:h.jsx(Rre,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Te("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function ym({className:e,inset:t,variant:n="default",...r}){return h.jsx(Ire,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Te("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function Tk({className:e,children:t,checked:n,...r}){return h.jsxs(Lre,{"data-slot":"dropdown-menu-checkbox-item",className:Te("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:h.jsx(zre,{children:h.jsx(bk,{className:"size-4"})})}),t]})}function Sl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return h.jsx($ie,{"data-slot":"separator",decorative:n,orientation:t,className:Te("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const Qle=[{to:"/imu",label:"Bot Imu",icon:Op},{to:"/dashboard",label:"Dashboard",icon:zF,end:!0},{to:"/projects",label:"Projects",icon:F_},{to:"/settings",label:"Settings",icon:F0}],Zle=[{to:"/schedules/runs",label:"Run History",icon:Uoe},{to:"/schedules/recurring",label:"Recurring",icon:koe},{to:"/schedules/one-time",label:"One-Time",icon:moe}],Jle=[{to:"/resources/roles",label:"Roles",icon:qF},{to:"/resources/skills",label:"Skills",icon:VF},{to:"/resources/agents",label:"Agents",icon:IF},{to:"/resources/memories",label:"Memory",icon:LF},{to:"/integrations",label:"Integrations",icon:sse}];function eue({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(!1),[c,f]=y.useState(!1),[m,d]=y.useState(""),g=y.useRef(null),v=Nk(t),b=JF(t),w=j=>{j.stopPropagation(),j.preventDefault(),d(e.title??""),a(!0),setTimeout(()=>{var C;return(C=g.current)==null?void 0:C.focus()},0)},S=()=>{const j=m.trim();v.mutate({conversationId:e.id,title:j||null}),a(!1)};return i?h.jsx("div",{className:"px-1",children:h.jsx(Xe,{ref:g,value:m,onChange:j=>d(j.target.value),onBlur:S,onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),S()),j.key==="Escape"&&(j.stopPropagation(),a(!1))},onClick:j=>j.stopPropagation(),className:"h-7 text-xs px-2"})}):h.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:Te("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:h.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),c?h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx("button",{onClick:j=>{j.stopPropagation(),b.mutate(e.id),f(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),h.jsx("button",{onClick:j=>{j.stopPropagation(),f(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[h.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:h.jsx(Rp,{className:"h-3 w-3"})}),!n&&h.jsx("button",{onClick:j=>{j.stopPropagation(),f(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:h.jsx(Ea,{className:"h-3 w-3"})})]})]})}function tue({conv:e,isActive:t,navigate:n}){const[r,i]=y.useState(!1),[a,o]=y.useState(!1),[l,c]=y.useState(!1),[f,m]=y.useState(""),d=y.useRef(null),g=kk(),v=ZF(),b=S=>{S.stopPropagation(),S.preventDefault(),m(e.title??""),i(!0),setTimeout(()=>{var j;return(j=d.current)==null?void 0:j.focus()},0)},w=()=>{const S=f.trim();g.mutate({conversationId:e.id,title:S||null}),i(!1)};return r?h.jsx("div",{className:"px-1",children:h.jsx(Xe,{ref:d,value:f,onChange:S=>m(S.target.value),onBlur:w,onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),w()),S.key==="Escape"&&(S.stopPropagation(),i(!1))},onClick:S=>S.stopPropagation(),className:"h-7 text-xs px-2"})}):h.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),className:Te("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx("button",{onClick:()=>n(`/imu/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:h.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),l?h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx("button",{onClick:S=>{S.stopPropagation(),v.mutate(e.id),c(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:v.isPending,children:"Delete"}),h.jsx("button",{onClick:S=>{S.stopPropagation(),c(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:a?1:0},children:[h.jsx("button",{onClick:b,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:h.jsx(Rp,{className:"h-3 w-3"})}),!t&&h.jsx("button",{onClick:S=>{S.stopPropagation(),c(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:h.jsx(Ea,{className:"h-3 w-3"})})]})]})}function nue({conversationId:e}){const t=Sa(),n=q0(),r=QF();return h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[h.jsxs("button",{onClick:()=>t("/imu"),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[h.jsx(z0,{className:"h-4 w-4 shrink-0"}),h.jsx(Op,{className:"h-4 w-4 shrink-0"}),h.jsx("span",{className:"truncate",children:"Bot Imu"})]}),h.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),h.jsx("button",{onClick:()=>r.mutate(void 0,{onSuccess:i=>t(`/imu/${i.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:h.jsx(lc,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(n.data??[]).map(i=>h.jsx(tue,{conv:i,isActive:i.id===e,navigate:t},i.id))})]})]})}function rue({projectId:e,conversationId:t}){var o,l;const n=Sa(),r=Ck(e,1,50),i=GF(),a=Ek(e);return h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[h.jsxs("button",{onClick:()=>n(`/projects/${e}`),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[h.jsx(z0,{className:"h-4 w-4 shrink-0"}),h.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),h.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),h.jsx("button",{onClick:()=>i.mutate({project_id:e},{onSuccess:c=>n(`/projects/${e}/conversations/${c.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:h.jsx(lc,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(c=>h.jsx(eue,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function iue(){var d,g;const t=wa().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,r=t[2]==="conversations"&&t[3]?Number(t[3]):0,{data:i}=Ek(n,{enabled:n>0}),{data:a}=Ck(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}=q0(),f=((g=c==null?void 0:c.find(v=>v.id===l))==null?void 0:g.title)??null,m=[];if(t[0]==="projects"){if(n===0)m.push({label:"Bot Imu",href:"/imu"}),t[2]==="sessions"&&t[3]&&m.push({label:`Session ${t[3].slice(0,8)}…`});else if(m.push({label:"Projects",href:"/projects"}),t[1]){const v=`/projects/${t[1]}`,b=(i==null?void 0:i.display_name)??`Project #${t[1]}`;m.push({label:b,href:v,projectSwitcher:!0}),t[2]==="sessions"&&t[3]?m.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&m.push({label:o??`Conversation #${t[3]}`})}}if(t[0]==="imu"&&(m.push({label:"Bot Imu",href:"/imu"}),t[1]&&m.push({label:f??`Conversation #${t[1]}`})),t[0]==="schedules"){const v={recurring:"Recurring Schedules","one-time":"One-Time Schedules",runs:"Run History"},b=t[1];b&&v[b]?(m.push({label:"Schedules",href:"/schedules/recurring"}),m.push({label:v[b]})):m.push({label:"Schedules"})}if(t[0]==="settings"&&m.push({label:"Settings"}),t[0]==="integrations"&&m.push({label:"Integrations"}),t[0]==="resources"){const v={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};m.push({label:"Resources"}),t[1]&&(m[m.length-1].href=`/resources/${t[1]}`,m.push({label:v[t[1]]??t[1]}))}return m}function aue(){const e=iue(),t=Sa(),n=Oc(),{data:r}=q0(),i=(r??[]).some(S=>S.active_session_count>0),{setTheme:a}=AN(),[o,l]=y.useState(!1),[c,f]=y.useState(!1),m=ES("/projects/:projectId/conversations/:conversationId"),d=m?Number(m.params.projectId):0,g=m?Number(m.params.conversationId):0,v=ES("/imu/:conversationId"),b=v?Number(v.params.conversationId):0,w=ES("/projects/0/sessions/:runId");return sle({onCommandPalette:()=>l(!0),onShortcutsHelp:()=>f(!0)}),h.jsxs("div",{className:"flex h-screen",children:[m?h.jsx(rue,{projectId:d,conversationId:g}):v?h.jsx(nue,{conversationId:b}):h.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[h.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:h.jsx(lr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),h.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[Qle.map(({to:S,label:j,icon:C,end:_})=>h.jsxs(Cy,{to:S,end:_,className:({isActive:k})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",(k||S==="/imu"&&!!w)&&!(S==="/projects"&&w)?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j,S==="/imu"&&i&&h.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-green-500 animate-pulse"})]},S)),h.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Schedules"}),Zle.map(({to:S,label:j,icon:C})=>h.jsxs(Cy,{to:S,className:({isActive:_})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j]},S)),h.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),Jle.map(({to:S,label:j,icon:C})=>h.jsxs(Cy,{to:S,className:({isActive:_})=>Te("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",_?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[h.jsx(C,{className:"h-4 w-4"}),j]},S))]})]}),h.jsxs("div",{className:"flex flex-1 flex-col",children:[h.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[h.jsx(Vle,{children:h.jsx(Kle,{children:e.map((S,j)=>{const C=j===e.length-1;return h.jsxs(Yle,{children:[j>0&&h.jsx(Wle,{}),S.projectSwitcher?h.jsxs(dd,{children:[h.jsxs(hd,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[S.label,h.jsx(joe,{className:"h-3 w-3 text-muted-foreground"})]}),h.jsx(md,{align:"start",children:(n.data??[]).map(_=>h.jsxs(ym,{onClick:()=>t(`/projects/${_.id}`),children:[S.href===`/projects/${_.id}`?h.jsx(bk,{className:"mr-2 h-3.5 w-3.5"}):h.jsx("span",{className:"mr-2 inline-block w-3.5"}),_.display_name]},_.id))})]}):C?h.jsx(Xle,{children:S.label}):h.jsx(Gle,{href:S.href,children:S.label})]},S.label)})})}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>l(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:h.jsx("kbd",{className:"font-mono",children:"⌘K"})}),h.jsxs(dd,{children:[h.jsx(hd,{asChild:!0,children:h.jsxs(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[h.jsx(HF,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),h.jsx($F,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),h.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),h.jsxs(md,{align:"end",children:[h.jsx(ym,{onClick:()=>a("light"),children:"Light"}),h.jsx(ym,{onClick:()=>a("dark"),children:"Dark"}),h.jsx(ym,{onClick:()=>a("system"),children:"System"})]})]})]})]}),h.jsx(Sl,{}),h.jsx("main",{className:"flex-1 overflow-auto p-6",children:h.jsx(qQ,{})})]}),h.jsx(Ule,{open:o,onOpenChange:l}),h.jsx(qle,{open:c,onOpenChange:f})]})}function oue(){const e=lt();return jt({mutationFn:t=>Pe.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function Pk(){const e=lt();return jt({mutationFn:t=>Pe.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function sue(){const e=lt();return jt({mutationFn:t=>Pe.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const lue=K0("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 ht({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?ON:"span";return h.jsx(i,{"data-slot":"badge","data-variant":t,className:Te(lue({variant:t}),e),...r})}function da({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",e),...t})})}function ha({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",e),...t})}function ma({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",e),...t})}function yn({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:Te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function Fe({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:Te("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ze({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function rx({sessions:e,projectNames:t}){return h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Run ID"}),t&&h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Role"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{children:"Started"}),h.jsx(Fe,{children:"Duration"}),h.jsx(Fe,{children:"Task"}),h.jsx(Fe,{className:"w-[80px]"})]})}),h.jsx(ma,{children:e.map(n=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${n.project_id}/sessions/${n.run_id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:n.run_id.slice(0,16)})}),t&&h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),h.jsx(ze,{className:"text-sm",children:n.role}),h.jsx(ze,{children:h.jsx(uue,{status:n.status})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:ix(n.started_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:X0(n.duration_ms)}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),h.jsx(ze,{children:h.jsx(cue,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function uue({status:e}){const t=cU(e);return h.jsxs(ht,{variant:"outline",className:Te("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&h.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const NR=cU;function cU(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 ix(e){try{return new Date(e).toLocaleString()}catch{return e}}function X0(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 cue({runId:e,disabled:t}){const[n,r]=y.useState(!1),i=sue(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(we,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):h.jsx(we,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:h.jsx(Ea,{className:"h-4 w-4"})})}function Nn({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Te("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Wh({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:Te("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Qh({className:e,...t}){return h.jsx("div",{"data-slot":"card-title",className:Te("leading-none font-semibold",e),...t})}function kn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:Te("px-6",e),...t})}const VS=1e4;function fue(e,t,n){const[r,i]=y.useState([]),[a,o]=y.useState(!1),[l,c]=y.useState(!1),f=y.useRef(null),m=y.useRef(void 0),d=y.useRef(1e3),g=y.useRef("");return y.useEffect(()=>{if(!t)return;const v=`${e}:${t}`;g.current!==v&&(i([]),c(!1),g.current=v);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);f.current=w,w.onopen=()=>{o(!0),d.current=1e3},w.addEventListener("snapshot",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&i(j.lines.slice(-VS))}catch{}}),w.addEventListener("append",S=>{try{const j=JSON.parse(S.data);Array.isArray(j.lines)&&j.lines.length>0&&i(C=>{const _=[...C,...j.lines];return _.length>VS?_.slice(-VS):_})}catch{}}),w.addEventListener("done",()=>{c(!0),w.close(),f.current=null}),w.onerror=()=>{w.close(),f.current=null,o(!1),m.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,m.current&&clearTimeout(m.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const due=5e3;function hue({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=fue(e,n,!0),c=o.slice(-4),[f,m]=y.useState("");y.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const C=Date.now()-w,_=Math.floor(C/1e3)%60,k=Math.floor(C/6e4)%60,O=Math.floor(C/36e5);m(O>0?`${O}h ${k}m`:`${k}m ${_}s`)};S();const j=setInterval(S,1e3);return()=>clearInterval(j)},[a]);const d=y.useRef(o.length),g=y.useRef(Date.now()),[v,b]=y.useState(!1);return y.useEffect(()=>{o.length!==d.current&&(d.current=o.length,g.current=Date.now(),b(!1))},[o.length]),y.useEffect(()=>{const w=setInterval(()=>{Date.now()-g.current>due&&b(!0)},1e3);return()=>clearInterval(w)},[]),h.jsx(Nn,{className:"overflow-hidden",children:h.jsxs(kn,{className:"space-y-2 pt-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":v?"bg-green-300":"animate-pulse bg-green-500"}`}),h.jsx("span",{className:"font-medium text-sm",children:r})]}),h.jsx(ht,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")})]}),h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Session: ",e.slice(0,12)]}),h.jsx("span",{children:"·"}),h.jsx("span",{children:f})]}),h.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:c.length>0?c.map((w,S)=>h.jsxs("div",{className:"truncate",children:[h.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):h.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),h.jsx("div",{className:"flex justify-end",children:h.jsxs(lr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",h.jsx(Tp,{className:"h-3 w-3"})]})})]})})}const KS=8;function mue(){var o;const t=((o=Ak().data)==null?void 0:o.items)??[],n=iJ({queries:t.slice(0,KS).map(l=>({queryKey:Oe.sessions.detail(l.project_id,l.run_id),queryFn:()=>Pe.get(`/projects/${l.project_id}/sessions/${l.run_id}`),staleTime:1e4}))}),r=[];for(const l of n){if(!l.data)continue;const c=l.data;for(const[f,m]of Object.entries(c.agents))r.push({runId:c.run_id,projectId:c.project_id,agentId:f,role:m.role,runtime:m.runtime,startedAt:m.started_at})}if(r.length===0)return null;const i=r.slice(0,KS),a=r.length-KS;return h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>h.jsx(hue,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&h.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function ln({className:e,...t}){return h.jsx("div",{"data-slot":"skeleton",className:Te("animate-pulse rounded-md bg-accent",e),...t})}function pue(){return h.jsxs("div",{className:"space-y-8",children:[h.jsx(ln,{className:"h-8 w-40"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(ln,{className:"h-4 w-24"}),h.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>h.jsx(ln,{className:"h-28 rounded-lg"},e))})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(ln,{className:"h-4 w-32"}),h.jsx(ln,{className:"h-48 rounded-lg"})]})]})}function gue(){var d,g;const e=Oc(),t=Ak(),n=lle(),r=ale(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return h.jsx(pue,{});if(a)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.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 m=new Map;for(const v of l)m.set(v.project_id,(m.get(v.project_id)??0)+1);return h.jsxs("div",{className:"space-y-8",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),h.jsx(mue,{}),h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Directory"}),h.jsx(Fe,{children:"Status"})]})}),h.jsxs(ma,{children:[o.slice(0,10).map(v=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),h.jsx(ze,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),h.jsx(ze,{children:h.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&h.jsx(ht,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(m.get(v.id)??0)>0&&h.jsxs(ht,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:[h.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),m.get(v.id)," running"]})]})})]},v.id)),o.length>10&&h.jsx(yn,{children:h.jsx(ze,{colSpan:3,className:"text-center",children:h.jsxs(lr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&h.jsxs("section",{className:"space-y-3",children:[h.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(rx,{sessions:l,projectNames:f})})})]}),(r.data??[]).length>0&&h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Title"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Sessions"}),h.jsx(Fe,{children:"Last Activity"})]})}),h.jsx(ma,{children:(r.data??[]).map(v=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${v.project_id}/conversations/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.title??`Conversation #${v.id}`})}),h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:v.session_count}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),h.jsxs("section",{className:"space-y-3",children:[h.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(rx,{sessions:c,projectNames:f})})})]})]})}function fU(){return On({queryKey:Oe.config.global,queryFn:()=>Pe.get("/config/global")})}function vue(){const e=lt();return jt({mutationFn:t=>Pe.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.projects.all})}})}function yue(){const e=lt();return jt({mutationFn:t=>Pe.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.projects.all})}})}function xue(){const e=lt();return jt({mutationFn:({projectId:t,files:n})=>Pe.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.projects.files(n.projectId)})}})}function bue(){const e=lt();return jt({mutationFn:({projectId:t,filePath:n})=>Pe.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.projects.files(n.projectId)})}})}function wue(){const e=lt();return jt({mutationFn:t=>Pe.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(Oe.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:Oe.config.global})}})}function dU(){const e=lt();return jt({mutationFn:({projectId:t,data:n})=>Pe.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(Oe.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:Oe.projects.config(n.projectId)})}})}function W0({className:e,children:t,...n}){return h.jsxs(Zre,{"data-slot":"scroll-area",className:Te("relative",e),...n,children:[h.jsx(Jre,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),h.jsx(Sue,{}),h.jsx(eie,{})]})}function Sue({className:e,orientation:t="vertical",...n}){return h.jsx(p8,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Te("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(x8,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function jue({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=y.useState(null),[a,o]=y.useState(!0),[l,c]=y.useState(null),[f,m]=y.useState(null),d=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";Pe.get(`/fs/browse${b}`).then(i).catch(w=>c(w.message??"Failed to browse")).finally(()=>o(!1))},g=async()=>{if(!(!r||!(f!=null&&f.trim())))try{const v=await Pe.post("/fs/mkdir",{path:r.path,name:f.trim()});m(null),d(v.path)}catch(v){c(v instanceof Error?v.message:"Failed to create folder")}};return y.useEffect(()=>{d(e||void 0)},[]),h.jsx(_a,{open:!0,onOpenChange:v=>!v&&n(),children:h.jsxs(Ca,{className:"sm:max-w-[480px]",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Select Directory"})}),r&&h.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&h.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?h.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):h.jsx(W0,{className:"h-[300px]",children:h.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&h.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(r.parent),children:[h.jsx(zoe,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>h.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(v.path),children:[h.jsx(Boe,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&h.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),h.jsx(Y0,{children:f!==null?h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsx(Xe,{value:f,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Enter"&&g(),v.key==="Escape"&&m(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),h.jsx(we,{size:"sm",onClick:g,children:"Create"}),h.jsx(we,{size:"sm",variant:"outline",onClick:()=>m(null),children:"Cancel"})]}):h.jsxs(h.Fragment,{children:[h.jsx(we,{variant:"outline",onClick:()=>m(""),disabled:!r,children:"New Folder"}),h.jsx("div",{className:"flex-1"}),h.jsx(we,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),h.jsx(we,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function ot({className:e,...t}){return h.jsx(Bre,{"data-slot":"label",className:Te("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function pa({...e}){return h.jsx(Eie,{"data-slot":"select",...e})}function ga({...e}){return h.jsx(Cie,{"data-slot":"select-value",...e})}function va({className:e,size:t="default",children:n,...r}){return h.jsxs(_ie,{"data-slot":"select-trigger","data-size":t,className:Te("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,h.jsx(Nie,{asChild:!0,children:h.jsx(fd,{className:"size-4 opacity-50"})})]})}function ya({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return h.jsx(kie,{children:h.jsxs(Aie,{"data-slot":"select-content",className:Te("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[h.jsx(Eue,{}),h.jsx(Oie,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(_ue,{})]})})}function An({className:e,children:t,...n}){return h.jsxs(Tie,{"data-slot":"select-item",className:Te("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(Mie,{children:h.jsx(bk,{className:"size-4"})})}),h.jsx(Pie,{children:t})]})}function Eue({className:e,...t}){return h.jsx(Die,{"data-slot":"select-scroll-up-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(woe,{className:"size-4"})})}function _ue({className:e,...t}){return h.jsx(Rie,{"data-slot":"select-scroll-down-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(fd,{className:"size-4"})})}function Cue(){const{data:e,isLoading:t,error:n}=Oc(),[r,i]=y.useState(!1);if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-32"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),h.jsxs(we,{onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&h.jsx(Nue,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Directory"}),h.jsx(Fe,{children:"Created"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[80px]"})]})}),h.jsx(ma,{children:a.map(o=>h.jsxs(yn,{children:[h.jsx(ze,{children:h.jsx(lr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:Aue(o.created_at)}),h.jsx(ze,{children:o.dir_exists?h.jsx(ht,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):h.jsx(ht,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})}),h.jsx(ze,{children:h.jsx(kue,{projectId:o.id})})]},o.id))})]})})})]})}function Nue({onDone:e,onCancel:t}){var P,L,I;const[n,r]=y.useState(""),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState(""),[m,d]=y.useState(!1),[g,v]=y.useState(!1),b=vue(),w=dU(),j=(P=fU().data)==null?void 0:P.defaults,C=(j==null?void 0:j.isolation)??"none",_=((L=j==null?void 0:j.session)==null?void 0:L.merge_strategy)??"auto",k=o||C,O=async()=>{const F=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),$={},X=c||_;$.isolation=k,$.session={merge_strategy:X},await w.mutateAsync({projectId:F.id,data:$}),e()},A=async F=>{F.preventDefault();try{if(k==="worktree"&&i.trim()&&!(await Pe.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await O()}catch{}},T=async()=>{try{await Pe.post("/fs/git-init",{path:i.trim()}),v(!1),await O()}catch{}};return h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("form",{onSubmit:A,className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"display-name",children:"Display Name"}),h.jsx(Xe,{id:"display-name",value:n,onChange:F=>r(F.target.value),required:!0,autoFocus:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"working-dir",children:"Working Directory"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{id:"working-dir",value:i,onChange:F=>a(F.target.value),placeholder:"/path/to/project",required:!0}),h.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!m),children:"Browse"})]})]})]}),m&&h.jsx(jue,{initialPath:i||void 0,onSelect:F=>{a(F),d(!1)},onCancel:()=>d(!1)}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"isolation",children:"Isolation"}),h.jsxs(pa,{value:o||C,onValueChange:l,children:[h.jsx(va,{id:"isolation",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"none",children:"none"}),h.jsx(An,{value:"worktree",children:"worktree"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"merge-strategy",children:"Merge Strategy"}),h.jsxs(pa,{value:c||_,onValueChange:f,children:[h.jsx(va,{id:"merge-strategy",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"auto",children:"auto"}),h.jsx(An,{value:"local",children:"local"}),h.jsx(An,{value:"pr",children:"pr"})]})]})]})]}),g&&h.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[h.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",h.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),h.jsxs("div",{className:"mt-2 flex gap-2",children:[h.jsx(we,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),h.jsx(we,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&h.jsx("p",{className:"text-sm text-destructive",children:(I=b.error||w.error)==null?void 0:I.message}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(we,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),h.jsx(we,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function kue({projectId:e}){const[t,n]=y.useState(!1),r=yue(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(we,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):h.jsx(we,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:h.jsx(Ea,{className:"h-4 w-4"})})}function Aue(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function Bd(e){return On({queryKey:Oe.projects.resources(e),queryFn:()=>Pe.get(`/projects/${e}/resources`)})}function Oue(e,t,n,r){return On({queryKey:Oe.projects.resourceDetail(e,t,n),queryFn:()=>Pe.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Tue(e,t,n,r){return On({queryKey:Oe.projects.resourceConfig(e,t,n),queryFn:()=>Pe.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Pue(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 Mk({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Pue(e,t);return h.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[h.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:h.jsx(yoe,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?h.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):h.jsx(we,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),h.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:h.jsx(Tp,{className:"h-4 w-4"})})]})}function hU(e,t,n){return On({queryKey:Oe.registry.config(e,t),queryFn:()=>Pe.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function Eo({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:Te("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function zp({...e}){return h.jsx(IJ,{"data-slot":"collapsible",...e})}function $p({...e}){return h.jsx(NB,{"data-slot":"collapsible-trigger",...e})}function Bp({...e}){return h.jsx(kB,{"data-slot":"collapsible-content",...e})}function Mue({projectId:e,open:t,onOpenChange:n}){var xe,Me,et,tt,Xt,nn;const r=Sa(),i=_k(e),{data:a}=Bd(e),o=H0(e),l=oue(),c=(xe=i.data)==null?void 0:xe.merged,f="__empty__",[m,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(""),[k,O]=y.useState(""),[A,T]=y.useState(""),[P,L]=y.useState(""),[I,F]=y.useState(""),[$,X]=y.useState(!1),[D,V]=y.useState([]),[z,q]=y.useState(!1),[G,K]=y.useState(""),[R,H]=y.useState(!1),[U,B]=y.useState(!1),Q=lt(),Z=()=>{d(""),v(""),w(""),j(""),_(""),O(""),T(""),L(""),F(""),X(!1),V([]),q(!1)},te=je=>{je.preventDefault(),H(!0)},ae=je=>{je.preventDefault(),H(!0)},re=je=>{je.preventDefault(),H(!1)},ee=async je=>{je.preventDefault(),H(!1);const st=Array.from(je.dataTransfer.files);if(st.length){B(!0);try{const xt=await Pe.upload(`/projects/${e}/files`,st);Q.invalidateQueries({queryKey:Oe.projects.files(e)}),V(ut=>{const Bn=xt.map(rn=>rn.path).filter(rn=>!ut.includes(rn));return[...ut,...Bn]})}catch{}finally{B(!1)}}},se=je=>{V(st=>st.includes(je)?st.filter(xt=>xt!==je):[...st,je])},ge=async je=>{je.preventDefault();try{const st={project_id:e,task:m.trim()};g.trim()&&(st.role=g.trim());const xt={};b.trim()&&(xt.runtime=b.trim()),S.trim()&&(xt.memory=S.trim()),C&&(xt.cache_delegations=C==="true"),k.trim()&&(xt.cache_max_entries=Number(k.trim())),A.trim()&&(xt.cache_ttl_seconds=Number(A.trim())),P.trim()&&(xt.max_num_delegations=Number(P.trim())),Object.keys(xt).length>0&&(st.overrides=xt),D.length>0&&(st.context_files=D),I.trim()&&(st.system_prompt=I.trim()),$&&(st.interactive=!0);const ut=await l.mutateAsync(st);Z(),n(!1),r(`/projects/${e}/sessions/${ut.run_id}`)}catch{}},ie=(c==null?void 0:c.orchestrator_role)??"orchestrator",Ee=(a??[]).filter(je=>je.type==="roles").map(je=>je.name).filter(je=>je!==ie),He=[ie,...Ee],ke=(a??[]).filter(je=>je.type==="agents").map(je=>je.name),it=new Set((a??[]).filter(je=>je.type==="memories").map(je=>je.name));it.add("none");const Je=[...it].sort(),We=g.trim()||ie,zt=hU("roles",We,{enabled:!!We}),mt=((et=(Me=zt.data)==null?void 0:Me.params_values)==null?void 0:et.default_agent)??((nn=(Xt=(tt=zt.data)==null?void 0:tt.params_schema)==null?void 0:Xt.default_agent)==null?void 0:nn.default)??"",Et=mt&&ke.includes(mt)?mt:(c==null?void 0:c.runtime)??"strawpot-claude-code",Kt=g.trim()&&!He.includes(g.trim())?"Role not found in installed roles":"",It=b.trim()&&ke.length>0&&!ke.includes(b.trim())?"Runtime not found in installed agents":"",fn=S.trim()&&!Je.includes(S.trim())?"Memory not found in installed providers":"",ce=!!Kt||!!It||!!fn;return h.jsx(_a,{open:t,onOpenChange:n,children:h.jsxs(Ca,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Launch Session"})}),h.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs("div",{className:"relative",onDragOver:te,onDragEnter:ae,onDragLeave:re,onDrop:ee,children:[h.jsx(Eo,{id:"task",value:m,onChange:je=>d(je.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(R||U)&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:U?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(U0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(o.data??[]).length>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(dd,{children:[h.jsx(hd,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"outline",size:"sm",children:[h.jsx(wk,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),h.jsxs(md,{align:"start",className:"w-64",onCloseAutoFocus:je=>je.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files...",value:G,onChange:je=>K(je.target.value),className:"h-7 text-xs",onKeyDown:je=>je.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(o.data??[]).filter(je=>je.path.toLowerCase().includes(G.toLowerCase())).map(je=>h.jsx(Tk,{checked:D.includes(je.path),onCheckedChange:()=>se(je.path),onSelect:st=>st.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:je.path})},je.path))})]})]}),D.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.length," file(s) attached"]})]}),D.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[(z?D:D.slice(0,3)).map(je=>h.jsxs(ht,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>se(je),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),h.jsxs("span",{className:"truncate",children:["@",je]})]},je)),!z&&D.length>3&&h.jsxs("button",{type:"button",onClick:()=>q(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",D.length-3," more"]}),z&&D.length>3&&h.jsx("button",{type:"button",onClick:()=>q(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"role",children:"Role"}),h.jsx(Xe,{id:"role",list:"datalist-role",value:g,onChange:je=>v(je.target.value),placeholder:ie}),h.jsxs("datalist",{id:"datalist-role",children:[h.jsx("option",{value:ie}),Ee.map(je=>h.jsx("option",{value:je},je))]}),Kt&&h.jsx("p",{className:"text-xs text-destructive",children:Kt})]}),h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:$,onChange:je=>X(je.target.checked),className:"rounded border-input"}),h.jsx("span",{className:"text-sm",children:"Interactive mode"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),h.jsxs(zp,{children:[h.jsx($p,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"ghost",size:"sm",children:[h.jsx(fd,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),h.jsxs(Bp,{className:"mt-3 space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"runtime",children:"Runtime"}),h.jsx(Xe,{id:"runtime",list:"datalist-runtime",value:b,onChange:je=>w(je.target.value),placeholder:Et}),ke.length>0&&h.jsx("datalist",{id:"datalist-runtime",children:ke.map(je=>h.jsx("option",{value:je},je))}),It&&h.jsx("p",{className:"text-xs text-destructive",children:It})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"memory",children:"Memory"}),h.jsx(Xe,{id:"memory",list:"datalist-memory",value:S,onChange:je=>j(je.target.value),placeholder:(c==null?void 0:c.memory)||"dial"}),h.jsx("datalist",{id:"datalist-memory",children:Je.map(je=>h.jsx("option",{value:je},je))}),fn&&h.jsx("p",{className:"text-xs text-destructive",children:fn})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"system-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"system-prompt",value:I,onChange:je=>F(je.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:P,onChange:je=>L(je.target.value),placeholder:c!=null&&c.max_num_delegations?String(c.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Delegations"}),h.jsxs(pa,{value:C||f,onValueChange:je=>_(je===f?"":je),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:(c==null?void 0:c.cache_delegations)!==!1?"true":"false"})}),h.jsxs(ya,{children:[h.jsxs(An,{value:f,className:"text-muted-foreground",children:["Default (",(c==null?void 0:c.cache_delegations)!==!1?"true":"false",")"]}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:k,onChange:je=>O(je.target.value),placeholder:c!=null&&c.cache_max_entries?String(c.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:A,onChange:je=>T(je.target.value),placeholder:c!=null&&c.cache_ttl_seconds?String(c.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),l.error&&h.jsx("p",{className:"text-sm text-destructive",children:l.error.message}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(we,{type:"submit",disabled:l.isPending||ce,children:l.isPending?"Launching...":"Launch"}),h.jsx(we,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function Due(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function mU({projectId:e}){const t=H0(e),n=xue(),r=bue(),i=y.useRef(null),[a,o]=y.useState(!1),[l,c]=y.useState(null),f=y.useCallback(j=>{const C=Array.from(j);C.length!==0&&n.mutate({projectId:e,files:C},{onSuccess:()=>dt.success(`Uploaded ${C.length} file(s)`),onError:()=>dt.error("Upload failed")})},[e,n]),m=y.useCallback(j=>{j.preventDefault(),o(!1),f(j.dataTransfer.files)},[f]),d=y.useCallback(j=>{j.preventDefault(),o(!0)},[]),g=y.useCallback(j=>{j.preventDefault(),o(!1)},[]),v=y.useCallback(()=>{var j;(j=i.current)==null||j.click()},[]),b=y.useCallback(j=>{j.target.files&&(f(j.target.files),j.target.value="")},[f]),w=y.useCallback(j=>{r.mutate({projectId:e,filePath:j},{onSuccess:()=>{dt.success("File deleted"),c(null)},onError:()=>{dt.error("Failed to delete file"),c(null)}})},[e,r]),S=t.data??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{onDrop:m,onDragOver: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:[h.jsx(U0,{className:"h-8 w-8 text-muted-foreground"}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",h.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&h.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),h.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{className:"w-24",children:"Size"}),h.jsx(Fe,{className:"w-44",children:"Modified"}),h.jsx(Fe,{className:"w-28"})]})}),h.jsx(ma,{children:S.map(j=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-mono text-xs",children:j.path}),h.jsx(ze,{className:"text-xs text-muted-foreground",children:Due(j.size)}),h.jsx(ze,{className:"text-xs text-muted-foreground",children:new Date(j.modified_at).toLocaleString()}),h.jsx(ze,{children:l===j.path?h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:()=>w(j.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),h.jsx("button",{type:"button",onClick:()=>c(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):h.jsx("div",{className:"flex justify-end",children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(j.path),disabled:r.isPending,children:h.jsx(Ea,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},j.path))})]})})})]})}function Fp({className:e,orientation:t="horizontal",...n}){return h.jsx(Uie,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Te("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const Rue=K0("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 Up({className:e,variant:t="default",...n}){return h.jsx(Hie,{"data-slot":"tabs-list","data-variant":t,className:Te(Rue({variant:t}),e),...n})}function or({className:e,...t}){return h.jsx(qie,{"data-slot":"tabs-trigger",className:Te("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function sr({className:e,...t}){return h.jsx(Vie,{"data-slot":"tabs-content",className:Te("flex-1 outline-none",e),...t})}function Iue(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Lue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$ue={};function kR(e,t){return($ue.jsx?zue:Lue).test(e)}const Bue=/[ \t\n\f\r]/g;function Fue(e){return typeof e=="object"?e.type==="text"?AR(e.value):!1:AR(e)}function AR(e){return e.replace(Bue,"")===""}class Hp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Hp.prototype.normal={};Hp.prototype.property={};Hp.prototype.space=void 0;function pU(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hp(n,r,t)}function V_(e){return e.toLowerCase()}class bi{constructor(t,n){this.attribute=n,this.property=t}}bi.prototype.attribute="";bi.prototype.booleanish=!1;bi.prototype.boolean=!1;bi.prototype.commaOrSpaceSeparated=!1;bi.prototype.commaSeparated=!1;bi.prototype.defined=!1;bi.prototype.mustUseProperty=!1;bi.prototype.number=!1;bi.prototype.overloadedBoolean=!1;bi.prototype.property="";bi.prototype.spaceSeparated=!1;bi.prototype.space=void 0;let Uue=0;const vt=Tc(),Gn=Tc(),K_=Tc(),_e=Tc(),dn=Tc(),Uf=Tc(),Ai=Tc();function Tc(){return 2**++Uue}const Y_=Object.freeze(Object.defineProperty({__proto__:null,boolean:vt,booleanish:Gn,commaOrSpaceSeparated:Ai,commaSeparated:Uf,number:_e,overloadedBoolean:K_,spaceSeparated:dn},Symbol.toStringTag,{value:"Module"})),YS=Object.keys(Y_);class Dk extends bi{constructor(t,n,r,i){let a=-1;if(super(t,n),OR(this,"space",i),typeof r=="number")for(;++a<YS.length;){const o=YS[a];OR(this,YS[a],(r&Y_[o])===Y_[o])}}}Dk.prototype.defined=!0;function OR(e,t,n){n&&(e[t]=n)}function Fd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Dk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[V_(r)]=r,n[V_(a.attribute)]=r}return new Hp(t,n,e.space)}const gU=Fd({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:dn,ariaCurrent:null,ariaDescribedBy:dn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:dn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:dn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dn,ariaLevel:_e,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:dn,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:dn,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:Gn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vU(e,t){return t in e?e[t]:t}function yU(e,t){return vU(e,t.toLowerCase())}const Hue=Fd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Uf,acceptCharset:dn,accessKey:dn,action:null,allow:null,allowFullScreen:vt,allowPaymentRequest:vt,allowUserMedia:vt,alt:null,as:null,async:vt,autoCapitalize:null,autoComplete:dn,autoFocus:vt,autoPlay:vt,blocking:dn,capture:null,charSet:null,checked:vt,cite:null,className:dn,cols:_e,colSpan:null,content:null,contentEditable:Gn,controls:vt,controlsList:dn,coords:_e|Uf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vt,defer:vt,dir:null,dirName:null,disabled:vt,download:K_,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vt,formTarget:null,headers:dn,height:_e,hidden:K_,high:_e,href:null,hrefLang:null,htmlFor:dn,httpEquiv:dn,id:null,imageSizes:null,imageSrcSet:null,inert:vt,inputMode:null,integrity:null,is:null,isMap:vt,itemId:null,itemProp:dn,itemRef:dn,itemScope:vt,itemType:dn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vt,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:vt,muted:vt,name:null,nonce:null,noModule:vt,noValidate:vt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vt,optimum:_e,pattern:null,ping:dn,placeholder:null,playsInline:vt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vt,referrerPolicy:null,rel:dn,required:vt,reversed:vt,rows:_e,rowSpan:_e,sandbox:dn,scope:null,scoped:vt,seamless:vt,selected:vt,shadowRootClonable:vt,shadowRootDelegatesFocus:vt,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:vt,useMap:null,value:Gn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dn,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vt,declare:vt,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:vt,noHref:vt,noShade:vt,noWrap:vt,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:vt,disableRemotePlayback:vt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:yU}),que=Fd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ai,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:dn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:vt,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Uf,g2:Uf,glyphName:Uf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Ai,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ai,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ai,rev:Ai,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ai,requiredFeatures:Ai,requiredFonts:Ai,requiredFormats:Ai,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Ai,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ai,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ai,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vU}),xU=Fd({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()}}),bU=Fd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yU}),wU=Fd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Vue={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"},Kue=/[A-Z]/g,TR=/-[a-z]/g,Yue=/^data[-\w.:]+$/i;function Gue(e,t){const n=V_(t);let r=t,i=bi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Yue.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(TR,Wue);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!TR.test(a)){let o=a.replace(Kue,Xue);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Dk}return new i(r,t)}function Xue(e){return"-"+e.toLowerCase()}function Wue(e){return e.charAt(1).toUpperCase()}const Que=pU([gU,Hue,xU,bU,wU],"html"),Rk=pU([gU,que,xU,bU,wU],"svg");function Zue(e){return e.join(" ").trim()}var wf={},GS,PR;function Jue(){if(PR)return GS;PR=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="/",m="*",d="",g="comment",v="declaration";function b(S,j){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];j=j||{};var C=1,_=1;function k(D){var V=D.match(t);V&&(C+=V.length);var z=D.lastIndexOf(c);_=~z?D.length-z:_+D.length}function O(){var D={line:C,column:_};return function(V){return V.position=new A(D),L(),V}}function A(D){this.start=D,this.end={line:C,column:_},this.source=j.source}A.prototype.content=S;function T(D){var V=new Error(j.source+":"+C+":"+_+": "+D);if(V.reason=D,V.filename=j.source,V.line=C,V.column=_,V.source=S,!j.silent)throw V}function P(D){var V=D.exec(S);if(V){var z=V[0];return k(z),S=S.slice(z.length),V}}function L(){P(n)}function I(D){var V;for(D=D||[];V=F();)V!==!1&&D.push(V);return D}function F(){var D=O();if(!(f!=S.charAt(0)||m!=S.charAt(1))){for(var V=2;d!=S.charAt(V)&&(m!=S.charAt(V)||f!=S.charAt(V+1));)++V;if(V+=2,d===S.charAt(V-1))return T("End of comment missing");var z=S.slice(2,V-2);return _+=2,k(z),S=S.slice(V),_+=2,D({type:g,comment:z})}}function $(){var D=O(),V=P(r);if(V){if(F(),!P(i))return T("property missing ':'");var z=P(a),q=D({type:v,property:w(V[0].replace(e,d)),value:z?w(z[0].replace(e,d)):d});return P(o),q}}function X(){var D=[];I(D);for(var V;V=$();)V!==!1&&(D.push(V),I(D));return D}return L(),X()}function w(S){return S?S.replace(l,d):d}return GS=b,GS}var MR;function ece(){if(MR)return wf;MR=1;var e=wf&&wf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=n;const t=e(Jue());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:m}=c;l?i(f,m,c):m&&(a=a||{},a[f]=m)}),a}return wf}var Zh={},DR;function tce(){if(DR)return Zh;DR=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},c=function(f,m){return m===void 0&&(m={}),a(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(i,l):f=f.replace(r,l),f.replace(t,o))};return Zh.camelCase=c,Zh}var Jh,RR;function nce(){if(RR)return Jh;RR=1;var e=Jh&&Jh.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ece()),n=tce();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,Jh=r,Jh}var rce=nce();const ice=Hi(rce),SU=jU("end"),Ik=jU("start");function jU(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ace(e){const t=Ik(e),n=SU(e);if(t&&n)return{start:t,end:n}}function Em(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?IR(e.position):"start"in e||"end"in e?IR(e):"line"in e||"column"in e?G_(e):""}function G_(e){return LR(e&&e.line)+":"+LR(e&&e.column)}function IR(e){return G_(e&&e.start)+"-"+G_(e&&e.end)}function LR(e){return e&&typeof e=="number"?e:1}class Vr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Em(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vr.prototype.file="";Vr.prototype.name="";Vr.prototype.reason="";Vr.prototype.message="";Vr.prototype.stack="";Vr.prototype.column=void 0;Vr.prototype.line=void 0;Vr.prototype.ancestors=void 0;Vr.prototype.cause=void 0;Vr.prototype.fatal=void 0;Vr.prototype.place=void 0;Vr.prototype.ruleId=void 0;Vr.prototype.source=void 0;const Lk={}.hasOwnProperty,oce=new Map,sce=/[A-Z]/g,lce=new Set(["table","tbody","thead","tfoot","tr"]),uce=new Set(["td","th"]),EU="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cce(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=yce(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=vce(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"?Rk:Que,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_U(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function _U(e,t,n){if(t.type==="element")return fce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return mce(e,t,n);if(t.type==="mdxjsEsm")return hce(e,t);if(t.type==="root")return pce(e,t,n);if(t.type==="text")return gce(e,t)}function fce(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rk,e.schema=i),e.ancestors.push(t);const a=NU(e,t.tagName,!1),o=xce(e,t);let l=$k(e,t);return lce.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Fue(c):!0})),CU(e,o,a,t),zk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function dce(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Bm(e,t.position)}function hce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bm(e,t.position)}function mce(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Rk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:NU(e,t.name,!0),o=bce(e,t),l=$k(e,t);return CU(e,o,a,t),zk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function pce(e,t,n){const r={};return zk(r,$k(e,t)),e.create(t,e.Fragment,r,n)}function gce(e,t){return t.value}function CU(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vce(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 yce(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=Ik(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 xce(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Lk.call(t.properties,i)){const a=wce(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&uce.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 bce(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Bm(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Bm(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function $k(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:oce;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=_U(e,a,o);l!==void 0&&n.push(l)}return n}function wce(e,t,n){const r=Gue(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Iue(n):Zue(n)),r.property==="style"){let i=typeof n=="object"?n:Sce(e,String(n));return e.stylePropertyNameCase==="css"&&(i=jce(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Vue[r.property]||r.property:r.attribute,n]}}function Sce(e,t){try{return ice(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Vr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=EU+"#cannot-parse-style-attribute",i}}function NU(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=kR(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=kR(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Lk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bm(e)}function Bm(e,t){const n=new Vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=EU+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jce(e){const t={};let n;for(n in e)Lk.call(e,n)&&(t[Ece(n)]=e[n]);return t}function Ece(e){let t=e.replace(sce,_ce);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _ce(e){return"-"+e.toLowerCase()}const XS={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Cce={};function Bk(e,t){const n=Cce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kU(e,r,i)}function kU(e,t,n){if(Nce(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 zR(e.children,t,n)}return Array.isArray(e)?zR(e,t,n):""}function zR(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=kU(e[i],t,n);return r.join("")}function Nce(e){return!!(e&&typeof e=="object")}const $R=document.createElement("i");function Fk(e){const t="&"+e+";";$R.innerHTML=t;const n=$R.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ii(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function oa(e,t){return e.length>0?(Ii(e,e.length,0,t),e):t}const BR={}.hasOwnProperty;function AU(e){const t={};let n=-1;for(;++n<e.length;)kce(t,e[n]);return t}function kce(e,t){let n;for(n in t){const i=(BR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){BR.call(i,o)||(i[o]=[]);const l=a[o];Ace(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Ace(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ii(e,0,0,r)}function OU(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 Ka(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=Jl(/[A-Za-z]/),Ur=Jl(/[\dA-Za-z]/),Oce=Jl(/[#-'*+\--9=?A-Z^-~]/);function ax(e){return e!==null&&(e<32||e===127)}const X_=Jl(/\d/),Tce=Jl(/[\dA-Fa-f]/),Pce=Jl(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function St(e){return e===-2||e===-1||e===32}const Q0=Jl(new RegExp("\\p{P}|\\p{S}","u")),fc=Jl(/\s/);function Jl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ud(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ur(e.charCodeAt(n+1))&&Ur(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return St(c)?(e.enter(n),l(c)):t(c)}function l(c){return St(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const Mce={tokenize:Dce};function Dce(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return nt(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const Rce={tokenize:Ice},FR={tokenize:Lce};function Ice(e){const t=this,n=[];let r=0,i,a,o;return l;function l(_){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,c,f)(_)}return f(_)}function c(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const k=t.events.length;let O=k,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){A=t.events[O][1].end;break}j(r);let T=k;for(;T<t.events.length;)t.events[T][1].end={...A},T++;return Ii(t.events,O+1,0,t.events.slice(k)),t.events.length=T,f(_)}return l(_)}function f(_){if(r===n.length){if(!i)return g(_);if(i.currentConstruct&&i.currentConstruct.concrete)return b(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(FR,m,d)(_)}function m(_){return i&&C(),j(r),g(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(_)}function g(_){return t.containerState={},e.attempt(FR,v,b)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),g(_)}function b(_){if(_===null){i&&C(),j(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(_)}function w(_){if(_===null){S(e.exit("chunkFlow"),!0),j(0),e.consume(_);return}return nt(_)?(e.consume(_),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(_),w)}function S(_,k){const O=t.sliceStream(_);if(k&&O.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(O),t.parser.lazy[_.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<o&&(!i.events[A][1].end||i.events[A][1].end.offset>o))return;const T=t.events.length;let P=T,L,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(L){I=t.events[P][1].end;break}L=!0}for(j(r),A=T;A<t.events.length;)t.events[A][1].end={...I},A++;Ii(t.events,P+1,0,t.events.slice(T)),t.events.length=A}}function j(_){let k=n.length;for(;k-- >_;){const O=n[k];t.containerState=O[1],O[0].exit.call(t,e)}n.length=_}function C(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Lce(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pd(e){if(e===null||cn(e)||fc(e))return 1;if(Q0(e))return 2}function Z0(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 W_={name:"attention",resolveAll:zce,tokenize:$ce};function zce(e,t){let n=-1,r,i,a,o,l,c,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},g={...e[n][1].start};UR(d,-c),UR(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=oa(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=oa(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=oa(f,Z0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=oa(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=oa(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Ii(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function $ce(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pd(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"),m=pd(c),d=!m||m===2&&i||n.includes(c),g=!i||i===2&&m||n.includes(r);return f._open=!!(a===42?d:d&&(i||!g)),f._close=!!(a===42?g:g&&(m||!d)),t(c)}}function UR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Bce={name:"autolink",tokenize:Fce};function Fce(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return ei(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Ur(v)?(r=1,l(v)):f(v)}function l(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||Ur(v))&&r++<32?(e.consume(v),l):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||ax(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),m):Oce(v)?(e.consume(v),f):n(v)}function m(v){return Ur(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,m):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||Ur(v))&&r++<63){const b=v===45?g:d;return e.consume(v),b}return n(v)}}const qp={partial:!0,tokenize:Uce};function Uce(e,t,n){return r;function r(a){return St(a)?Mt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||nt(a)?t(a):n(a)}}const TU={continuation:{tokenize:qce},exit:Vce,name:"blockQuote",tokenize:Hce};function Hce(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 St(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function qce(e,t,n){const r=this;return i;function i(o){return St(o)?Mt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(TU,t,n)(o)}}function Vce(e){e.exit("blockQuote")}const PU={name:"characterEscape",tokenize:Kce};function Kce(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 Pce(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const MU={name:"characterReference",tokenize:Yce};function Yce(e,t,n){const r=this;let i=0,a,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Ur,m(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Tce,m):(e.enter("characterReferenceValue"),a=7,o=X_,m(d))}function m(d){if(d===59&&i){const g=e.exit("characterReferenceValue");return o===Ur&&!Fk(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),m):n(d)}}const HR={partial:!0,tokenize:Xce},qR={concrete:!0,name:"codeFenced",tokenize:Gce};function Gce(e,t,n){const r=this,i={partial:!0,tokenize:O};let a=0,o=0,l;return c;function c(A){return f(A)}function f(A){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===l?(o++,e.consume(A),m):o<3?n(A):(e.exit("codeFencedFenceSequence"),St(A)?Mt(e,d,"whitespace")(A):d(A))}function d(A){return A===null||nt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(HR,w,k)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(A)):St(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,v,"whitespace")(A)):A===96&&A===l?n(A):(e.consume(A),g)}function v(A){return A===null||nt(A)?d(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(A)):A===96&&A===l?n(A):(e.consume(A),b)}function w(A){return e.attempt(i,k,S)(A)}function S(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return a>0&&St(A)?Mt(e,C,"linePrefix",a+1)(A):C(A)}function C(A){return A===null||nt(A)?e.check(HR,w,k)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||nt(A)?(e.exit("codeFlowValue"),C(A)):(e.consume(A),_)}function k(A){return e.exit("codeFenced"),t(A)}function O(A,T,P){let L=0;return I;function I(V){return A.enter("lineEnding"),A.consume(V),A.exit("lineEnding"),F}function F(V){return A.enter("codeFencedFence"),St(V)?Mt(A,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):$(V)}function $(V){return V===l?(A.enter("codeFencedFenceSequence"),X(V)):P(V)}function X(V){return V===l?(L++,A.consume(V),X):L>=o?(A.exit("codeFencedFenceSequence"),St(V)?Mt(A,D,"whitespace")(V):D(V)):P(V)}function D(V){return V===null||nt(V)?(A.exit("codeFencedFence"),T(V)):P(V)}}}function Xce(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 WS={name:"codeIndented",tokenize:Qce},Wce={partial:!0,tokenize:Zce};function Qce(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(f)}function a(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?c(f):nt(f)?e.attempt(Wce,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||nt(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function Zce(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):nt(o)?i(o):n(o)}}const Jce={name:"codeText",previous:tfe,resolve:efe,tokenize:nfe};function efe(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 tfe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nfe(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,m(d)):nt(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||nt(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function m(d){return d===96?(e.consume(d),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",f(d))}}class rfe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&em(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),em(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),em(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);em(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);em(this.left,n.reverse())}}}function em(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function DU(e){const t={};let n=-1,r,i,a,o,l,c,f;const m=new rfe(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ife(m,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=m.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},l=m.slice(i,n),l.unshift(r),m.splice(i,n-i+1,l))}}return Ii(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function ife(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 m,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||(m=r.sliceStream(v),v.next||m.push(null),d&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(m),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(w=g+1,S.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),g=S.length;g--;){const j=l.slice(S[g],S[g+1]),C=a.pop();c.push([C,C+j.length-1]),e.splice(C,2,j)}for(c.reverse(),g=-1;++g<c.length;)f[b+c[g][0]]=b+c[g][1],b+=c[g][1]-c[g][0]-1;return f}const afe={resolve:sfe,tokenize:lfe},ofe={partial:!0,tokenize:ufe};function sfe(e){return DU(e),e}function lfe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):nt(l)?e.check(ofe,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 ufe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Mt(e,a,"linePrefix")}function a(o){if(o===null||nt(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function RU(e,t,n,r,i,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let m=0;return d;function d(j){return j===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(j),e.exit(a),g):j===null||j===32||j===41||ax(j)?n(j):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(j))}function g(j){return j===62?(e.enter(a),e.consume(j),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(j))}function v(j){return j===62?(e.exit("chunkString"),e.exit(l),g(j)):j===null||j===60||nt(j)?n(j):(e.consume(j),j===92?b:v)}function b(j){return j===60||j===62||j===92?(e.consume(j),v):v(j)}function w(j){return!m&&(j===null||j===41||cn(j))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(j)):m<f&&j===40?(e.consume(j),m++,w):j===41?(e.consume(j),m--,w):j===null||j===32||j===40||ax(j)?n(j):(e.consume(j),j===92?S:w)}function S(j){return j===40||j===41||j===92?(e.consume(j),w):w(j)}}function IU(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),m}function m(v){return l>999||v===null||v===91||v===93&&!c||v===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):nt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||nt(v)||l++>999?(e.exit("chunkString"),m(v)):(e.consume(v),c||(c=!St(v)),v===92?g:d)}function g(v){return v===91||v===92||v===93?(e.consume(v),l++,d):d(v)}}function LU(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):nt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Mt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===o||g===null||nt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?d:m)}function d(g){return g===o||g===92?(e.consume(g),m):m(g)}}function _m(e,t){let n;return r;function r(i){return nt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):St(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cfe={name:"definition",tokenize:dfe},ffe={partial:!0,tokenize:hfe};function dfe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return IU.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return cn(v)?_m(e,f)(v):f(v)}function f(v){return RU(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return e.attempt(ffe,d,d)(v)}function d(v){return St(v)?Mt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||nt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function hfe(e,t,n){return r;function r(l){return cn(l)?_m(e,i)(l):n(l)}function i(l){return LU(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return St(l)?Mt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||nt(l)?t(l):n(l)}}const mfe={name:"hardBreakEscape",tokenize:pfe};function pfe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return nt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const gfe={name:"headingAtx",resolve:vfe,tokenize:yfe};function vfe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ii(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yfe(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),o(m)}function o(m){return m===35&&r++<6?(e.consume(m),o):m===null||cn(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||nt(m)?(e.exit("atxHeading"),t(m)):St(m)?Mt(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||cn(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const xfe=["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"],VR=["pre","script","style","textarea"],bfe={concrete:!0,name:"htmlFlow",resolveTo:jfe,tokenize:Efe},wfe={partial:!0,tokenize:Cfe},Sfe={partial:!0,tokenize:_fe};function jfe(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 Efe(e,t,n){const r=this;let i,a,o,l,c;return f;function f(B){return m(B)}function m(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),d}function d(B){return B===33?(e.consume(B),g):B===47?(e.consume(B),a=!0,w):B===63?(e.consume(B),i=3,r.interrupt?t:R):ei(B)?(e.consume(B),o=String.fromCharCode(B),S):n(B)}function g(B){return B===45?(e.consume(B),i=2,v):B===91?(e.consume(B),i=5,l=0,b):ei(B)?(e.consume(B),i=4,r.interrupt?t:R):n(B)}function v(B){return B===45?(e.consume(B),r.interrupt?t:R):n(B)}function b(B){const Q="CDATA[";return B===Q.charCodeAt(l++)?(e.consume(B),l===Q.length?r.interrupt?t:$:b):n(B)}function w(B){return ei(B)?(e.consume(B),o=String.fromCharCode(B),S):n(B)}function S(B){if(B===null||B===47||B===62||cn(B)){const Q=B===47,Z=o.toLowerCase();return!Q&&!a&&VR.includes(Z)?(i=1,r.interrupt?t(B):$(B)):xfe.includes(o.toLowerCase())?(i=6,Q?(e.consume(B),j):r.interrupt?t(B):$(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):a?C(B):_(B))}return B===45||Ur(B)?(e.consume(B),o+=String.fromCharCode(B),S):n(B)}function j(B){return B===62?(e.consume(B),r.interrupt?t:$):n(B)}function C(B){return St(B)?(e.consume(B),C):I(B)}function _(B){return B===47?(e.consume(B),I):B===58||B===95||ei(B)?(e.consume(B),k):St(B)?(e.consume(B),_):I(B)}function k(B){return B===45||B===46||B===58||B===95||Ur(B)?(e.consume(B),k):O(B)}function O(B){return B===61?(e.consume(B),A):St(B)?(e.consume(B),O):_(B)}function A(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),c=B,T):St(B)?(e.consume(B),A):P(B)}function T(B){return B===c?(e.consume(B),c=null,L):B===null||nt(B)?n(B):(e.consume(B),T)}function P(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||cn(B)?O(B):(e.consume(B),P)}function L(B){return B===47||B===62||St(B)?_(B):n(B)}function I(B){return B===62?(e.consume(B),F):n(B)}function F(B){return B===null||nt(B)?$(B):St(B)?(e.consume(B),F):n(B)}function $(B){return B===45&&i===2?(e.consume(B),z):B===60&&i===1?(e.consume(B),q):B===62&&i===4?(e.consume(B),H):B===63&&i===3?(e.consume(B),R):B===93&&i===5?(e.consume(B),K):nt(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(wfe,U,X)(B)):B===null||nt(B)?(e.exit("htmlFlowData"),X(B)):(e.consume(B),$)}function X(B){return e.check(Sfe,D,U)(B)}function D(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),V}function V(B){return B===null||nt(B)?X(B):(e.enter("htmlFlowData"),$(B))}function z(B){return B===45?(e.consume(B),R):$(B)}function q(B){return B===47?(e.consume(B),o="",G):$(B)}function G(B){if(B===62){const Q=o.toLowerCase();return VR.includes(Q)?(e.consume(B),H):$(B)}return ei(B)&&o.length<8?(e.consume(B),o+=String.fromCharCode(B),G):$(B)}function K(B){return B===93?(e.consume(B),R):$(B)}function R(B){return B===62?(e.consume(B),H):B===45&&i===2?(e.consume(B),R):$(B)}function H(B){return B===null||nt(B)?(e.exit("htmlFlowData"),U(B)):(e.consume(B),H)}function U(B){return e.exit("htmlFlow"),t(B)}}function _fe(e,t,n){const r=this;return i;function i(o){return nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Cfe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qp,t,n)}}const Nfe={name:"htmlText",tokenize:kfe};function kfe(e,t,n){const r=this;let i,a,o;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),O):R===63?(e.consume(R),_):ei(R)?(e.consume(R),P):n(R)}function f(R){return R===45?(e.consume(R),m):R===91?(e.consume(R),a=0,b):ei(R)?(e.consume(R),C):n(R)}function m(R){return R===45?(e.consume(R),v):n(R)}function d(R){return R===null?n(R):R===45?(e.consume(R),g):nt(R)?(o=d,q(R)):(e.consume(R),d)}function g(R){return R===45?(e.consume(R),v):d(R)}function v(R){return R===62?z(R):R===45?g(R):d(R)}function b(R){const H="CDATA[";return R===H.charCodeAt(a++)?(e.consume(R),a===H.length?w:b):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),S):nt(R)?(o=w,q(R)):(e.consume(R),w)}function S(R){return R===93?(e.consume(R),j):w(R)}function j(R){return R===62?z(R):R===93?(e.consume(R),j):w(R)}function C(R){return R===null||R===62?z(R):nt(R)?(o=C,q(R)):(e.consume(R),C)}function _(R){return R===null?n(R):R===63?(e.consume(R),k):nt(R)?(o=_,q(R)):(e.consume(R),_)}function k(R){return R===62?z(R):_(R)}function O(R){return ei(R)?(e.consume(R),A):n(R)}function A(R){return R===45||Ur(R)?(e.consume(R),A):T(R)}function T(R){return nt(R)?(o=T,q(R)):St(R)?(e.consume(R),T):z(R)}function P(R){return R===45||Ur(R)?(e.consume(R),P):R===47||R===62||cn(R)?L(R):n(R)}function L(R){return R===47?(e.consume(R),z):R===58||R===95||ei(R)?(e.consume(R),I):nt(R)?(o=L,q(R)):St(R)?(e.consume(R),L):z(R)}function I(R){return R===45||R===46||R===58||R===95||Ur(R)?(e.consume(R),I):F(R)}function F(R){return R===61?(e.consume(R),$):nt(R)?(o=F,q(R)):St(R)?(e.consume(R),F):L(R)}function $(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,X):nt(R)?(o=$,q(R)):St(R)?(e.consume(R),$):(e.consume(R),D)}function X(R){return R===i?(e.consume(R),i=void 0,V):R===null?n(R):nt(R)?(o=X,q(R)):(e.consume(R),X)}function D(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||cn(R)?L(R):(e.consume(R),D)}function V(R){return R===47||R===62||cn(R)?L(R):n(R)}function z(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function q(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),G}function G(R){return St(R)?Mt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):K(R)}function K(R){return e.enter("htmlTextData"),o(R)}}const Uk={name:"labelEnd",resolveAll:Pfe,resolveTo:Mfe,tokenize:Dfe},Afe={tokenize:Rfe},Ofe={tokenize:Ife},Tfe={tokenize:Lfe};function Pfe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ii(e,0,e.length,n),e}function Mfe(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}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=oa(l,e.slice(a+1,a+r+3)),l=oa(l,[["enter",m,t]]),l=oa(l,Z0(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=oa(l,[["exit",m,t],e[o-2],e[o-1],["exit",f,t]]),l=oa(l,e.slice(o+1)),l=oa(l,[["exit",c,t]]),Ii(e,a,e.length,l),e}function Dfe(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(Ka(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(Afe,m,o?m:d)(g):g===91?e.attempt(Ofe,m,o?f:d)(g):o?m(g):d(g)}function f(g){return e.attempt(Tfe,m,d)(g)}function m(g){return t(g)}function d(g){return a._balanced=!0,n(g)}}function Rfe(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 cn(d)?_m(e,a)(d):a(d)}function a(d){return d===41?m(d):RU(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return cn(d)?_m(e,c)(d):m(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?LU(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):m(d)}function f(d){return cn(d)?_m(e,m)(d):m(d)}function m(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Ife(e,t,n){const r=this;return i;function i(l){return IU.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Ka(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function Lfe(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 zfe={name:"labelStartImage",resolveAll:Uk.resolveAll,tokenize:$fe};function $fe(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 Bfe={name:"labelStartLink",resolveAll:Uk.resolveAll,tokenize:Ffe};function Ffe(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 QS={name:"lineEnding",tokenize:Ufe};function Ufe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}const Ty={name:"thematicBreak",tokenize:Hfe};function Hfe(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||nt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===i?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),St(f)?Mt(e,l,"whitespace")(f):l(f))}}const mi={continuation:{tokenize:Yfe},exit:Xfe,name:"list",tokenize:Kfe},qfe={partial:!0,tokenize:Wfe},Vfe={partial:!0,tokenize:Gfe};function Kfe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:X_(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ty,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 X_(v)&&++o<10?(e.consume(v),c):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),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(qp,r.interrupt?n:m,e.attempt(qfe,g,d))}function m(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function d(v){return St(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 Yfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qp,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!St(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(Vfe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(mi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Gfe(e,t,n){const r=this;return Mt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Xfe(e){e.exit(this.containerState.type)}function Wfe(e,t,n){const r=this;return Mt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!St(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const KR={name:"setextUnderline",resolveTo:Qfe,tokenize:Zfe};function Qfe(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 Zfe(e,t,n){const r=this;let i;return a;function a(f){let m=r.events.length,d;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){d=r.events[m][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"),St(f)?Mt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||nt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Jfe={tokenize:ede};function ede(e){const t=this,n=e.attempt(qp,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(afe,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 tde={resolveAll:$U()},nde=zU("string"),rde=zU("text");function zU(e){return{resolveAll:$U(e==="text"?ide:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(m){return f(m)?a(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),c}function c(m){return f(m)?(n.exit("data"),a(m)):(n.consume(m),c)}function f(m){if(m===null)return!0;const d=i[m];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 $U(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 ide(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 ade={42:mi,43:mi,45:mi,48:mi,49:mi,50:mi,51:mi,52:mi,53:mi,54:mi,55:mi,56:mi,57:mi,62:TU},ode={91:cfe},sde={[-2]:WS,[-1]:WS,32:WS},lde={35:gfe,42:Ty,45:[KR,Ty],60:bfe,61:KR,95:Ty,96:qR,126:qR},ude={38:MU,92:PU},cde={[-5]:QS,[-4]:QS,[-3]:QS,33:zfe,38:MU,42:W_,60:[Bce,Nfe],91:Bfe,92:[mfe,PU],93:Uk,95:W_,96:Jce},fde={null:[W_,tde]},dde={null:[42,95]},hde={null:[]},mde=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dde,contentInitial:ode,disable:hde,document:ade,flow:lde,flowInitial:sde,insideSpan:fde,string:ude,text:cde},Symbol.toStringTag,{value:"Module"}));function pde(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],l=[];const c={attempt:T(O),check:T(A),consume:C,enter:_,exit:k,interrupt:T(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:d};let m=t.tokenize.call(f,c);return t.resolveAll&&a.push(t),f;function d(F){return o=oa(o,F),S(),o[o.length-1]!==null?[]:(P(t,0),f.events=Z0(a,f.events,f),f.events)}function g(F,$){return vde(v(F),$)}function v(F){return gde(o,F)}function b(){const{_bufferIndex:F,_index:$,line:X,column:D,offset:V}=r;return{_bufferIndex:F,_index:$,line:X,column:D,offset:V}}function w(F){i[F.line]=F.column,I()}function S(){let F;for(;r._index<o.length;){const $=o[r._index];if(typeof $=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<$.length;)j($.charCodeAt(r._bufferIndex));else j($)}}function j(F){m=m(F)}function C(F){nt(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,I()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=F}function _(F,$){const X=$||{};return X.type=F,X.start=b(),f.events.push(["enter",X,f]),l.push(X),X}function k(F){const $=l.pop();return $.end=b(),f.events.push(["exit",$,f]),$}function O(F,$){P(F,$.from)}function A(F,$){$.restore()}function T(F,$){return X;function X(D,V,z){let q,G,K,R;return Array.isArray(D)?U(D):"tokenize"in D?U([D]):H(D);function H(te){return ae;function ae(re){const ee=re!==null&&te[re],se=re!==null&&te.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return U(ge)(re)}}function U(te){return q=te,G=0,te.length===0?z:B(te[G])}function B(te){return ae;function ae(re){return R=L(),K=te,te.partial||(f.currentConstruct=te),te.name&&f.parser.constructs.disable.null.includes(te.name)?Z():te.tokenize.call($?Object.assign(Object.create(f),$):f,c,Q,Z)(re)}}function Q(te){return F(K,R),V}function Z(te){return R.restore(),++G<q.length?B(q[G]):z}}}function P(F,$){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Ii(f.events,$,f.events.length-$,F.resolve(f.events.slice($),f)),F.resolveTo&&(f.events=F.resolveTo(f.events,f))}function L(){const F=b(),$=f.previous,X=f.currentConstruct,D=f.events.length,V=Array.from(l);return{from:D,restore:z};function z(){r=F,f.previous=$,f.currentConstruct=X,f.events.length=D,l=V,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function gde(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 vde(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 yde(e){const r={constructs:AU([mde,...(e||{}).extensions||[]]),content:i(Mce),defined:[],document:i(Rce),flow:i(Jfe),lazy:{},string:i(nde),text:i(rde)};return r;function i(a){return o;function o(l){return pde(r,a,l)}}}function xde(e){for(;!DU(e););return e}const YR=/[\0\t\n\r]/g;function bde(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let f,m,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(YR.lastIndex=d,f=YR.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(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=g+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const wde=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Sde(e){return e.replace(wde,jde)}function jde(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return OU(n.slice(a?2:1),a?16:10)}return Fk(n)||e}const BU={}.hasOwnProperty;function Ede(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),_de(n)(xde(yde(n).document().write(bde()(e,t,!0))))}function _de(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(We),autolinkProtocol:L,autolinkEmail:L,atxHeading:a(He),blockQuote:a(se),characterEscape:L,characterReference:L,codeFenced:a(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ge,o),codeText:a(ie,o),codeTextData:L,data:L,codeFlowValue:L,definition:a(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Ee),hardBreakEscape:a(ke),hardBreakTrailing:a(ke),htmlFlow:a(it,o),htmlFlowData:L,htmlText:a(it,o),htmlTextData:L,image:a(Je),label:o,link:a(We),listItem:a(mt),listItemValue:g,listOrdered:a(zt,d),listUnordered:a(zt),paragraph:a(Et),reference:B,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(He),strong:a(Kt),thematicBreak:a(fn)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Z,characterReferenceMarkerNumeric:Z,characterReferenceValue:te,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:I,codeIndented:c(j),codeText:c(V),codeTextData:I,data:I,definition:c(),definitionDestinationString:k,definitionLabelString:C,definitionTitleString:_,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(X),htmlFlowData:I,htmlText:c(D),htmlTextData:I,image:c(q),label:K,labelText:G,lineEnding:F,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:R,resourceTitleString:H,resource:U,setextHeading:c(P),setextHeadingLineSequence:T,setextHeadingText:A,strong:c(),thematicBreak:c()}};FU(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let xe={type:"root",children:[]};const Me={stack:[xe],tokenStack:[],config:t,enter:l,exit:f,buffer:o,resume:m,data:n},et=[];let tt=-1;for(;++tt<ce.length;)if(ce[tt][1].type==="listOrdered"||ce[tt][1].type==="listUnordered")if(ce[tt][0]==="enter")et.push(tt);else{const Xt=et.pop();tt=i(ce,Xt,tt)}for(tt=-1;++tt<ce.length;){const Xt=t[ce[tt][0]];BU.call(Xt,ce[tt][1].type)&&Xt[ce[tt][1].type].call(Object.assign({sliceSerialize:ce[tt][2].sliceSerialize},Me),ce[tt][1])}if(Me.tokenStack.length>0){const Xt=Me.tokenStack[Me.tokenStack.length-1];(Xt[1]||GR).call(Me,void 0,Xt[0])}for(xe.position={start:ml(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:ml(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)xe=t.transforms[tt](xe)||xe;return xe}function i(ce,xe,Me){let et=xe-1,tt=-1,Xt=!1,nn,je,st,xt;for(;++et<=Me;){const ut=ce[et];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?tt++:tt--,xt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(nn&&!xt&&!tt&&!st&&(st=et),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!tt&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||tt===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(nn){let Bn=et;for(je=void 0;Bn--;){const rn=ce[Bn];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;je&&(ce[je][1].type="lineEndingBlank",Xt=!0),rn[1].type="lineEnding",je=Bn}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}st&&(!je||st<je)&&(nn._spread=!0),nn.end=Object.assign({},je?ce[je][1].start:ut[1].end),ce.splice(je||et,0,["exit",nn,ut[2]]),et++,Me++}if(ut[1].type==="listItemPrefix"){const Bn={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};nn=Bn,ce.splice(et,0,["enter",Bn,ut[2]]),et++,Me++,st=void 0,xt=!0}}}return ce[xe][1]._spread=Xt,Me}function a(ce,xe){return Me;function Me(et){l.call(this,ce(et),et),xe&&xe.call(this,et)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ce,xe,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([xe,Me||void 0]),ce.position={start:ml(xe.start),end:void 0}}function c(ce){return xe;function xe(Me){ce&&ce.call(this,Me),f.call(this,Me)}}function f(ce,xe){const Me=this.stack.pop(),et=this.tokenStack.pop();if(et)et[0].type!==ce.type&&(xe?xe.call(this,ce,et[0]):(et[1]||GR).call(this,ce,et[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Em({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=ml(ce.end)}function m(){return Bk(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=ce}function b(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=ce}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce.replace(/(\r?\n|\r)$/g,"")}function C(ce){const xe=this.resume(),Me=this.stack[this.stack.length-1];Me.label=xe,Me.identifier=Ka(this.sliceSerialize(ce)).toLowerCase()}function _(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ce}function k(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ce}function O(ce){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Me=this.sliceSerialize(ce).length;xe.depth=Me}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function T(ce){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ce){const Me=this.stack[this.stack.length-1].children;let et=Me[Me.length-1];(!et||et.type!=="text")&&(et=It(),et.position={start:ml(ce.start),end:void 0},Me.push(et)),this.stack.push(et)}function I(ce){const xe=this.stack.pop();xe.value+=this.sliceSerialize(ce),xe.position.end=ml(ce.end)}function F(ce){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=xe.children[xe.children.length-1];Me.position.end=ml(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(L.call(this,ce),I.call(this,ce))}function $(){this.data.atHardBreak=!0}function X(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function D(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function V(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ce}function z(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=xe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function q(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=xe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function G(ce){const xe=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=Sde(xe),Me.identifier=Ka(xe).toLowerCase()}function K(){const ce=this.stack[this.stack.length-1],xe=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const et=ce.children;Me.children=et}else Me.alt=xe}function R(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ce}function H(){const ce=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ce}function U(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Q(ce){const xe=this.resume(),Me=this.stack[this.stack.length-1];Me.label=xe,Me.identifier=Ka(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function Z(ce){this.data.characterReferenceType=ce.type}function te(ce){const xe=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let et;Me?(et=OU(xe,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):et=Fk(xe);const tt=this.stack[this.stack.length-1];tt.value+=et}function ae(ce){const xe=this.stack.pop();xe.position.end=ml(ce.end)}function re(ce){I.call(this,ce);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(ce)}function ee(ce){I.call(this,ce);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(ce)}function se(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function it(){return{type:"html",value:""}}function Je(){return{type:"image",title:null,url:"",alt:null}}function We(){return{type:"link",title:null,url:"",children:[]}}function zt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function mt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Et(){return{type:"paragraph",children:[]}}function Kt(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function fn(){return{type:"thematicBreak"}}}function ml(e){return{line:e.line,column:e.column,offset:e.offset}}function FU(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?FU(e,r):Cde(e,r)}}function Cde(e,t){let n;for(n in t)if(BU.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 GR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Em({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Em({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Em({start:t.start,end:t.end})+") is still open")}function Nde(e){const t=this;t.parser=n;function n(r){return Ede(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kde(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 Ade(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function Ode(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 Tde(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pde(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mde(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ud(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 Dde(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 Rde(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function UU(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 Ide(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return UU(e,t);const i={src:Ud(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 Lde(e,t){const n={src:Ud(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 zde(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 $de(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return UU(e,t);const i={href:Ud(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 Bde(e,t){const n={href:Ud(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 Fde(e,t,n){const r=e.all(t),i=n?Ude(n):HU(t),a={},o=[];if(typeof t.checked=="boolean"){const m=r[0];let d;m&&m.type==="element"&&m.tagName==="p"?d=m:(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 m=r[l];(i||l!==0||m.type!=="element"||m.tagName!=="p")&&o.push({type:"text",value:`
`}),m.type==="element"&&m.tagName==="p"&&!i?o.push(...m.children):o.push(m)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function Ude(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=HU(n[r])}return t}function HU(e){const t=e.spread;return t??e.children.length>1}function Hde(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 qde(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vde(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Kde(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yde(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=Ik(t.children[1]),c=SU(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 Gde(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 m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function Xde(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const XR=9,WR=32;function Wde(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(QR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(QR(t.slice(i),i>0,!1)),a.join("")}function QR(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===XR||a===WR;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===XR||a===WR;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Qde(e,t){const n={type:"text",value:Wde(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Zde(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Jde={blockquote:kde,break:Ade,code:Ode,delete:Tde,emphasis:Pde,footnoteReference:Mde,heading:Dde,html:Rde,imageReference:Ide,image:Lde,inlineCode:zde,linkReference:$de,link:Bde,listItem:Fde,list:Hde,paragraph:qde,root:Vde,strong:Kde,table:Yde,tableCell:Xde,tableRow:Gde,text:Qde,thematicBreak:Zde,toml:Wv,yaml:Wv,definition:Wv,footnoteDefinition:Wv};function Wv(){}const qU=-1,J0=0,Cm=1,ox=2,Hk=3,qk=4,Vk=5,Kk=6,VU=7,KU=8,ZR=typeof self=="object"?self:globalThis,ehe=(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 J0:case qU:return n(o,i);case Cm:{const l=n([],i);for(const c of o)l.push(r(c));return l}case ox:{const l=n({},i);for(const[c,f]of o)l[r(c)]=r(f);return l}case Hk:return n(new Date(o),i);case qk:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case Vk:{const l=n(new Map,i);for(const[c,f]of o)l.set(r(c),r(f));return l}case Kk:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case VU:{const{name:l,message:c}=o;return n(new ZR[l](c),i)}case KU: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 ZR[a](o),i)};return r},JR=e=>ehe(new Map,e)(0),Sf="",{toString:the}={},{keys:nhe}=Object,tm=e=>{const t=typeof e;if(t!=="object"||!e)return[J0,t];const n=the.call(e).slice(8,-1);switch(n){case"Array":return[Cm,Sf];case"Object":return[ox,Sf];case"Date":return[Hk,Sf];case"RegExp":return[qk,Sf];case"Map":return[Vk,Sf];case"Set":return[Kk,Sf];case"DataView":return[Cm,n]}return n.includes("Array")?[Cm,n]:n.includes("Error")?[VU,n]:[ox,n]},Qv=([e,t])=>e===J0&&(t==="function"||t==="symbol"),rhe=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=tm(o);switch(l){case J0:{let m=o;switch(c){case"bigint":l=KU,m=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return i([qU],o)}return i([l,m],o)}case Cm:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),i([c,[...g]],o)}const m=[],d=i([l,m],o);for(const g of o)m.push(a(g));return d}case ox:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const m=[],d=i([l,m],o);for(const g of nhe(o))(e||!Qv(tm(o[g])))&&m.push([a(g),a(o[g])]);return d}case Hk:return i([l,o.toISOString()],o);case qk:{const{source:m,flags:d}=o;return i([l,{source:m,flags:d}],o)}case Vk:{const m=[],d=i([l,m],o);for(const[g,v]of o)(e||!(Qv(tm(g))||Qv(tm(v))))&&m.push([a(g),a(v)]);return d}case Kk:{const m=[],d=i([l,m],o);for(const g of o)(e||!Qv(tm(g)))&&m.push(a(g));return d}}const{message:f}=o;return i([l,{name:c,message:f}],o)};return a},eI=(e,{json:t,lossy:n}={})=>{const r=[];return rhe(!(t||n),!!t,new Map,r)(e),r},sx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?JR(eI(e,t)):structuredClone(e):(e,t)=>JR(eI(e,t));function ihe(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 ahe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ohe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ihe,r=e.options.footnoteBackLabel||ahe,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 m=e.all(f),d=String(f.identifier).toUpperCase(),g=Ud(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=m[m.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else m.push(...b);const j={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(m,!0)};e.patch(f,j),l.push(j)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...sx(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 eb=(function(e){if(e==null)return che;if(typeof e=="function")return tb(e);if(typeof e=="object")return Array.isArray(e)?she(e):lhe(e);if(typeof e=="string")return uhe(e);throw new Error("Expected function, string, or object as test")});function she(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eb(e[n]);return tb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function lhe(e){const t=e;return tb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function uhe(e){return tb(t);function t(n){return n&&n.type===e}}function tb(e){return t;function t(n,r,i){return!!(fhe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function che(){return!0}function fhe(e){return e!==null&&typeof e=="object"&&"type"in e}const YU=[],dhe=!0,Q_=!1,hhe="skip";function GU(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=eb(i),o=r?-1:1;l(e,void 0,[])();function l(c,f,m){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=YU,b,w,S;if((!t||a(c,f,m[m.length-1]||void 0))&&(v=mhe(n(c,m)),v[0]===Q_))return v;if("children"in c&&c.children){const j=c;if(j.children&&v[0]!==hhe)for(w=(r?j.children.length:-1)+o,S=m.concat(j);w>-1&&w<j.children.length;){const C=j.children[w];if(b=l(C,w,S)(),b[0]===Q_)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function mhe(e){return Array.isArray(e)?e:typeof e=="number"?[dhe,e]:e==null?YU:[e]}function Yk(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),GU(e,a,l,i);function l(c,f){const m=f[f.length-1],d=m?m.children.indexOf(c):void 0;return o(c,d,m)}}const Z_={}.hasOwnProperty,phe={};function ghe(e,t){const n=t||phe,r=new Map,i=new Map,a=new Map,o={...Jde,...n.handlers},l={all:f,applyData:yhe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:vhe,wrap:bhe};return Yk(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const d=m.type==="definition"?r:i,g=String(m.identifier).toUpperCase();d.has(g)||d.set(g,m)}}),l;function c(m,d){const g=m.type,v=l.handlers[g];if(Z_.call(l.handlers,g)&&v)return v(l,m,d);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in m){const{children:w,...S}=m,j=sx(S);return j.children=l.all(m),j}return sx(m)}return(l.options.unknownHandler||xhe)(l,m,d)}function f(m){const d=[];if("children"in m){const g=m.children;let v=-1;for(;++v<g.length;){const b=l.one(g[v],m);if(b){if(v&&g[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=tI(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=tI(w.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function vhe(e,t){e.position&&(t.position=ace(e))}function yhe(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,sx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xhe(e,t){const n=t.data||{},r="value"in t&&!(Z_.call(n,"hProperties")||Z_.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 bhe(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 tI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nI(e,t){const n=ghe(e,t),r=n.one(e,void 0),i=ohe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function whe(e,t){return e&&"run"in e?async function(n,r){const i=nI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nI(n,{file:r,...e||t})}}function rI(e){if(e)throw e}var ZS,iI;function She(){if(iI)return ZS;iI=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 m=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!d)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},o=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return ZS=function c(){var f,m,d,g,v,b,w=arguments[0],S=1,j=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<j;++S)if(f=arguments[S],f!=null)for(m in f)d=l(w,m),g=l(f,m),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:m,newValue:c(C,b,g)})):typeof g<"u"&&o(w,{name:m,newValue:g}));return w},ZS}var jhe=She();const JS=Hi(jhe);function J_(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 Ehe(){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 m=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,m?_he(m,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 _he(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 m=f;if(l&&n)throw m;return i(m)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const co={basename:Che,dirname:Nhe,extname:khe,join:Ahe,sep:"/"};function Che(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vp(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 Nhe(e){if(Vp(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 khe(e){Vp(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 Ahe(...e){let t=-1,n;for(;++t<e.length;)Vp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ohe(n)}function Ohe(e){Vp(e);const t=e.codePointAt(0)===47;let n=The(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function The(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 Vp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Phe={cwd:Mhe};function Mhe(){return"/"}function eC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Dhe(e){if(typeof e=="string")e=new URL(e);else if(!eC(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 Rhe(e)}function Rhe(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 ej=["history","path","basename","stem","extname","dirname"];class XU{constructor(t){let n;t?eC(t)?n={path:t}:typeof t=="string"||Ihe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Phe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ej.length;){const a=ej[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)ej.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?co.basename(this.path):void 0}set basename(t){nj(t,"basename"),tj(t,"basename"),this.path=co.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?co.dirname(this.path):void 0}set dirname(t){aI(this.basename,"dirname"),this.path=co.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?co.extname(this.path):void 0}set extname(t){if(tj(t,"extname"),aI(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=co.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eC(t)&&(t=Dhe(t)),nj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?co.basename(this.path,this.extname):void 0}set stem(t){nj(t,"stem"),tj(t,"stem"),this.path=co.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Vr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function tj(e,t){if(e&&e.includes(co.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+co.sep+"`")}function nj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aI(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Ihe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lhe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),zhe={}.hasOwnProperty;class Gk extends Lhe{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=Ehe()}copy(){const t=new Gk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(JS(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(aj("data",this.frozen),this.namespace[t]=n,this):zhe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(aj("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=Zv(t),r=this.parser||this.Parser;return rj("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rj("process",this.parser||this.Parser),ij("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=Zv(t),c=r.parse(l);r.run(c,l,function(m,d,g){if(m||!d||!g)return f(m);const v=d,b=r.stringify(v,g);Fhe(b)?g.value=b:g.result=b,f(m,g)});function f(m,d){m||!d?o(m):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),rj("processSync",this.parser||this.Parser),ij("processSync",this.compiler||this.Compiler),this.process(t,i),sI("processSync","process",n),r;function i(a,o){n=!0,rI(a),r=o}}run(t,n,r){oI(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=Zv(n);i.run(t,c,f);function f(m,d,g){const v=d||t;m?l(m):o?o(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),sI("runSync","run",r),i;function a(o,l){rI(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Zv(n),i=this.compiler||this.Compiler;return ij("stringify",i),oI(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(aj("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[m,...d]=f;c(m,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=JS(!0,i.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const d=f[m];a(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,m){let d=-1,g=-1;for(;++d<r.length;)if(r[d][0]===f){g=d;break}if(g===-1)r.push([f,...m]);else if(m.length>0){let[v,...b]=m;const w=r[g][1];J_(w)&&J_(v)&&(v=JS(!0,w,v)),r[g]=[f,v,...b]}}}}const $he=new Gk().freeze();function rj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ij(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function aj(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 oI(e){if(!J_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sI(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zv(e){return Bhe(e)?e:new XU(e)}function Bhe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fhe(e){return typeof e=="string"||Uhe(e)}function Uhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Hhe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lI=[],uI={allowDangerousHtml:!0},qhe=/^(https?|ircs?|mailto|xmpp)$/i,Vhe=[{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 Khe(e){const t=Yhe(e),n=Ghe(e);return Xhe(t.runSync(t.parse(n),n),e)}function Yhe(e){const t=e.rehypePlugins||lI,n=e.remarkPlugins||lI,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uI}:uI;return $he().use(Nde).use(n).use(whe,r).use(t)}function Ghe(e){const t=e.children||"",n=new XU;return typeof t=="string"&&(n.value=t),n}function Xhe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Whe;for(const m of Vhe)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Hhe+m.id,void 0);return Yk(e,f),cce(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function f(m,d,g){if(m.type==="raw"&&g&&typeof d=="number")return o?g.children.splice(d,1):g.children[d]={type:"text",value:m.value},d;if(m.type==="element"){let v;for(v in XS)if(Object.hasOwn(XS,v)&&Object.hasOwn(m.properties,v)){const b=m.properties[v],w=XS[v];(w===null||w.includes(m.tagName))&&(m.properties[v]=c(String(b||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(m,d,g)),v&&g&&typeof d=="number")return l&&m.children?g.children.splice(d,1,...m.children):g.children.splice(d,1),d}}}function Whe(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||qhe.test(e.slice(0,t))?e:""}function cI(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 Qhe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zhe(e,t,n){const i=eb((n||{}).ignore||[]),a=Jhe(t);let o=-1;for(;++o<a.length;)GU(e,"text",l);function l(f,m){let d=-1,g;for(;++d<m.length;){const v=m[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,m)}function c(f,m){const d=m[m.length-1],g=a[o][0],v=a[o][1];let b=0;const S=d.children.indexOf(f);let j=!1,C=[];g.lastIndex=0;let _=g.exec(f.value);for(;_;){const k=_.index,O={index:_.index,input:_.input,stack:[...m,f]};let A=v(..._,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?g.lastIndex=k+1:(b!==k&&C.push({type:"text",value:f.value.slice(b,k)}),Array.isArray(A)?C.push(...A):A&&C.push(A),b=k+_[0].length,j=!0),!g.global)break;_=g.exec(f.value)}return j?(b<f.value.length&&C.push({type:"text",value:f.value.slice(b)}),d.children.splice(S,1,...C)):C=[f],S+C.length}}function Jhe(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([eme(i[0]),tme(i[1])])}return t}function eme(e){return typeof e=="string"?new RegExp(Qhe(e),"g"):e}function tme(e){return typeof e=="function"?e:function(){return e}}const oj="phrasing",sj=["autolink","link","image","label"];function nme(){return{transforms:[ume],enter:{literalAutolink:ime,literalAutolinkEmail:lj,literalAutolinkHttp:lj,literalAutolinkWww:lj},exit:{literalAutolink:lme,literalAutolinkEmail:sme,literalAutolinkHttp:ame,literalAutolinkWww:ome}}}function rme(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:oj,notInConstruct:sj},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:oj,notInConstruct:sj},{character:":",before:"[ps]",after:"\\/",inConstruct:oj,notInConstruct:sj}]}}function ime(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lj(e){this.config.enter.autolinkProtocol.call(this,e)}function ame(e){this.config.exit.autolinkProtocol.call(this,e)}function ome(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 sme(e){this.config.exit.autolinkEmail.call(this,e)}function lme(e){this.exit(e)}function ume(e){Zhe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cme],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fme]],{ignore:["link","linkReference"]})}function cme(e,t,n,r,i){let a="";if(!WU(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!dme(n)))return!1;const o=hme(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 fme(e,t,n,r){return!WU(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dme(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 hme(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=cI(e,"(");let a=cI(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 WU(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fc(n)||Q0(n))&&(!t||n!==47)}QU.peek=Sme;function mme(){this.buffer()}function pme(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function gme(){this.buffer()}function vme(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xme(e){this.exit(e)}function bme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ka(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wme(e){this.exit(e)}function Sme(){return"["}function QU(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 jme(){return{enter:{gfmFootnoteCallString:mme,gfmFootnoteCall:pme,gfmFootnoteDefinitionLabelString:gme,gfmFootnoteDefinition:vme},exit:{gfmFootnoteCallString:yme,gfmFootnoteCall:xme,gfmFootnoteDefinitionLabelString:bme,gfmFootnoteDefinition:wme}}}function Eme(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:QU},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"),m=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),m(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?ZU:_me))),f(),c}}function _me(e,t,n){return t===0?e:ZU(e,t,n)}function ZU(e,t,n){return(n?"":"    ")+e}const Cme=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];JU.peek=Tme;function Nme(){return{canContainEols:["delete"],enter:{strikethrough:Ame},exit:{strikethrough:Ome}}}function kme(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Cme}],handlers:{delete:JU}}}function Ame(e){this.enter({type:"delete",children:[]},e)}function Ome(e){this.exit(e)}function JU(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 Tme(){return"~"}function Pme(e){return e.length}function Mme(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Pme,a=[],o=[],l=[],c=[];let f=0,m=-1;for(;++m<e.length;){const w=[],S=[];let j=-1;for(e[m].length>f&&(f=e[m].length);++j<e[m].length;){const C=Dme(e[m][j]);if(n.alignDelimiters!==!1){const _=i(C);S[j]=_,(c[j]===void 0||_>c[j])&&(c[j]=_)}w.push(C)}o[m]=w,l[m]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)a[d]=fI(r[d]);else{const w=fI(r);for(;++d<f;)a[d]=w}d=-1;const g=[],v=[];for(;++d<f;){const w=a[d];let S="",j="";w===99?(S=":",j=":"):w===108?S=":":w===114&&(j=":");let C=n.alignDelimiters===!1?1:Math.max(1,c[d]-S.length-j.length);const _=S+"-".repeat(C)+j;n.alignDelimiters!==!1&&(C=S.length+C+j.length,C>c[d]&&(c[d]=C),v[d]=C),g[d]=_}o.splice(1,0,g),l.splice(1,0,v),m=-1;const b=[];for(;++m<o.length;){const w=o[m],S=l[m];d=-1;const j=[];for(;++d<f;){const C=w[d]||"";let _="",k="";if(n.alignDelimiters!==!1){const O=c[d]-(S[d]||0),A=a[d];A===114?_=" ".repeat(O):A===99?O%2?(_=" ".repeat(O/2+.5),k=" ".repeat(O/2-.5)):(_=" ".repeat(O/2),k=_):k=" ".repeat(O)}n.delimiterStart!==!1&&!d&&j.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||d)&&j.push(" "),n.alignDelimiters!==!1&&j.push(_),j.push(C),n.alignDelimiters!==!1&&j.push(k),n.padding!==!1&&j.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&j.push("|")}b.push(n.delimiterEnd===!1?j.join("").replace(/ +$/,""):j.join(""))}return b.join(`
`)}function Dme(e){return e==null?"":String(e)}function fI(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 Rme(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()),Ime);return i(),o}function Ime(e,t,n){return">"+(n?"":" ")+e}function Lme(e,t){return dI(e,t.inConstruct,!0)&&!dI(e,t.notInConstruct,!1)}function dI(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 hI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&Lme(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function zme(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 $me(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 Bme(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 Fme(e,t,n,r){const i=Bme(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if($me(e,n)){const d=n.enter("codeIndented"),g=n.indentLines(a,Ume);return d(),g}const l=n.createTracker(r),c=i.repeat(Math.max(zme(a,i)+1,3)),f=n.enter("codeFenced");let m=l.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);m+=l.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);m+=l.move(" "),m+=l.move(n.safe(e.meta,{before:m,after:`
`,encode:["`"],...l.current()})),d()}return m+=l.move(`
`),a&&(m+=l.move(a+`
`)),m+=l.move(c),f(),m}function Ume(e,t,n){return(n?"":"    ")+e}function Xk(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 Hme(e,t,n,r){const i=Xk(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 qme(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Fm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function lx(e,t,n){const r=pd(e),i=pd(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}}eH.peek=Vme;function eH(e,t,n,r){const i=qme(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),m=lx(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(c=Fm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=lx(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+Fm(d));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function Vme(e,t,n){return n.options.emphasis||"*"}function Kme(e,t){let n=!1;return Yk(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Q_}),!!((!e.depth||e.depth<3)&&Bk(e)&&(t.options.setext||n))}function Yme(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Kme(e,n)){const m=n.enter("headingSetext"),d=n.enter("phrasing"),g=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return d(),m(),g+`
`+(i===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(f)&&(f=Fm(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,n.options.closeAtx&&(f+=" "+o),c(),l(),f}tH.peek=Gme;function tH(e){return e.value||""}function Gme(){return"<"}nH.peek=Xme;function nH(e,t,n,r){const i=Xk(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 Xme(){return"!"}rH.peek=Wme;function rH(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 m=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Wme(){return"!"}iH.peek=Qme;function iH(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 Qme(){return"`"}function aH(e,t){const n=Bk(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))}oH.peek=Zme;function oH(e,t,n,r){const i=Xk(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(aH(e,n)){const m=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=m,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 Zme(e,t,n){return aH(e,n)?"<":"["}sH.peek=Jme;function sH(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 m=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=m,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Jme(){return"["}function Wk(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 epe(e){const t=Wk(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 tpe(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 lH(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 npe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?tpe(n):Wk(n);const l=e.ordered?o==="."?")":".":epe(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),lH(n)===o&&m){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 rpe(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 ipe(e,t,n,r){const i=rpe(n);let a=n.bulletCurrent||Wk(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()),m);return c(),f;function m(d,g,v){return g?(v?"":" ".repeat(o))+d:(v?a:a+" ".repeat(o-a.length))+d}}function ape(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const ope=eb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function spe(e,t,n,r){return(e.children.some(function(o){return ope(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function lpe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}uH.peek=upe;function uH(e,t,n,r){const i=lpe(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),m=lx(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(c=Fm(f)+c.slice(1));const d=c.charCodeAt(c.length-1),g=lx(r.after.charCodeAt(0),d,i);g.inside&&(c=c.slice(0,-1)+Fm(d));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:g.outside,before:m.outside},l+c+v}function upe(e,t,n){return n.options.strong||"*"}function cpe(e,t,n,r){return n.safe(e.value,r)}function fpe(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 dpe(e,t,n){const r=(lH(n)+(n.options.ruleSpaces?" ":"")).repeat(fpe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cH={blockquote:Rme,break:hI,code:Fme,definition:Hme,emphasis:eH,hardBreak:hI,heading:Yme,html:tH,image:nH,imageReference:rH,inlineCode:iH,link:oH,linkReference:sH,list:npe,listItem:ipe,paragraph:ape,root:spe,strong:uH,text:cpe,thematicBreak:dpe};function hpe(){return{enter:{table:mpe,tableData:mI,tableHeader:mI,tableRow:gpe},exit:{codeText:vpe,table:ppe,tableData:uj,tableHeader:uj,tableRow:uj}}}function mpe(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 ppe(e){this.exit(e),this.data.inTable=void 0}function gpe(e){this.enter({type:"tableRow",children:[]},e)}function uj(e){this.exit(e)}function mI(e){this.enter({type:"tableCell",children:[]},e)}function vpe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ype));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ype(e,t){return t==="|"?t:e}function xpe(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(m(v,w,S),v.align)}function l(v,b,w,S){const j=d(v,w,S),C=f([j]);return C.slice(0,C.indexOf(`
`))}function c(v,b,w,S){const j=w.enter("tableCell"),C=w.enter("phrasing"),_=w.containerPhrasing(v,{...S,before:a,after:a});return C(),j(),_}function f(v,b){return Mme(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("table");for(;++j<S.length;)C[j]=d(S[j],b,w);return _(),C}function d(v,b,w){const S=v.children;let j=-1;const C=[],_=b.enter("tableRow");for(;++j<S.length;)C[j]=c(S[j],v,b,w);return _(),C}function g(v,b,w){let S=cH.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function bpe(){return{exit:{taskListCheckValueChecked:pI,taskListCheckValueUnchecked:pI,paragraph:Spe}}}function wpe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jpe}}}function pI(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Spe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function jpe(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=cH.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(m){return m+o}}function Epe(){return[nme(),jme(),Nme(),hpe(),bpe()]}function _pe(e){return{extensions:[rme(),Eme(e),kme(),xpe(e),wpe()]}}const Cpe={tokenize:Ppe,partial:!0},fH={tokenize:Mpe,partial:!0},dH={tokenize:Dpe,partial:!0},hH={tokenize:Rpe,partial:!0},Npe={tokenize:Ipe,partial:!0},mH={name:"wwwAutolink",tokenize:Ope,previous:gH},pH={name:"protocolAutolink",tokenize:Tpe,previous:vH},Cs={name:"emailAutolink",tokenize:Ape,previous:yH},Po={};function kpe(){return{text:Po}}let _u=48;for(;_u<123;)Po[_u]=Cs,_u++,_u===58?_u=65:_u===91&&(_u=97);Po[43]=Cs;Po[45]=Cs;Po[46]=Cs;Po[95]=Cs;Po[72]=[Cs,pH];Po[104]=[Cs,pH];Po[87]=[Cs,mH];Po[119]=[Cs,mH];function Ape(e,t,n){const r=this;let i,a;return o;function o(d){return!tC(d)||!yH.call(r,r.previous)||Qk(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return tC(d)?(e.consume(d),l):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(Npe,m,f)(d):d===45||d===95||Ur(d)?(a=!0,e.consume(d),c):m(d)}function f(d){return e.consume(d),i=!0,c}function m(d){return a&&i&&ei(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Ope(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!gH.call(r,r.previous)||Qk(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Cpe,e.attempt(fH,e.attempt(dH,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Tpe(e,t,n){const r=this;let i="",a=!1;return o;function o(d){return(d===72||d===104)&&vH.call(r,r.previous)&&!Qk(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(ei(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const g=i.toLowerCase();if(g==="http"||g==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),a?f:(a=!0,c)):n(d)}function f(d){return d===null||ax(d)||cn(d)||fc(d)||Q0(d)?n(d):e.attempt(fH,e.attempt(dH,m),n)(d)}function m(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function Ppe(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 Mpe(e,t,n){let r,i,a;return o;function o(f){return f===46||f===95?e.check(hH,c,l)(f):f===null||cn(f)||fc(f)||f!==45&&Q0(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 Dpe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(hH,t,a)(o):o===null||cn(o)||fc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function Rpe(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),i):l===60||l===null||cn(l)||fc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||cn(l)||fc(l)?t(l):r(l)}function a(l){return ei(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ei(l)?(e.consume(l),o):n(l)}}function Ipe(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ur(a)?n(a):t(a)}}function gH(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cn(e)}function vH(e){return!ei(e)}function yH(e){return!(e===47||tC(e))}function tC(e){return e===43||e===45||e===46||e===95||Ur(e)}function Qk(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 Lpe={tokenize:Vpe,partial:!0};function zpe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Upe,continuation:{tokenize:Hpe},exit:qpe}},text:{91:{name:"gfmFootnoteCall",tokenize:Fpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:$pe,resolveTo:Bpe}}}}function $pe(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=Ka(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 Bpe(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 Fpe(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||cn(d))return n(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return i.includes(Ka(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return cn(d)||(o=!0),a++,e.consume(d),d===92?m:f}function m(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function Upe(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",m):n(b)}function m(b){if(o>999||b===93&&!l||b===null||b===91||cn(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Ka(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return cn(b)||(l=!0),o++,e.consume(b),b===92?d:m}function d(b){return b===91||b===92||b===93?(e.consume(b),o++,m):m(b)}function g(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),Mt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function Hpe(e,t,n){return e.check(qp,t,e.attempt(Lpe,t,n))}function qpe(e){e.exit("gfmFootnoteDefinition")}function Vpe(e,t,n){const r=this;return Mt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Kpe(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 m={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",m,l],["enter",o[f][1],l],["exit",o[f][1],l],["enter",d,l]],v=l.parser.constructs.insideSpan.null;v&&Ii(g,g.length,0,Z0(v,o.slice(f+1,c),l)),Ii(g,g.length,0,[["exit",d,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",m,l]]),Ii(o,f-1,c-f+3,g),c=f+g.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const f=this.previous,m=this.events;let d=0;return g;function g(b){return f===126&&m[m.length-1][1].type!=="characterEscape"?c(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=pd(f);if(b===126)return d>1?c(b):(o.consume(b),d++,v);if(d<2&&!n)return c(b);const S=o.exit("strikethroughSequenceTemporary"),j=pd(b);return S._open=!j||j===2&&!!w,S._close=!w||w===2&&!!j,l(b)}}}class Ype{constructor(){this.map=[]}add(t,n,r){Gpe(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 Gpe(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 Xpe(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 Wpe(){return{flow:{null:{name:"table",tokenize:Qpe,resolveAll:Zpe}}}}function Qpe(e,t,n){const r=this;let i=0,a=0,o;return l;function l(I){let F=r.events.length-1;for(;F>-1;){const D=r.events[F][1].type;if(D==="lineEnding"||D==="linePrefix")F--;else break}const $=F>-1?r.events[F][1].type:null,X=$==="tableHead"||$==="tableRow"?A:c;return X===A&&r.parser.lazy[r.now().line]?n(I):X(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(o=!0,a+=1),m(I)}function m(I){return I===null?n(I):nt(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),v):n(I):St(I)?Mt(e,m,"whitespace")(I):(a+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,m):(e.enter("data"),d(I)))}function d(I){return I===null||I===124||cn(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?g:d)}function g(I){return I===92||I===124?(e.consume(I),d):d(I)}function v(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,St(I)?Mt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):b(I))}function b(I){return I===45||I===58?S(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),w):O(I)}function w(I){return St(I)?Mt(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),j):I===45?(a+=1,j(I)):I===null||nt(I)?k(I):O(I)}function j(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):O(I)}function C(I){return I===45?(e.consume(I),C):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return St(I)?Mt(e,k,"whitespace")(I):k(I)}function k(I){return I===124?b(I):I===null||nt(I)?!o||i!==a?O(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):O(I)}function O(I){return n(I)}function A(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||nt(I)?(e.exit("tableRow"),t(I)):St(I)?Mt(e,T,"whitespace")(I):(e.enter("data"),P(I))}function P(I){return I===null||I===124||cn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?L:P)}function L(I){return I===92||I===124?(e.consume(I),P):P(I)}}function Zpe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,m,d;const g=new Ype;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(gI(g,t,c,f,m),m=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,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},g.add(n,0,[["enter",m,t]])),i=b.type==="tableDelimiterRow"?2:m?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Jv(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=Jv(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=Jv(g,t,a,i,n,d)):o[1]!==0&&(d=Jv(g,t,o,i,n,d)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&gI(g,t,c,f,m),g.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Xpe(t.events,n))}return e}function Jv(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},Df(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Df(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=Df(t.events,n[2]),m=Df(t.events,n[3]),d={type:l,start:Object.assign({},f),end:Object.assign({},m)};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({},Df(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function gI(e,t,n,r,i){const a=[],o=Df(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 Df(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Jpe={name:"tasklistCheck",tokenize:tge};function ege(){return{text:{91:Jpe}}}function tge(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return cn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return nt(c)?t(c):St(c)?e.check({tokenize:nge},t,n)(c):n(c)}}function nge(e,t,n){return Mt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function rge(e){return AU([kpe(),zpe(),Kpe(e),Wpe(),ege()])}const ige={};function age(e){const t=this,n=e||ige,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(rge(n)),a.push(Epe()),o.push(_pe(n))}function Li({content:e,className:t}){return h.jsx("div",{className:t,children:h.jsx(Khe,{remarkPlugins:[age],components:{h1:({children:n})=>h.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>h.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>h.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>h.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?h.jsx("code",{className:"block whitespace-pre-wrap break-words rounded bg-muted/60 px-2 py-1.5 font-mono text-xs leading-relaxed",children:n}):h.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>h.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>h.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>h.jsx("div",{className:"mb-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>h.jsx("em",{className:"italic",children:n})},children:e})})}function nb({view:e,onChange:t}){return h.jsxs("div",{className:"mb-3 flex gap-1",children:[h.jsx("button",{className:Te("rounded px-2 py-1 text-xs font-medium",e==="markdown"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("markdown"),children:"Markdown"}),h.jsx("button",{className:Te("rounded px-2 py-1 text-xs font-medium",e==="raw"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"),onClick:()=>t("raw"),children:"Raw"})]})}function oge(){const e=lt();return jt({mutationFn:t=>Pe.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function xH(){const e=lt();return jt({mutationFn:({type:t,name:n})=>Pe.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function sge(){const e=lt();return jt({mutationFn:t=>Pe.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function lge(){const e=lt();return jt({mutationFn:t=>Pe.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function uge(){const e=lt();return jt({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>Pe.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.registry.config(n.type,n.name)})}})}function cge(e){const t=lt();return jt({mutationFn:n=>Pe.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Oe.projects.resources(e)})}})}function bH(e){const t=lt();return jt({mutationFn:({type:n,name:r})=>Pe.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Oe.projects.resources(e)})}})}function fge(e){const t=lt();return jt({mutationFn:n=>Pe.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Oe.projects.resources(e)})}})}function dge(e){const t=lt();return jt({mutationFn:n=>Pe.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Oe.projects.resources(e)})}})}function hge(e){const t=lt();return jt({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>Pe.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:Oe.projects.resourceConfig(e,r.type,r.name)})}})}function wH({...e}){return h.jsx(BN,{"data-slot":"sheet",...e})}function mge({...e}){return h.jsx(FN,{"data-slot":"sheet-portal",...e})}function pge({className:e,...t}){return h.jsx(UN,{"data-slot":"sheet-overlay",className:Te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function SH({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return h.jsxs(mge,{children:[h.jsx(pge,{}),h.jsxs(HN,{"data-slot":"sheet-content",className:Te("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",n==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",n==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",n==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...i,children:[t,r&&h.jsxs(qN,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h.jsx(uc,{className:"size-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jH({className:e,...t}){return h.jsx("div",{"data-slot":"sheet-header",className:Te("flex flex-col gap-1.5 p-4",e),...t})}function EH({className:e,...t}){return h.jsx(t6,{"data-slot":"sheet-title",className:Te("font-semibold text-foreground",e),...t})}function _H({className:e,...t}){return h.jsx(n6,{"data-slot":"sheet-description",className:Te("text-sm text-muted-foreground",e),...t})}function gge(e){return On({queryKey:Oe.registry.validate(e??""),queryFn:()=>Pe.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Wu(e,t){return On({queryKey:Oe.registry.list(e),queryFn:()=>Pe.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function vge(e,t,n){return On({queryKey:Oe.registry.detail(e,t),queryFn:()=>Pe.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}const yge=K0("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Nm({className:e,variant:t,...n}){return h.jsx("div",{"data-slot":"alert",role:"alert",className:Te(yge({variant:t}),e),...n})}function km({className:e,...t}){return h.jsx("div",{"data-slot":"alert-title",className:Te("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Am({className:e,...t}){return h.jsx("div",{"data-slot":"alert-description",className:Te("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function xge({agentName:e}){const{data:t}=gge(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:h.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&h.jsxs(Nm,{variant:"destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsx(km,{children:"Missing Prerequisites"}),h.jsx(Am,{children:t.missing_tools.map(r=>h.jsxs("div",{className:"mt-1",children:[h.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&h.jsx("code",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-xs",children:r.install_hint})]},r.name))})]}),t.setup_command&&h.jsxs(Nm,{children:[h.jsx(wse,{className:"h-4 w-4"}),h.jsx(km,{children:"Setup"}),h.jsxs(Am,{children:[h.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),h.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),h.jsx("p",{className:"mt-2 text-muted-foreground",children:"Or set the API key in the config below instead."})]})]}),!t.env_ok&&!t.setup_command&&t.missing_env.length>0&&h.jsxs(Nm,{children:[h.jsx(Goe,{className:"h-4 w-4"}),h.jsx(km,{children:"API Key Required"}),h.jsx(Am,{children:h.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>h.jsxs("span",{children:[i>0&&", ",h.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function bge({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=hU(e,t,{enabled:n&&!r}),a=Tue(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=uge(),f=hge(r??0),m=r?f:c,{data:d}=Wu("agents",{enabled:n&&e==="roles"}),[g,v]=y.useState({}),[b,w]=y.useState({}),[S,j]=y.useState(new Set);if(y.useEffect(()=>{o&&(v({...o.env_values}),w({...o.params_values}))},[o]),l||!o)return null;const C=Object.keys(o.env_schema),_=Object.keys(o.params_schema);if(C.length===0&&_.length===0)return null;const k=L=>j(I=>{const F=new Set(I);return F.has(L)?F.delete(L):F.add(L),F}),O=(d??[]).map(L=>L.name),A=String(b.default_agent??"").trim(),T=e==="roles"&&A&&O.length>0&&!O.includes(A)?"Agent not found in installed agents":"",P=()=>{m.mutate({type:e,name:t,env_values:C.length>0?g:void 0,params_values:_.length>0?b:void 0},{onSuccess:()=>dt.success("Configuration saved"),onError:()=>dt.error("Failed to save configuration")})};return h.jsxs("div",{className:"flex flex-col gap-4",children:[C.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(Sl,{}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),C.map(L=>{const I=o.env_schema[L],F=S.has(L);return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ot,{className:"text-xs font-mono",children:L}),I.required&&h.jsx(ht,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),I.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),h.jsxs("div",{className:"relative",children:[h.jsx(Xe,{type:F?"text":"password",value:g[L]??"",onChange:$=>v(X=>({...X,[L]:$.target.value})),placeholder:L,className:"h-8 pr-8 text-xs font-mono"}),h.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",onClick:()=>k(L),children:F?h.jsx(Moe,{className:"h-3.5 w-3.5"}):h.jsx(Roe,{className:"h-3.5 w-3.5"})})]})]},L)})]})]}),_.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(Sl,{}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),_.map(L=>{const I=o.params_schema[L],F=b[L],$=I.default;if(I.type==="boolean")return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(ot,{className:"text-xs font-mono",children:L}),I.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),h.jsxs(pa,{value:F!=null?String(F):$!=null?String($):"",onValueChange:q=>w(G=>({...G,[L]:q==="true"})),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{})}),h.jsxs(ya,{children:[h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]},L);const X=I.type==="int"||I.type==="float"?"number":"text",D=I.type==="float"?"any":void 0,V=L==="default_agent"&&d?d.map(q=>q.name):void 0,z=V?`datalist-${L}`:void 0;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(ot,{className:"text-xs font-mono",children:L}),I.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:I.description}),h.jsx(Xe,{type:X,step:D,list:z,value:F!=null?String(F):"",onChange:q=>w(G=>({...G,[L]:X==="number"&&q.target.value!==""?Number(q.target.value):q.target.value})),placeholder:$!=null?String($):void 0,className:"h-8 text-xs font-mono"}),V&&h.jsx("datalist",{id:z,children:V.map(q=>h.jsx("option",{value:q},q))}),L==="default_agent"&&T&&h.jsx("p",{className:"text-xs text-destructive",children:T})]},L)})]})]}),h.jsxs(we,{size:"sm",onClick:P,disabled:m.isPending||!!T,className:"self-start",children:[h.jsx(UF,{className:"mr-2 h-3.5 w-3.5"}),m.isPending?"Saving...":"Save Configuration"]})]})}function CH({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var $,X;const a=lt(),o=()=>{i!=null&&a.invalidateQueries({queryKey:Oe.projects.resources(i)})},l=xH(),c=sge(),f=lge(),m=bH(i??0),d=fge(i??0),g=dge(i??0),v=i!=null&&(e==null?void 0:e.source)==="project",b=v?m:l,w=v?d:c,S=v?g:f,[j,C]=y.useState(!1),[_,k]=y.useState("markdown"),O=w.isPending||S.isPending||b.isPending;if(!e)return null;const A=()=>{if(!j){C(!0);return}b.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(dt.success(`Uninstalled ${e.name}`),v||o(),r(!1)):dt.error(`Uninstall failed: ${D.stderr||D.stdout}`),C(!1)},onError:()=>{dt.error("Uninstall request failed"),C(!1)}})},T=()=>{w.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(dt.success(`Updated ${e.name}`),v||o()):dt.error(`Update failed: ${D.stderr||D.stdout}`)},onError:()=>dt.error("Update request failed")})},P=()=>{S.mutate({type:t,name:e.name},{onSuccess:D=>{D.exit_code===0?(dt.success(`Reinstalled ${e.name}`),v||o()):dt.error(`Reinstall failed: ${D.stderr||D.stdout}`)},onError:()=>dt.error("Reinstall request failed")})},I=(($={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:$.includes(e.name))??!1,F=(X=e.frontmatter)==null?void 0:X.metadata;return h.jsx(wH,{open:n,onOpenChange:D=>{r(D),C(!1),k("markdown")},children:h.jsxs(SH,{side:"right",className:"flex h-full flex-col sm:max-w-xl overflow-x-hidden",children:[h.jsxs(jH,{className:"shrink-0",children:[h.jsxs(EH,{className:"flex items-center gap-2",children:[e.name,e.version&&h.jsxs(ht,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),h.jsx(_H,{children:e.description||"No description"})]}),h.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[h.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Source: ",h.jsx("strong",{children:e.source})]}),h.jsxs("span",{children:["Path: ",h.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),F&&Object.keys(F).length>0&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(F,null,2)})]})]}),h.jsx(W0,{className:"min-h-0 flex-1",children:h.jsxs("div",{className:"px-4 overflow-hidden",children:[t==="agents"&&h.jsx(xge,{agentName:e.name}),h.jsx(bge,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),h.jsx("div",{className:"mt-4",children:e.body?h.jsxs(h.Fragment,{children:[h.jsx(nb,{view:_,onChange:k}),_==="markdown"?h.jsx(Li,{content:e.body,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e.body})]}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No content."})})]})}),h.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[h.jsx(we,{size:"sm",onClick:T,disabled:O,children:w.isPending?"Updating...":"Update"}),h.jsx(we,{variant:"outline",size:"sm",onClick:P,disabled:O,children:S.isPending?"Reinstalling...":"Reinstall"}),h.jsx("div",{className:"flex-1"}),!I&&h.jsxs(h.Fragment,{children:[h.jsx(we,{variant:j?"destructive":"outline",size:"sm",onClick:A,disabled:O,children:b.isPending?"Uninstalling...":j?"Confirm Uninstall":"Uninstall"}),j&&!b.isPending&&h.jsx(we,{variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Cancel"})]})]})]})})}const wge=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function Zk({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=y.useState(n??"roles"),[o,l]=y.useState(""),[c,f]=y.useState(null),[m,d]=y.useState(null);y.useEffect(()=>{e&&n&&a(n)},[e,n]);const g=oge(),v=cge(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")}}))},j=C=>{C||(f(null),d(null),l("")),t(C)};return h.jsx(_a,{open:e,onOpenChange:j,children:h.jsxs(Ca,{className:"sm:max-w-md",children:[h.jsxs(Na,{children:[h.jsx(ka,{children:r?"Install Resource to Project":"Install Resource"}),h.jsx(G0,{children:"Install a resource from StrawHub by name."})]}),h.jsxs("div",{className:"flex flex-col gap-4",children:[c&&h.jsxs(Nm,{variant:c.status==="error"?"destructive":"default",className:c.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[c.status==="success"?h.jsx(Pp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):h.jsx($0,{className:"h-4 w-4"}),h.jsx(km,{children:c.status==="success"?"Installed":"Error"}),h.jsx(Am,{children:c.message})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(ot,{htmlFor:"install-type",children:"Type"}),h.jsxs(pa,{value:i,onValueChange:a,disabled:w,children:[h.jsx(va,{id:"install-type",children:h.jsx(ga,{})}),h.jsx(ya,{children:wge.map(C=>h.jsx(An,{value:C.value,children:C.label},C.value))})]})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(ot,{htmlFor:"install-name",children:"Package Name"}),h.jsx(Xe,{id:"install-name",autoFocus:!0,value:o,onChange:C=>l(C.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:w,onKeyDown:C=>{C.key==="Enter"&&S()}})]}),m&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:m})]})]}),h.jsx(Y0,{children:(c==null?void 0:c.status)==="success"?h.jsx(we,{onClick:()=>j(!1),children:"Done"}):h.jsx(we,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const vI=["roles","skills","agents","memories"],NH={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memories"};function Sge({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=Bd(e),[a,o]=y.useState(null),[l,c]=y.useState(""),[f,m]=y.useState(!1),[d,g]=y.useState(!1),v=t??d,b=n??g,{data:w}=Oue(e,l,a??"",{enabled:f&&!!a&&!!l}),S=j=>{o(j.name),c(j.type),m(!0)};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources available to this project"}),h.jsxs(we,{onClick:()=>b(!0),size:"sm",children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((j,C)=>h.jsx(ln,{className:"h-12 w-full"},C))}):!r||r.length===0?h.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources available yet."}):h.jsxs(Fp,{defaultValue:"all",children:[h.jsxs(Up,{children:[h.jsx(or,{value:"all",children:"All"}),vI.map(j=>{const C=r.filter(_=>_.type===j).length;return h.jsxs(or,{value:j,disabled:C===0,children:[NH[j]," (",C,")"]},j)})]}),h.jsx(sr,{value:"all",children:h.jsx(yI,{resources:r,showType:!0,projectId:e,onSelect:S})}),vI.map(j=>h.jsx(sr,{value:j,children:h.jsx(yI,{resources:r.filter(C=>C.type===j),projectId:e,onSelect:S})},j))]}),h.jsx(CH,{resource:w??null,resourceType:l,open:f,onOpenChange:m,projectId:e}),h.jsx(Zk,{open:v,onOpenChange:b,projectId:e})]})}function yI({resources:e,showType:t,projectId:n,onSelect:r}){return e.length===0?h.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No resources in this category."}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Source"}),t&&h.jsx(Fe,{children:"Type"}),h.jsx(Fe,{children:"Version"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Config"}),h.jsx(Fe,{className:"w-24"})]})}),h.jsx(ma,{children:e.map(i=>h.jsxs(yn,{className:"cursor-pointer",onClick:()=>r(i),children:[h.jsx(ze,{className:"font-medium",children:i.name}),h.jsx(ze,{children:h.jsx(ht,{variant:"outline",className:`text-xs ${i.source==="global"?"border-dashed":""}`,children:i.source==="global"?"Global":"Project"})}),t&&h.jsx(ze,{children:h.jsx(ht,{variant:"outline",className:"text-xs",children:NH[i.type]??i.type})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:i.version??"—"}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:i.description||"—"}),h.jsx(ze,{children:i.config_count>0&&h.jsxs(ht,{variant:"secondary",className:"text-xs gap-1",children:[h.jsx(F0,{className:"h-3 w-3"}),i.config_count]})}),h.jsx(ze,{children:i.source==="project"&&h.jsx(jge,{projectId:n,resourceType:i.type,name:i.name})})]},`${i.type}-${i.name}`))})]})})})}function jge({projectId:e,resourceType:t,name:n}){const[r,i]=y.useState(!1),a=bH(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?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(we,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):h.jsx(we,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:h.jsx(Ea,{className:"h-4 w-4"})})}function Ege(e,t="30d"){return On({queryKey:Oe.projects.stats(e,t),queryFn:()=>Pe.get(`/projects/${e}/stats?period=${t}`)})}var _ge=["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 Jk(e){if(typeof e!="string")return!1;var t=_ge;return t.includes(e)}var Cge=["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"],Nge=new Set(Cge);function kH(e){return typeof e!="string"?!1:Nge.has(e)}function AH(e){return typeof e=="string"&&e.startsWith("data-")}function $i(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(kH(n)||AH(n))&&(t[n]=e[n]);return t}function dc(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return $i(t)}return typeof e=="object"&&!Array.isArray(e)?$i(e):null}function ni(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(kH(n)||AH(n)||Jk(n))&&(t[n]=e[n]);return t}function kge(e){return e==null?null:y.isValidElement(e)?ni(e.props):typeof e=="object"&&!Array.isArray(e)?ni(e):null}var Age=["children","width","height","viewBox","className","style","title","desc"];function nC(){return nC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nC.apply(null,arguments)}function Oge(e,t){if(e==null)return{};var n,r,i=Tge(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 Tge(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 eA=y.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:f}=e,m=Oge(e,Age),d=a||{width:r,height:i,x:0,y:0},g=Rt("recharts-surface",o);return y.createElement("svg",nC({},ni(m),{className:g,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),y.createElement("title",null,c),y.createElement("desc",null,f),n)}),Pge=["children","className"];function rC(){return rC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rC.apply(null,arguments)}function Mge(e,t){if(e==null)return{};var n,r,i=Dge(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 Dge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ur=y.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Mge(e,Pge),a=Rt("recharts-layer",r);return y.createElement("g",rC({className:a},ni(i),{ref:t}),n)}),OH=y.createContext(null),Rge=()=>y.useContext(OH);function hn(e){return function(){return e}}const TH=Math.cos,ux=Math.sin,Za=Math.sqrt,cx=Math.PI,rb=2*cx,iC=Math.PI,aC=2*iC,Pu=1e-6,Ige=aC-Pu;function PH(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lge(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return PH;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 zge{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?PH:Lge(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,m=o-t,d=l-n,g=m*m+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Pu)if(!(Math.abs(d*c-f*m)>Pu)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=c*c+f*f,S=v*v+b*b,j=Math.sqrt(w),C=Math.sqrt(g),_=a*Math.tan((iC-Math.acos((w+g-S)/(2*j*C)))/2),k=_/C,O=_/j;Math.abs(k-1)>Pu&&this._append`L${t+k*m},${n+k*d}`,this._append`A${a},${a},0,0,${+(d*v>m*b)},${this._x1=t+O*c},${this._y1=n+O*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),f=t+l,m=n+c,d=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${f},${m}`:(Math.abs(this._x1-f)>Pu||Math.abs(this._y1-m)>Pu)&&this._append`L${f},${m}`,r&&(g<0&&(g=g%aC+aC),g>Ige?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=f},${this._y1=m}`:g>Pu&&this._append`A${r},${r},0,${+(g>=iC)},${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 tA(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 zge(t)}function nA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function MH(e){this._context=e}MH.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 ib(e){return new MH(e)}function DH(e){return e[0]}function RH(e){return e[1]}function IH(e,t){var n=hn(!0),r=null,i=ib,a=null,o=tA(l);e=typeof e=="function"?e:e===void 0?DH:hn(e),t=typeof t=="function"?t:t===void 0?RH:hn(t);function l(c){var f,m=(c=nA(c)).length,d,g=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=m;++f)!(f<m&&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:hn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:hn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:hn(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function ey(e,t,n){var r=null,i=hn(!0),a=null,o=ib,l=null,c=tA(f);e=typeof e=="function"?e:e===void 0?DH:hn(+e),t=typeof t=="function"?t:hn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?RH:hn(+n);function f(d){var g,v,b,w=(d=nA(d)).length,S,j=!1,C,_=new Array(w),k=new Array(w);for(a==null&&(l=o(C=c())),g=0;g<=w;++g){if(!(g<w&&i(S=d[g],g,d))===j)if(j=!j)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=g-1;b>=v;--b)l.point(_[b],k[b]);l.lineEnd(),l.areaEnd()}j&&(_[g]=+e(S,g,d),k[g]=+t(S,g,d),l.point(r?+r(S,g,d):_[g],n?+n(S,g,d):k[g]))}if(C)return l=null,C+""||null}function m(){return IH().defined(i).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:hn(+d),r=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:hn(+d),f):e},f.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:hn(+d),f):r},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:hn(+d),n=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:hn(+d),f):t},f.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:hn(+d),f):n},f.lineX0=f.lineY0=function(){return m().x(e).y(t)},f.lineY1=function(){return m().x(e).y(n)},f.lineX1=function(){return m().x(r).y(t)},f.defined=function(d){return arguments.length?(i=typeof d=="function"?d:hn(!!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 LH{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 $ge(e){return new LH(e,!0)}function Bge(e){return new LH(e,!1)}const rA={draw(e,t){const n=Za(t/cx);e.moveTo(n,0),e.arc(0,0,n,0,rb)}},Fge={draw(e,t){const n=Za(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},zH=Za(1/3),Uge=zH*2,Hge={draw(e,t){const n=Za(t/Uge),r=n*zH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},qge={draw(e,t){const n=Za(t),r=-n/2;e.rect(r,r,n,n)}},Vge=.8908130915292852,$H=ux(cx/10)/ux(7*cx/10),Kge=ux(rb/10)*$H,Yge=-TH(rb/10)*$H,Gge={draw(e,t){const n=Za(t*Vge),r=Kge*n,i=Yge*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=rb*a/5,l=TH(o),c=ux(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},cj=Za(3),Xge={draw(e,t){const n=-Za(t/(cj*3));e.moveTo(0,n*2),e.lineTo(-cj*n,-n),e.lineTo(cj*n,-n),e.closePath()}},Ji=-.5,ea=Za(3)/2,oC=1/Za(12),Wge=(oC/2+1)*3,Qge={draw(e,t){const n=Za(t/Wge),r=n/2,i=n*oC,a=r,o=n*oC+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Ji*r-ea*i,ea*r+Ji*i),e.lineTo(Ji*a-ea*o,ea*a+Ji*o),e.lineTo(Ji*l-ea*c,ea*l+Ji*c),e.lineTo(Ji*r+ea*i,Ji*i-ea*r),e.lineTo(Ji*a+ea*o,Ji*o-ea*a),e.lineTo(Ji*l+ea*c,Ji*c-ea*l),e.closePath()}};function Zge(e,t){let n=null,r=tA(i);e=typeof e=="function"?e:hn(e||rA),t=typeof t=="function"?t:hn(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:hn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:hn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function fx(){}function dx(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 BH(e){this._context=e}BH.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:dx(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:dx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jge(e){return new BH(e)}function FH(e){this._context=e}FH.prototype={areaStart:fx,areaEnd:fx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:dx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eve(e){return new FH(e)}function UH(e){this._context=e}UH.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:dx(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tve(e){return new UH(e)}function HH(e){this._context=e}HH.prototype={areaStart:fx,areaEnd:fx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function nve(e){return new HH(e)}function xI(e){return e<0?-1:1}function bI(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(xI(a)+xI(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function wI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function fj(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 hx(e){this._context=e}hx.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:fj(this,this._t0,wI(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,fj(this,wI(this,n=bI(this,e,t)),n);break;default:fj(this,this._t0,n=bI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function qH(e){this._context=new VH(e)}(qH.prototype=Object.create(hx.prototype)).point=function(e,t){hx.prototype.point.call(this,t,e)};function VH(e){this._context=e}VH.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 rve(e){return new hx(e)}function ive(e){return new qH(e)}function KH(e){this._context=e}KH.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=SI(e),i=SI(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 SI(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 ave(e){return new KH(e)}function ab(e,t){this._context=e,this._t=t}ab.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 ove(e){return new ab(e,.5)}function sve(e){return new ab(e,0)}function lve(e){return new ab(e,1)}function hc(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function sC(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function uve(e,t){return e[t]}function cve(e){const t=[];return t.key=e,t}function fve(){var e=hn([]),t=sC,n=hc,r=uve;function i(a){var o=Array.from(e.apply(this,arguments),cve),l,c=o.length,f=-1,m;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,m=nA(t(o));l<c;++l)o[m[l]].index=l;return n(o,m),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:hn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:hn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?sC:typeof a=="function"?a:hn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??hc,i):n},i}function dve(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}hc(e,t)}}function hve(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}hc(e,t)}}function mve(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 m=e[t[l]],d=m[r][1]||0,g=m[r-1][1]||0,v=(d-g)/2,b=0;b<l;++b){var w=e[t[b]],S=w[r][1]||0,j=w[r-1][1]||0;v+=S-j}c+=d,f+=v*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=f/c)}i[r-1][1]+=i[r-1][0]=n,hc(e,t)}}var dj={},hj={},jI;function pve(){return jI||(jI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(hj)),hj}var mj={},EI;function YH(){return EI||(EI=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})(mj)),mj}var pj={},_I;function iA(){return _I||(_I=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})(pj)),pj}var gj={},vj={},CI;function gve(){return CI||(CI=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})(vj)),vj}var NI;function aA(){return NI||(NI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gve(),n=iA();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="",m=!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:m?d==='"'||d==="'"?f=d:d==="]"?(m=!1,a.push(c),c=""):c+=d:d==="["?(m=!0,c&&(a.push(c),c="")):d==="."?c&&(a.push(c),c=""):c+=d,l++}return c&&a.push(c),a}e.toPath=r})(gj)),gj}var kI;function oA(){return kI||(kI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pve(),n=YH(),r=iA(),i=aA();function a(l,c,f){if(l==null)return f;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return f;const m=l[c];return m===void 0?n.isDeepKey(c)?a(l,i.toPath(c),f):f:m}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const m=l[c];return m===void 0?f:m}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 m=l[c];return m===void 0?f:m}}}function o(l,c,f){if(c.length===0)return f;let m=l;for(let d=0;d<c.length;d++){if(m==null||t.isUnsafeProperty(c[d]))return f;m=m[c[d]]}return m===void 0?f:m}e.get=a})(dj)),dj}var yj,AI;function vve(){return AI||(AI=1,yj=oA().get),yj}var yve=vve();const mc=Hi(yve);var xve=4;function Rl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xve,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ln(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var l=n[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Rl(l)+a:i+a},"")}var xr=e=>e===0?0:e>0?1:-1,_o=e=>typeof e=="number"&&e!=+e,pc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Re=e=>(typeof e=="number"||e instanceof Number)&&!_o(e),Co=e=>Re(e)||typeof e=="string",bve=0,Um=e=>{var t=++bve;return"".concat(e||"").concat(t)},Hr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Re(t)&&typeof t!="string")return r;var a;if(pc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return _o(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},GH=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function wn(e,t,n){return Re(e)&&Re(t)?Rl(e+n*(t-e)):t}function XH(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):mc(r,t))===n)}var En=e=>e===null||typeof e>"u",Kp=e=>En(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function yi(e){return e!=null}function eu(){}var wve=["type","size","sizeType"];function lC(){return lC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lC.apply(null,arguments)}function OI(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 TI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){Sve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sve(e,t,n){return(t=jve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jve(e){var t=Eve(e,"string");return typeof t=="symbol"?t:t+""}function Eve(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 _ve(e,t){if(e==null)return{};var n,r,i=Cve(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 Cve(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 WH={symbolCircle:rA,symbolCross:Fge,symbolDiamond:Hge,symbolSquare:qge,symbolStar:Gge,symbolTriangle:Xge,symbolWye:Qge},Nve=Math.PI/180,kve=e=>{var t="symbol".concat(Kp(e));return WH[t]||rA},Ave=(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*Nve;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}},Ove=(e,t)=>{WH["symbol".concat(Kp(e))]=t},sA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=_ve(e,wve),a=TI(TI({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var g=kve(o),v=Zge().type(g).size(Ave(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:f,cy:m}=a,d=ni(a);return Re(f)&&Re(m)&&Re(n)?y.createElement("path",lC({},d,{className:Rt("recharts-symbols",c),transform:"translate(".concat(f,", ").concat(m,")"),d:l()})):null};sA.registerSymbol=Ove;var QH=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,lA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(y.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Jk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Tve=(e,t,n)=>r=>(e(t,n,r),null),Yp=(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];Jk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Tve(a,t,n))}),r};function PI(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 Pve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){Mve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mve(e,t,n){return(t=Dve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dve(e){var t=Rve(e,"string");return typeof t=="symbol"?t:t+""}function Rve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zn(e,t){var n=Pve({},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 mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mx.apply(null,arguments)}function MI(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 ZH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(n),!0).forEach(function(r){Ive(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ive(e,t,n){return(t=Lve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lve(e){var t=zve(e,"string");return typeof t=="symbol"?t:t+""}function zve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var na=32,$ve={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Bve(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Fve(e){var{data:t,iconType:n,inactiveColor:r}=e,i=na/2,a=na/6,o=na/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:Bve(t.payload),x1:0,y1:i,x2:na,y2:i,className:"recharts-legend-icon"});if(c==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
            H`).concat(na,"M").concat(2*o,",").concat(i,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return y.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(na/8,"h").concat(na,"v").concat(na*3/4,"h").concat(-na,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var f=ZH({},t);return delete f.legendIcon,y.cloneElement(t.legendIcon,f)}return y.createElement(sA,{fill:l,cx:i,cy:i,size:na,sizeType:"diameter",type:c})}function Uve(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:na,height:na},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,g)=>{var v=d.formatter||i,b=Rt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=typeof l=="object"?ZH({},l):{};w.color=d.inactive?a:w.color||d.color;var S=v?v(d.value,d,g):d.value;return y.createElement("li",mx({className:b,style:f,key:"legend-item-".concat(g)},Yp(e,d,g)),y.createElement(eA,{width:n,height:n,viewBox:c,style:m,"aria-label":"".concat(S," legend icon")},y.createElement(Fve,{data:d,iconType:o,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Hve=e=>{var t=Zn(e,$ve),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:a},y.createElement(Uve,mx({},t,{payload:n})))},xj={},bj={},DI;function qve(){return DI||(DI=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})(bj)),bj}var wj={},RI;function Vve(){return RI||(RI=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})(wj)),wj}var Sj={},II;function JH(){return II||(II=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Sj)),Sj}var jj={},Ej={},_j={},LI;function Kve(){return LI||(LI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(_j)),_j}var zI;function eq(){return zI||(zI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kve();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Ej)),Ej}var Cj={},$I;function Yve(){return $I||($I=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Cj)),Cj}var BI;function Gve(){return BI||(BI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eq(),n=Yve();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(jj)),jj}var Nj={},kj={},FI;function Xve(){return FI||(FI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oA();function n(r){return function(i){return t.get(i,r)}}e.property=n})(kj)),kj}var Aj={},Oj={},Tj={},Pj={},UI;function tq(){return UI||(UI=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})(Pj)),Pj}var Mj={},HI;function nq(){return HI||(HI=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})(Mj)),Mj}var Dj={},qI;function rq(){return qI||(qI=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})(Dj)),Dj}var VI;function Wve(){return VI||(VI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tq(),n=nq(),r=rq();function i(m,d,g){return typeof g!="function"?i(m,d,()=>{}):a(m,d,function v(b,w,S,j,C,_){const k=g(b,w,S,j,C,_);return k!==void 0?!!k:a(b,w,v,_)},new Map)}function a(m,d,g,v){if(d===m)return!0;switch(typeof d){case"object":return o(m,d,g,v);case"function":return Object.keys(d).length>0?a(m,{...d},g,v):r.isEqualsSameValueZero(m,d);default:return t.isObject(m)?typeof d=="string"?d==="":!0:r.isEqualsSameValueZero(m,d)}}function o(m,d,g,v){if(d==null)return!0;if(Array.isArray(d))return c(m,d,g,v);if(d instanceof Map)return l(m,d,g,v);if(d instanceof Set)return f(m,d,g,v);const b=Object.keys(d);if(m==null||n.isPrimitive(m))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(d))return v.get(d)===m;v==null||v.set(d,m);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(m)&&!(S in m)||d[S]===void 0&&m[S]!==void 0||d[S]===null&&m[S]!==null||!g(m[S],d[S],S,m,d,v))return!1}return!0}finally{v==null||v.delete(d)}}function l(m,d,g,v){if(d.size===0)return!0;if(!(m instanceof Map))return!1;for(const[b,w]of d.entries()){const S=m.get(b);if(g(S,w,b,m,d,v)===!1)return!1}return!0}function c(m,d,g,v){if(d.length===0)return!0;if(!Array.isArray(m))return!1;const b=new Set;for(let w=0;w<d.length;w++){const S=d[w];let j=!1;for(let C=0;C<m.length;C++){if(b.has(C))continue;const _=m[C];let k=!1;if(g(_,S,w,m,d,v)&&(k=!0),k){b.add(C),j=!0;break}}if(!j)return!1}return!0}function f(m,d,g,v){return d.size===0?!0:m instanceof Set?c([...m],[...d],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Tj)),Tj}var KI;function iq(){return KI||(KI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wve();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Oj)),Oj}var Rj={},Ij={},Lj={},YI;function Qve(){return YI||(YI=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})(Lj)),Lj}var zj={},GI;function uA(){return GI||(GI=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})(zj)),zj}var $j={},XI;function aq(){return XI||(XI=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]",m="[object Array]",d="[object Function]",g="[object ArrayBuffer]",v="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",_="[object Uint32Array]",k="[object BigUint64Array]",O="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",P="[object BigInt64Array]",L="[object Float32Array]",I="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=m,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=L,e.float64ArrayTag=I,e.functionTag=d,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=O,e.mapTag=c,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=C,e.uint32ArrayTag=_,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=j})($j)),$j}var Bj={},WI;function Zve(){return WI||(WI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Bj)),Bj}var QI;function oq(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qve(),n=uA(),r=aq(),i=nq(),a=Zve();function o(m,d){return l(m,void 0,m,new Map,d)}function l(m,d,g,v=new Map,b=void 0){const w=b==null?void 0:b(m,d,g,v);if(w!==void 0)return w;if(i.isPrimitive(m))return m;if(v.has(m))return v.get(m);if(Array.isArray(m)){const S=new Array(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,b);return Object.hasOwn(m,"index")&&(S.index=m.index),Object.hasOwn(m,"input")&&(S.input=m.input),S}if(m instanceof Date)return new Date(m.getTime());if(m instanceof RegExp){const S=new RegExp(m.source,m.flags);return S.lastIndex=m.lastIndex,S}if(m instanceof Map){const S=new Map;v.set(m,S);for(const[j,C]of m)S.set(j,l(C,j,g,v,b));return S}if(m instanceof Set){const S=new Set;v.set(m,S);for(const j of m)S.add(l(j,void 0,g,v,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(m))return m.subarray();if(a.isTypedArray(m)){const S=new(Object.getPrototypeOf(m)).constructor(m.length);v.set(m,S);for(let j=0;j<m.length;j++)S[j]=l(m[j],j,g,v,b);return S}if(m instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&m instanceof SharedArrayBuffer)return m.slice(0);if(m instanceof DataView){const S=new DataView(m.buffer.slice(0),m.byteOffset,m.byteLength);return v.set(m,S),c(S,m,g,v,b),S}if(typeof File<"u"&&m instanceof File){const S=new File([m],m.name,{type:m.type});return v.set(m,S),c(S,m,g,v,b),S}if(typeof Blob<"u"&&m instanceof Blob){const S=new Blob([m],{type:m.type});return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof Error){const S=structuredClone(m);return v.set(m,S),S.message=m.message,S.name=m.name,S.stack=m.stack,S.cause=m.cause,S.constructor=m.constructor,c(S,m,g,v,b),S}if(m instanceof Boolean){const S=new Boolean(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof Number){const S=new Number(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(m instanceof String){const S=new String(m.valueOf());return v.set(m,S),c(S,m,g,v,b),S}if(typeof m=="object"&&f(m)){const S=Object.create(Object.getPrototypeOf(m));return v.set(m,S),c(S,m,g,v,b),S}return m}function c(m,d,g=m,v,b){const w=[...Object.keys(d),...t.getSymbols(d)];for(let S=0;S<w.length;S++){const j=w[S],C=Object.getOwnPropertyDescriptor(m,j);(C==null||C.writable)&&(m[j]=l(d[j],j,g,v,b))}}function f(m){switch(n.getTag(m)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(Ij)),Ij}var ZI;function Jve(){return ZI||(ZI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oq();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Rj)),Rj}var JI;function eye(){return JI||(JI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iq(),n=Jve();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Aj)),Aj}var Fj={},Uj={},Hj={},eL;function tye(){return eL||(eL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oq(),n=uA(),r=aq();function i(a,o){return t.cloneDeepWith(a,(l,c,f,m)=>{const d=o==null?void 0:o(l,c,f,m);if(d!==void 0)return d;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return m.set(a,g),t.copyProperties(g,a,f,m),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(Hj)),Hj}var tL;function nye(){return tL||(tL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tye();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Uj)),Uj}var qj={},Vj={},nL;function sq(){return nL||(nL=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})(Vj)),Vj}var Kj={},rL;function rye(){return rL||(rL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uA();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Kj)),Kj}var iL;function iye(){return iL||(iL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YH(),n=sq(),r=rye(),i=aA();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 m=0;m<c.length;m++){const d=c[m];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})(qj)),qj}var aL;function aye(){return aL||(aL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iq(),n=iA(),r=nye(),i=oA(),a=iye();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 m=i.get(f,l);return m===void 0?a.has(f,l):c===void 0?m===void 0:t.isMatch(m,c)}}e.matchesProperty=o})(Fj)),Fj}var oL;function oye(){return oL||(oL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JH(),n=Xve(),r=eye(),i=aye();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})(Nj)),Nj}var sL;function sye(){return sL||(sL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qve(),n=Vve(),r=JH(),i=Gve(),a=oye();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(xj)),xj}var Yj,lL;function lye(){return lL||(lL=1,Yj=sye().uniqBy),Yj}var uye=lye();const uL=Hi(uye);function lq(e,t,n){return t===!0?uL(e,n):typeof t=="function"?uL(e,t):e}var Gj={exports:{}},Xj={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var cL;function cye(){if(cL)return Xj;cL=1;var e=Pd(),t=Wee();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Xj.useSyncExternalStoreWithSelector=function(f,m,d,g,v){var b=a(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=l(function(){function j(A){if(!C){if(C=!0,_=A,A=g(A),v!==void 0&&w.hasValue){var T=w.value;if(v(T,A))return k=T}return k=A}if(T=k,r(_,A))return T;var P=g(A);return v!==void 0&&v(T,P)?(_=A,T):(_=A,k=P)}var C=!1,_,k,O=d===void 0?null:d;return[function(){return j(m())},O===null?void 0:function(){return j(O())}]},[m,d,g,v]);var S=i(f,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},Xj}var fL;function fye(){return fL||(fL=1,Gj.exports=cye()),Gj.exports}var uq=fye();const dye=Hi(uq);var cA=y.createContext(null),hye=e=>e,tn=()=>{var e=y.useContext(cA);return e?e.store.dispatch:hye},Py=()=>{},mye=()=>Py,pye=(e,t)=>e===t;function $e(e){var t=y.useContext(cA),n=y.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Py,[t,e]);return uq.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:mye,t?t.store.getState:Py,t?t.store.getState:Py,n,pye)}function gye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function vye(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function yye(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 dL=e=>Array.isArray(e)?e:[e];function xye(e){const t=Array.isArray(e[0])?e[0]:e;return yye(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function bye(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var wye=class{constructor(e){this.value=e}deref(){return this.value}},Sye=typeof WeakRef<"u"?WeakRef:wye,jye=0,hL=1;function ty(){return{s:jye,v:void 0,o:null,p:null}}function cq(e,t={}){let n=ty();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=ty(),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=ty(),w.set(b,l)):l=S}}const f=l;let m;if(l.s===hL)m=l.v;else if(m=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,m)&&(m=g,a!==0&&a--),i=typeof m=="object"&&m!==null||typeof m=="function"?new Sye(m):m}return f.s=hL,f.v=m,m}return o.clearCache=()=>{n=ty(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Eye(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()),gye(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const m={...n,...c},{memoize:d,memoizeOptions:g=[],argsMemoize:v=cq,argsMemoizeOptions:b=[]}=m,w=dL(g),S=dL(b),j=xye(i),C=d(function(){return a++,f.apply(null,arguments)},...w),_=v(function(){o++;const O=bye(j,arguments);return l=C.apply(null,O),l},...S);return Object.assign(_,{resultFunc:f,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Eye(cq),_ye=Object.assign((e,t=le)=>{vye(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:()=>_ye}),Wj={},Qj={},Zj={},mL;function Cye(){return mL||(mL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(Zj)),Zj}var Jj={},eE={},pL;function fq(){return pL||(pL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(eE)),eE}var gL;function Nye(){return gL||(gL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fq(),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})(Jj)),Jj}var vL;function kye(){return vL||(vL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cye(),n=Nye(),r=aA();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},m=(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=>m(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})(Qj)),Qj}var tE={},yL;function Aye(){return yL||(yL=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 m=l[f];Array.isArray(m)&&c<a?o(m,c+1):i.push(m)}};return o(n,0),i}e.flatten=t})(tE)),tE}var nE={},xL;function dq(){return xL||(xL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sq(),n=eq(),r=tq(),i=rq();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})(nE)),nE}var bL;function Oye(){return bL||(bL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kye(),n=Aye(),r=dq();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})(Wj)),Wj}var rE,wL;function Tye(){return wL||(wL=1,rE=Oye().sortBy),rE}var Pye=Tye();const ob=Hi(Pye);var hq=e=>e.legend.settings,Mye=e=>e.legend.size,Dye=e=>e.legend.payload,Rye=le([Dye,hq],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ob(r,n):r});function Iye(){return $e(Rye)}var ny=1;function mq(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=y.useState({height:0,left:0,top:0,width:0}),r=y.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>ny||Math.abs(o.left-t.left)>ny||Math.abs(o.top-t.top)>ny||Math.abs(o.width-t.width)>ny)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Ar(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Lye=typeof Symbol=="function"&&Symbol.observable||"@@observable",SL=Lye,iE=()=>Math.random().toString(36).substring(7).split("").join("."),zye={INIT:`@@redux/INIT${iE()}`,REPLACE:`@@redux/REPLACE${iE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${iE()}`},px=zye;function fA(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 pq(e,t,n){if(typeof e!="function")throw new Error(Ar(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ar(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ar(1));return n(pq)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function f(){o===a&&(o=new Map,a.forEach((S,j)=>{o.set(j,S)}))}function m(){if(c)throw new Error(Ar(3));return i}function d(S){if(typeof S!="function")throw new Error(Ar(4));if(c)throw new Error(Ar(5));let j=!0;f();const C=l++;return o.set(C,S),function(){if(j){if(c)throw new Error(Ar(6));j=!1,f(),o.delete(C),a=null}}}function g(S){if(!fA(S))throw new Error(Ar(7));if(typeof S.type>"u")throw new Error(Ar(8));if(typeof S.type!="string")throw new Error(Ar(17));if(c)throw new Error(Ar(9));try{c=!0,i=r(i,S)}finally{c=!1}return(a=o).forEach(C=>{C()}),S}function v(S){if(typeof S!="function")throw new Error(Ar(10));r=S,g({type:px.REPLACE})}function b(){const S=d;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Ar(11));function C(){const k=j;k.next&&k.next(m())}return C(),{unsubscribe:S(C)}},[SL](){return this}}}return g({type:px.INIT}),{dispatch:g,subscribe:d,getState:m,replaceReducer:v,[SL]:b}}function $ye(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:px.INIT})>"u")throw new Error(Ar(12));if(typeof n(void 0,{type:px.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ar(13))})}function gq(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{$ye(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let c=!1;const f={};for(let m=0;m<r.length;m++){const d=r[m],g=n[d],v=o[d],b=g(v,l);if(typeof b>"u")throw l&&l.type,new Error(Ar(14));f[d]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?f:o}}function gx(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Bye(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Ar(15))};const o={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},l=e.map(c=>c(o));return a=gx(...l)(i.dispatch),{...i,dispatch:a}}}function vq(e){return fA(e)&&"type"in e&&typeof e.type=="string"}var yq=Symbol.for("immer-nothing"),jL=Symbol.for("immer-draftable"),ri=Symbol.for("immer-state");function Fa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Di=Object,gd=Di.getPrototypeOf,vx="constructor",sb="prototype",uC="configurable",yx="enumerable",My="writable",Hm="value",xs=e=>!!e&&!!e[ri];function Xa(e){var t;return e?xq(e)||ub(e)||!!e[jL]||!!((t=e[vx])!=null&&t[jL])||cb(e)||fb(e):!1}var Fye=Di[sb][vx].toString(),EL=new WeakMap;function xq(e){if(!e||!dA(e))return!1;const t=gd(e);if(t===null||t===Di[sb])return!0;const n=Di.hasOwnProperty.call(t,vx)&&t[vx];if(n===Object)return!0;if(!Rf(n))return!1;let r=EL.get(n);return r===void 0&&(r=Function.toString.call(n),EL.set(n,r)),r===Fye}function lb(e,t,n=!0){Gp(e)===0?(n?Reflect.ownKeys(e):Di.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Gp(e){const t=e[ri];return t?t.type_:ub(e)?1:cb(e)?2:fb(e)?3:0}var _L=(e,t,n=Gp(e))=>n===2?e.has(t):Di[sb].hasOwnProperty.call(e,t),cC=(e,t,n=Gp(e))=>n===2?e.get(t):e[t],xx=(e,t,n,r=Gp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Uye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ub=Array.isArray,cb=e=>e instanceof Map,fb=e=>e instanceof Set,dA=e=>typeof e=="object",Rf=e=>typeof e=="function",aE=e=>typeof e=="boolean";function Hye(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ns=e=>e.copy_||e.base_,hA=e=>e.modified_?e.copy_:e.base_;function fC(e,t){if(cb(e))return new Map(e);if(fb(e))return new Set(e);if(ub(e))return Array[sb].slice.call(e);const n=xq(e);if(t===!0||t==="class_only"&&!n){const r=Di.getOwnPropertyDescriptors(e);delete r[ri];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[My]===!1&&(l[My]=!0,l[uC]=!0),(l.get||l.set)&&(r[o]={[uC]:!0,[My]:!0,[yx]:l[yx],[Hm]:e[o]})}return Di.create(gd(e),r)}else{const r=gd(e);if(r!==null&&n)return{...e};const i=Di.create(r);return Di.assign(i,e)}}function mA(e,t=!1){return db(e)||xs(e)||!Xa(e)||(Gp(e)>1&&Di.defineProperties(e,{set:ry,add:ry,clear:ry,delete:ry}),Di.freeze(e),t&&lb(e,(n,r)=>{mA(r,!0)},!1)),e}function qye(){Fa(2)}var ry={[Hm]:qye};function db(e){return e===null||!dA(e)?!0:Di.isFrozen(e)}var bx="MapSet",dC="Patches",CL="ArrayMethods",bq={};function gc(e){const t=bq[e];return t||Fa(0,e),t}var NL=e=>!!bq[e],qm,wq=()=>qm,Vye=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:NL(bx)?gc(bx):void 0,arrayMethodsPlugin_:NL(CL)?gc(CL):void 0});function kL(e,t){t&&(e.patchPlugin_=gc(dC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function hC(e){mC(e),e.drafts_.forEach(Kye),e.drafts_=null}function mC(e){e===qm&&(qm=e.parent_)}var AL=e=>qm=Vye(qm,e);function Kye(e){const t=e[ri];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function OL(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ri].modified_&&(hC(t),Fa(4)),Xa(e)&&(e=TL(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ri].base_,e,t)}else e=TL(t,n);return Yye(t,e,!0),hC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yq?e:void 0}function TL(e,t){if(db(t))return t;const n=t[ri];if(!n)return wx(t,e.handledSet_,e);if(!hb(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);Eq(n,e)}return n.copy_}function Yye(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mA(t,n)}function Sq(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var hb=(e,t)=>e.scope_===t,Gye=[];function jq(e,t,n,r){const i=ns(e),a=e.type_;if(r!==void 0&&cC(i,r,a)===t){xx(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;lb(i,(c,f)=>{if(xs(f)){const m=l.get(f)||[];m.push(c),l.set(f,m)}})}const o=e.draftLocations_.get(t)??Gye;for(const l of o)xx(i,l,n,a)}function Xye(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!hb(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=hA(a);jq(e,a.draft_??a,o,n),Eq(a,i)})}function Eq(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)}Sq(e)}}function Wye(e,t,n){const{scope_:r}=e;if(xs(n)){const i=n[ri];hb(i,r)&&i.callbacks_.push(function(){Dy(e);const o=hA(i);jq(e,n,o,t)})}else Xa(n)&&e.callbacks_.push(function(){const a=ns(e);e.type_===3?a.has(n)&&wx(n,r.handledSet_,r):cC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&wx(cC(e.copy_,t,e.type_),r.handledSet_,r)})}function wx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xs(e)||t.has(e)||!Xa(e)||db(e)||(t.add(e),lb(e,(r,i)=>{if(xs(i)){const a=i[ri];if(hb(a,n)){const o=hA(a);xx(e,r,o,e.type_),Sq(a)}}else Xa(i)&&wx(i,t,n)})),e}function Qye(e,t){const n=ub(e),r={type_:n?1:0,scope_:t?t.scope_:wq(),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=Sx;n&&(i=[r],a=Vm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var Sx={get(e,t){if(t===ri)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ns(e);if(!_L(i,t,e.type_))return Zye(e,i,t);const a=i[t];if(e.finalized_||!Xa(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Hye(t))return a;if(a===oE(e.base_,t)){Dy(e);const o=e.type_===1?+t:t,l=gC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in ns(e)},ownKeys(e){return Reflect.ownKeys(ns(e))},set(e,t,n){const r=_q(ns(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=oE(ns(e),t),a=i==null?void 0:i[ri];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Uye(n,i)&&(n!==void 0||_L(e.base_,t,e.type_)))return!0;Dy(e),pC(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),Wye(e,t,n)),!0},deleteProperty(e,t){return Dy(e),oE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ns(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[My]:!0,[uC]:e.type_!==1||t!=="length",[yx]:r[yx],[Hm]:n[t]}},defineProperty(){Fa(11)},getPrototypeOf(e){return gd(e.base_)},setPrototypeOf(){Fa(12)}},Vm={};for(let e in Sx){let t=Sx[e];Vm[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Vm.deleteProperty=function(e,t){return Vm.set.call(this,e,t,void 0)};Vm.set=function(e,t,n){return Sx.set.call(this,e[0],t,n,e[0])};function oE(e,t){const n=e[ri];return(n?ns(n):e)[t]}function Zye(e,t,n){var i;const r=_q(t,n);return r?Hm in r?r[Hm]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function _q(e,t){if(!(t in e))return;let n=gd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=gd(n)}}function pC(e){e.modified_||(e.modified_=!0,e.parent_&&pC(e.parent_))}function Dy(e){e.copy_||(e.assigned_=new Map,e.copy_=fC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Jye=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Rf(n)&&!Rf(r)){const o=r;r=n;const l=this;return function(f=o,...m){return l.produce(f,d=>r.call(this,d,...m))}}Rf(r)||Fa(6),i!==void 0&&!Rf(i)&&Fa(7);let a;if(Xa(n)){const o=AL(this),l=gC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?hC(o):mC(o)}return kL(o,i),OL(a,o)}else if(!n||!dA(n)){if(a=r(n),a===void 0&&(a=n),a===yq&&(a=void 0),this.autoFreeze_&&mA(a,!0),i){const o=[],l=[];gc(dC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else Fa(1,n)},this.produceWithPatches=(n,r)=>{if(Rf(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]},aE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),aE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),aE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Xa(t)||Fa(8),xs(t)&&(t=sa(t));const n=AL(this),r=gC(n,t,void 0);return r[ri].isManual_=!0,mC(n),r}finishDraft(t,n){const r=t&&t[ri];(!r||!r.isManual_)&&Fa(9);const{scope_:i}=r;return kL(i,n),OL(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=gc(dC).applyPatches_;return xs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function gC(e,t,n,r){const[i,a]=cb(t)?gc(bx).proxyMap_(t,n):fb(t)?gc(bx).proxySet_(t,n):Qye(t,n);return((n==null?void 0:n.scope_)??wq()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?Xye(n,a,r):a.callbacks_.push(function(c){var m;(m=c.mapSetPlugin_)==null||m.fixSetContents(a);const{patchPlugin_:f}=c;a.modified_&&f&&f.generatePatches_(a,[],c)}),i}function sa(e){return xs(e)||Fa(10,e),Cq(e)}function Cq(e){if(!Xa(e)||db(e))return e;const t=e[ri];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fC(e,!0);return lb(n,(i,a)=>{xx(n,i,Cq(a))},r),t&&(t.finalized_=!1),n}var exe=new Jye,Nq=exe.produce;function kq(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var txe=kq(),nxe=kq,rxe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?gx:gx.apply(null,arguments)};function Bi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(zi(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>vq(r)&&r.type===e,n}var Aq=class xm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xm.prototype)}static get[Symbol.species](){return xm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xm(...t[0].concat(this)):new xm(...t.concat(this))}};function PL(e){return Xa(e)?Nq(e,()=>{}):e}function iy(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function ixe(e){return typeof e=="boolean"}var axe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Aq;return n&&(ixe(n)?o.push(txe):o.push(nxe(n.extraArgument))),o},Oq="RTK_autoBatch",gn=()=>e=>({payload:e,meta:{[Oq]:!0}}),ML=e=>t=>{setTimeout(t,e)},Tq=(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:ML(10):e.type==="callback"?e.queueNotification:ML(e.timeout),f=()=>{o=!1,a&&(a=!1,l.forEach(m=>m()))};return Object.assign({},r,{subscribe(m){const d=()=>i&&m(),g=r.subscribe(d);return l.add(m),()=>{g(),l.delete(m)}},dispatch(m){var d;try{return i=!((d=m==null?void 0:m.meta)!=null&&d[Oq]),a=!i,a&&(o||(o=!0,c(f))),r.dispatch(m)}finally{i=!0}}})},oxe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Aq(e);return r&&i.push(Tq(typeof r=="object"?r:void 0)),i};function sxe(e){const t=axe(),{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(fA(n))l=gq(n);else throw new Error(zi(1));let c;typeof r=="function"?c=r(t):c=t();let f=gx;i&&(f=rxe({trace:!1,...typeof i=="object"&&i}));const m=Bye(...c),d=oxe(m);let g=typeof o=="function"?o(d):d();const v=f(...g);return pq(l,a,v)}function Pq(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(zi(28));if(l in t)throw new Error(zi(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function lxe(e){return typeof e=="function"}function uxe(e,t){let[n,r,i]=Pq(t),a;if(lxe(e))a=()=>PL(e());else{const l=PL(e);a=()=>l}function o(l=a(),c){let f=[n[c.type],...r.filter(({matcher:m})=>m(c)).map(({reducer:m})=>m)];return f.filter(m=>!!m).length===0&&(f=[i]),f.reduce((m,d)=>{if(d)if(xs(m)){const v=d(m,c);return v===void 0?m:v}else{if(Xa(m))return Nq(m,g=>d(g,c));{const g=d(m,c);if(g===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return m},l)}return o.getInitialState=a,o}var cxe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fxe=(e=21)=>{let t="",n=e;for(;n--;)t+=cxe[Math.random()*64|0];return t},dxe=Symbol.for("rtk-slice-createasyncthunk");function hxe(e,t){return`${e}/${t}`}function mxe({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[dxe];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(zi(11));const l=(typeof i.reducers=="function"?i.reducers(gxe()):i.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(k,O){const A=typeof k=="string"?k:k.type;if(!A)throw new Error(zi(12));if(A in f.sliceCaseReducersByType)throw new Error(zi(13));return f.sliceCaseReducersByType[A]=O,m},addMatcher(k,O){return f.sliceMatchers.push({matcher:k,reducer:O}),m},exposeAction(k,O){return f.actionCreators[k]=O,m},exposeCaseReducer(k,O){return f.sliceCaseReducersByName[k]=O,m}};c.forEach(k=>{const O=l[k],A={reducerName:k,type:hxe(a,k),createNotation:typeof i.reducers=="function"};yxe(O)?bxe(A,O,m,t):vxe(A,O,m)});function d(){const[k={},O=[],A=void 0]=typeof i.extraReducers=="function"?Pq(i.extraReducers):[i.extraReducers],T={...k,...f.sliceCaseReducersByType};return uxe(i.initialState,P=>{for(let L in T)P.addCase(L,T[L]);for(let L of f.sliceMatchers)P.addMatcher(L.matcher,L.reducer);for(let L of O)P.addMatcher(L.matcher,L.reducer);A&&P.addDefaultCase(A)})}const g=k=>k,v=new Map,b=new WeakMap;let w;function S(k,O){return w||(w=d()),w(k,O)}function j(){return w||(w=d()),w.getInitialState()}function C(k,O=!1){function A(P){let L=P[k];return typeof L>"u"&&O&&(L=iy(b,A,j)),L}function T(P=g){const L=iy(v,O,()=>new WeakMap);return iy(L,P,()=>{const I={};for(const[F,$]of Object.entries(i.selectors??{}))I[F]=pxe($,P,()=>iy(b,P,j),O);return I})}return{reducerPath:k,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const _={name:a,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:j,...C(o),injectInto(k,{reducerPath:O,...A}={}){const T=O??o;return k.inject({reducerPath:T,reducer:S},A),{..._,...C(T,!0)}}};return _}}function pxe(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var Kr=mxe();function gxe(){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 vxe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!xxe(r))throw new Error(zi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Bi(e,o):Bi(e))}function yxe(e){return e._reducerDefinitionType==="asyncThunk"}function xxe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function bxe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(zi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:f,options:m}=n,d=i(e,a,m);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||ay,pending:l||ay,rejected:c||ay,settled:f||ay})}function ay(){}var wxe="task",Mq="listener",Dq="completed",pA="cancelled",Sxe=`task-${pA}`,jxe=`task-${Dq}`,vC=`${Mq}-${pA}`,Exe=`${Mq}-${Dq}`,mb=class{constructor(e){pS(this,"name","TaskAbortError");pS(this,"message");this.code=e,this.message=`${wxe} ${pA} (reason: ${e})`}},gA=(e,t)=>{if(typeof e!="function")throw new TypeError(zi(32))},jx=()=>{},Rq=(e,t=jx)=>(e.catch(t),e),Iq=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Qu=e=>{if(e.aborted)throw new mb(e.reason)};function Lq(e,t){let n=jx;return new Promise((r,i)=>{const a=()=>i(new mb(e.reason));if(e.aborted){a();return}n=Iq(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=jx})}var _xe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof mb?"cancelled":"rejected",error:n}}finally{t==null||t()}},Ex=e=>t=>Rq(Lq(e,t).then(n=>(Qu(e),n))),zq=e=>{const t=Ex(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Hf}=Object,DL={},pb="listenerMiddleware",Cxe=(e,t)=>{const n=r=>Iq(e,()=>r.abort(e.reason));return(r,i)=>{gA(r);const a=new AbortController;n(a);const o=_xe(async()=>{Qu(e),Qu(a.signal);const l=await r({pause:Ex(a.signal),delay:zq(a.signal),signal:a.signal});return Qu(a.signal),l},()=>a.abort(jxe));return i!=null&&i.autoJoin&&t.push(o.catch(jx)),{result:Ex(e)(o),cancel(){a.abort(Sxe)}}}},Nxe=(e,t)=>{const n=async(r,i)=>{Qu(t);let a=()=>{};const l=[new Promise((c,f)=>{let m=e({predicate:r,effect:(d,g)=>{g.unsubscribe(),c([d,g.getState(),g.getOriginalState()])}});a=()=>{m(),f()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Lq(t,Promise.race(l));return Qu(t),c}finally{a()}};return(r,i)=>Rq(n(r,i))},$q=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Bi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(zi(21));return gA(a),{predicate:i,type:t,effect:a}},Bq=Hf(e=>{const{type:t,predicate:n,effect:r}=$q(e);return{id:fxe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(zi(22))}}},{withTypes:()=>Bq}),RL=(e,t)=>{const{type:n,effect:r,predicate:i}=$q(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},yC=e=>{e.pending.forEach(t=>{t.abort(vC)})},kxe=(e,t)=>()=>{for(const n of t.keys())yC(n);e.clear()},IL=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Fq=Hf(Bi(`${pb}/add`),{withTypes:()=>Fq}),Axe=Bi(`${pb}/removeAll`),Uq=Hf(Bi(`${pb}/remove`),{withTypes:()=>Uq}),Oxe=(...e)=>{console.error(`${pb}/error`,...e)},Xp=(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=Oxe}=e;gA(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&yC(v)}),c=v=>{const b=RL(t,v)??Bq(v);return l(b)};Hf(c,{withTypes:()=>c});const f=v=>{const b=RL(t,v);return b&&(b.unsubscribe(),v.cancelActive&&yC(b)),!!b};Hf(f,{withTypes:()=>f});const m=async(v,b,w,S)=>{const j=new AbortController,C=Nxe(c,j.signal),_=[];try{v.pending.add(j),r(v),await Promise.resolve(v.effect(b,Hf({},w,{getOriginalState:S,condition:(k,O)=>C(k,O).then(Boolean),take:C,delay:zq(j.signal),pause:Ex(j.signal),extra:a,signal:j.signal,fork:Cxe(j.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((k,O,A)=>{k!==j&&(k.abort(vC),A.delete(k))})},cancel:()=>{j.abort(vC),v.pending.delete(j)},throwIfCancelled:()=>{Qu(j.signal)}})))}catch(k){k instanceof mb||IL(o,k,{raisedBy:"effect"})}finally{await Promise.all(_),j.abort(Exe),i(v),v.pending.delete(j)}},d=kxe(t,n);return{middleware:v=>b=>w=>{if(!vq(w))return b(w);if(Fq.match(w))return c(w.payload);if(Axe.match(w)){d();return}if(Uq.match(w))return f(w.payload);let S=v.getState();const j=()=>{if(S===DL)throw new Error(zi(23));return S};let C;try{if(C=b(w),t.size>0){const _=v.getState(),k=Array.from(t.values());for(const O of k){let A=!1;try{A=O.predicate(w,_,S)}catch(T){A=!1,IL(o,T,{raisedBy:"predicate"})}A&&m(O,w,v,j)}}}finally{S=DL}return C},startListening:c,stopListening:f,clearListeners:d}};function zi(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Txe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Hq=Kr({name:"chartLayout",initialState:Txe,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:Pxe,setLayout:Mxe,setChartSize:Dxe,setScale:Rxe}=Hq.actions,Ixe=Hq.reducer;function qq(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Pt(e){return Number.isFinite(e)}function No(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function 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 If(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){Lxe(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 Lxe(e,t,n){return(t=zxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zxe(e){var t=$xe(e,"string");return typeof t=="symbol"?t:t+""}function $xe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function en(e,t,n){return En(e)||En(t)?n:Co(t)?mc(e,t,n):typeof t=="function"?t(e):n}var Bxe=(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"&&Re(e[a]))return If(If({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Re(e[o]))return If(If({},e),{},{[o]:e[o]+(i||0)})}return e},Ns=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Vq=(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},Kq=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:f,tickCount:m,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?xr(a[0]-a[1])*2*w:w,d||g){var S=(d||g||[]).map((j,C)=>{var _=r?r.indexOf(j):j,k=o.map(_);return Pt(k)?{coordinate:k+w,value:j,offset:w,index:C}:null}).filter(yi);return S}return c&&f?f.map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.ticks&&m!=null?o.ticks(m).map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:j,index:C,offset:w}:null}).filter(yi):o.domain().map((j,C)=>{var _=o.map(j);return Pt(_)?{coordinate:_+w,value:r?r[j]:j,index:C,offset:w}:null}).filter(yi)},Fxe=(e,t)=>{if(!t||t.length!==2||!Re(t[0])||!Re(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(!Re(e[0])||e[0]<n)&&(i[0]=n),(!Re(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Uxe=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 m=f[1],d=f[0],g=_o(m)?d:m;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=o,o+=g,f[1]=o)}}}},Hxe=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=_o(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},qxe={sign:Uxe,expand:dve,none:hc,silhouette:hve,wiggle:mve,positive:Hxe},Vxe=(e,t,n)=>{var r,i=(r=qxe[n])!==null&&r!==void 0?r:hc,a=fve().keys(t).value((l,c)=>Number(en(l,c,0))).order(sC).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((f,m)=>{var d=en(e[m],t[c],0);Array.isArray(d)&&d.length===2&&Re(d[0])&&Re(d[1])&&(f[0]=d[0],f[1]=d[1])})}),o};function Kxe(e){return e==null?void 0:String(e)}function zL(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!En(i[t.dataKey])){var l=XH(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=en(i,En(o)?t.dataKey:o),f=t.scale.map(c);return Re(f)?f:null}var $L=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var l=en(a,t.dataKey,t.scale.domain()[o]);if(En(l))return null;var c=t.scale.map(l);return Re(c)?c-i/2+r:null},Yxe=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]},Gxe=e=>{var t=e.flat(2).filter(Re);return[Math.min(...t),Math.max(...t)]},Xxe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Wxe=(e,t,n)=>{if(e!=null)return Xxe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,f)=>{var m=qq(f,t,n),d=Gxe(m);return!Pt(d[0])||!Pt(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]))},BL=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FL=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vd=(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=ob(t,m=>m.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 UL(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return If(If({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Hd(e,t){if(e)return String(e);if(typeof t=="string")return t}var Qxe=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Zxe=(e,t)=>t==="centric"?e.angle:e.radius,ks=e=>e.layout.width,As=e=>e.layout.height,Jxe=e=>e.layout.scale,Yq=e=>e.layout.margin,gb=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),vb=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Gq="data-recharts-item-index",Xq="data-recharts-item-id",Wp=60;function HL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){e0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e0e(e,t,n){return(t=t0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t0e(e){var t=n0e(e,"string");return typeof t=="symbol"?t:t+""}function n0e(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 r0e=e=>e.brush.height;function i0e(e){var t=vb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Wp;return n+i}return n},0)}function a0e(e){var t=vb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Wp;return n+i}return n},0)}function o0e(e){var t=gb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function s0e(e){var t=gb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var cr=le([ks,As,Yq,r0e,i0e,a0e,o0e,s0e,hq,Mye],(e,t,n,r,i,a,o,l,c,f)=>{var m={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+o,bottom:(n.bottom||0)+l},g=oy(oy({},d),m),v=g.bottom;g.bottom+=r,g=Bxe(g,c,f);var b=e-g.left-g.right,w=t-g.top-g.bottom;return oy(oy({brushBottom:v},g),{},{width:Math.max(b,0),height:Math.max(w,0)})}),l0e=le(cr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),vA=le(ks,As,(e,t)=>({x:0,y:0,width:e,height:t})),u0e=y.createContext(null),Yr=()=>y.useContext(u0e)!=null,yb=e=>e.brush,xb=le([yb,cr,Yq],(e,t,n)=>({height:e.height,x:Re(e.x)?e.x:t.left,y:Re(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Re(e.width)?e.width:t.width})),sE={},lE={},uE={},qL;function c0e(){return qL||(qL=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"),m=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},d=()=>{f&&m(),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=()=>{m()},j=function(...C){if(i!=null&&i.aborted)return;o=this,l=C;const _=g==null;v(),c&&_&&m()};return j.schedule=v,j.cancel=w,j.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),j}e.debounce=t})(uE)),uE}var VL;function f0e(){return VL||(VL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c0e();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 m,d=null;const g=t.debounce(function(...w){m=r.apply(this,w),d=null},i,{edges:f}),v=function(...w){return c!=null&&(d===null&&(d=Date.now()),Date.now()-d>=c)?(m=r.apply(this,w),d=Date.now(),g.cancel(),g.schedule(),m):(g.apply(this,w),m)},b=()=>(g.flush(),m);return v.cancel=g.cancel,v.flush=b,v}e.debounce=n})(lE)),lE}var KL;function d0e(){return KL||(KL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=f0e();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})(sE)),sE}var cE,YL;function h0e(){return YL||(YL=1,cE=d0e().throttle),cE}var m0e=h0e();const p0e=Hi(m0e);var _x=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},yo={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Wq=(e,t,n)=>{var{width:r=yo.width,height:i=yo.height,aspect:a,maxHeight:o}=n,l=pc(r)?e:Number(r),c=pc(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},g0e={width:0,height:0,overflow:"visible"},v0e={width:0,overflowX:"visible"},y0e={height:0,overflowY:"visible"},x0e={},b0e=e=>{var{width:t,height:n}=e,r=pc(t),i=pc(n);return r&&i?g0e:r?v0e:i?y0e:x0e};function w0e(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=yo.width,a=yo.height):i===void 0?i=r&&r>0?void 0:yo.width:a===void 0&&(a=r&&r>0?void 0:yo.height),{width:i,height:a}}function xC(){return xC=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},xC.apply(null,arguments)}function GL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GL(Object(n),!0).forEach(function(r){S0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S0e(e,t,n){return(t=j0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j0e(e){var t=E0e(e,"string");return typeof t=="symbol"?t:t+""}function E0e(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 Qq=y.createContext(yo.initialDimension);function _0e(e){return No(e.width)&&No(e.height)}function Zq(e){var{children:t,width:n,height:r}=e,i=y.useMemo(()=>({width:n,height:r}),[n,r]);return _0e(i)?y.createElement(Qq.Provider,{value:i},t):null}var yA=()=>y.useContext(Qq),C0e=y.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=yo.initialDimension,width:i,height:a,minWidth:o=yo.minWidth,minHeight:l,maxHeight:c,children:f,debounce:m=yo.debounce,id:d,className:g,onResize:v,style:b={}}=e,w=y.useRef(null),S=y.useRef();S.current=v,y.useImperativeHandle(t,()=>w.current);var[j,C]=y.useState({containerWidth:r.width,containerHeight:r.height}),_=y.useCallback((P,L)=>{C(I=>{var F=Math.round(P),$=Math.round(L);return I.containerWidth===F&&I.containerHeight===$?I:{containerWidth:F,containerHeight:$}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return eu;var P=$=>{var X,D=$[0];if(D!=null){var{width:V,height:z}=D.contentRect;_(V,z),(X=S.current)===null||X===void 0||X.call(S,V,z)}};m>0&&(P=p0e(P,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(P),{width:I,height:F}=w.current.getBoundingClientRect();return _(I,F),L.observe(w.current),()=>{L.disconnect()}},[_,m]);var{containerWidth:k,containerHeight:O}=j;_x(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:T}=Wq(k,O,{width:i,height:a,aspect:n,maxHeight:c});return _x(A!=null&&A>0||T!=null&&T>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,A,T,i,a,o,l,n),y.createElement("div",{id:d?"".concat(d):void 0,className:Rt("recharts-responsive-container",g),style:XL(XL({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},y.createElement("div",{style:b0e({width:i,height:a})},y.createElement(Zq,{width:A,height:T},f)))}),xA=y.forwardRef((e,t)=>{var n=yA();if(No(n.width)&&No(n.height))return e.children;var{width:r,height:i}=w0e({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=Wq(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Re(a)&&Re(o)?y.createElement(Zq,{width:a,height:o},e.children):y.createElement(C0e,xC({},e,{width:r,height:i,ref:t}))});function bA(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 bb=()=>{var e,t=Yr(),n=$e(l0e),r=$e(xb),i=(e=$e(yb))===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}},N0e={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Jq=()=>{var e;return(e=$e(cr))!==null&&e!==void 0?e:N0e},wA=()=>$e(ks),SA=()=>$e(As),k0e=()=>$e(e=>e.layout.margin),Ut=e=>e.layout.layoutType,Pc=()=>$e(Ut),e9=()=>{var e=Pc();if(e==="horizontal"||e==="vertical")return e},t9=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},A0e=()=>{var e=Pc();return e!==void 0},Qp=e=>{var t=tn(),n=Yr(),{width:r,height:i}=e,a=yA(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),y.useEffect(()=>{!n&&No(o)&&No(l)&&t(Dxe({width:o,height:l}))},[t,n,o,l]),null},n9=Symbol.for("immer-nothing"),WL=Symbol.for("immer-draftable"),Fi=Symbol.for("immer-state");function Ua(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Km=Object.getPrototypeOf;function yd(e){return!!e&&!!e[Fi]}function vc(e){var t;return e?r9(e)||Array.isArray(e)||!!e[WL]||!!((t=e.constructor)!=null&&t[WL])||Zp(e)||Sb(e):!1}var O0e=Object.prototype.constructor.toString(),QL=new WeakMap;function r9(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=QL.get(n);return r===void 0&&(r=Function.toString.call(n),QL.set(n,r)),r===O0e}function Cx(e,t,n=!0){wb(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 wb(e){const t=e[Fi];return t?t.type_:Array.isArray(e)?1:Zp(e)?2:Sb(e)?3:0}function bC(e,t){return wb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function i9(e,t,n){const r=wb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function T0e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zp(e){return e instanceof Map}function Sb(e){return e instanceof Set}function Mu(e){return e.copy_||e.base_}function wC(e,t){if(Zp(e))return new Map(e);if(Sb(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=r9(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Fi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Km(e),r)}else{const r=Km(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function jA(e,t=!1){return jb(e)||yd(e)||!vc(e)||(wb(e)>1&&Object.defineProperties(e,{set:sy,add:sy,clear:sy,delete:sy}),Object.freeze(e),t&&Object.values(e).forEach(n=>jA(n,!0))),e}function P0e(){Ua(2)}var sy={value:P0e};function jb(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var M0e={};function yc(e){const t=M0e[e];return t||Ua(0,e),t}var Ym;function a9(){return Ym}function D0e(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ZL(e,t){t&&(yc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function SC(e){jC(e),e.drafts_.forEach(R0e),e.drafts_=null}function jC(e){e===Ym&&(Ym=e.parent_)}function JL(e){return Ym=D0e(Ym,e)}function R0e(e){const t=e[Fi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function e3(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Fi].modified_&&(SC(t),Ua(4)),vc(e)&&(e=Nx(t,e),t.parent_||kx(t,e)),t.patches_&&yc("Patches").generateReplacementPatches_(n[Fi].base_,e,t.patches_,t.inversePatches_)):e=Nx(t,n,[]),SC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==n9?e:void 0}function Nx(e,t,n){if(jb(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Fi];if(!i)return Cx(t,(a,o)=>t3(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return kx(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)=>t3(e,i,a,c,f,n,l),r),kx(e,a,!1),n&&e.patches_&&yc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function t3(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=jb(i);if(!(l&&!o)){if(yd(i)){const c=a&&t&&t.type_!==3&&!bC(t.assigned_,r)?a.concat(r):void 0,f=Nx(e,i,c);if(i9(n,r,f),yd(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(vc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Nx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Zp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&kx(e,i)}}}function kx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jA(t,n)}function I0e(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:a9(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=EA;n&&(i=[r],a=Gm);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var EA={get(e,t){if(t===Fi)return e;const n=Mu(e);if(!bC(n,t))return L0e(e,n,t);const r=n[t];return e.finalized_||!vc(r)?r:r===fE(e.base_,t)?(dE(e),e.copy_[t]=_C(r,e)):r},has(e,t){return t in Mu(e)},ownKeys(e){return Reflect.ownKeys(Mu(e))},set(e,t,n){const r=o9(Mu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=fE(Mu(e),t),a=i==null?void 0:i[Fi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(T0e(n,i)&&(n!==void 0||bC(e.base_,t)))return!0;dE(e),EC(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 fE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dE(e),EC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Mu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ua(11)},getPrototypeOf(e){return Km(e.base_)},setPrototypeOf(){Ua(12)}},Gm={};Cx(EA,(e,t)=>{Gm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Gm.deleteProperty=function(e,t){return Gm.set.call(this,e,t,void 0)};Gm.set=function(e,t,n){return EA.set.call(this,e[0],t,n,e[0])};function fE(e,t){const n=e[Fi];return(n?Mu(n):e)[t]}function L0e(e,t,n){var i;const r=o9(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function o9(e,t){if(!(t in e))return;let n=Km(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Km(n)}}function EC(e){e.modified_||(e.modified_=!0,e.parent_&&EC(e.parent_))}function dE(e){e.copy_||(e.copy_=wC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var z0e=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,m=>n.call(this,m,...f))}}typeof n!="function"&&Ua(6),r!==void 0&&typeof r!="function"&&Ua(7);let i;if(vc(t)){const a=JL(this),o=_C(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?SC(a):jC(a)}return ZL(a,r),e3(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===n9&&(i=void 0),this.autoFreeze_&&jA(i,!0),r){const a=[],o=[];yc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Ua(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){vc(e)||Ua(8),yd(e)&&(e=$0e(e));const t=JL(this),n=_C(e,void 0);return n[Fi].isManual_=!0,jC(t),n}finishDraft(e,t){const n=e&&e[Fi];(!n||!n.isManual_)&&Ua(9);const{scope_:r}=n;return ZL(r,t),e3(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=yc("Patches").applyPatches_;return yd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function _C(e,t){const n=Zp(e)?yc("MapSet").proxyMap_(e,t):Sb(e)?yc("MapSet").proxySet_(e,t):I0e(e,t);return(t?t.scope_:a9()).drafts_.push(n),n}function $0e(e){return yd(e)||Ua(10,e),s9(e)}function s9(e){if(!vc(e)||jb(e))return e;const t=e[Fi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=wC(e,!0);return Cx(n,(i,a)=>{i9(n,i,s9(a))},r),t&&(t.finalized_=!1),n}var B0e=new z0e;B0e.produce;var F0e={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},l9=Kr({name:"legend",initialState:F0e,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:gn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:gn()},removeLegendPayload:{reducer(e,t){var n=sa(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:gn()}}}),{setLegendSize:n3,setLegendSettings:U0e,addLegendPayload:u9,replaceLegendPayload:c9,removeLegendPayload:f9}=l9.actions,H0e=l9.reducer,hE={exports:{}},mE={};/**
 * @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 r3;function q0e(){if(r3)return mE;r3=1;var e=Pd();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 mE.useSyncExternalStoreWithSelector=function(c,f,m,d,g){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function S(O){if(!j){if(j=!0,C=O,O=d(O),g!==void 0&&b.hasValue){var A=b.value;if(g(A,O))return _=A}return _=O}if(A=_,n(C,O))return A;var T=d(O);return g!==void 0&&g(A,T)?(C=O,A):(C=O,_=T)}var j=!1,C,_,k=m===void 0?null:m;return[function(){return S(f())},k===null?void 0:function(){return S(k())}]},[f,m,d,g]);var w=r(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},mE}var i3;function V0e(){return i3||(i3=1,hE.exports=q0e()),hE.exports}V0e();function K0e(e){e()}function Y0e(){let e=null,t=null;return{clear(){e=null,t=null},notify(){K0e(()=>{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 a3={notify(){},get:()=>[]};function G0e(e,t){let n,r=a3,i=0,a=!1;function o(w){m();const S=r.subscribe(w);let j=!1;return()=>{j||(j=!0,S(),d())}}function l(){r.notify()}function c(){b.onStateChange&&b.onStateChange()}function f(){return a}function m(){i++,n||(n=e.subscribe(c),r=Y0e())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=a3)}function g(){a||(a=!0,m())}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 X0e=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",W0e=X0e(),Q0e=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Z0e=Q0e(),J0e=()=>W0e||Z0e?y.useLayoutEffect:y.useEffect,ebe=J0e();function o3(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function tbe(e,t){if(o3(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])||!o3(e[n[i]],t[n[i]]))return!1;return!0}var pE=Symbol.for("react-redux-context"),gE=typeof globalThis<"u"?globalThis:{};function nbe(){if(!y.createContext)return{};const e=gE[pE]??(gE[pE]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var rbe=nbe();function ibe(e){const{children:t,context:n,serverState:r,store:i}=e,a=y.useMemo(()=>{const c=G0e(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=y.useMemo(()=>i.getState(),[i]);ebe(()=>{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||rbe;return y.createElement(l.Provider,{value:a},t)}var abe=ibe,obe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function sbe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function qd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(obe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!tbe(e[r],t[r]))return!1}else if(!sbe(e[r],t[r]))return!1;return!0}var lbe=["contextPayload"];function CC(){return CC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CC.apply(null,arguments)}function s3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s3(Object(n),!0).forEach(function(r){ube(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ube(e,t,n){return(t=cbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cbe(e){var t=fbe(e,"string");return typeof t=="symbol"?t:t+""}function fbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dbe(e,t){if(e==null)return{};var n,r,i=hbe(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 hbe(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 mbe(e){return e.value}function pbe(e){var{contextPayload:t}=e,n=dbe(e,lbe),r=lq(t,e.payloadUniqBy,mbe),i=xd(xd({},n),{},{payload:r});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(Hve,i)}function gbe(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:c}=t,f,m;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"?m={top:((i||0)-a.height)/2}:m=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),xd(xd({},f),m)}function vbe(e){var t=tn();return y.useEffect(()=>{t(U0e(e))},[t,e]),null}function ybe(e){var t=tn();return y.useEffect(()=>(t(n3(e)),()=>{t(n3({width:0,height:0}))}),[t,e]),null}function xbe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var bbe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function wbe(e){var t=Zn(e,bbe),n=Iye(),r=Rge(),i=k0e(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[f,m]=mq([n]),d=wA(),g=SA();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=xbe(t.layout,o,a,v),w=c?l:xd(xd({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},gbe(l,t,i,d,g,f)),l),S=c??r;if(S==null||n==null)return null;var j=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:m},y.createElement(vbe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&y.createElement(ybe,{width:f.width,height:f.height}),y.createElement(pbe,CC({},t,b,{margin:i,chartWidth:d,chartHeight:g,contextPayload:n})));return Xl.createPortal(j,S)}var d9=y.memo(wbe,qd);d9.displayName="Legend";function NC(){return NC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NC.apply(null,arguments)}function 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 nm(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){Sbe(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 Sbe(e,t,n){return(t=jbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jbe(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)}function _be(e){return Array.isArray(e)&&Co(e[0])&&Co(e[1])?e.join(" ~ "):e}var jf={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 Cbe(e,t){return t==null?e:ob(e,t)}var Nbe=e=>{var{separator:t=jf.separator,contentStyle:n,itemStyle:r,labelStyle:i=jf.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:f,label:m,labelFormatter:d,accessibilityLayer:g=jf.accessibilityLayer}=e,v=()=>{if(a&&a.length){var O={padding:0,margin:0},A=Cbe(a,l),T=A.map((P,L)=>{if(P.type==="none")return null;var I=P.formatter||o||_be,{value:F,name:$}=P,X=F,D=$;if(I){var V=I(F,$,P,L,a);if(Array.isArray(V))[X,D]=V;else if(V!=null)X=V;else return null}var z=nm(nm({},jf.itemStyle),{},{color:P.color||jf.itemStyle.color},r);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:z},Co(D)?y.createElement("span",{className:"recharts-tooltip-item-name"},D):null,Co(D)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},X),y.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:O},T)}return null},b=nm(nm({},jf.contentStyle),n),w=nm({margin:0},i),S=!En(m),j=S?m:"",C=Rt("recharts-default-tooltip",c),_=Rt("recharts-tooltip-label",f);S&&d&&a!==void 0&&a!==null&&(j=d(m,a));var k=g?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",NC({className:C,style:b},k),y.createElement("p",{className:_,style:w},y.isValidElement(j)?j:"".concat(j)),v())},rm="recharts-tooltip-wrapper",kbe={visibility:"hidden"};function Abe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Rt(rm,{["".concat(rm,"-right")]:Re(n)&&t&&Re(t.x)&&n>=t.x,["".concat(rm,"-left")]:Re(n)&&t&&Re(t.x)&&n<t.x,["".concat(rm,"-bottom")]:Re(r)&&t&&Re(t.y)&&r>=t.y,["".concat(rm,"-top")]:Re(r)&&t&&Re(t.y)&&r<t.y})}function u3(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:f}=e;if(a&&Re(a[r]))return a[r];var m=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?m:d;var g=c[r];if(g==null)return 0;if(o[r]){var v=m,b=g;return v<b?Math.max(d,g):Math.max(m,g)}if(f==null)return 0;var w=d+l,S=g+f;return w>S?Math.max(m,g):Math.max(d,g)}function Obe(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 Tbe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:f}=e,m,d,g;return l.height>0&&l.width>0&&n?(d=u3({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),g=u3({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),m=Obe({translateX:d,translateY:g,useTranslate3d:c})):m=kbe,{cssProperties:m,cssClasses:Abe({translateX:d,translateY:g,coordinate:n})}}var Pbe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Jp={isSsr:Pbe()};function h9(){var[e,t]=y.useState(()=>Jp.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return y.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(n),!0).forEach(function(r){Mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Lbe(e){var t,n,r,i,a,o,l=h9(),[c,f]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,j,C,_;f({dismissed:!0,dismissedAtCoordinate:{x:(S=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&S!==void 0?S:0,y:(C=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&f(Ef(Ef({},c),{},{dismissed:!1}));var{cssClasses:m,cssProperties:d}=Tbe({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?{}:Ef(Ef({transition:Ibe({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Ef(Ef({},g),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:v,ref:e.innerRef},e.children)}var zbe=y.memo(Lbe),m9=()=>{var e;return(e=$e(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function kC(){return kC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kC.apply(null,arguments)}function f3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function d3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f3(Object(n),!0).forEach(function(r){$be(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 $be(e,t,n){return(t=Bbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bbe(e){var t=Fbe(e,"string");return typeof t=="symbol"?t:t+""}function Fbe(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 h3={curveBasisClosed:eve,curveBasisOpen:tve,curveBasis:Jge,curveBumpX:$ge,curveBumpY:Bge,curveLinearClosed:nve,curveLinear:ib,curveMonotoneX:rve,curveMonotoneY:ive,curveNatural:ave,curveStep:ove,curveStepAfter:lve,curveStepBefore:sve},Ax=e=>Pt(e.x)&&Pt(e.y),m3=e=>e.base!=null&&Ax(e.base)&&Ax(e),im=e=>e.x,am=e=>e.y,Ube=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Kp(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=h3["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return h3[n]||ib},p3={connectNulls:!1,type:"linear"},Hbe=e=>{var{type:t=p3.type,points:n=[],baseLine:r,layout:i,connectNulls:a=p3.connectNulls}=e,o=Ube(t,i),l=a?n.filter(Ax):n;if(Array.isArray(r)){var c,f=n.map((b,w)=>d3(d3({},b),{},{base:r[w]}));i==="vertical"?c=ey().y(am).x1(im).x0(b=>b.base.x):c=ey().x(im).y1(am).y0(b=>b.base.y);var m=c.defined(m3).curve(o),d=a?f.filter(m3):f;return m(d)}var g;i==="vertical"&&Re(r)?g=ey().y(am).x1(im).x0(r):Re(r)?g=ey().x(im).y1(am).y0(r):g=IH().x(im).y(am);var v=g.defined(Ax).curve(o);return v(l)},_A=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Pc();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?Hbe(o):r;return y.createElement("path",kC({},$i(e),lA(e),{className:Rt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},qbe=["x","y","top","left","width","height","className"];function AC(){return AC=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},AC.apply(null,arguments)}function g3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vbe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(n),!0).forEach(function(r){Kbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kbe(e,t,n){return(t=Ybe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ybe(e){var t=Gbe(e,"string");return typeof t=="symbol"?t:t+""}function Gbe(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 Xbe(e,t){if(e==null)return{};var n,r,i=Wbe(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 Wbe(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 Qbe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Zbe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=Xbe(e,qbe),f=Vbe({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Re(t)||!Re(n)||!Re(a)||!Re(o)||!Re(r)||!Re(i)?null:y.createElement("path",AC({},ni(f),{className:Rt("recharts-cross",l),d:Qbe(t,n,a,o,r,i)}))};function Jbe(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 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){ewe(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 ewe(e,t,n){return(t=twe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function twe(e){var t=nwe(e,"string");return typeof t=="symbol"?t:t+""}function nwe(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 rwe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),p9=(e,t,n)=>e.map(r=>"".concat(rwe(r)," ").concat(t,"ms ").concat(n)).join(","),iwe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Xm=(e,t)=>Object.keys(t).reduce((n,r)=>y3(y3({},n),{},{[r]:e(r,t[r])}),{});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 ar(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){awe(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 awe(e,t,n){return(t=owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function owe(e){var t=swe(e,"string");return typeof t=="symbol"?t:t+""}function swe(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 Ox=(e,t,n)=>e+(t-e)*n,OC=e=>{var{from:t,to:n}=e;return t!==n},g9=(e,t,n)=>{var r=Xm((i,a)=>{if(OC(a)){var[o,l]=e(a.from,a.to,a.velocity);return ar(ar({},a),{},{from:o,velocity:l})}return a},t);return n<1?Xm((i,a)=>OC(a)&&r[i]!=null?ar(ar({},a),{},{velocity:Ox(a.velocity,r[i].velocity,n),from:Ox(a.from,r[i].from,n)}):a,t):g9(e,r,n-1)};function lwe(e,t,n,r,i,a){var o,l=r.reduce((g,v)=>ar(ar({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>Xm((g,v)=>v.from,l),f=()=>!Object.values(l).filter(OC).length,m=null,d=g=>{o||(o=g);var v=g-o,b=v/n.dt;l=g9(n,l,b),i(ar(ar(ar({},e),t),c())),o=g,f()||(m=a.setTimeout(d))};return()=>(m=a.setTimeout(d),()=>{var g;(g=m)===null||g===void 0||g()})}function uwe(e,t,n,r,i,a,o){var l=null,c=i.reduce((d,g)=>{var v=e[g],b=t[g];return v==null||b==null?d:ar(ar({},d),{},{[g]:[v,b]})},{}),f,m=d=>{f||(f=d);var g=(d-f)/r,v=Xm((w,S)=>Ox(...S,n(g)),c);if(a(ar(ar(ar({},e),t),v)),g<1)l=o.setTimeout(m);else{var b=Xm((w,S)=>Ox(...S,n(1)),c);a(ar(ar(ar({},e),t),b))}};return()=>(l=o.setTimeout(m),()=>{var d;(d=l)===null||d===void 0||d()})}const cwe=(e,t,n,r,i,a)=>{var o=iwe(e,t);return n==null?()=>(i(ar(ar({},e),t)),()=>{}):n.isStepper===!0?lwe(e,t,n,o,i,a):uwe(e,t,n,r,o,i,a)};var Tx=1e-4,v9=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],y9=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),b3=(e,t)=>n=>{var r=v9(e,t);return y9(r,n)},fwe=(e,t)=>n=>{var r=v9(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return y9(i,n)},dwe=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]]},hwe=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=dwe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},mwe=(e,t,n,r)=>{var i=b3(e,n),a=b3(t,r),o=fwe(e,n),l=f=>f>1?1:f<0?0:f,c=f=>{for(var m=f>1?1:f,d=m,g=0;g<8;++g){var v=i(d)-m,b=o(d);if(Math.abs(v-m)<Tx||b<Tx)return a(d);d=l(d-v/b)}return a(d)};return c.isStepper=!1,c},w3=function(){return mwe(...hwe(...arguments))},pwe=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,m=c*r,d=c+(f-m)*i/1e3,g=c*i/1e3+o;return Math.abs(g-l)<Tx&&Math.abs(d)<Tx?[l,0]:[g,d]};return a.isStepper=!0,a.dt=i,a},gwe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return w3(e);case"spring":return pwe();default:if(e.split("(")[0]==="cubic-bezier")return w3(e)}return typeof e=="function"?e:null};function vwe(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 ywe{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 xwe(){return vwe(new ywe)}var bwe=y.createContext(xwe);function wwe(e,t){var n=y.useContext(bwe);return y.useMemo(()=>t??n(e),[e,t,n])}var Swe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},S3={t:0},vE={t:1};function eg(e){var t=Zn(e,Swe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:f}=t,m=h9(),d=n==="auto"?!Jp.isSsr&&!m:n,g=wwe(t.animationId,t.animationManager),[v,b]=y.useState(d?S3:vE),w=y.useRef(null);return y.useEffect(()=>{d||b(vE)},[d]),y.useEffect(()=>{if(!d||!r)return eu;var S=cwe(S3,vE,gwe(a),i,b,g.getTimeoutController()),j=()=>{w.current=S()};return g.start([c,o,j,i,l]),()=>{g.stop(),w.current&&w.current(),l()}},[d,r,i,a,o,c,l,g]),f(v.t)}function tg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=y.useRef(Um(t)),r=y.useRef(e);return r.current!==e&&(n.current=Um(t),r.current=e),n.current}var jwe=["radius"],Ewe=["radius"],j3,E3,_3,C3,N3,k3,A3,O3,T3,P3;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 D3(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){_we(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 _we(e,t,n){return(t=Cwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cwe(e){var t=Nwe(e,"string");return typeof t=="symbol"?t:t+""}function Nwe(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 Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Px.apply(null,arguments)}function R3(e,t){if(e==null)return{};var n,r,i=kwe(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 kwe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function so(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var I3=(e,t,n,r,i)=>{var a=Rl(n),o=Rl(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,f=a>=0?1:-1,m=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=Ln(j3||(j3=so(["M",",",""])),e,t+c*g[0]),g[0]>0&&(d+=Ln(E3||(E3=so(["A ",",",",0,0,",",",",",""])),g[0],g[0],m,e+f*g[0],t)),d+=Ln(_3||(_3=so(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(d+=Ln(C3||(C3=so(["A ",",",",0,0,",`,
        `,",",""])),g[1],g[1],m,e+n,t+c*g[1])),d+=Ln(N3||(N3=so(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(d+=Ln(k3||(k3=so(["A ",",",",0,0,",`,
        `,",",""])),g[2],g[2],m,e+n-f*g[2],t+r)),d+=Ln(A3||(A3=so(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(d+=Ln(O3||(O3=so(["A ",",",",0,0,",`,
        `,",",""])),g[3],g[3],m,e,t+r-c*g[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var j=Math.min(l,i);d=Ln(T3||(T3=so(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*j,j,j,m,e+f*j,t,e+n-f*j,t,j,j,m,e+n,t+c*j,e+n,t+r-c*j,j,j,m,e+n-f*j,t+r,e+f*j,t+r,j,j,m,e,t+r-c*j)}else d=Ln(P3||(P3=so(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},L3={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},x9=e=>{var t=Zn(e,L3),n=y.useRef(null),[r,i]=y.useState(-1);y.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var q=n.current.getTotalLength();q&&i(q)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:f,className:m}=t,{animationEasing:d,animationDuration:g,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=y.useRef(l),j=y.useRef(c),C=y.useRef(a),_=y.useRef(o),k=y.useMemo(()=>({x:a,y:o,width:l,height:c,radius:f}),[a,o,l,c,f]),O=tg(k,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var A=Rt("recharts-rectangle",m);if(!w){var T=ni(t),{radius:P}=T,L=R3(T,jwe);return y.createElement("path",Px({},L,{x:Rl(a),y:Rl(o),width:Rl(l),height:Rl(c),radius:typeof f=="number"?f:void 0,className:A,d:I3(a,o,l,c,f)}))}var I=S.current,F=j.current,$=C.current,X=_.current,D="0px ".concat(r===-1?1:r,"px"),V="".concat(r,"px ").concat(r,"px"),z=p9(["strokeDasharray"],g,typeof d=="string"?d:L3.animationEasing);return y.createElement(eg,{animationId:O,key:O,canBegin:r>0,duration:g,easing:d,isActive:w,begin:v},q=>{var G=wn(I,l,q),K=wn(F,c,q),R=wn($,a,q),H=wn(X,o,q);n.current&&(S.current=G,j.current=K,C.current=R,_.current=H);var U;b?q>0?U={transition:z,strokeDasharray:V}:U={strokeDasharray:D}:U={strokeDasharray:V};var B=ni(t),{radius:Q}=B,Z=R3(B,Ewe);return y.createElement("path",Px({},Z,{radius:typeof f=="number"?f:void 0,className:A,d:I3(R,H,G,K,f),ref:n,style:D3(D3({},U),t.style)}))})};function z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z3(Object(n),!0).forEach(function(r){Awe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Awe(e,t,n){return(t=Owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Owe(e){var t=Twe(e,"string");return typeof t=="symbol"?t:t+""}function Twe(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=Math.PI/180,Pwe=e=>e*180/Math.PI,Xn=(e,t,n,r)=>({x:e+Math.cos(-Mx*r)*n,y:t+Math.sin(-Mx*r)*n}),b9=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},Mwe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Dwe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Mwe({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:Pwe(c),angleInRadian:c}},Rwe=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}},Iwe=(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},Lwe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Dwe({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:f}=Rwe(t),m=a,d;if(c<=f){for(;m>f;)m-=360;for(;m<c;)m+=360;d=m>=c&&m<=f}else{for(;m>c;)m-=360;for(;m<f;)m+=360;d=m>=f&&m<=c}return d?$3($3({},t),{},{radius:i,angle:Iwe(m,t)}):null};function w9(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Xn(t,n,r,i),l=Xn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var B3,F3,U3,H3,q3,V3,K3;function TC(){return TC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TC.apply(null,arguments)}function Lu(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zwe=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},ly=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,m=Math.asin(l/f)/Mx,d=c?i:i+a*m,g=Xn(t,n,f,d),v=Xn(t,n,r,d),b=c?i-a*m:i,w=Xn(t,n,f*Math.cos(m*Mx),b);return{center:g,circleTangency:v,lineTangency:w,theta:m}},S9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=zwe(a,o),c=a+l,f=Xn(t,n,i,a),m=Xn(t,n,i,c),d=Ln(B3||(B3=Lu(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),f.x,f.y,i,i,+(Math.abs(l)>180),+(a>c),m.x,m.y);if(r>0){var g=Xn(t,n,r,a),v=Xn(t,n,r,c);d+=Ln(F3||(F3=Lu(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),g.x,g.y)}else d+=Ln(U3||(U3=Lu(["L ",","," Z"])),t,n);return d},$we=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:f}=e,m=xr(f-c),{circleTangency:d,lineTangency:g,theta:v}=ly({cx:t,cy:n,radius:i,angle:c,sign:m,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=ly({cx:t,cy:n,radius:i,angle:f,sign:-m,cornerRadius:a,cornerIsExternal:l}),j=l?Math.abs(c-f):Math.abs(c-f)-v-S;if(j<0)return o?Ln(H3||(H3=Lu(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),g.x,g.y,a,a,a*2,a,a,-a*2):S9({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var C=Ln(q3||(q3=Lu(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),g.x,g.y,a,a,+(m<0),d.x,d.y,i,i,+(j>180),+(m<0),b.x,b.y,a,a,+(m<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:k,theta:O}=ly({cx:t,cy:n,radius:r,angle:c,sign:m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:A,lineTangency:T,theta:P}=ly({cx:t,cy:n,radius:r,angle:f,sign:-m,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),L=l?Math.abs(c-f):Math.abs(c-f)-O-P;if(L<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=Ln(V3||(V3=Lu(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(m<0),A.x,A.y,r,r,+(L>180),+(m>0),_.x,_.y,a,a,+(m<0),k.x,k.y)}else C+=Ln(K3||(K3=Lu(["L",",","Z"])),t,n);return C},Bwe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},j9=e=>{var t=Zn(e,Bwe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:m,className:d}=t;if(a<i||f===m)return null;var g=Rt("recharts-sector",d),v=a-i,b=Hr(o,v,0,!0),w;return b>0&&Math.abs(f-m)<360?w=$we({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:m}):w=S9({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:m}),y.createElement("path",TC({},ni(t),{className:g,d:w}))};function Fwe(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(QH(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=Xn(r,i,a,l),f=Xn(r,i,o,l);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return w9(t)}}var yE={},xE={},bE={},Y3;function Uwe(){return Y3||(Y3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fq();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(bE)),bE}var G3;function Hwe(){return G3||(G3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uwe();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})(xE)),xE}var X3;function qwe(){return X3||(X3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dq(),n=Hwe();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})(yE)),yE}var wE,W3;function Vwe(){return W3||(W3=1,wE=qwe().range),wE}var Kwe=Vwe();const E9=Hi(Kwe);var Os=e=>e.chartData,Eb=le([Os],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),CA=(e,t,n,r)=>r?Eb(e):Os(e),Ywe=(e,t,n)=>n?Eb(e):Os(e);function So(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Pt(t)&&Pt(n))return!0}return!1}function Q3(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function _9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Pt(n))i=n;else if(typeof n=="function")return;if(Pt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(So(o))return o}}function Gwe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(So(r))return Q3(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(Re(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"&&BL.test(i)){var c=BL.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(Re(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"&&FL.test(a)){var m=FL.exec(a);if(m==null||m[1]==null||t==null)l=void 0;else{var d=+m[1];l=t[1]+d}}else l=t==null?void 0:t[1];var g=[o,l];if(So(g))return t==null?g:Q3(g,t,n)}}}var Vd=1e9,Xwe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},kA,jn=!0,xa="[DecimalError] ",Zu=xa+"Invalid argument: ",NA=xa+"Exponent out of range: ",Kd=Math.floor,Du=Math.pow,Wwe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pi,yr=1e7,vn=7,C9=9007199254740991,Dx=Kd(C9/vn),Ie={};Ie.absoluteValue=Ie.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ie.comparedTo=Ie.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Ie.decimalPlaces=Ie.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*vn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ie.dividedBy=Ie.div=function(e){return fs(this,new this.constructor(e))};Ie.dividedToIntegerBy=Ie.idiv=function(e){var t=this,n=t.constructor;return un(fs(t,new n(e),0,1),n.precision)};Ie.equals=Ie.eq=function(e){return!this.cmp(e)};Ie.exponent=function(){return Qn(this)};Ie.greaterThan=Ie.gt=function(e){return this.cmp(e)>0};Ie.greaterThanOrEqualTo=Ie.gte=function(e){return this.cmp(e)>=0};Ie.isInteger=Ie.isint=function(){return this.e>this.d.length-2};Ie.isNegative=Ie.isneg=function(){return this.s<0};Ie.isPositive=Ie.ispos=function(){return this.s>0};Ie.isZero=function(){return this.s===0};Ie.lessThan=Ie.lt=function(e){return this.cmp(e)<0};Ie.lessThanOrEqualTo=Ie.lte=function(e){return this.cmp(e)<1};Ie.logarithm=Ie.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Pi))throw Error(xa+"NaN");if(n.s<1)throw Error(xa+(n.s?"NaN":"-Infinity"));return n.eq(Pi)?new r(0):(jn=!1,t=fs(Wm(n,a),Wm(e,a),a),jn=!0,un(t,i))};Ie.minus=Ie.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?A9(t,e):N9(t,(e.s=-e.s,e))};Ie.modulo=Ie.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(xa+"NaN");return n.s?(jn=!1,t=fs(n,e,0,1).times(e),jn=!0,n.minus(t)):un(new r(n),i)};Ie.naturalExponential=Ie.exp=function(){return k9(this)};Ie.naturalLogarithm=Ie.ln=function(){return Wm(this)};Ie.negated=Ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ie.plus=Ie.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?N9(t,e):A9(t,(e.s=-e.s,e))};Ie.precision=Ie.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zu+e);if(t=Qn(i)+1,r=i.d.length-1,n=r*vn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ie.squareRoot=Ie.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(xa+"NaN")}for(e=Qn(l),jn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=xo(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Kd((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(fs(l,a,o+2)).times(.5),xo(a.d).slice(0,o)===(t=xo(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(un(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return jn=!0,un(r,n)};Ie.times=Ie.mul=function(e){var t,n,r,i,a,o,l,c,f,m=this,d=m.constructor,g=m.d,v=(e=new d(e)).d;if(!m.s||!e.s)return new d(0);for(e.s*=m.s,n=m.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%yr|0,t=l/yr|0;a[i]=(a[i]+t)%yr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,jn?un(e,d.precision):e};Ie.toDecimalPlaces=Ie.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ko(e,0,Vd),t===void 0?t=r.rounding:ko(t,0,8),un(n,e+Qn(n)+1,t))};Ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=xc(r,!0):(ko(e,0,Vd),t===void 0?t=i.rounding:ko(t,0,8),r=un(new i(r),e+1,t),n=xc(r,!0,e+1)),n};Ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?xc(i):(ko(e,0,Vd),t===void 0?t=a.rounding:ko(t,0,8),r=un(new a(i),e+Qn(i)+1,t),n=xc(r.abs(),!1,e+Qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ie.toInteger=Ie.toint=function(){var e=this,t=e.constructor;return un(new t(e),Qn(e)+1,t.rounding)};Ie.toNumber=function(){return+this};Ie.toPower=Ie.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,f=12,m=+(e=new c(e));if(!e.s)return new c(Pi);if(l=new c(l),!l.s){if(e.s<1)throw Error(xa+"Infinity");return l}if(l.eq(Pi))return l;if(r=c.precision,e.eq(Pi))return un(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=m<0?-m:m)<=C9){for(i=new c(Pi),t=Math.ceil(r/vn+4),jn=!1;n%2&&(i=i.times(l),J3(i.d,t)),n=Kd(n/2),n!==0;)l=l.times(l),J3(l.d,t);return jn=!0,e.s<0?new c(Pi).div(i):un(i,r)}}else if(a<0)throw Error(xa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,jn=!1,i=e.times(Wm(l,r+f)),jn=!0,i=k9(i),i.s=a,i};Ie.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Qn(i),r=xc(i,n<=a.toExpNeg||n>=a.toExpPos)):(ko(e,1,Vd),t===void 0?t=a.rounding:ko(t,0,8),i=un(new a(i),e,t),n=Qn(i),r=xc(i,e<=n||n<=a.toExpNeg,e)),r};Ie.toSignificantDigits=Ie.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ko(e,1,Vd),t===void 0?t=r.rounding:ko(t,0,8)),un(new r(n),e,t)};Ie.toString=Ie.valueOf=Ie.val=Ie.toJSON=Ie[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return xc(e,t<=n.toExpNeg||t>=n.toExpPos)};function N9(e,t){var n,r,i,a,o,l,c,f,m=e.constructor,d=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),jn?un(t,d):t;if(c=e.d,f=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=f.length):(r=f,i=o,l=c.length),o=Math.ceil(d/vn),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=f.length,l-a<0&&(a=l,r=f,f=c,c=r),n=0;a;)n=(c[--a]=c[a]+f[a]+n)/yr|0,c[a]%=yr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,jn?un(t,d):t}function ko(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Zu+e)}function xo(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=vn-r.length,n&&(a+=bl(n)),a+=r;o=e[t],r=o+"",n=vn-r.length,n&&(a+=bl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var fs=(function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%yr|0,o=a/yr|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*yr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,f,m,d,g,v,b,w,S,j,C,_,k,O,A,T,P,L=r.constructor,I=r.s==i.s?1:-1,F=r.d,$=i.d;if(!r.s)return new L(r);if(!i.s)throw Error(xa+"Division by zero");for(c=r.e-i.e,T=$.length,O=F.length,v=new L(I),b=v.d=[],f=0;$[f]==(F[f]||0);)++f;if($[f]>(F[f]||0)&&--c,a==null?C=a=L.precision:o?C=a+(Qn(r)-Qn(i))+1:C=a,C<0)return new L(0);if(C=C/vn+2|0,f=0,T==1)for(m=0,$=$[0],C++;(f<O||m)&&C--;f++)_=m*yr+(F[f]||0),b[f]=_/$|0,m=_%$|0;else{for(m=yr/($[0]+1)|0,m>1&&($=e($,m),F=e(F,m),T=$.length,O=F.length),k=T,w=F.slice(0,T),S=w.length;S<T;)w[S++]=0;P=$.slice(),P.unshift(0),A=$[0],$[1]>=yr/2&&++A;do m=0,l=t($,w,T,S),l<0?(j=w[0],T!=S&&(j=j*yr+(w[1]||0)),m=j/A|0,m>1?(m>=yr&&(m=yr-1),d=e($,m),g=d.length,S=w.length,l=t(d,w,g,S),l==1&&(m--,n(d,T<g?P:$,g))):(m==0&&(l=m=1),d=$.slice()),g=d.length,g<S&&d.unshift(0),n(w,d,S),l==-1&&(S=w.length,l=t($,w,T,S),l<1&&(m++,n(w,T<S?P:$,S))),S=w.length):l===0&&(m++,w=[0]),b[f++]=m,l&&w[0]?w[S++]=F[k]||0:(w=[F[k]],S=1);while((k++<O||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=c,un(v,o?a+Qn(v)+1:a)}})();function k9(e,t){var n,r,i,a,o,l,c=0,f=0,m=e.constructor,d=m.precision;if(Qn(e)>16)throw Error(NA+Qn(e));if(!e.s)return new m(Pi);for(jn=!1,l=d,o=new m(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Du(2,f))/Math.LN10*2+5|0,l+=r,n=i=a=new m(Pi),m.precision=l;;){if(i=un(i.times(e),l),n=n.times(++c),o=a.plus(fs(i,n,l)),xo(o.d).slice(0,l)===xo(a.d).slice(0,l)){for(;f--;)a=un(a.times(a),l);return m.precision=d,t==null?(jn=!0,un(a,d)):a}a=o}}function Qn(e){for(var t=e.e*vn,n=e.d[0];n>=10;n/=10)t++;return t}function SE(e,t,n){if(t>e.LN10.sd())throw jn=!0,n&&(e.precision=n),Error(xa+"LN10 precision limit exceeded");return un(new e(e.LN10),t)}function bl(e){for(var t="";e--;)t+="0";return t}function Wm(e,t){var n,r,i,a,o,l,c,f,m,d=1,g=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(xa+(v.s?"NaN":"-Infinity"));if(v.eq(Pi))return new w(0);if(t==null?(jn=!1,f=S):f=t,v.eq(10))return t==null&&(jn=!0),SE(w,f);if(f+=g,w.precision=f,n=xo(b),r=n.charAt(0),a=Qn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=xo(v.d),r=n.charAt(0),d++;a=Qn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=SE(w,f+2,S).times(a+""),v=Wm(new w(r+"."+n.slice(1)),f-g).plus(c),w.precision=S,t==null?(jn=!0,un(v,S)):v;for(l=o=v=fs(v.minus(Pi),v.plus(Pi),f),m=un(v.times(v),f),i=3;;){if(o=un(o.times(m),f),c=l.plus(fs(o,new w(i),f)),xo(c.d).slice(0,f)===xo(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus(SE(w,f+2,S).times(a+""))),l=fs(l,new w(d),f),w.precision=S,t==null?(jn=!0,un(l,S)):l;l=c,i+=2}}function Z3(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=Kd(n/vn),e.d=[],r=(n+1)%vn,n<0&&(r+=vn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=vn;r<i;)e.d.push(+t.slice(r,r+=vn));t=t.slice(r),r=vn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),jn&&(e.e>Dx||e.e<-Dx))throw Error(NA+n)}else e.s=0,e.e=0,e.d=[0];return e}function un(e,t,n){var r,i,a,o,l,c,f,m,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=vn,i=t,f=d[m=0];else{if(m=Math.ceil((r+1)/vn),a=d.length,m>=a)return e;for(f=a=d[m],o=1;a>=10;a/=10)o++;r%=vn,i=r-vn+o}if(n!==void 0&&(a=Du(10,o-i-1),l=f/a%10|0,c=t<0||d[m+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/Du(10,o-i):0:d[m-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=Qn(e),d.length=1,t=t-a-1,d[0]=Du(10,(vn-t%vn)%vn),e.e=Kd(-t/vn)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=m,a=1,m--):(d.length=m+1,a=Du(10,vn-r),d[m]=i>0?(f/Du(10,o-i)%Du(10,i)|0)*a:0),c)for(;;)if(m==0){(d[0]+=a)==yr&&(d[0]=1,++e.e);break}else{if(d[m]+=a,d[m]!=yr)break;d[m--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(jn&&(e.e>Dx||e.e<-Dx))throw Error(NA+Qn(e));return e}function A9(e,t){var n,r,i,a,o,l,c,f,m,d,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),jn?un(t,v):t;if(c=e.d,d=t.d,r=t.e,f=e.e,c=c.slice(),o=f-r,o){for(m=o<0,m?(n=c,o=-o,l=d.length):(n=d,r=f,l=c.length),i=Math.max(Math.ceil(v/vn),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=d.length,m=i<l,m&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){m=c[i]<d[i];break}o=0}for(m&&(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]=yr-1;--c[a],c[i]+=yr}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,jn?un(t,v):t):new g(0)}function xc(e,t,n){var r,i=Qn(e),a=xo(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+bl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+bl(-i-1)+a,n&&(r=n-o)>0&&(a+=bl(r))):i>=o?(a+=bl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+bl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=bl(r))),e.s<0?"-"+a:a}function J3(e,t){if(e.length>t)return e.length=t,!0}function O9(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Zu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Z3(o,a.toString())}else if(typeof a!="string")throw Error(Zu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Wwe.test(a))Z3(o,a);else throw Error(Zu+a)}if(i.prototype=Ie,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=O9,i.config=i.set=Qwe,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 Qwe(e){if(!e||typeof e!="object")throw Error(xa+"Object expected");var t,n,r,i=["precision",1,Vd,"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(Kd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Zu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Zu+n+": "+r);return this}var kA=O9(Xwe);Pi=new kA(1);const Tt=kA;function T9(e){var t;return e===0?t=1:t=Math.floor(new Tt(e).abs().log(10).toNumber())+1,t}function P9(e,t,n){for(var r=new Tt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var M9=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},AA=(e,t,n)=>{if(e.lte(0))return new Tt(0);var r=T9(e.toNumber()),i=new Tt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new Tt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new Tt(c.toNumber()):new Tt(Math.ceil(c.toNumber()))},D9=(e,t,n)=>{var r;if(e.lte(0))return new Tt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Tt(a).abs().log(10).toNumber()),l=new Tt(10).pow(o),c=e.div(l).toNumber(),f=i.findIndex(v=>v>=c-1e-10);if(f===-1&&(l=l.mul(10),f=0),f+=n,f>=i.length){var m=Math.floor(f/i.length);f%=i.length,l=l.mul(new Tt(10).pow(m))}var d=(r=i[f])!==null&&r!==void 0?r:1,g=new Tt(d).mul(l);return t?g:new Tt(Math.ceil(g.toNumber()))},Zwe=(e,t,n)=>{var r=new Tt(1),i=new Tt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Tt(10).pow(T9(e)-1),i=new Tt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Tt(Math.floor(e)))}else e===0?i=new Tt(Math.floor((t-1)/2)):n||(i=new Tt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new Tt(c-o).mul(r)).toNumber());return l},R9=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]:AA;if(!Number.isFinite((n-t)/(r-1)))return{step:new Tt(0),tickMin:new Tt(0),tickMax:new Tt(0)};var l=o(new Tt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new Tt(0):(c=new Tt(t).add(n).div(2),c=c.sub(new Tt(c).mod(l)));var f=Math.ceil(c.sub(t).div(l).toNumber()),m=Math.ceil(new Tt(n).sub(c).div(l).toNumber()),d=f+m+1;return d>r?R9(t,n,r,i,a+1,o):(d<r&&(m=n>0?m+(r-d):m,f=n>0?f:f+(r-d)),{step:l,tickMin:c.sub(new Tt(f).mul(l)),tickMax:c.add(new Tt(m).mul(l))})},ez=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]=M9([n,r]);if(c===-1/0||f===1/0){var m=f===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?m.reverse():m}if(c===f)return Zwe(c,i,a);var d=o==="snap125"?D9:AA,{step:g,tickMin:v,tickMax:b}=R9(c,f,l,a,0,d),w=P9(v,b.add(new Tt(.1).mul(g)),g);return n>r?w.reverse():w},tz=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]=M9([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var f=o==="snap125"?D9:AA,m=Math.max(n,2),d=f(new Tt(c).sub(l).div(m-1),a,0),g=[...P9(new Tt(l),new Tt(c),d),c];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},I9=e=>e.rootProps.maxBarSize,Jwe=e=>e.rootProps.barGap,L9=e=>e.rootProps.barCategoryGap,e1e=e=>e.rootProps.barSize,ng=e=>e.rootProps.stackOffset,z9=e=>e.rootProps.reverseStackOrder,OA=e=>e.options.chartName,TA=e=>e.rootProps.syncId,$9=e=>e.rootProps.syncMethod,PA=e=>e.options.eventEmitter,Wn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Cu={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},lo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},_b=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Cb(e,t,n){if(n!=="auto")return n;if(e!=null)return Ns(e,t)?"category":"number"}function nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nz(Object(n),!0).forEach(function(r){t1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t1e(e,t,n){return(t=n1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n1e(e){var t=r1e(e,"string");return typeof t=="symbol"?t:t+""}function r1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rz={allowDataOverflow:Cu.allowDataOverflow,allowDecimals:Cu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Cu.angleAxisId,includeHidden:!1,name:void 0,reversed:Cu.reversed,scale:Cu.scale,tick:Cu.tick,tickCount:void 0,ticks:void 0,type:Cu.type,unit:void 0,niceTicks:"auto"},iz={allowDataOverflow:lo.allowDataOverflow,allowDecimals:lo.allowDecimals,allowDuplicatedCategory:lo.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:lo.radiusAxisId,includeHidden:lo.includeHidden,name:void 0,reversed:lo.reversed,scale:lo.scale,tick:lo.tick,tickCount:lo.tickCount,ticks:void 0,type:lo.type,unit:void 0,niceTicks:"auto"},i1e=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},MA=le([i1e,t9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Cb(t,"angleAxis",rz.type))!==null&&n!==void 0?n:"category";return Rx(Rx({},rz),{},{type:r})}),a1e=(e,t)=>e.polarAxis.radiusAxis[t],DA=le([a1e,t9],(e,t)=>{var n;if(e!=null)return e;var r=(n=Cb(t,"radiusAxis",iz.type))!==null&&n!==void 0?n:"category";return Rx(Rx({},iz),{},{type:r})}),Nb=e=>e.polarOptions,RA=le([ks,As,cr],b9),B9=le([Nb,RA],(e,t)=>{if(e!=null)return Hr(e.innerRadius,t,0)}),F9=le([Nb,RA],(e,t)=>{if(e!=null)return Hr(e.outerRadius,t,t*.8)}),o1e=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},U9=le([Nb],o1e);le([MA,U9],_b);var H9=le([RA,B9,F9],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([DA,H9],_b);var q9=le([Ut,Nb,B9,F9,ks,As],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:f}=t;return{cx:Hr(o,i,i/2),cy:Hr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),Tn=(e,t)=>t,rg=(e,t,n)=>n;function IA(e){return e==null?void 0:e.id}function V9(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 m=IA(l);f.forEach((d,g)=>{var v=a==null||i?g:String(en(d,a,null)),b=en(d,l.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[m]:b}),o.set(v,w)})}}),Array.from(o.values())}function kb(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 s1e(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Sr=e=>{var t=Ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Yd=e=>e.tooltip.settings.axisId;function LA(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 K9=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!So(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Pt(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Ll(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function l1e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zA(e){let t,n,r;e.length!==2?(t=Ll,n=(l,c)=>Ll(e(l),c),r=(l,c)=>e(l)-c):(t=e===Ll||e===l1e?e:u1e,n=e,r=e);function i(l,c,f=0,m=l.length){if(f<m){if(t(c,c)!==0)return m;do{const d=f+m>>>1;n(l[d],c)<0?f=d+1:m=d}while(f<m)}return f}function a(l,c,f=0,m=l.length){if(f<m){if(t(c,c)!==0)return m;do{const d=f+m>>>1;n(l[d],c)<=0?f=d+1:m=d}while(f<m)}return f}function o(l,c,f=0,m=l.length){const d=i(l,c,f,m-1);return d>f&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:o,right:a}}function u1e(){return 0}function Y9(e){return e===null?NaN:+e}function*c1e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const f1e=zA(Ll),ig=f1e.right;zA(Y9).center;class az extends Map{constructor(t,n=m1e){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(oz(this,t))}has(t){return super.has(oz(this,t))}set(t,n){return super.set(d1e(this,t),n)}delete(t){return super.delete(h1e(this,t))}}function oz({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function d1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function h1e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function m1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function p1e(e=Ll){if(e===Ll)return G9;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 G9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const g1e=Math.sqrt(50),v1e=Math.sqrt(10),y1e=Math.sqrt(2);function Ix(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>=g1e?10:a>=v1e?5:a>=y1e?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?Ix(e,t,n*2):[l,c,f]}function PC(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?Ix(t,e,n):Ix(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 MC(e,t,n){return t=+t,e=+e,n=+n,Ix(e,t,n)[2]}function DC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?MC(t,e,n):MC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function sz(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function lz(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function X9(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?G9:p1e(i);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,m=Math.log(c),d=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*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));X9(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(om(e,n,t),i(e[r],a)>0&&om(e,n,r);o<l;){for(om(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?om(e,n,l):(++l,om(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function om(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function x1e(e,t,n){if(e=Float64Array.from(c1e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return lz(e);if(t>=1)return sz(e);var r,i=(r-1)*t,a=Math.floor(i),o=sz(X9(e,a).subarray(0,a+1)),l=lz(e.subarray(a+1));return o+(l-o)*(i-a)}}function b1e(e,t,n=Y9){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 w1e(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 Aa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ts(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const RC=Symbol("implicit");function $A(){var e=new az,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 az;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 $A(t,n).unknown(r)},Aa.apply(i,arguments),i}function BA(){var e=$A().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,f=0,m=.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))*m,o=a*(1-c),l&&(b=Math.round(b),o=Math.round(o));var S=w1e(g).map(function(j){return b+a*j});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),d()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(g){return arguments.length?(l=!!g,d()):l},e.padding=function(g){return arguments.length?(c=Math.min(1,f=+g),d()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),d()):c},e.paddingOuter=function(g){return arguments.length?(f=+g,d()):f},e.align=function(g){return arguments.length?(m=Math.max(0,Math.min(1,g)),d()):m},e.copy=function(){return BA(t(),[r,i]).round(l).paddingInner(c).paddingOuter(f).align(m)},Aa.apply(d(),arguments)}function W9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return W9(t())},e}function S1e(){return W9(BA.apply(null,arguments).paddingInner(1))}function FA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Q9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ag(){}var Qm=.7,Lx=1/Qm,qf="\\s*([+-]?\\d+)\\s*",Zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",j1e=/^#([0-9a-f]{3,8})$/,E1e=new RegExp(`^rgb\\(${qf},${qf},${qf}\\)$`),_1e=new RegExp(`^rgb\\(${jo},${jo},${jo}\\)$`),C1e=new RegExp(`^rgba\\(${qf},${qf},${qf},${Zm}\\)$`),N1e=new RegExp(`^rgba\\(${jo},${jo},${jo},${Zm}\\)$`),k1e=new RegExp(`^hsl\\(${Zm},${jo},${jo}\\)$`),A1e=new RegExp(`^hsla\\(${Zm},${jo},${jo},${Zm}\\)$`),uz={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};FA(ag,bc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cz,formatHex:cz,formatHex8:O1e,formatHsl:T1e,formatRgb:fz,toString:fz});function cz(){return this.rgb().formatHex()}function O1e(){return this.rgb().formatHex8()}function T1e(){return Z9(this).formatHsl()}function fz(){return this.rgb().formatRgb()}function bc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=j1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dz(t):n===3?new xi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?uy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?uy(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=E1e.exec(e))?new xi(t[1],t[2],t[3],1):(t=_1e.exec(e))?new xi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=C1e.exec(e))?uy(t[1],t[2],t[3],t[4]):(t=N1e.exec(e))?uy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=k1e.exec(e))?pz(t[1],t[2]/100,t[3]/100,1):(t=A1e.exec(e))?pz(t[1],t[2]/100,t[3]/100,t[4]):uz.hasOwnProperty(e)?dz(uz[e]):e==="transparent"?new xi(NaN,NaN,NaN,0):null}function dz(e){return new xi(e>>16&255,e>>8&255,e&255,1)}function uy(e,t,n,r){return r<=0&&(e=t=n=NaN),new xi(e,t,n,r)}function P1e(e){return e instanceof ag||(e=bc(e)),e?(e=e.rgb(),new xi(e.r,e.g,e.b,e.opacity)):new xi}function IC(e,t,n,r){return arguments.length===1?P1e(e):new xi(e,t,n,r??1)}function xi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}FA(xi,IC,Q9(ag,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qm:Math.pow(Qm,e),new xi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xi(Ju(this.r),Ju(this.g),Ju(this.b),zx(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:hz,formatHex:hz,formatHex8:M1e,formatRgb:mz,toString:mz}));function hz(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}`}function M1e(){return`#${zu(this.r)}${zu(this.g)}${zu(this.b)}${zu((isNaN(this.opacity)?1:this.opacity)*255)}`}function mz(){const e=zx(this.opacity);return`${e===1?"rgb(":"rgba("}${Ju(this.r)}, ${Ju(this.g)}, ${Ju(this.b)}${e===1?")":`, ${e})`}`}function zx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ju(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zu(e){return e=Ju(e),(e<16?"0":"")+e.toString(16)}function pz(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ha(e,t,n,r)}function Z9(e){if(e instanceof Ha)return new Ha(e.h,e.s,e.l,e.opacity);if(e instanceof ag||(e=bc(e)),!e)return new Ha;if(e instanceof Ha)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 Ha(o,l,c,e.opacity)}function D1e(e,t,n,r){return arguments.length===1?Z9(e):new Ha(e,t,n,r??1)}function Ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}FA(Ha,D1e,Q9(ag,{brighter(e){return e=e==null?Lx:Math.pow(Lx,e),new Ha(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qm:Math.pow(Qm,e),new Ha(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new xi(jE(e>=240?e-240:e+120,i,r),jE(e,i,r),jE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ha(gz(this.h),cy(this.s),cy(this.l),zx(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=zx(this.opacity);return`${e===1?"hsl(":"hsla("}${gz(this.h)}, ${cy(this.s)*100}%, ${cy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gz(e){return e=(e||0)%360,e<0?e+360:e}function cy(e){return Math.max(0,Math.min(1,e||0))}function jE(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 UA=e=>()=>e;function R1e(e,t){return function(n){return e+n*t}}function I1e(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 L1e(e){return(e=+e)==1?J9:function(t,n){return n-t?I1e(t,n,e):UA(isNaN(t)?n:t)}}function J9(e,t){var n=t-e;return n?R1e(e,n):UA(isNaN(e)?t:e)}const $x=(function e(t){var n=L1e(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=J9(i.opacity,a.opacity);return function(m){return i.r=o(m),i.g=l(m),i.b=c(m),i.opacity=f(m),i+""}}return r.gamma=e,r})(1);function z1e(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 $1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function B1e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=ds(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function F1e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ba(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function U1e(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ds(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var LC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,EE=new RegExp(LC.source,"g");function H1e(e){return function(){return e}}function q1e(e){return function(t){return e(t)+""}}function e7(e,t){var n=LC.lastIndex=EE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=LC.exec(e))&&(i=EE.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:Ba(r,i)})),n=EE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?q1e(c[0].x):H1e(t):(t=c.length,function(f){for(var m=0,d;m<t;++m)l[(d=c[m]).i]=d.x(f);return l.join("")})}function ds(e,t){var n=typeof t,r;return t==null||n==="boolean"?UA(t):(n==="number"?Ba:n==="string"?(r=bc(t))?(t=r,$x):e7:t instanceof bc?$x:t instanceof Date?F1e:$1e(t)?z1e:Array.isArray(t)?B1e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?U1e:Ba)(e,t)}function HA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var vz=180/Math.PI,zC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function t7(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)*vz,skewX:Math.atan(c)*vz,scaleX:o,scaleY:l}}var fy;function V1e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zC:t7(t.a,t.b,t.c,t.d,t.e,t.f)}function K1e(e){return e==null||(fy||(fy=document.createElementNS("http://www.w3.org/2000/svg","g")),fy.setAttribute("transform",e),!(e=fy.transform.baseVal.consolidate()))?zC:(e=e.matrix,t7(e.a,e.b,e.c,e.d,e.e,e.f))}function n7(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,m,d,g,v,b){if(f!==d||m!==g){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:Ba(f,d)},{i:w-2,x:Ba(m,g)})}else(d||g)&&v.push("translate("+d+t+g+n)}function o(f,m,d,g){f!==m?(f-m>180?m+=360:m-f>180&&(f+=360),g.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ba(f,m)})):m&&d.push(i(d)+"rotate("+m+r)}function l(f,m,d,g){f!==m?g.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ba(f,m)}):m&&d.push(i(d)+"skewX("+m+r)}function c(f,m,d,g,v,b){if(f!==d||m!==g){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:Ba(f,d)},{i:w-2,x:Ba(m,g)})}else(d!==1||g!==1)&&v.push(i(v)+"scale("+d+","+g+")")}return function(f,m){var d=[],g=[];return f=e(f),m=e(m),a(f.translateX,f.translateY,m.translateX,m.translateY,d,g),o(f.rotate,m.rotate,d,g),l(f.skewX,m.skewX,d,g),c(f.scaleX,f.scaleY,m.scaleX,m.scaleY,d,g),f=m=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 Y1e=n7(V1e,"px, ","px)","deg)"),G1e=n7(K1e,", ",")",")"),X1e=1e-12;function yz(e){return((e=Math.exp(e))+1/e)/2}function W1e(e){return((e=Math.exp(e))-1/e)/2}function Q1e(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ry=(function e(t,n,r){function i(a,o){var l=a[0],c=a[1],f=a[2],m=o[0],d=o[1],g=o[2],v=m-l,b=d-c,w=v*v+b*b,S,j;if(w<X1e)j=Math.log(g/f)/t,S=function(T){return[l+T*v,c+T*b,f*Math.exp(t*T*j)]};else{var C=Math.sqrt(w),_=(g*g-f*f+r*w)/(2*f*n*C),k=(g*g-f*f-r*w)/(2*g*n*C),O=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(k*k+1)-k);j=(A-O)/t,S=function(T){var P=T*j,L=yz(O),I=f/(n*C)*(L*Q1e(t*P+O)-W1e(O));return[l+I*v,c+I*b,f*L/yz(t*P+O)]}}return S.duration=j*1e3*t/Math.SQRT2,S}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i})(Math.SQRT2,2,4);function Z1e(e,t){t===void 0&&(t=e,e=ds);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function J1e(e){return function(){return e}}function Bx(e){return+e}var xz=[0,1];function ti(e){return e}function $C(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:J1e(isNaN(t)?NaN:.5)}function eSe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function tSe(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=$C(i,r),a=n(o,a)):(r=$C(r,i),a=n(a,o)),function(l){return a(r(l))}}function nSe(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]=$C(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=ig(e,l,1,r)-1;return a[c](i[c](l))}}function og(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Tb(){var e=xz,t=xz,n=ds,r,i,a,o=ti,l,c,f;function m(){var g=Math.min(e.length,t.length);return o!==ti&&(o=eSe(e[0],e[g-1])),l=g>2?nSe:tSe,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),Ba)))(g)))},d.domain=function(g){return arguments.length?(e=Array.from(g,Bx),m()):e.slice()},d.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},d.rangeRound=function(g){return t=Array.from(g),n=HA,m()},d.clamp=function(g){return arguments.length?(o=g?!0:ti,m()):o!==ti},d.interpolate=function(g){return arguments.length?(n=g,m()):n},d.unknown=function(g){return arguments.length?(a=g,d):a},function(g,v){return r=g,i=v,m()}}function qA(){return Tb()(ti,ti)}function rSe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Fx(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 bd(e){return e=Fx(Math.abs(e)),e?e[1]:NaN}function iSe(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 aSe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oSe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jm(e){if(!(t=oSe.exec(e)))throw new Error("invalid format: "+e);var t;return new VA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jm.prototype=VA.prototype;function VA(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+""}VA.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 sSe(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 Ux;function lSe(e,t){var n=Fx(e,t);if(!n)return Ux=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Ux=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")+Fx(e,Math.max(0,t+a-1))[0]}function bz(e,t){var n=Fx(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 wz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rSe,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)=>bz(e*100,t),r:bz,s:lSe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Sz(e){return e}var jz=Array.prototype.map,Ez=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uSe(e){var t=e.grouping===void 0||e.thousands===void 0?Sz:iSe(jz.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?Sz:aSe(jz.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=Jm(d);var v=d.fill,b=d.align,w=d.sign,S=d.symbol,j=d.zero,C=d.width,_=d.comma,k=d.precision,O=d.trim,A=d.type;A==="n"?(_=!0,A="g"):wz[A]||(k===void 0&&(k=12),O=!0,A="g"),(j||v==="0"&&b==="=")&&(j=!0,v="0",b="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),P=(S==="$"?r:/[%p]/.test(A)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),L=wz[A],I=/[defgprs%]/.test(A);k=k===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function F($){var X=T,D=P,V,z,q;if(A==="c")D=L($)+D,$="";else{$=+$;var G=$<0||1/$<0;if($=isNaN($)?c:L(Math.abs($),k),O&&($=sSe($)),G&&+$==0&&w!=="+"&&(G=!1),X=(G?w==="("?w:l:w==="-"||w==="("?"":w)+X,D=(A==="s"&&!isNaN($)&&Ux!==void 0?Ez[8+Ux/3]:"")+D+(G&&w==="("?")":""),I){for(V=-1,z=$.length;++V<z;)if(q=$.charCodeAt(V),48>q||q>57){D=(q===46?i+$.slice(V+1):$.slice(V))+D,$=$.slice(0,V);break}}}_&&!j&&($=t($,1/0));var K=X.length+$.length+D.length,R=K<C?new Array(C-K+1).join(v):"";switch(_&&j&&($=t(R+$,R.length?C-D.length:1/0),R=""),b){case"<":$=X+$+D+R;break;case"=":$=X+R+$+D;break;case"^":$=R.slice(0,K=R.length>>1)+X+$+D+R.slice(K);break;default:$=R+X+$+D;break}return a($)}return F.toString=function(){return d+""},F}function m(d,g){var v=Math.max(-8,Math.min(8,Math.floor(bd(g)/3)))*3,b=Math.pow(10,-v),w=f((d=Jm(d),d.type="f",d),{suffix:Ez[8+v/3]});return function(S){return w(b*S)}}return{format:f,formatPrefix:m}}var dy,KA,r7;cSe({thousands:",",grouping:[3],currency:["$",""]});function cSe(e){return dy=uSe(e),KA=dy.format,r7=dy.formatPrefix,dy}function fSe(e){return Math.max(0,-bd(Math.abs(e)))}function dSe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(bd(t)/3)))*3-bd(Math.abs(e)))}function hSe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,bd(t)-bd(e))+1}function i7(e,t,n,r){var i=DC(e,t,n),a;switch(r=Jm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=dSe(i,o))&&(r.precision=a),r7(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=hSe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=fSe(i))&&(r.precision=a-(r.type==="%")*2);break}}return KA(r)}function tu(e){var t=e.domain;return e.ticks=function(n){var r=t();return PC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return i7(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,m=10;for(l<o&&(f=o,o=l,l=f,f=i,i=a,a=f);m-- >0;){if(f=MC(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 a7(){var e=qA();return e.copy=function(){return og(e,a7())},Aa.apply(e,arguments),tu(e)}function o7(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,Bx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return o7(e).unknown(t)},e=arguments.length?Array.from(e,Bx):[0,1],tu(n)}function s7(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 _z(e){return Math.log(e)}function Cz(e){return Math.exp(e)}function mSe(e){return-Math.log(-e)}function pSe(e){return-Math.exp(-e)}function gSe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function vSe(e){return e===10?gSe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ySe(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 Nz(e){return(t,n)=>-e(-t,n)}function YA(e){const t=e(_z,Cz),n=t.domain;let r=10,i,a;function o(){return i=ySe(r),a=vSe(r),n()[0]<0?(i=Nz(i),a=Nz(a),e(mSe,pSe)):e(_z,Cz),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],m=c[c.length-1];const d=m<f;d&&([f,m]=[m,f]);let g=i(f),v=i(m),b,w;const S=l==null?10:+l;let j=[];if(!(r%1)&&v-g<S){if(g=Math.floor(g),v=Math.ceil(v),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>m)break;j.push(w)}}else for(;g<=v;++g)for(b=r-1;b>=1;--b)if(w=g>0?b/a(-g):b*a(g),!(w<f)){if(w>m)break;j.push(w)}j.length*2<S&&(j=PC(f,m,S))}else j=PC(g,v,Math.min(v-g,S)).map(a);return d?j.reverse():j},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Jm(c)).precision==null&&(c.trim=!0),c=KA(c)),l===1/0)return c;const f=Math.max(1,r*l/t.ticks().length);return m=>{let d=m/a(Math.round(i(m)));return d*r<r-.5&&(d*=r),d<=f?c(m):""}},t.nice=()=>n(s7(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function l7(){const e=YA(Tb()).domain([1,10]);return e.copy=()=>og(e,l7()).base(e.base()),Aa.apply(e,arguments),e}function kz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Az(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function GA(e){var t=1,n=e(kz(t),Az(t));return n.constant=function(r){return arguments.length?e(kz(t=+r),Az(t)):t},tu(n)}function u7(){var e=GA(Tb());return e.copy=function(){return og(e,u7()).constant(e.constant())},Aa.apply(e,arguments)}function Oz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function xSe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function bSe(e){return e<0?-e*e:e*e}function XA(e){var t=e(ti,ti),n=1;function r(){return n===1?e(ti,ti):n===.5?e(xSe,bSe):e(Oz(n),Oz(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tu(t)}function WA(){var e=XA(Tb());return e.copy=function(){return og(e,WA()).exponent(e.exponent())},Aa.apply(e,arguments),e}function wSe(){return WA.apply(null,arguments).exponent(.5)}function Tz(e){return Math.sign(e)*e*e}function SSe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function c7(){var e=qA(),t=[0,1],n=!1,r;function i(a){var o=SSe(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(Tz(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,Bx)).map(Tz)),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 c7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Aa.apply(i,arguments),tu(i)}function f7(){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]=b1e(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ig(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Ll),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return f7().domain(e).range(t).unknown(r)},Aa.apply(a,arguments)}function d7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[ig(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 d7().domain([e,t]).range(i).unknown(a)},Aa.apply(tu(o),arguments)}function h7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ig(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 h7().domain(e).range(t).unknown(n)},Aa.apply(i,arguments)}const _E=new Date,CE=new Date;function fr(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=>fr(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)=>(_E.setTime(+a),CE.setTime(+o),e(_E),e(CE),Math.floor(n(_E,CE))),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 Hx=fr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Hx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Hx);Hx.range;const ls=1e3,la=ls*60,us=la*60,bs=us*24,QA=bs*7,Pz=bs*30,NE=bs*365,$u=fr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ls)},(e,t)=>(t-e)/ls,e=>e.getUTCSeconds());$u.range;const ZA=fr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getMinutes());ZA.range;const JA=fr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCMinutes());JA.range;const eO=fr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ls-e.getMinutes()*la)},(e,t)=>{e.setTime(+e+t*us)},(e,t)=>(t-e)/us,e=>e.getHours());eO.range;const tO=fr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*us)},(e,t)=>(t-e)/us,e=>e.getUTCHours());tO.range;const sg=fr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*la)/bs,e=>e.getDate()-1);sg.range;const Pb=fr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>e.getUTCDate()-1);Pb.range;const m7=fr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bs,e=>Math.floor(e/bs));m7.range;function Mc(e){return fr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*la)/QA)}const Mb=Mc(0),qx=Mc(1),jSe=Mc(2),ESe=Mc(3),wd=Mc(4),_Se=Mc(5),CSe=Mc(6);Mb.range;qx.range;jSe.range;ESe.range;wd.range;_Se.range;CSe.range;function Dc(e){return fr(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)/QA)}const Db=Dc(0),Vx=Dc(1),NSe=Dc(2),kSe=Dc(3),Sd=Dc(4),ASe=Dc(5),OSe=Dc(6);Db.range;Vx.range;NSe.range;kSe.range;Sd.range;ASe.range;OSe.range;const nO=fr(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());nO.range;const rO=fr(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());rO.range;const ws=fr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ws.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ws.range;const Ss=fr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ss.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ss.range;function p7(e,t,n,r,i,a){const o=[[$u,1,ls],[$u,5,5*ls],[$u,15,15*ls],[$u,30,30*ls],[a,1,la],[a,5,5*la],[a,15,15*la],[a,30,30*la],[i,1,us],[i,3,3*us],[i,6,6*us],[i,12,12*us],[r,1,bs],[r,2,2*bs],[n,1,QA],[t,1,Pz],[t,3,3*Pz],[e,1,NE]];function l(f,m,d){const g=m<f;g&&([f,m]=[m,f]);const v=d&&typeof d.range=="function"?d:c(f,m,d),b=v?v.range(f,+m+1):[];return g?b.reverse():b}function c(f,m,d){const g=Math.abs(m-f)/d,v=zA(([,,S])=>S).right(o,g);if(v===o.length)return e.every(DC(f/NE,m/NE,d));if(v===0)return Hx.every(Math.max(DC(f,m,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[TSe,PSe]=p7(Ss,rO,Db,m7,tO,JA),[MSe,DSe]=p7(ws,nO,Mb,sg,eO,ZA);function kE(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 AE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function sm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function RSe(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=lm(i),m=um(i),d=lm(a),g=um(a),v=lm(o),b=um(o),w=lm(l),S=um(l),j=lm(c),C=um(c),_={a:q,A:G,b:K,B:R,c:null,d:zz,e:zz,f:ije,g:mje,G:gje,H:tje,I:nje,j:rje,L:g7,m:aje,M:oje,p:H,q:U,Q:Fz,s:Uz,S:sje,u:lje,U:uje,V:cje,w:fje,W:dje,x:null,X:null,y:hje,Y:pje,Z:vje,"%":Bz},k={a:B,A:Q,b:Z,B:te,c:null,d:$z,e:$z,f:wje,g:Tje,G:Mje,H:yje,I:xje,j:bje,L:y7,m:Sje,M:jje,p:ae,q:re,Q:Fz,s:Uz,S:Eje,u:_je,U:Cje,V:Nje,w:kje,W:Aje,x:null,X:null,y:Oje,Y:Pje,Z:Dje,"%":Bz},O={a:I,A:F,b:$,B:X,c:D,d:Iz,e:Iz,f:QSe,g:Rz,G:Dz,H:Lz,I:Lz,j:YSe,L:WSe,m:KSe,M:GSe,p:L,q:VSe,Q:JSe,s:eje,S:XSe,u:BSe,U:FSe,V:USe,w:$Se,W:HSe,x:V,X:z,y:Rz,Y:Dz,Z:qSe,"%":ZSe};_.x=A(n,_),_.X=A(r,_),_.c=A(t,_),k.x=A(n,k),k.X=A(r,k),k.c=A(t,k);function A(ee,se){return function(ge){var ie=[],Se=-1,Ee=0,He=ee.length,ke,it,Je;for(ge instanceof Date||(ge=new Date(+ge));++Se<He;)ee.charCodeAt(Se)===37&&(ie.push(ee.slice(Ee,Se)),(it=Mz[ke=ee.charAt(++Se)])!=null?ke=ee.charAt(++Se):it=ke==="e"?" ":"0",(Je=se[ke])&&(ke=Je(ge,it)),ie.push(ke),Ee=Se+1);return ie.push(ee.slice(Ee,Se)),ie.join("")}}function T(ee,se){return function(ge){var ie=sm(1900,void 0,1),Se=P(ie,ee,ge+="",0),Ee,He;if(Se!=ge.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(se&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Ee=AE(sm(ie.y,0,1)),He=Ee.getUTCDay(),Ee=He>4||He===0?Vx.ceil(Ee):Vx(Ee),Ee=Pb.offset(Ee,(ie.V-1)*7),ie.y=Ee.getUTCFullYear(),ie.m=Ee.getUTCMonth(),ie.d=Ee.getUTCDate()+(ie.w+6)%7):(Ee=kE(sm(ie.y,0,1)),He=Ee.getDay(),Ee=He>4||He===0?qx.ceil(Ee):qx(Ee),Ee=sg.offset(Ee,(ie.V-1)*7),ie.y=Ee.getFullYear(),ie.m=Ee.getMonth(),ie.d=Ee.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),He="Z"in ie?AE(sm(ie.y,0,1)).getUTCDay():kE(sm(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(He+5)%7:ie.w+ie.U*7-(He+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,AE(ie)):kE(ie)}}function P(ee,se,ge,ie){for(var Se=0,Ee=se.length,He=ge.length,ke,it;Se<Ee;){if(ie>=He)return-1;if(ke=se.charCodeAt(Se++),ke===37){if(ke=se.charAt(Se++),it=O[ke in Mz?se.charAt(Se++):ke],!it||(ie=it(ee,ge,ie))<0)return-1}else if(ke!=ge.charCodeAt(ie++))return-1}return ie}function L(ee,se,ge){var ie=f.exec(se.slice(ge));return ie?(ee.p=m.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function I(ee,se,ge){var ie=v.exec(se.slice(ge));return ie?(ee.w=b.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function F(ee,se,ge){var ie=d.exec(se.slice(ge));return ie?(ee.w=g.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function $(ee,se,ge){var ie=j.exec(se.slice(ge));return ie?(ee.m=C.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function X(ee,se,ge){var ie=w.exec(se.slice(ge));return ie?(ee.m=S.get(ie[0].toLowerCase()),ge+ie[0].length):-1}function D(ee,se,ge){return P(ee,t,se,ge)}function V(ee,se,ge){return P(ee,n,se,ge)}function z(ee,se,ge){return P(ee,r,se,ge)}function q(ee){return o[ee.getDay()]}function G(ee){return a[ee.getDay()]}function K(ee){return c[ee.getMonth()]}function R(ee){return l[ee.getMonth()]}function H(ee){return i[+(ee.getHours()>=12)]}function U(ee){return 1+~~(ee.getMonth()/3)}function B(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function Z(ee){return c[ee.getUTCMonth()]}function te(ee){return l[ee.getUTCMonth()]}function ae(ee){return i[+(ee.getUTCHours()>=12)]}function re(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var se=A(ee+="",_);return se.toString=function(){return ee},se},parse:function(ee){var se=T(ee+="",!1);return se.toString=function(){return ee},se},utcFormat:function(ee){var se=A(ee+="",k);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var Mz={"-":"",_:" ",0:"0"},jr=/^\s*\d+/,ISe=/^%/,LSe=/[\\^$*+?|[\]().{}]/g;function Ft(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function zSe(e){return e.replace(LSe,"\\$&")}function lm(e){return new RegExp("^(?:"+e.map(zSe).join("|")+")","i")}function um(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function $Se(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function BSe(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function FSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function USe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function HSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Dz(e,t,n){var r=jr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Rz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function qSe(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 VSe(e,t,n){var r=jr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function KSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Iz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function YSe(e,t,n){var r=jr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Lz(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function GSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function XSe(e,t,n){var r=jr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function WSe(e,t,n){var r=jr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function QSe(e,t,n){var r=jr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ZSe(e,t,n){var r=ISe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function JSe(e,t,n){var r=jr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function eje(e,t,n){var r=jr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function zz(e,t){return Ft(e.getDate(),t,2)}function tje(e,t){return Ft(e.getHours(),t,2)}function nje(e,t){return Ft(e.getHours()%12||12,t,2)}function rje(e,t){return Ft(1+sg.count(ws(e),e),t,3)}function g7(e,t){return Ft(e.getMilliseconds(),t,3)}function ije(e,t){return g7(e,t)+"000"}function aje(e,t){return Ft(e.getMonth()+1,t,2)}function oje(e,t){return Ft(e.getMinutes(),t,2)}function sje(e,t){return Ft(e.getSeconds(),t,2)}function lje(e){var t=e.getDay();return t===0?7:t}function uje(e,t){return Ft(Mb.count(ws(e)-1,e),t,2)}function v7(e){var t=e.getDay();return t>=4||t===0?wd(e):wd.ceil(e)}function cje(e,t){return e=v7(e),Ft(wd.count(ws(e),e)+(ws(e).getDay()===4),t,2)}function fje(e){return e.getDay()}function dje(e,t){return Ft(qx.count(ws(e)-1,e),t,2)}function hje(e,t){return Ft(e.getFullYear()%100,t,2)}function mje(e,t){return e=v7(e),Ft(e.getFullYear()%100,t,2)}function pje(e,t){return Ft(e.getFullYear()%1e4,t,4)}function gje(e,t){var n=e.getDay();return e=n>=4||n===0?wd(e):wd.ceil(e),Ft(e.getFullYear()%1e4,t,4)}function vje(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ft(t/60|0,"0",2)+Ft(t%60,"0",2)}function $z(e,t){return Ft(e.getUTCDate(),t,2)}function yje(e,t){return Ft(e.getUTCHours(),t,2)}function xje(e,t){return Ft(e.getUTCHours()%12||12,t,2)}function bje(e,t){return Ft(1+Pb.count(Ss(e),e),t,3)}function y7(e,t){return Ft(e.getUTCMilliseconds(),t,3)}function wje(e,t){return y7(e,t)+"000"}function Sje(e,t){return Ft(e.getUTCMonth()+1,t,2)}function jje(e,t){return Ft(e.getUTCMinutes(),t,2)}function Eje(e,t){return Ft(e.getUTCSeconds(),t,2)}function _je(e){var t=e.getUTCDay();return t===0?7:t}function Cje(e,t){return Ft(Db.count(Ss(e)-1,e),t,2)}function x7(e){var t=e.getUTCDay();return t>=4||t===0?Sd(e):Sd.ceil(e)}function Nje(e,t){return e=x7(e),Ft(Sd.count(Ss(e),e)+(Ss(e).getUTCDay()===4),t,2)}function kje(e){return e.getUTCDay()}function Aje(e,t){return Ft(Vx.count(Ss(e)-1,e),t,2)}function Oje(e,t){return Ft(e.getUTCFullYear()%100,t,2)}function Tje(e,t){return e=x7(e),Ft(e.getUTCFullYear()%100,t,2)}function Pje(e,t){return Ft(e.getUTCFullYear()%1e4,t,4)}function Mje(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sd(e):Sd.ceil(e),Ft(e.getUTCFullYear()%1e4,t,4)}function Dje(){return"+0000"}function Bz(){return"%"}function Fz(e){return+e}function Uz(e){return Math.floor(+e/1e3)}var _f,b7,w7;Rje({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 Rje(e){return _f=RSe(e),b7=_f.format,_f.parse,w7=_f.utcFormat,_f.utcParse,_f}function Ije(e){return new Date(e)}function Lje(e){return e instanceof Date?+e:+new Date(+e)}function iO(e,t,n,r,i,a,o,l,c,f){var m=qA(),d=m.invert,g=m.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),S=f("%I %p"),j=f("%a %d"),C=f("%b %d"),_=f("%B"),k=f("%Y");function O(A){return(c(A)<A?v:l(A)<A?b:o(A)<A?w:a(A)<A?S:r(A)<A?i(A)<A?j:C:n(A)<A?_:k)(A)}return m.invert=function(A){return new Date(d(A))},m.domain=function(A){return arguments.length?g(Array.from(A,Lje)):g().map(Ije)},m.ticks=function(A){var T=g();return e(T[0],T[T.length-1],A??10)},m.tickFormat=function(A,T){return T==null?O:f(T)},m.nice=function(A){var T=g();return(!A||typeof A.range!="function")&&(A=t(T[0],T[T.length-1],A??10)),A?g(s7(T,A)):m},m.copy=function(){return og(m,iO(e,t,n,r,i,a,o,l,c,f))},m}function zje(){return Aa.apply(iO(MSe,DSe,ws,nO,Mb,sg,eO,ZA,$u,b7).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $je(){return Aa.apply(iO(TSe,PSe,Ss,rO,Db,Pb,tO,JA,$u,w7).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Rb(){var e=0,t=1,n,r,i,a,o=ti,l=!1,c;function 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 m(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=m(ds),f.rangeRound=m(HA),f.unknown=function(d){return arguments.length?(c=d,f):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),f}}function nu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function S7(){var e=tu(Rb()(ti));return e.copy=function(){return nu(e,S7())},Ts.apply(e,arguments)}function j7(){var e=YA(Rb()).domain([1,10]);return e.copy=function(){return nu(e,j7()).base(e.base())},Ts.apply(e,arguments)}function E7(){var e=GA(Rb());return e.copy=function(){return nu(e,E7()).constant(e.constant())},Ts.apply(e,arguments)}function aO(){var e=XA(Rb());return e.copy=function(){return nu(e,aO()).exponent(e.exponent())},Ts.apply(e,arguments)}function Bje(){return aO.apply(null,arguments).exponent(.5)}function _7(){var e=[],t=ti;function n(r){if(r!=null&&!isNaN(r=+r))return t((ig(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Ll),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>x1e(e,a/r))},n.copy=function(){return _7(t).domain(e)},Ts.apply(n,arguments)}function Ib(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,f=ti,m,d=!1,g;function v(w){return isNaN(w=+w)?g:(w=.5+((w=+m(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=m(e=+e),a=m(t=+t),o=m(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(d=!!w,v):d},v.interpolator=function(w){return arguments.length?(f=w,v):f};function b(w){return function(S){var j,C,_;return arguments.length?([j,C,_]=S,f=Z1e(w,[j,C,_]),v):[f(0),f(.5),f(1)]}}return v.range=b(ds),v.rangeRound=b(HA),v.unknown=function(w){return arguments.length?(g=w,v):g},function(w){return m=w,i=w(e),a=w(t),o=w(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function C7(){var e=tu(Ib()(ti));return e.copy=function(){return nu(e,C7())},Ts.apply(e,arguments)}function N7(){var e=YA(Ib()).domain([.1,1,10]);return e.copy=function(){return nu(e,N7()).base(e.base())},Ts.apply(e,arguments)}function k7(){var e=GA(Ib());return e.copy=function(){return nu(e,k7()).constant(e.constant())},Ts.apply(e,arguments)}function oO(){var e=XA(Ib());return e.copy=function(){return nu(e,oO()).exponent(e.exponent())},Ts.apply(e,arguments)}function Fje(){return oO.apply(null,arguments).exponent(.5)}const bm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:BA,scaleDiverging:C7,scaleDivergingLog:N7,scaleDivergingPow:oO,scaleDivergingSqrt:Fje,scaleDivergingSymlog:k7,scaleIdentity:o7,scaleImplicit:RC,scaleLinear:a7,scaleLog:l7,scaleOrdinal:$A,scalePoint:S1e,scalePow:WA,scaleQuantile:f7,scaleQuantize:d7,scaleRadial:c7,scaleSequential:S7,scaleSequentialLog:j7,scaleSequentialPow:aO,scaleSequentialQuantile:_7,scaleSequentialSqrt:Bje,scaleSequentialSymlog:E7,scaleSqrt:wSe,scaleSymlog:u7,scaleThreshold:h7,scaleTime:zje,scaleUtc:$je,tickFormat:i7},Symbol.toStringTag,{value:"Module"}));function Uje(e){if(e in bm)return bm[e]();var t="scale".concat(Kp(e));if(t in bm)return bm[t]()}function Hz(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Uje(e);if(r!=null)return r.domain(t).range(n),r}}function sO(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Hz(e.scale,n,r):Hz(t,n,r)}function Hje(e){return"scale".concat(Kp(e))}function qje(e){return Hje(e)in bm}var A7=(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 qje(r)?r:"point"}};function Vje(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 O7(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=Vje(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,m=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-f)<=Math.abs(a-m)?n[c-1]:n[c]}}}function Kje(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):O7(e,void 0)}function qz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qz(Object(n),!0).forEach(function(r){Yje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yje(e,t,n){return(t=Gje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gje(e){var t=Xje(e,"string");return typeof t=="symbol"?t:t+""}function Xje(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 BC=[0,"auto"],rr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},T7=(e,t)=>e.cartesianAxis.xAxis[t],Ps=(e,t)=>{var n=T7(e,t);return n??rr},ir={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:BC,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:Wp},P7=(e,t)=>e.cartesianAxis.yAxis[t],Ms=(e,t)=>{var n=P7(e,t);return n??ir},Wje={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:""},lO=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Wje},$n=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"zAxis":return lO(e,n);case"angleAxis":return MA(e,n);case"radiusAxis":return DA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Qje=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Gd=(e,t,n)=>{switch(t){case"xAxis":return Ps(e,n);case"yAxis":return Ms(e,n);case"angleAxis":return MA(e,n);case"radiusAxis":return DA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},M7=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function uO(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 Lb=e=>e.graphicalItems.cartesianItems,Zje=le([Tn,rg],uO),cO=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),lg=le([Lb,$n,Zje],cO,{memoizeOptions:{resultEqualityCheck:Ob}}),D7=le([lg],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(kb)),R7=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Jje=le([lg],R7),fO=e=>e.map(t=>t.data).filter(Boolean).flat(1),eEe=le([lg],fO,{memoizeOptions:{resultEqualityCheck:Ob}}),dO=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},hO=le([eEe,CA],dO),mO=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:en(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:en(i,r)}))):e.map(r=>({value:r})),ug=le([hO,$n,lg],mO);function Vf(e){if(Co(e)||e instanceof Date){var t=Number(e);if(Pt(t))return t}}function Vz(e){if(Array.isArray(e)){var t=[Vf(e[0]),Vf(e[1])];return So(t)?t:void 0}var n=Vf(e);if(n!=null)return[n,n]}function js(e){return e.map(Vf).filter(yi)}function tEe(e,t){var n=Vf(e),r=Vf(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var nEe=le([ug],e=>e==null?void 0:e.map(t=>t.value).sort(tEe));function I7(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function rEe(e,t,n){return!n||typeof t!="number"||_o(t)?[]:n.length?js(n.flatMap(r=>{var i=en(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!Pt(a)||!Pt(o)))return[t-a,t+o]})):[]}var dr=e=>{var t=Sr(e),n=Yd(e);return Gd(e,t,n)},cg=le([dr],e=>e==null?void 0:e.dataKey),iEe=le([D7,CA,dr],V9),L7=(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,m=f.map(IA);return[l,{stackedData:Vxe(e,m,n),graphicalItems:f}]}))},FC=le([iEe,D7,ng,z9],L7),z7=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Wxe(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},aEe=le([$n],e=>e.allowDataOverflow),pO=e=>{var t;if(e==null||!("domain"in e))return BC;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=js(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:BC},gO=le([$n],pO),vO=le([gO,aEe],_9),oEe=le([FC,Os,Tn,vO],z7,{memoizeOptions:{resultEqualityCheck:Ab}}),zb=e=>e.errorBars,sEe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>I7(n,r)),Yx=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]}},yO=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var f,m,d=(f=r[c.id])===null||f===void 0?void 0:f.filter(j=>I7(i,j)),g=en(l,(m=t.dataKey)!==null&&m!==void 0?m:c.dataKey),v=rEe(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=Vz(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=Vz(en(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Pt(a)&&Pt(o))return[a,o]},lEe=le([hO,$n,Jje,zb,Tn],yO,{memoizeOptions:{resultEqualityCheck:Ab}});function uEe(e){var{value:t}=e;if(Co(t)||t instanceof Date)return t}var cEe=(e,t,n)=>{var r=e.map(uEe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&GH(r))?E9(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},$7=e=>e.referenceElements.dots,Xd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),fEe=le([$7,Tn,rg],Xd),B7=e=>e.referenceElements.areas,dEe=le([B7,Tn,rg],Xd),F7=e=>e.referenceElements.lines,hEe=le([F7,Tn,rg],Xd),U7=(e,t)=>{if(e!=null){var n=js(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},mEe=le(fEe,Tn,U7),H7=(e,t)=>{if(e!=null){var n=js(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},pEe=le([dEe,Tn],H7);function gEe(e){var t;if(e.x!=null)return js([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:js(n)}function vEe(e){var t;if(e.y!=null)return js([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:js(n)}var q7=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?gEe(r):vEe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},yEe=le([hEe,Tn],q7),xEe=le(mEe,yEe,pEe,(e,t,n)=>Yx(e,n,t)),xO=(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?Yx(r,a,i):Yx(a,i);return Gwe(t,f,e.allowDataOverflow)},bEe=le([$n,gO,vO,oEe,lEe,xEe,Ut,Tn],xO,{memoizeOptions:{resultEqualityCheck:Ab}}),wEe=[0,1],bO=(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=Ns(t,a);if(f&&l==null){var m;return E9(0,(m=n==null?void 0:n.length)!==null&&m!==void 0?m:0)}return c==="category"?cEe(r,e,f):i==="expand"?wEe:o}},wO=le([$n,Ut,hO,ug,ng,Tn,bEe],bO),ru=le([$n,M7,OA],A7),SO=(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&&So(e)){if(a)return ez(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return tz(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&So(e))return ez(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&So(e))return tz(e,t.tickCount,t.allowDecimals,"adaptive")}}},jO=le([wO,Gd,ru],SO),EO=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&So(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,f)]}return t},SEe=le([$n,wO,jO,Tn],EO),jEe=le(ug,$n,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(js(e.map(d=>d.value))).sort((d,g)=>d-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],f=r[l+1];if(!(c==null||f==null)){var m=f-c;n=Math.min(n,m)}}return n/o}}),V7=le(jEe,Ut,L9,cr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Pt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Hr(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),EEe=(e,t,n)=>{var r=Ps(e,t);return r==null||typeof r.padding!="string"?0:V7(e,"xAxis",t,n,r.padding)},_Ee=(e,t,n)=>{var r=Ms(e,t);return r==null||typeof r.padding!="string"?0:V7(e,"yAxis",t,n,r.padding)},CEe=le(Ps,EEe,(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}}),NEe=le(Ms,_Ee,(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}}),kEe=le([cr,CEe,xb,yb,(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]}),AEe=le([cr,Ut,NEe,xb,yb,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),fg=(e,t,n,r)=>{var i;switch(t){case"xAxis":return kEe(e,n,r);case"yAxis":return AEe(e,n,r);case"zAxis":return(i=lO(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return U9(e);case"radiusAxis":return H9(e,n);default:return}},K7=le([$n,fg],_b),OEe=le([ru,SEe],K9),_O=le([$n,ru,OEe,K7],sO),Y7=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Ns(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},CO=le([Ut,ug,Gd,Tn],Y7),$b=le([_O],LA);le([_O],Kje);le([_O,nEe],O7);le([lg,zb,Tn],sEe);function G7(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Bb=(e,t)=>t,Fb=(e,t,n)=>n,TEe=le(gb,Bb,Fb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(G7)),PEe=le(vb,Bb,Fb,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(G7)),X7=(e,t)=>({width:e.width,height:t.height}),MEe=(e,t)=>{var n=typeof t.width=="number"?t.width:Wp;return{width:n,height:e.height}},W7=le(cr,Ps,X7),DEe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},REe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},IEe=le(As,cr,TEe,Bb,Fb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=X7(t,l);o==null&&(o=DEe(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}),LEe=le(ks,cr,PEe,Bb,Fb,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=MEe(t,l);o==null&&(o=REe(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}),zEe=(e,t)=>{var n=Ps(e,t);if(n!=null)return IEe(e,n.orientation,n.mirror)},$Ee=le([cr,Ps,zEe,(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}}}),BEe=(e,t)=>{var n=Ms(e,t);if(n!=null)return LEe(e,n.orientation,n.mirror)},FEe=le([cr,Ms,BEe,(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}}}),Q7=le(cr,Ms,(e,t)=>{var n=typeof t.width=="number"?t.width:Wp;return{width:n,height:e.height}}),Kz=(e,t,n)=>{switch(t){case"xAxis":return W7(e,n).width;case"yAxis":return Q7(e,n).height;default:return}},Z7=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=Ns(e,r),c=t.map(f=>f.value);if(o&&l&&a==="category"&&i&&GH(c))return c}},NO=le([Ut,ug,$n,Tn],Z7),Yz=le([Ut,Qje,ru,$b,NO,CO,fg,jO,Tn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var f=Ns(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}}}),UEe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var f=Ns(e,c),{type:m,ticks:d,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=m==="category"&&r.bandwidth?r.bandwidth()/v:0;b=c==="angleAxis"&&a!=null&&a.length>=2?xr(a[0]-a[1])*2*b:b;var w=d||i;return w?w.map((S,j)=>{var C=o?o.indexOf(S):S,_=r.map(C);return Pt(_)?{index:j,coordinate:_+b,value:S,offset:b}:null}).filter(yi):f&&l?l.map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(yi):r.ticks?r.ticks(g).map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:S,index:j,offset:b}:null}).filter(yi):r.domain().map((S,j)=>{var C=r.map(S);return Pt(C)?{coordinate:C+b,value:o?o[S]:S,index:j,offset:b}:null}).filter(yi)}},J7=le([Ut,Gd,ru,$b,jO,fg,NO,CO,Tn],UEe),HEe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=Ns(e,o),{tickCount:c}=t,f=0;return f=o==="angleAxis"&&(r==null?void 0:r.length)>=2?xr(r[0]-r[1])*2*f:f,l&&a?a.map((m,d)=>{var g=n.map(m);return Pt(g)?{coordinate:g+f,value:m,index:d,offset:f}:null}).filter(yi):n.ticks?n.ticks(c).map((m,d)=>{var g=n.map(m);return Pt(g)?{coordinate:g+f,value:m,index:d,offset:f}:null}).filter(yi):n.domain().map((m,d)=>{var g=n.map(m);return Pt(g)?{coordinate:g+f,value:i?i[m]:m,index:d,offset:f}:null}).filter(yi)}},ql=le([Ut,Gd,$b,fg,NO,CO,Tn],HEe),Vl=le($n,$b,(e,t)=>{if(!(e==null||t==null))return Kx(Kx({},e),{},{scale:t})}),qEe=le([$n,ru,wO,K7],sO),VEe=le([qEe],LA);le((e,t,n)=>lO(e,n),VEe,(e,t)=>{if(!(e==null||t==null))return Kx(Kx({},e),{},{scale:t})});var KEe=le([Ut,gb,vb],(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}}),YEe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([YEe],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 eV=e=>e.options.defaultTooltipEventType,tV=e=>e.options.validateTooltipEventTypes;function nV(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function kO(e,t){var n=eV(e),r=tV(e);return nV(t,n,r)}function GEe(e){return $e(t=>kO(t,e))}var rV=(e,t)=>{var n,r=Number(t);if(!(_o(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},XEe=e=>e.tooltip.settings,jl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},WEe={itemInteraction:{click:jl,hover:jl},axisInteraction:{click:jl,hover:jl},keyboardInteraction:jl,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},iV=Kr({name:"tooltip",initialState:WEe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:gn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:gn()},removeTooltipEntrySettings:{reducer(e,t){var n=sa(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:gn()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:QEe,replaceTooltipEntrySettings:ZEe,removeTooltipEntrySettings:JEe,setTooltipSettingsState:e_e,setActiveMouseOverItemIndex:aV,mouseLeaveItem:t_e,mouseLeaveChart:oV,setActiveClickItemIndex:n_e,setMouseOverAxisIndex:sV,setMouseClickAxisIndex:r_e,setSyncInteraction:UC,setKeyboardInteraction:Gx}=iV.actions,i_e=iV.reducer;function Gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gz(Object(n),!0).forEach(function(r){a_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a_e(e,t,n){return(t=o_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o_e(e){var t=s_e(e,"string");return typeof t=="symbol"?t:t+""}function s_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 l_e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function u_e(e){return e.index!=null}var lV=(e,t,n,r)=>{if(t==null)return jl;var i=l_e(e,t,n);if(i==null)return jl;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(u_e(i)){if(a)return hy(hy({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return hy(hy({},jl),{},{coordinate:i.coordinate})};function c_e(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function f_e(e,t){var n=c_e(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function d_e(e,t,n){if(n==null||t==null)return!0;var r=en(e,t);return r==null||!So(n)?!0:f_e(r,n)}var AO=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Pt(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(a,l)),f=t[c];return f==null||d_e(f,n,r)?String(c):null},uV=(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}}}},cV=(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})},fV=e=>e.options.tooltipPayloadSearcher,Wd=e=>e.tooltip;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 Wz(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){h_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h_e(e,t,n){return(t=m_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m_e(e){var t=p_e(e,"string");return typeof t=="symbol"?t:t+""}function p_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 g_e(e){if(typeof e=="string"||typeof e=="number")return e}function v_e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function y_e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function Qz(e){if(typeof e=="string")return e}function x_e(e){if(!(e==null||typeof e!="object")){var t="name"in e?g_e(e.name):void 0,n="unit"in e?v_e(e.unit):void 0,r="dataKey"in e?y_e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Qz(e.color):void 0,o="fill"in e?Qz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function b_e(e,t){return e??t}var dV=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:f,dataEndIndex:m}=n,d=[];return e.reduce((g,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,j=b_e(w,l),C=Array.isArray(j)?qq(j,f,m):j,_=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,k=S==null?void 0:S.nameKey,O;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&o==="axis"?O=XH(C,r,i):O=a(C,t,c,k),Array.isArray(O))O.forEach(T=>{var P,L,I=x_e(T),F=I==null?void 0:I.name,$=I==null?void 0:I.dataKey,X=I==null?void 0:I.payload,D=Wz(Wz({},S),{},{name:F,unit:I==null?void 0:I.unit,color:(P=I==null?void 0:I.color)!==null&&P!==void 0?P:S==null?void 0:S.color,fill:(L=I==null?void 0:I.fill)!==null&&L!==void 0?L:S==null?void 0:S.fill});g.push(UL({tooltipEntrySettings:D,dataKey:$,payload:X,value:en(X,$),name:F==null?void 0:String(F)}))});else{var A;g.push(UL({tooltipEntrySettings:S,dataKey:_,payload:O,value:en(O,_),name:(A=en(O,k))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return g},d)}},OO=le([dr,M7,OA],A7),w_e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),S_e=le([Sr,Yd],uO),Qd=le([w_e,dr,S_e],cO,{memoizeOptions:{resultEqualityCheck:Ob}}),j_e=le([Qd],e=>e.filter(kb)),E_e=le([Qd],fO,{memoizeOptions:{resultEqualityCheck:Ob}}),Zd=le([E_e,Os],dO),__e=le([j_e,Os,dr],V9),TO=le([Zd,dr,Qd],mO),hV=le([dr],pO),C_e=le([dr],e=>e.allowDataOverflow),mV=le([hV,C_e],_9),N_e=le([Qd],e=>e.filter(kb)),k_e=le([__e,N_e,ng,z9],L7),A_e=le([k_e,Os,Sr,mV],z7),O_e=le([Qd],R7),T_e=le([Zd,dr,O_e,zb,Sr],yO,{memoizeOptions:{resultEqualityCheck:Ab}}),P_e=le([$7,Sr,Yd],Xd),M_e=le([P_e,Sr],U7),D_e=le([B7,Sr,Yd],Xd),R_e=le([D_e,Sr],H7),I_e=le([F7,Sr,Yd],Xd),L_e=le([I_e,Sr],q7),z_e=le([M_e,L_e,R_e],Yx),$_e=le([dr,hV,mV,A_e,T_e,z_e,Ut,Sr],xO),dg=le([dr,Ut,Zd,TO,ng,Sr,$_e],bO),B_e=le([dg,dr,OO],SO),F_e=le([dr,dg,B_e,Sr],EO),pV=e=>{var t=Sr(e),n=Yd(e),r=!1;return fg(e,t,n,r)},gV=le([dr,pV],_b),U_e=le([dr,OO,F_e,gV],sO),vV=le([U_e],LA),H_e=le([Ut,TO,dr,Sr],Z7),q_e=le([Ut,TO,dr,Sr],Y7),V_e=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,f=Ns(e,l);if(r){var m=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/m:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?xr(i[0]-i[1])*2*d:d,f&&o?o.map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+d,value:g,index:v,offset:d}:null}).filter(yi):r.domain().map((g,v)=>{var b=r.map(g);return Pt(b)?{coordinate:b+d,value:a?a[g]:g,index:v,offset:d}:null}).filter(yi)}}},Ds=le([Ut,dr,OO,vV,pV,H_e,q_e,Sr],V_e),PO=le([eV,tV,XEe],(e,t,n)=>nV(n.shared,e,t)),yV=e=>e.tooltip.settings.trigger,MO=e=>e.tooltip.settings.defaultIndex,hg=le([Wd,PO,yV,MO],lV),Kl=le([hg,Zd,cg,dg],AO),xV=le([Ds,Kl],rV),DO=le([hg],e=>{if(e)return e.dataKey}),bV=le([hg],e=>{if(e)return e.graphicalItemId}),wV=le([Wd,PO,yV,MO],cV),K_e=le([ks,As,Ut,cr,Ds,MO,wV],uV),Y_e=le([hg,K_e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),G_e=le([hg],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),X_e=le([wV,Kl,Os,cg,xV,fV,PO],dV),W_e=le([X_e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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 Jz(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){Q_e(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 Q_e(e,t,n){return(t=Z_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z_e(e){var t=J_e(e,"string");return typeof t=="symbol"?t:t+""}function J_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eCe=()=>$e(dr),tCe=()=>{var e=eCe(),t=$e(Ds),n=$e(vV);return vd(!e||!n?void 0:Jz(Jz({},e),{},{scale:n}),t)};function e4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e4(Object(n),!0).forEach(function(r){nCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nCe(e,t,n){return(t=rCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rCe(e){var t=iCe(e,"string");return typeof t=="symbol"?t:t+""}function iCe(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 aCe=(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}},oCe=(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 Cf(Cf(Cf({},r),Xn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return Cf(Cf(Cf({},r),Xn(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 sCe(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 SV=(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,m,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=(m=n[l])===null||m===void 0?void 0:m.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(xr(b-v)!==xr(w-b)){var j=[];if(xr(w-b)===xr(i[1]-i[0])){S=w;var C=b+i[1]-i[0];j[0]=Math.min(C,(C+v)/2),j[1]=Math.max(C,(C+v)/2)}else{S=v;var _=w+i[1]-i[0];j[0]=Math.min(b,(_+b)/2),j[1]=Math.max(b,(_+b)/2)}var k=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>k[0]&&e<=k[1]||e>=j[0]&&e<=j[1]){var O;return(O=n[l])===null||O===void 0?void 0:O.index}}else{var A=Math.min(v,w),T=Math.max(v,w);if(e>(A+b)/2&&e<=(T+b)/2){var P;return(P=n[l])===null||P===void 0?void 0:P.index}}}else if(t)for(var L=0;L<o;L++){var I=t[L];if(I!=null){var F=t[L+1],$=t[L-1];if(L===0&&F!=null&&e<=(I.coordinate+F.coordinate)/2||L===o-1&&$!=null&&e>(I.coordinate+$.coordinate)/2||L>0&&L<o-1&&$!=null&&F!=null&&e>(I.coordinate+$.coordinate)/2&&e<=(I.coordinate+F.coordinate)/2)return I.index}}return-1},lCe=()=>$e(OA),RO=(e,t)=>t,jV=(e,t,n)=>n,IO=(e,t,n,r)=>r,uCe=le(Ds,e=>ob(e,t=>t.coordinate)),LO=le([Wd,RO,jV,IO],lV),zO=le([LO,Zd,cg,dg],AO),cCe=(e,t,n)=>{if(t!=null){var r=Wd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},EV=le([Wd,RO,jV,IO],cV),Xx=le([ks,As,Ut,cr,Ds,IO,EV],uV),fCe=le([LO,Xx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),_V=le([Ds,zO],rV),dCe=le([EV,zO,Os,cg,_V,fV,RO],dV),hCe=le([LO,zO],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),mCe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&sCe(e,o)){var l=Qxe(e,t),c=SV(l,a,i,n,r),f=aCe(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},pCe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=Lwe(e,n);if(l){var c=Zxe(l,t),f=SV(c,o,a,r,i),m=oCe(t,a,f,l);return{activeIndex:String(f),activeCoordinate:m}}}},gCe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?mCe(e,t,r,i,a,o,l):pCe(e,t,n,r,i,a,o)},vCe=le(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),yCe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Wn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:s1e}});function t4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t4(Object(n),!0).forEach(function(r){xCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xCe(e,t,n){return(t=bCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bCe(e){var t=wCe(e,"string");return typeof t=="symbol"?t:t+""}function wCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SCe={},jCe={zIndexMap:Object.values(Wn).reduce((e,t)=>n4(n4({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),SCe)},ECe=new Set(Object.values(Wn));function _Ce(e){return ECe.has(e)}var CV=Kr({name:"zIndex",initialState:jCe,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:gn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!_Ce(n)&&delete e.zIndexMap[n])},prepare:gn()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:gn()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:gn()}}}),{registerZIndexPortal:CCe,unregisterZIndexPortal:NCe,registerZIndexPortalElement:kCe,unregisterZIndexPortalElement:ACe}=CV.actions,OCe=CV.reducer;function wi(e){var{zIndex:t,children:n}=e,r=A0e(),i=r&&t!==void 0&&t!==0,a=Yr(),o=tn();y.useLayoutEffect(()=>i?(o(CCe({zIndex:t})),()=>{o(NCe({zIndex:t}))}):eu,[o,t,i]);var l=$e(c=>vCe(c,t,a));return i?l?Xl.createPortal(n,l):null:n}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 r4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function my(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r4(Object(n),!0).forEach(function(r){TCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TCe(e,t,n){return(t=PCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PCe(e){var t=MCe(e,"string");return typeof t=="symbol"?t:t+""}function MCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DCe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return y.isValidElement(t)?y.cloneElement(t,r):y.createElement(n,r)}function RCe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:f,chartName:m}=e,d=n,g=r,v=i;if(!c||!d||m!=="ScatterChart"&&f!=="axis")return null;var b,w,S;if(m==="ScatterChart")b=d,w=Zbe,S=Wn.cursorLine;else if(m==="BarChart")b=Jbe(l,d,a,o),w=x9,S=Wn.cursorRectangle;else if(l==="radial"&&QH(d)){var{cx:j,cy:C,radius:_,startAngle:k,endAngle:O}=w9(d);b={cx:j,cy:C,startAngle:k,endAngle:O,innerRadius:_,outerRadius:_},w=j9,S=Wn.cursorLine}else b={points:Fwe(l,d,a)},w=_A,S=Wn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=my(my(my(my({stroke:"#ccc",pointerEvents:"none"},a),b),dc(c)),{},{payload:g,payloadIndex:v,className:Rt("recharts-tooltip-cursor",A)});return y.createElement(wi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},y.createElement(DCe,{cursor:c,cursorComp:w,cursorProps:T}))}function ICe(e){var t=tCe(),n=Jq(),r=Pc(),i=lCe();return t==null||n==null||r==null||i==null?null:y.createElement(RCe,HC({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var NV=y.createContext(null),LCe=()=>y.useContext(NV),OE={exports:{}},i4;function zCe(){return i4||(i4=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,m){this.fn=c,this.context=f,this.once=m||!1}function a(c,f,m,d,g){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new i(m,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=[],m,d;if(this._eventsCount===0)return f;for(d in m=this._events)t.call(m,d)&&f.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(m)):f},l.prototype.listeners=function(f){var m=n?n+f:f,d=this._events[m];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 m=n?n+f:f,d=this._events[m];return d?d.fn?1:d.length:0},l.prototype.emit=function(f,m,d,g,v,b){var w=n?n+f:f;if(!this._events[w])return!1;var S=this._events[w],j=arguments.length,C,_;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),j){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,m),!0;case 3:return S.fn.call(S.context,m,d),!0;case 4:return S.fn.call(S.context,m,d,g),!0;case 5:return S.fn.call(S.context,m,d,g,v),!0;case 6:return S.fn.call(S.context,m,d,g,v,b),!0}for(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];S.fn.apply(S.context,C)}else{var k=S.length,O;for(_=0;_<k;_++)switch(S[_].once&&this.removeListener(f,S[_].fn,void 0,!0),j){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,m);break;case 3:S[_].fn.call(S[_].context,m,d);break;case 4:S[_].fn.call(S[_].context,m,d,g);break;default:if(!C)for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];S[_].fn.apply(S[_].context,C)}}return!0},l.prototype.on=function(f,m,d){return a(this,f,m,d,!1)},l.prototype.once=function(f,m,d){return a(this,f,m,d,!0)},l.prototype.removeListener=function(f,m,d,g){var v=n?n+f:f;if(!this._events[v])return this;if(!m)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===m&&(!g||b.once)&&(!d||b.context===d)&&o(this,v);else{for(var w=0,S=[],j=b.length;w<j;w++)(b[w].fn!==m||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 m;return f?(m=n?n+f:f,this._events[m]&&o(this,m)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(OE)),OE.exports}var $Ce=zCe();const BCe=Hi($Ce);var ep=new BCe,qC="recharts.syncEvent.tooltip",a4="recharts.syncEvent.brush",$O=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!_o(n))return e[n]}},FCe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},kV=Kr({name:"options",initialState:FCe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),UCe=kV.reducer,{createEventEmitter:HCe}=kV.actions;function qCe(e){return e.tooltip.syncInteraction}var VCe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},AV=Kr({name:"chartData",initialState:VCe,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:o4,setDataStartEndIndexes:KCe,setComputedData:t$e}=AV.actions,YCe=AV.reducer,GCe=["x","y"];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 Nf(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){XCe(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 XCe(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 ZCe(e,t){if(e==null)return{};var n,r,i=JCe(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 JCe(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 eNe(){var e=$e(TA),t=$e(PA),n=tn(),r=$e($9),i=$e(Ds),a=Pc(),o=bb(),l=$e(c=>c.rootProps.className);y.useEffect(()=>{if(e==null)return eu;var c=(f,m,d)=>{if(t!==d&&e===f){if(r==="index"){var g;if(o&&m!==null&&m!==void 0&&(g=m.payload)!==null&&g!==void 0&&g.coordinate&&m.payload.sourceViewBox){var v=m.payload.coordinate,{x:b,y:w}=v,S=ZCe(v,GCe),{x:j,y:C,width:_,height:k}=m.payload.sourceViewBox,O=Nf(Nf({},S),{},{x:o.x+(_?(b-j)/_:0)*o.width,y:o.y+(k?(w-C)/k:0)*o.height});n(Nf(Nf({},m),{},{payload:Nf(Nf({},m.payload),{},{coordinate:O})}))}else n(m);return}if(i!=null){var A;if(typeof r=="function"){var T={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},P=r(i,T);A=i[P]}else r==="value"&&(A=i.find(z=>String(z.value)===m.payload.label));var{coordinate:L}=m.payload;if(A==null||m.payload.active===!1||L==null||o==null){n(UC({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:I,y:F}=L,$=Math.min(I,o.x+o.width),X=Math.min(F,o.y+o.height),D={x:a==="horizontal"?A.coordinate:$,y:a==="horizontal"?X:A.coordinate},V=UC({active:m.payload.active,coordinate:D,dataKey:m.payload.dataKey,index:String(A.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});n(V)}}};return ep.on(qC,c),()=>{ep.off(qC,c)}},[l,n,t,e,r,i,a,o])}function tNe(){var e=$e(TA),t=$e(PA),n=tn();y.useEffect(()=>{if(e==null)return eu;var r=(i,a,o)=>{t!==o&&e===i&&n(KCe(a))};return ep.on(a4,r),()=>{ep.off(a4,r)}},[n,t,e])}function nNe(){var e=tn();y.useEffect(()=>{e(HCe())},[e]),eNe(),tNe()}function rNe(e,t,n,r,i,a){var o=$e(b=>cCe(b,e,t)),l=$e(bV),c=$e(PA),f=$e(TA),m=$e($9),d=$e(qCe),g=d==null?void 0:d.active,v=bb();y.useEffect(()=>{if(!g&&f!=null&&c!=null){var b=UC({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});ep.emit(qC,f,b,c)}},[g,n,o,l,i,r,c,f,m,a,v])}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 u4(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){iNe(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 iNe(e,t,n){return(t=aNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aNe(e){var t=oNe(e,"string");return typeof t=="symbol"?t:t+""}function oNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sNe(e){return e.dataKey}function lNe(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(Nbe,t)}var c4=[],uNe={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 OV(e){var t,n,r=Zn(e,uNe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:c,filterNull:f,isAnimationActive:m,offset:d,payloadUniqBy:g,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:j,shared:C,trigger:_,defaultIndex:k,portal:O,axisId:A}=r,T=tn(),P=typeof k=="number"?String(k):k;y.useEffect(()=>{T(e_e({shared:C,trigger:_,axisId:A,active:i,defaultIndex:P}))},[T,C,_,A,i,P]);var L=bb(),I=m9(),F=GEe(C),{activeIndex:$,isActive:X}=(t=$e(re=>hCe(re,F,_,P)))!==null&&t!==void 0?t:{},D=$e(re=>dCe(re,F,_,P)),V=$e(re=>_V(re,F,_,P)),z=$e(re=>fCe(re,F,_,P)),q=D,G=LCe(),K=(n=i??X)!==null&&n!==void 0?n:!1,[R,H]=mq([q,K]),U=F==="axis"?V:void 0;rNe(F,_,z,U,$,K);var B=O??G;if(B==null||L==null||F==null)return null;var Q=q??c4;K||(Q=c4),f&&Q.length&&(Q=lq(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),g,sNe));var Z=Q.length>0,te=u4(u4({},r),{},{payload:Q,label:U,active:K,activeIndex:$,coordinate:z,accessibilityLayer:I}),ae=y.createElement(zbe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:m,active:K,coordinate:z,hasPayload:Z,offset:d,position:v,reverseDirection:b,useTranslate3d:w,viewBox:L,wrapperStyle:S,lastBoundingBox:R,innerRef:H,hasPortalFromProps:!!O},lNe(c,te));return y.createElement(y.Fragment,null,Xl.createPortal(ae,B),K&&y.createElement(ICe,{cursor:j,tooltipEventType:F,coordinate:z,payload:Q,index:$}))}var mg=e=>null;mg.displayName="Cell";function cNe(e,t,n){return(t=fNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fNe(e){var t=dNe(e,"string");return typeof t=="symbol"?t:t+""}function dNe(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 hNe{constructor(t){cNe(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 f4(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 mNe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f4(Object(n),!0).forEach(function(r){pNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pNe(e,t,n){return(t=gNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gNe(e){var t=vNe(e,"string");return typeof t=="symbol"?t:t+""}function vNe(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 yNe={cacheSize:2e3,enableCache:!0},TV=mNe({},yNe),d4=new hNe(TV.cacheSize),xNe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},h4="recharts_measurement_span";function bNe(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 m4=(e,t)=>{try{var n=document.getElementById(h4);n||(n=document.createElement("span"),n.setAttribute("id",h4),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,xNe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Om=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jp.isSsr)return{width:0,height:0};if(!TV.enableCache)return m4(t,n);var r=bNe(t,n),i=d4.get(r);if(i)return i;var a=m4(t,n);return d4.set(r,a),a},PV;function wNe(e,t,n){return(t=SNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SNe(e){var t=jNe(e,"string");return typeof t=="symbol"?t:t+""}function jNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var p4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ENe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,_Ne=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,CNe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},NNe=["cm","mm","pt","pc","in","Q","px"];function kNe(e){return NNe.includes(e)}var Lf="NaN";function ANe(e,t){return e*CNe[t]}class Or{static parse(t){var n,[,r,i]=(n=_Ne.exec(t))!==null&&n!==void 0?n:[];return r==null?Or.NaN:new Or(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,_o(t)&&(this.unit=""),n!==""&&!ENe.test(n)&&(this.num=NaN,this.unit=""),kNe(n)&&(this.num=ANe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Or(NaN,""):new Or(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Or(NaN,""):new Or(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Or(NaN,""):new Or(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Or(NaN,""):new Or(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return _o(this.num)}}PV=Or;wNe(Or,"NaN",new PV(NaN,""));function MV(e){if(e==null||e.includes(Lf))return Lf;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=p4.exec(t))!==null&&n!==void 0?n:[],o=Or.parse(r??""),l=Or.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Lf;t=t.replace(p4,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,m,d,g]=(f=g4.exec(t))!==null&&f!==void 0?f:[],v=Or.parse(m??""),b=Or.parse(g??""),w=d==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Lf;t=t.replace(g4,w.toString())}return t}var v4=/\(([^()]*)\)/;function ONe(e){for(var t=e,n;(n=v4.exec(t))!=null;){var[,r]=n;t=t.replace(v4,MV(r))}return t}function TNe(e){var t=e.replace(/\s+/g,"");return t=ONe(t),t=MV(t),t}function PNe(e){try{return TNe(e)}catch{return Lf}}function TE(e){var t=PNe(e.slice(5,-1));return t===Lf?"":t}var MNe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],DNe=["dx","dy","angle","className","breakAll"];function VC(){return VC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VC.apply(null,arguments)}function y4(e,t){if(e==null)return{};var n,r,i=RNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function RNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var DV=/[ \f\n\r\t\v\u2028\u2029]+/,RV=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];En(t)||(n?i=t.toString().split(""):i=t.toString().split(DV));var a=i.map(l=>({word:l,width:Om(l,r).width})),o=n?0:Om(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function IV(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function INe(e){return En(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var LV=(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},[]),zV=e=>e.reduce((t,n)=>t.width>n.width?t:n),LNe="…",x4=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),f=RV({breakAll:n,style:r,children:c+LNe});if(!f)return[!1,[]];var m=LV(f.wordsWithComputedWidth,a,o,l),d=m.length>i||zV(m).width>Number(a);return[d,m]},zNe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,f=Re(a),m=String(o),d=LV(t,r,n,i);if(!f||i)return d;var g=d.length>a||zV(d).width>Number(r);if(!g)return d;for(var v=0,b=m.length-1,w=0,S;v<=b&&w<=m.length-1;){var j=Math.floor((v+b)/2),C=j-1,[_,k]=x4(m,C,c,l,a,r,n,i),[O]=x4(m,j,c,l,a,r,n,i);if(!_&&!O&&(v=j+1),_&&O&&(b=j-1),!_&&O){S=k;break}w++}return S||d},b4=e=>{var t=En(e)?[]:e.toString().split(DV);return[{words:t,width:void 0}]},$Ne=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Jp.isSsr){var l,c,f=RV({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:m,spaceWidth:d}=f;l=m,c=d}else return b4(r);return zNe({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return b4(r)},$V="#808080",BNe={angle:0,breakAll:!1,capHeight:"0.71em",fill:$V,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ub=y.forwardRef((e,t)=>{var n=Zn(e,BNe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:f,verticalAnchor:m}=n,d=y4(n,MNe),g=y.useMemo(()=>$Ne({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:v,dy:b,angle:w,className:S,breakAll:j}=d,C=y4(d,DNe);if(!Co(r)||!Co(i)||g.length===0)return null;var _=Number(r)+(Re(v)?v:0),k=Number(i)+(Re(b)?b:0);if(!Pt(_)||!Pt(k))return null;var O;switch(m){case"start":O=TE("calc(".concat(o,")"));break;case"middle":O=TE("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=TE("calc(".concat(g.length-1," * -").concat(a,")"));break}var A=[],T=g[0];if(c&&T!=null){var P=T.width,{width:L}=d;A.push("scale(".concat(Re(L)&&Re(P)?L/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(_,", ").concat(k,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",VC({},ni(C),{ref:t,x:_,y:k,className:Rt("recharts-text",S),textAnchor:f,fill:l.includes("url")?$V:l}),g.map((I,F)=>{var $=I.words.join(j?"":" ");return y.createElement("tspan",{x:_,dy:F===0?O:a,key:"".concat($,"-").concat(F)},$)}))});Ub.displayName="Text";function w4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w4(Object(n),!0).forEach(function(r){FNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FNe(e,t,n){return(t=UNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UNe(e){var t=HNe(e,"string");return typeof t=="symbol"?t:t+""}function HNe(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 qNe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:f}=bA(t),m=a,d=a+(c-f)/2,g=(m+d)/2,v=(c+f)/2,b=m+c/2,w=l>=0?1:-1,S=w*r,j=w>0?"end":"start",C=w>0?"start":"end",_=c>=0?1:-1,k=_*r,O=_>0?"end":"start",A=_>0?"start":"end",T=i;if(n==="top"){var P={x:m+c/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:j};return T&&(P.height=Math.max(o-T.y,0),P.width=c),P}if(n==="bottom"){var L={x:d+f/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:C};return T&&(L.height=Math.max(T.y+T.height-(o+l),0),L.width=f),L}if(n==="left"){var I={x:g-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"};return T&&(I.width=Math.max(I.x-T.x,0),I.height=l),I}if(n==="right"){var F={x:g+v+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(F.width=Math.max(T.x+T.width-F.x,0),F.height=l),F}var $=T?{width:v,height:l}:{};return n==="insideLeft"?uo({x:g+k,y:o+l/2,horizontalAnchor:A,verticalAnchor:"middle"},$):n==="insideRight"?uo({x:g+v-k,y:o+l/2,horizontalAnchor:O,verticalAnchor:"middle"},$):n==="insideTop"?uo({x:m+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:C},$):n==="insideBottom"?uo({x:d+f/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:j},$):n==="insideTopLeft"?uo({x:m+k,y:o+S,horizontalAnchor:A,verticalAnchor:C},$):n==="insideTopRight"?uo({x:m+c-k,y:o+S,horizontalAnchor:O,verticalAnchor:C},$):n==="insideBottomLeft"?uo({x:d+k,y:o+l-S,horizontalAnchor:A,verticalAnchor:j},$):n==="insideBottomRight"?uo({x:d+f-k,y:o+l-S,horizontalAnchor:O,verticalAnchor:j},$):n&&typeof n=="object"&&(Re(n.x)||pc(n.x))&&(Re(n.y)||pc(n.y))?uo({x:a+Hr(n.x,v),y:o+Hr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},$):uo({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},VNe=["labelRef"],KNe=["content"];function S4(e,t){if(e==null)return{};var n,r,i=YNe(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 YNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function j4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j4(Object(n),!0).forEach(function(r){GNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GNe(e,t,n){return(t=XNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XNe(e){var t=WNe(e,"string");return typeof t=="symbol"?t:t+""}function WNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ss.apply(null,arguments)}var BV=y.createContext(null),QNe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,c=y.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return y.createElement(BV.Provider,{value:c},l)},FV=()=>{var e=y.useContext(BV),t=bb();return e||(t?bA(t):void 0)},ZNe=y.createContext(null),JNe=()=>{var e=y.useContext(ZNe),t=$e(q9);return e||t},eke=e=>{var{value:t,formatter:n}=e,r=En(e.children)?t:e.children;return typeof n=="function"?n(r):r},BO=e=>e!=null&&typeof e=="function",tke=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},nke=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:f,outerRadius:m,startAngle:d,endAngle:g,clockWise:v}=i,b=(f+m)/2,w=tke(d,g),S=w>=0?1:-1,j,C;switch(t){case"insideStart":j=d+S*a,C=v;break;case"insideEnd":j=g-S*a,C=!v;break;case"end":j=g+S*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=w<=0?C:!C;var _=Xn(l,c,b,j),k=Xn(l,c,b,j+(C?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
    `).concat(k.x,",").concat(k.y),A=En(e.id)?Um("recharts-radial-line-"):e.id;return y.createElement("text",ss({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",o)}),y.createElement("defs",null,y.createElement("path",{id:A,d:O})),y.createElement("textPath",{xlinkHref:"#".concat(A)},n))},rke=(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:m,y:d}=Xn(r,i,o+t,f);return{x:m,y:d,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+o)/2,{x:v,y:b}=Xn(r,i,g,f);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Iy=e=>e!=null&&"cx"in e&&Re(e.cx),ike={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function ake(e){if(!Iy(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function wl(e){var t=Zn(e,ike),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:f,labelRef:m}=t,d=JNe(),g=FV(),v=i==="center"?g:d??g,b,w,S;n==null?b=v:Iy(n)?b=n:b=bA(n);var j=ake(b);if(!b||En(a)&&En(o)&&!y.isValidElement(l)&&typeof l!="function")return null;var C=wm(wm({},t),{},{viewBox:b});if(y.isValidElement(l)){var{labelRef:_}=C,k=S4(C,VNe);return y.cloneElement(l,k)}if(typeof l=="function"){var{content:O}=C,A=S4(C,KNe);if(w=y.createElement(l,A),y.isValidElement(w))return w}else w=eke(t);var T=ni(t);if(Iy(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return nke(t,i,w,T,b);S=rke(b,t.offset,t.position)}else{if(!j)return null;var P=qNe({viewBox:j,position:i,offset:t.offset,parentViewBox:Iy(r)?void 0:r});S=wm(wm({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return y.createElement(wi,{zIndex:t.zIndex},y.createElement(Ub,ss({ref:m,className:Rt("recharts-label",c)},T,S,{textAnchor:IV(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:f}),w))}wl.displayName="Label";var oke=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?y.createElement(wl,ss({key:"label-implicit"},r)):Co(e)?y.createElement(wl,ss({key:"label-implicit",value:e},r)):y.isValidElement(e)?e.type===wl?y.cloneElement(e,wm({key:"label-implicit"},r)):y.createElement(wl,ss({key:"label-implicit",content:e},r)):BO(e)?y.createElement(wl,ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?y.createElement(wl,ss({},e,{key:"label-implicit"},r)):null};function ske(e){var{label:t,labelRef:n}=e,r=FV();return oke(t,r,n)||null}var lke=["valueAccessor"],uke=["dataKey","clockWise","id","textBreakAll","zIndex"];function Wx(){return Wx=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},Wx.apply(null,arguments)}function E4(e,t){if(e==null)return{};var n,r,i=cke(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 cke(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 fke=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(INe(t))return t},UV=y.createContext(void 0),HV=UV.Provider,qV=y.createContext(void 0),dke=qV.Provider;function hke(){return y.useContext(UV)}function mke(){return y.useContext(qV)}function Ly(e){var{valueAccessor:t=fke}=e,n=E4(e,lke),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=E4(n,uke),f=hke(),m=mke(),d=f||m;return!d||!d.length?null:y.createElement(wi,{zIndex:l??Wn.label},y.createElement(ur,{className:"recharts-label-list"},d.map((g,v)=>{var b,w=En(r)?t(g,v):en(g.payload,r),S=En(a)?{}:{id:"".concat(a,"-").concat(v)};return y.createElement(wl,Wx({key:"label-".concat(v)},ni(g),c,S,{fill:(b=n.fill)!==null&&b!==void 0?b:g.fill,parentViewBox:g.parentViewBox,value:w,textBreakAll:o,viewBox:g.viewBox,index:v,zIndex:0}))})))}Ly.displayName="LabelList";function FO(e){var{label:t}=e;return t?t===!0?y.createElement(Ly,{key:"labelList-implicit"}):y.isValidElement(t)||BO(t)?y.createElement(Ly,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Ly,Wx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function KC(){return KC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KC.apply(null,arguments)}var VV=e=>{var{cx:t,cy:n,r,className:i}=e,a=Rt("recharts-dot",i);return Re(t)&&Re(n)&&Re(r)?y.createElement("circle",KC({},$i(e),lA(e),{className:a,cx:t,cy:n,r})):null},KV=e=>e.graphicalItems.polarItems,pke=le([Tn,rg],uO),Hb=le([KV,$n,pke],cO),gke=le([Hb],fO),qb=le([gke,Eb],dO),vke=le([qb,$n,Hb],mO);le([qb,$n,Hb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=en(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:en(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var _4=()=>{},yke=le([qb,$n,Hb,zb,Tn],yO),xke=le([$n,gO,vO,_4,yke,_4,Ut,Tn],xO),YV=le([$n,Ut,qb,vke,ng,Tn,xke],bO),bke=le([YV,Gd,ru],SO),wke=le([$n,YV,bke,Tn],EO);le([ru,wke],K9);var Ske={radiusAxis:{},angleAxis:{}},GV=Kr({name:"polarAxis",initialState:Ske,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:n$e,removeRadiusAxis:r$e,addAngleAxis:i$e,removeAngleAxis:a$e}=GV.actions,jke=GV.reducer;function XV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function C4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function N4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C4(Object(n),!0).forEach(function(r){Eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C4(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=Cke(e,"string");return typeof t=="symbol"?t:t+""}function Cke(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 Nke=(e,t)=>t,UO=le([KV,Nke],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),kke=[],HO=(e,t,n)=>(n==null?void 0:n.length)===0?kke:n,WV=le([Eb,UO,HO],(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=>N4(N4({},t.presentationProps),a.props))),i!=null)return i}}),Ake=le([WV,UO,HO],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=en(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Hd(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),Oke=le([WV,UO,HO,cr],(e,t,n,r)=>{if(!(t==null||e==null))return DAe({offset:r,pieSettings:t,displayedData:e,cells:n})}),PE={exports:{}},Jt={};/**
 * @license React
 * react-is.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var k4;function Tke(){if(k4)return Jt;k4=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"),m=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 m:return w;case a:return w;default:return S}}case t:return S}}}return Jt.ContextConsumer=a,Jt.ContextProvider=o,Jt.Element=e,Jt.ForwardRef=l,Jt.Fragment=n,Jt.Lazy=d,Jt.Memo=m,Jt.Portal=t,Jt.Profiler=i,Jt.StrictMode=r,Jt.Suspense=c,Jt.SuspenseList=f,Jt.isContextConsumer=function(w){return b(w)===a},Jt.isContextProvider=function(w){return b(w)===o},Jt.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Jt.isForwardRef=function(w){return b(w)===l},Jt.isFragment=function(w){return b(w)===n},Jt.isLazy=function(w){return b(w)===d},Jt.isMemo=function(w){return b(w)===m},Jt.isPortal=function(w){return b(w)===t},Jt.isProfiler=function(w){return b(w)===i},Jt.isStrictMode=function(w){return b(w)===r},Jt.isSuspense=function(w){return b(w)===c},Jt.isSuspenseList=function(w){return b(w)===f},Jt.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===c||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===m||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Jt.typeOf=b,Jt}var A4;function Pke(){return A4||(A4=1,PE.exports=Tke()),PE.exports}var Mke=Pke(),O4=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",T4=null,ME=null,QV=e=>{if(e===T4&&Array.isArray(ME))return ME;var t=[];return y.Children.forEach(e,n=>{En(n)||(Mke.isFragment(n)?t=t.concat(QV(n.props.children)):t.push(n))}),ME=t,T4=e,t};function qO(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>O4(i)):r=[O4(t)],QV(e).forEach(i=>{var a=mc(i,"type.displayName")||mc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var ZV=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,DE={},P4;function Dke(){return P4||(P4=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})(DE)),DE}var RE,M4;function Rke(){return M4||(M4=1,RE=Dke().isPlainObject),RE}var Ike=Rke();const Lke=Hi(Ike);var D4,R4,I4,L4,z4;function $4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function B4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$4(Object(n),!0).forEach(function(r){zke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zke(e,t,n){return(t=$ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ke(e){var t=Bke(e,"string");return typeof t=="symbol"?t:t+""}function Bke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qx(){return Qx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qx.apply(null,arguments)}function cm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var F4=(e,t,n,r,i)=>{var a=n-r,o;return o=Ln(D4||(D4=cm(["M ",",",""])),e,t),o+=Ln(R4||(R4=cm(["L ",",",""])),e+n,t),o+=Ln(I4||(I4=cm(["L ",",",""])),e+n-a/2,t+i),o+=Ln(L4||(L4=cm(["L ",",",""])),e+n-a/2-r,t+i),o+=Ln(z4||(z4=cm(["L ",","," Z"])),e,t),o},Fke={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Uke=e=>{var t=Zn(e,Fke),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:f,animationBegin:m,isUpdateAnimationActive:d}=t,g=y.useRef(null),[v,b]=y.useState(-1),w=y.useRef(i),S=y.useRef(a),j=y.useRef(o),C=y.useRef(n),_=y.useRef(r),k=tg(e,"trapezoid-");if(y.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var D=g.current.getTotalLength();D&&b(D)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var O=Rt("recharts-trapezoid",l);if(!d)return y.createElement("g",null,y.createElement("path",Qx({},ni(t),{className:O,d:F4(n,r,i,a,o)})));var A=w.current,T=S.current,P=j.current,L=C.current,I=_.current,F="0px ".concat(v===-1?1:v,"px"),$="".concat(v,"px ").concat(v,"px"),X=p9(["strokeDasharray"],f,c);return y.createElement(eg,{animationId:k,key:k,canBegin:v>0,duration:f,easing:c,isActive:d,begin:m},D=>{var V=wn(A,i,D),z=wn(T,a,D),q=wn(P,o,D),G=wn(L,n,D),K=wn(I,r,D);g.current&&(w.current=V,S.current=z,j.current=q,C.current=G,_.current=K);var R=D>0?{transition:X,strokeDasharray:$}:{strokeDasharray:F};return y.createElement("path",Qx({},ni(t),{className:O,d:F4(G,K,V,z,q),ref:g,style:B4(B4({},R),t.style)}))})},Hke=["option","shapeType","activeClassName","inActiveClassName"];function qke(e,t){if(e==null)return{};var n,r,i=Vke(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 Vke(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 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 Zx(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){Kke(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 Kke(e,t,n){return(t=Yke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yke(e){var t=Gke(e,"string");return typeof t=="symbol"?t:t+""}function Gke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xke(e,t){return Zx(Zx({},t),e)}function Wke(e,t){return e==="symbols"}function H4(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return y.createElement(x9,n);case"trapezoid":return y.createElement(Uke,n);case"sector":return y.createElement(j9,n);case"symbols":if(Wke(t))return y.createElement(sA,n);break;case"curve":return y.createElement(_A,n);default:return null}}function Qke(e){return y.isValidElement(e)?e.props:e}function VO(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=qke(e,Hke),o;if(y.isValidElement(t))o=y.cloneElement(t,Zx(Zx({},a),Qke(t)));else if(typeof t=="function")o=t(a,a.index);else if(Lke(t)&&typeof t!="boolean"){var l=Xke(t,a);o=y.createElement(H4,{shapeType:n,elementProps:l})}else{var c=a;o=y.createElement(H4,{shapeType:n,elementProps:c})}return a.isActive?y.createElement(ur,{className:r},o):y.createElement(ur,{className:i},o)}var KO=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(aV({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},YO=e=>{var t=tn();return(n,r)=>i=>{e==null||e(n,r,i),t(t_e())}},GO=(e,t,n)=>{var r=tn();return(i,a)=>o=>{e==null||e(i,a,o),r(n_e({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function XO(e){var{tooltipEntrySettings:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(QEe(t)):i.current!==t&&n(ZEe({prev:i.current,next:t})),i.current=t)},[t,n,r]),y.useLayoutEffect(()=>()=>{i.current&&(n(JEe(i.current)),i.current=null)},[n]),null}function JV(e){var{legendPayload:t}=e,n=tn(),r=Yr(),i=y.useRef(null);return y.useLayoutEffect(()=>{r||(i.current===null?n(u9(t)):i.current!==t&&n(c9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(f9(i.current)),i.current=null)},[n]),null}function Zke(e){var{legendPayload:t}=e,n=tn(),r=$e(Ut),i=y.useRef(null);return y.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(u9(t)):i.current!==t&&n(c9({prev:i.current,next:t})),i.current=t)},[n,r,t]),y.useLayoutEffect(()=>()=>{i.current&&(n(f9(i.current)),i.current=null)},[n]),null}var IE,Jke=()=>{var[e]=y.useState(()=>Um("uid-"));return e},eAe=(IE=pN.useId)!==null&&IE!==void 0?IE:Jke;function tAe(e,t){var n=eAe();return t||(e?"".concat(e,"-").concat(n):n)}var nAe=y.createContext(void 0),WO=e=>{var{id:t,type:n,children:r}=e,i=tAe("recharts-".concat(n),t);return y.createElement(nAe.Provider,{value:i},r(i))},rAe={cartesianItems:[],polarItems:[]},eK=Kr({name:"graphicalItems",initialState:rAe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:gn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:gn()},removeCartesianGraphicalItem:{reducer(e,t){var n=sa(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:gn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:gn()},removePolarGraphicalItem:{reducer(e,t){var n=sa(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:gn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=sa(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:gn()}}}),{addCartesianGraphicalItem:iAe,replaceCartesianGraphicalItem:aAe,removeCartesianGraphicalItem:oAe,addPolarGraphicalItem:sAe,removePolarGraphicalItem:lAe,replacePolarGraphicalItem:uAe}=eK.actions,cAe=eK.reducer,fAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(iAe(e)):n.current!==e&&t(aAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(oAe(n.current)),n.current=null)},[t]),null},tK=y.memo(fAe),dAe=e=>{var t=tn(),n=y.useRef(null);return y.useLayoutEffect(()=>{n.current===null?t(sAe(e)):n.current!==e&&t(uAe({prev:n.current,next:e})),n.current=e},[t,e]),y.useLayoutEffect(()=>()=>{n.current&&(t(lAe(n.current)),n.current=null)},[t]),null},hAe=y.memo(dAe),mAe=["key"],pAe=["onMouseEnter","onClick","onMouseLeave"],gAe=["id"],vAe=["id"];function Yl(){return Yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yl.apply(null,arguments)}function Vb(e,t){if(e==null)return{};var n,r,i=yAe(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 yAe(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 q4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q4(Object(n),!0).forEach(function(r){xAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xAe(e,t,n){return(t=bAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bAe(e){var t=wAe(e,"string");return typeof t=="symbol"?t:t+""}function wAe(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 SAe(e){var t=y.useMemo(()=>qO(e.children,mg),[e.children]),n=$e(r=>Ake(r,e.id,t));return n==null?null:y.createElement(Zke,{legendPayload:n})}function jAe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(y.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var EAe=y.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:f,id:m,activeShape:d}=e,g=jAe(d),v=r.map(w=>{var S=w.tooltipPayload;return g==null||S==null?S:S.map(j=>Sn(Sn({},j),{},{color:g,fill:g}))}),b={dataDefinedOnItem:v,getPosition:w=>{var S;return(S=r[Number(w)])===null||S===void 0?void 0:S.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Hd(l,t),hide:c,type:f,color:o,unit:"",graphicalItemId:m}};return y.createElement(XO,{tooltipEntrySettings:b})}),_Ae=(e,t)=>e>t?"start":e<t?"end":"middle",CAe=(e,t,n)=>Hr(typeof t=="function"?t(e):t,n,n*.8),NAe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=b9(a,o),c=i+Hr(e.cx,a,a/2),f=r+Hr(e.cy,o,o/2),m=Hr(e.innerRadius,l,0),d=CAe(n,e.outerRadius,l),g=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:f,innerRadius:m,outerRadius:d,maxRadius:g}},kAe=(e,t)=>{var n=xr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},AAe=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Rt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Vb(t,mAe);return y.createElement(_A,Yl({},i,{type:"linear",className:n}))},OAe=(e,t,n)=>{if(y.isValidElement(e))return y.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),y.isValidElement(r)))return r;var i=Rt("recharts-pie-label-text",XV(e));return y.createElement(Ub,Yl({},t,{alignmentBaseline:"middle",className:i}),r)};function TAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=$i(n),c=dc(i),f=dc(a),m=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=Xn(g.cx,g.cy,g.outerRadius+m,b),S=Sn(Sn(Sn(Sn({},l),g),{},{stroke:"none"},c),{},{index:v,textAnchor:_Ae(w.x,g.cx)},w),j=Sn(Sn(Sn(Sn({},l),g),{},{fill:"none",stroke:g.fill},f),{},{index:v,points:[Xn(g.cx,g.cy,g.outerRadius,b),w],key:"line"});return y.createElement(wi,{zIndex:Wn.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},y.createElement(ur,null,a&&AAe(a,j),OAe(i,S,en(g,o))))});return y.createElement(ur,{className:"recharts-pie-labels"},d)}function PAe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(FO,{label:i}):y.createElement(TAe,{sectors:t,props:n,showLabels:r})}function MAe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=$e(Kl),c=$e(DO),f=$e(bV),{onMouseEnter:m,onClick:d,onMouseLeave:g}=i,v=Vb(i,pAe),b=KO(m,i.dataKey,o),w=YO(g),S=GO(d,i.dataKey,o);return t==null||t.length===0?null:y.createElement(y.Fragment,null,t.map((j,C)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var _=f==null||f===o,k=String(C)===l&&(c==null||i.dataKey===c)&&_,O=l?r:null,A=n&&k?n:O,T=Sn(Sn({},j),{},{stroke:j.stroke,tabIndex:-1,[Gq]:C,[Xq]:o});return y.createElement(ur,Yl({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},Yp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),y.createElement(VO,Yl({option:a??A,index:C,shapeType:"sector",isActive:k},T)))}))}function DAe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:f,nameKey:m,tooltipType:d}=n,g=Math.abs(n.minAngle),v=kAe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(A=>en(A,f,0)!==0).length,j=(b>=360?S:S-1)*w,C=b-S*g-j,_=r.reduce((A,T)=>{var P=en(T,f,0);return A+(Re(P)?P:0)},0),k;if(_>0){var O;k=r.map((A,T)=>{var P=en(A,f,0),L=en(A,m,T),I=NAe(n,a,A),F=(Re(P)?P:0)/_,$,X=Sn(Sn({},A),i&&i[T]&&i[T].props),D=X!=null&&"fill"in X&&typeof X.fill=="string"?X.fill:n.fill;T?$=O.endAngle+xr(v)*w*(P!==0?1:0):$=l;var V=$+xr(v)*((P!==0?g:0)+F*C),z=($+V)/2,q=(I.innerRadius+I.outerRadius)/2,G=[{name:L,value:P,payload:X,dataKey:f,type:d,color:D,fill:D,graphicalItemId:n.id}],K=Xn(I.cx,I.cy,q,z);return O=Sn(Sn(Sn(Sn({},n.presentationProps),{},{percent:F,cornerRadius:typeof o=="string"?parseFloat(o):o,name:L,tooltipPayload:G,midAngle:z,middleRadius:q,tooltipPosition:K},X),I),{},{value:P,dataKey:f,startAngle:$,endAngle:V,payload:X,paddingAngle:xr(v)*w}),O})}return k}function RAe(e){var{showLabels:t,sectors:n,children:r}=e,i=y.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return y.createElement(dke,{value:t?i:void 0},r)}function IAe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:f,inactiveShape:m,onAnimationStart:d,onAnimationEnd:g}=t,v=tg(t,"recharts-pie-"),b=n.current,[w,S]=y.useState(!1),j=y.useCallback(()=>{typeof g=="function"&&g(),S(!1)},[g]),C=y.useCallback(()=>{typeof d=="function"&&d(),S(!0)},[d]);return y.createElement(RAe,{showLabels:!w,sectors:i},y.createElement(eg,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:C,onAnimationEnd:j,key:v},_=>{var k,O=[],A=i&&i[0],T=(k=A==null?void 0:A.startAngle)!==null&&k!==void 0?k:0;return i==null||i.forEach((P,L)=>{var I=b&&b[L],F=L>0?mc(P,"paddingAngle",0):0;if(I){var $=wn(I.endAngle-I.startAngle,P.endAngle-P.startAngle,_),X=Sn(Sn({},P),{},{startAngle:T+F,endAngle:T+$+F});O.push(X),T=X.endAngle}else{var{endAngle:D,startAngle:V}=P,z=wn(0,D-V,_),q=Sn(Sn({},P),{},{startAngle:T+F,endAngle:T+z+F});O.push(q),T=q.endAngle}}),n.current=O,y.createElement(ur,null,y.createElement(MAe,{sectors:O,activeShape:f,inactiveShape:m,allOtherPieProps:t,shape:t.shape,id:r}))}),y.createElement(PAe,{showLabels:!w,sectors:i,props:t}),t.children)}var LAe={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Wn.area};function zAe(e){var{id:t}=e,n=Vb(e,gAe),{hide:r,className:i,rootTabIndex:a}=e,o=y.useMemo(()=>qO(e.children,mg),[e.children]),l=$e(m=>Oke(m,t,o)),c=y.useRef(null),f=Rt("recharts-pie",i);return r||l==null?(c.current=null,y.createElement(ur,{tabIndex:a,className:f})):y.createElement(wi,{zIndex:e.zIndex},y.createElement(EAe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),y.createElement(ur,{tabIndex:a,className:f},y.createElement(IAe,{props:Sn(Sn({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function $Ae(e){var t=Zn(e,LAe),{id:n}=t,r=Vb(t,vAe),i=$i(r);return y.createElement(WO,{id:n,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(hAe,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),y.createElement(SAe,Yl({},r,{id:a})),y.createElement(zAe,Yl({},r,{id:a}))))}var nK=$Ae;nK.displayName="Pie";var BAe=["points"];function V4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V4(Object(n),!0).forEach(function(r){FAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FAe(e,t,n){return(t=UAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UAe(e){var t=HAe(e,"string");return typeof t=="symbol"?t:t+""}function HAe(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 Jx(){return Jx=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},Jx.apply(null,arguments)}function qAe(e,t){if(e==null)return{};var n,r,i=VAe(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 VAe(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 KAe(e){var{option:t,dotProps:n,className:r}=e;if(y.isValidElement(t))return y.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Rt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=qAe(a,BAe);return y.createElement(VV,Jx({},l,{className:i}))}function YAe(e,t){return e==null?!1:t?!0:e.length===1}function GAe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:f=Wn.scatter}=e;if(!YAe(t,n))return null;var m=ZV(n),d=kge(n),g=t.map((b,w)=>{var S,j,C=LE(LE(LE({r:3},o),d),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(j=b.y)!==null&&j!==void 0?j:void 0,dataKey:a,value:b.value,payload:b.payload,points:t});return y.createElement(KAe,{key:"dot-".concat(w),option:n,dotProps:C,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(c,")")),y.createElement(wi,{zIndex:f},y.createElement(ur,Jx({className:r},v),g))}function K4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Y4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K4(Object(n),!0).forEach(function(r){XAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XAe(e,t,n){return(t=WAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WAe(e){var t=QAe(e,"string");return typeof t=="symbol"?t:t+""}function QAe(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 rK=0,ZAe={xAxis:{},yAxis:{},zAxis:{}},iK=Kr({name:"cartesianAxis",initialState:ZAe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:gn()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:gn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:gn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:gn()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:gn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:gn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:gn()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:gn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:gn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...o,r].slice(-3);e.yAxis[n]=Y4(Y4({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:JAe,replaceXAxis:eOe,removeXAxis:tOe,addYAxis:nOe,replaceYAxis:rOe,removeYAxis:iOe,addZAxis:o$e,replaceZAxis:s$e,removeZAxis:l$e,updateYAxisWidth:aOe}=iK.actions,oOe=iK.reducer,sOe=le([cr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lOe=le([sOe,ks,As],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),QO=()=>$e(lOe),uOe=()=>$e(W_e);function G4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G4(Object(n),!0).forEach(function(r){cOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cOe(e,t,n){return(t=fOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fOe(e){var t=dOe(e,"string");return typeof t=="symbol"?t:t+""}function dOe(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 hOe=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=zE(zE(zE({},l),dc(i)),lA(i)),f;return y.isValidElement(i)?f=y.cloneElement(i,c):typeof i=="function"?f=i(c):f=y.createElement(VV,c),y.createElement(ur,{className:"recharts-active-dot",clipPath:o},f)};function mOe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Wn.activeDot}=e,l=$e(Kl),c=uOe();if(t==null||c==null)return null;var f=t.find(m=>c.includes(m.payload));return En(f)?null:y.createElement(wi,{zIndex:o},y.createElement(hOe,{point:f,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var X4=(e,t,n)=>{var r=n??e;if(!En(r))return Hr(r,t,0)},pOe=(e,t,n)=>{var r={},i=e.filter(kb),a=e.filter(f=>f.stackId==null),o=i.reduce((f,m)=>{var d=f[m.stackId];return d==null&&(d=[]),d.push(m),f[m.stackId]=d,f},r),l=Object.entries(o).map(f=>{var m,[d,g]=f,v=g.map(w=>w.dataKey),b=X4(t,n,(m=g[0])===null||m===void 0?void 0:m.barSize);return{stackId:d,dataKeys:v,barSize:b}}),c=a.map(f=>{var m=[f.dataKey].filter(g=>g!=null),d=X4(t,n,f.barSize);return{stackId:void 0,dataKeys:m,barSize:d}});return[...l,...c]};function W4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W4(Object(n),!0).forEach(function(r){gOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gOe(e,t,n){return(t=vOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vOe(e){var t=yOe(e,"string");return typeof t=="symbol"?t:t+""}function yOe(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 xOe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Hr(e,n,0,!0),c,f=[];if(Pt((a=r[0])===null||a===void 0?void 0:a.barSize)){var m=!1,d=n/o,g=r.reduce((C,_)=>C+(_.barSize||0),0);g+=(o-1)*l,g>=n&&(g-=(o-1)*l,l=0),g>=n&&d>0&&(m=!0,d*=.9,g=o*d);var v=(n-g)/2>>0,b={offset:v-l,size:0};c=r.reduce((C,_)=>{var k,O={stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:b.offset+b.size+l,size:m?d:(k=_.barSize)!==null&&k!==void 0?k:0}},A=[...C,O];return b=O.position,A},f)}else{var w=Hr(t,n,0,!0);n-2*w-(o-1)*l<=0&&(l=0);var S=(n-2*w-(o-1)*l)/o;S>1&&(S>>=0);var j=Pt(i)?Math.min(S,i):S;c=r.reduce((C,_,k)=>[...C,{stackId:_.stackId,dataKeys:_.dataKeys,position:{offset:w+(S+l)*k+(S-j)/2,size:j}}],f)}return c}}var bOe=(e,t,n,r,i,a,o)=>{var l=En(o)?t:o,c=xOe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(f=>py(py({},f),{},{position:py(py({},f.position),{},{offset:f.position.offset-i/2})}))),c},wOe=(e,t)=>{var n=IA(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)}}}},SOe=(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 jOe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Pt(e.zIndex)?e.zIndex:t}var aK=e=>{var{chartData:t}=e,n=tn(),r=Yr();return y.useEffect(()=>r?()=>{}:(n(o4(t)),()=>{n(o4(void 0))}),[t,n,r]),null},Q4={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},oK=Kr({name:"brush",initialState:Q4,reducers:{setBrushSettings(e,t){return t.payload==null?Q4:t.payload}}}),{setBrushSettings:u$e}=oK.actions,EOe=oK.reducer;function _Oe(e){return(e%180+180)%180}var COe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=_Oe(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)},NOe={dots:[],areas:[],lines:[]},sK=Kr({name:"referenceElements",initialState:NOe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=sa(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=sa(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=sa(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:c$e,removeDot:f$e,addArea:d$e,removeArea:h$e,addLine:m$e,removeLine:p$e}=sK.actions,kOe=sK.reducer,AOe=y.createContext(void 0),OOe=e=>{var{children:t}=e,[n]=y.useState("".concat(Um("recharts"),"-clip")),r=QO();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return y.createElement(AOe.Provider,{value:n},y.createElement("defs",null,y.createElement("clipPath",{id:n},y.createElement("rect",{x:i,y:a,height:l,width:o}))),t)};function lK(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 TOe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return COe(r,n)}function POe(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:l}=e;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function tp(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function MOe(e,t){return lK(e,t+1)}function DOe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,c=0,f=1,m=o,d=function(){var b=r==null?void 0:r[c];if(b===void 0)return{v:lK(r,f)};var w=c,S,j=()=>(S===void 0&&(S=n(b,w)),S),C=b.coordinate,_=c===0||tp(e,C,j,m,l);_||(c=0,m=o,f+=1),_&&(m=C+e*(j()/2+i),c+=f)},g;f<=a.length;)if(g=d(),g)return g.v;return[]}function ROe(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 m=(o-1)%f,d=l,g=!0,v=function(){var k=r[w];if(k==null)return 0;var O=w,A,T=()=>(A===void 0&&(A=n(k,O)),A),P=k.coordinate,L=w===m||tp(e,P,T,d,c);if(!L)return g=!1,1;L&&(d=P+e*(T()/2+i))},b,w=m;w<o&&(b=v(),!(b!==0&&b===1));w+=f);if(g){for(var S=[],j=m;j<o;j+=f){var C=r[j];C!=null&&S.push(C)}return S}}return[]}function Z4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z4(Object(n),!0).forEach(function(r){IOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IOe(e,t,n){return(t=LOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LOe(e){var t=zOe(e,"string");return typeof t=="symbol"?t:t+""}function zOe(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 $Oe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:c}=t,f=function(g){var v=a[g];if(v==null)return 1;var b=v,w,S=()=>(w===void 0&&(w=n(v,g)),w);if(g===o-1){var j=e*(b.coordinate+e*S()/2-c);a[g]=b=$r($r({},b),{},{tickCoord:j>0?b.coordinate-j*e:b.coordinate})}else a[g]=b=$r($r({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var C=tp(e,b.tickCoord,S,l,c);C&&(c=b.tickCoord-e*(S()/2+i),a[g]=$r($r({},b),{},{isShow:!0}))}},m=o-1;m>=0;m--)f(m);return a}function BOe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:c,end:f}=t;if(a){var m=r[l-1];if(m!=null){var d=n(m,l-1),g=e*(m.coordinate+e*d/2-f);if(o[l-1]=m=$r($r({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate}),m.tickCoord!=null){var v=tp(e,m.tickCoord,()=>d,c,f);v&&(f=m.tickCoord-e*(d/2+i),o[l-1]=$r($r({},m),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(C){var _=o[C];if(_==null)return 1;var k=_,O,A=()=>(O===void 0&&(O=n(_,C)),O);if(C===0){var T=e*(k.coordinate-e*A()/2-c);o[C]=k=$r($r({},k),{},{tickCoord:T<0?k.coordinate-T*e:k.coordinate})}else o[C]=k=$r($r({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var P=tp(e,k.tickCoord,A,c,f);P&&(c=k.tickCoord+e*(A()/2+i),o[C]=$r($r({},k),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function ZO(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:c,tickFormatter:f,unit:m,angle:d}=e;if(!i||!i.length||!r)return[];if(Re(c)||Jp.isSsr){var g;return(g=MOe(i,Re(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=m&&b==="width"?Om(m,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(O,A)=>{var T=typeof f=="function"?f(O.value,A):O.value;return b==="width"?TOe(Om(T,{fontSize:t,letterSpacing:n}),w,d):Om(T,{fontSize:t,letterSpacing:n})[b]},j=i[0],C=i[1],_=i.length>=2&&j!=null&&C!=null?xr(C.coordinate-j.coordinate):1,k=POe(a,_,b);return c==="equidistantPreserveStart"?DOe(_,k,S,i,o):c==="equidistantPreserveEnd"?ROe(_,k,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=BOe(_,k,S,i,o,c==="preserveStartEnd"):v=$Oe(_,k,S,i,o),v.filter(O=>O.isShow))}var FOe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(m=>{if(m){var d=m.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},UOe={xAxis:{},yAxis:{}},uK=Kr({name:"renderedTicks",initialState:UOe,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:HOe,removeRenderedTicks:qOe}=uK.actions,VOe=uK.reducer,KOe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function YOe(e,t){if(e==null)return{};var n,r,i=GOe(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 GOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wc(){return wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wc.apply(null,arguments)}function J4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function In(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J4(Object(n),!0).forEach(function(r){XOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XOe(e,t,n){return(t=WOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WOe(e){var t=QOe(e,"string");return typeof t=="symbol"?t:t+""}function QOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hs={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Wn.axis};function ZOe(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=In(In(In({},c),$i(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var m=+(a==="top"&&!o||a==="bottom"&&o);f=In(In({},f),{},{x1:t,y1:n+m*i,x2:t+r,y2:n+m*i})}else{var d=+(a==="left"&&!o||a==="right"&&o);f=In(In({},f),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return y.createElement("line",wc({},f,{className:Rt("recharts-cartesian-axis-line",mc(l,"className"))}))}function JOe(e,t,n,r,i,a,o,l,c){var f,m,d,g,v,b,w=l?-1:1,S=e.tickSize||o,j=Re(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=m=e.coordinate,g=n+ +!l*i,d=g-w*S,b=d-w*c,v=j;break;case"left":d=g=e.coordinate,m=t+ +!l*r,f=m-w*S,v=f-w*c,b=j;break;case"right":d=g=e.coordinate,m=t+ +l*r,f=m+w*S,v=f+w*c,b=j;break;default:f=m=e.coordinate,g=n+ +l*i,d=g+w*S,b=d+w*c,v=j;break}return{line:{x1:f,y1:d,x2:m,y2:g},tick:{x:v,y:b}}}function e2e(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function t2e(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function n2e(e){var{option:t,tickProps:n,value:r}=e,i,a=Rt(n.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,In(In({},n),{},{className:a}));else if(typeof t=="function")i=t(In(In({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Rt(o,XV(t))),i=y.createElement(Ub,wc({},n,{className:o}),r)}return i}function r2e(e){var{ticks:t,axisType:n,axisId:r}=e,i=tn();return y.useEffect(()=>{if(r==null||n==null)return eu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(HOe({ticks:a,axisId:r,axisType:n})),()=>{i(qOe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var i2e=y.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:c,tickTextProps:f,orientation:m,mirror:d,x:g,y:v,width:b,height:w,tickSize:S,tickMargin:j,fontSize:C,letterSpacing:_,getTicksConfig:k,events:O,axisType:A,axisId:T}=e,P=ZO(In(In({},k),{},{ticks:n}),C,_),L=$i(k),I=dc(r),F=IV(L.textAnchor)?L.textAnchor:e2e(m,d),$=t2e(m,d),X={};typeof i=="object"&&(X=i);var D=In(In({},L),{},{fill:"none"},X),V=P.map(G=>In({entry:G},JOe(G,g,v,b,w,m,S,d,j))),z=V.map(G=>{var{entry:K,line:R}=G;return y.createElement(ur,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(K.value,"-").concat(K.coordinate,"-").concat(K.tickCoord)},i&&y.createElement("line",wc({},D,R,{className:Rt("recharts-cartesian-axis-tick-line",mc(i,"className"))})))}),q=V.map((G,K)=>{var R,H,{entry:U,tick:B}=G,Q=In(In(In(In({verticalAnchor:$},L),{},{textAnchor:F,stroke:"none",fill:a},B),{},{index:K,payload:U,visibleTicksCount:P.length,tickFormatter:o,padding:c},f),{},{angle:(R=(H=f==null?void 0:f.angle)!==null&&H!==void 0?H:L.angle)!==null&&R!==void 0?R:0}),Z=In(In({},Q),I);return y.createElement(ur,wc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},Yp(O,U,K)),r&&y.createElement(n2e,{option:r,tickProps:Z,value:"".concat(typeof o=="function"?o(U.value,K):U.value).concat(l||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},y.createElement(r2e,{ticks:P,axisId:T,axisType:A}),q.length>0&&y.createElement(wi,{zIndex:Wn.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},q)),z.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},z))}),a2e=y.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:f}=e,m=YOe(e,KOe),[d,g]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return FOe({ticks:w.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=y.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=C;var _=C[0];if(_){var k=window.getComputedStyle(_),O=k.fontSize,A=k.letterSpacing;(O!==d||A!==v)&&(g(O),b(A))}}},[d,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:y.createElement(wi,{zIndex:e.zIndex},y.createElement(ur,{className:Rt("recharts-cartesian-axis",a)},y.createElement(ZOe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:$i(e)}),y.createElement(i2e,{ref:S,axisType:c,events:m,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),y.createElement(QNe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(ske,{label:e.label,labelRef:e.labelRef}),e.children)))}),JO=y.forwardRef((e,t)=>{var n=Zn(e,hs);return y.createElement(a2e,wc({},n,{ref:t}))});JO.displayName="CartesianAxis";var o2e=["x1","y1","x2","y2","key"],s2e=["offset"],l2e=["xAxisId","yAxisId"],u2e=["xAxisId","yAxisId"];function e5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(n),!0).forEach(function(r){c2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function c2e(e,t,n){return(t=f2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f2e(e){var t=d2e(e,"string");return typeof t=="symbol"?t:t+""}function d2e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bu.apply(null,arguments)}function e0(e,t){if(e==null)return{};var n,r,i=h2e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function h2e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var m2e=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:l}=e;return y.createElement("rect",{x:r,y:i,ry:l,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function cK(e){var{option:t,lineItemProps:n}=e,r;if(y.isValidElement(t))r=y.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:l,y2:c,key:f}=n,m=e0(n,o2e),d=(i=$i(m))!==null&&i!==void 0?i:{},{offset:g}=d,v=e0(d,s2e);r=y.createElement("line",Bu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:f}))}return r}function p2e(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=e0(e,l2e),c=i.map((f,m)=>{var d=Fr(Fr({},l),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(m),index:m});return y.createElement(cK,{key:"line-".concat(m),option:r,lineItemProps:d})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function g2e(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=e0(e,u2e),c=i.map((f,m)=>{var d=Fr(Fr({},l),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(m),index:m});return y.createElement(cK,{option:r,lineItemProps:d,key:"line-".concat(m)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function v2e(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 m=f.map((d,g)=>{var v=f[g+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:d,x:r,height:w,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function y2e(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 m=f.map((d,g)=>{var v=f[g+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=g%n.length;return y.createElement("rect",{key:"react-".concat(g),x:d,y:a,width:w,height:l,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var x2e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return Vq(ZO(Fr(Fr(Fr({},hs),n),{},{ticks:Kq(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},b2e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return Vq(ZO(Fr(Fr(Fr({},hs),n),{},{ticks:Kq(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},w2e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function e2(e){var t=wA(),n=SA(),r=Jq(),i=Fr(Fr({},Zn(e,w2e)),{},{x:Re(e.x)?e.x:r.left,y:Re(e.y)?e.y:r.top,width:Re(e.width)?e.width:r.width,height:Re(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:c,width:f,height:m,syncWithTicks:d,horizontalValues:g,verticalValues:v}=i,b=Yr(),w=$e(L=>Yz(L,"xAxis",a,b)),S=$e(L=>Yz(L,"yAxis",o,b));if(!No(f)||!No(m)||!Re(l)||!Re(c))return null;var j=i.verticalCoordinatesGenerator||x2e,C=i.horizontalCoordinatesGenerator||b2e,{horizontalPoints:_,verticalPoints:k}=i;if((!_||!_.length)&&typeof C=="function"){var O=g&&g.length,A=C({yAxis:S?Fr(Fr({},S),{},{ticks:O?g:S.ticks}):void 0,width:t??f,height:n??m,offset:r},O?!0:d);_x(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(_=A)}if((!k||!k.length)&&typeof j=="function"){var T=v&&v.length,P=j({xAxis:w?Fr(Fr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??f,height:n??m,offset:r},T?!0:d);_x(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}return y.createElement(wi,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(m2e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(v2e,Bu({},i,{horizontalPoints:_})),y.createElement(y2e,Bu({},i,{verticalPoints:k})),y.createElement(p2e,Bu({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:S})),y.createElement(g2e,Bu({},i,{offset:r,verticalPoints:k,xAxis:w,yAxis:S}))))}e2.displayName="CartesianGrid";var S2e={},fK=Kr({name:"errorBars",initialState:S2e,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:g$e,replaceErrorBar:v$e,removeErrorBar:y$e}=fK.actions,j2e=fK.reducer,E2e=["children"];function _2e(e,t){if(e==null)return{};var n,r,i=C2e(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 C2e(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 N2e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},k2e=y.createContext(N2e);function dK(e){var{children:t}=e,n=_2e(e,E2e);return y.createElement(k2e.Provider,{value:n},t)}function t2(e,t){var n,r,i=$e(f=>Ps(f,e)),a=$e(f=>Ms(f,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:rr.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:ir.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function hK(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=QO(),{needClipX:a,needClipY:o,needClip:l}=t2(t,n);if(!l||!i)return null;var{x:c,y:f,width:m,height:d}=i;return y.createElement("clipPath",{id:"clipPath-".concat(r)},y.createElement("rect",{x:a?c:c-m/2,y:o?f:f-d/2,width:a?m:m*2,height:o?d:d*2}))}var mK=(e,t,n,r)=>Vl(e,"xAxis",t,r),pK=(e,t,n,r)=>ql(e,"xAxis",t,r),gK=(e,t,n,r)=>Vl(e,"yAxis",n,r),vK=(e,t,n,r)=>ql(e,"yAxis",n,r),A2e=le([Ut,mK,gK,pK,vK],(e,t,n,r,i)=>Ns(e,"xAxis")?vd(t,r,!1):vd(n,i,!1)),O2e=(e,t,n,r,i)=>i;function T2e(e){return e.type==="line"}var P2e=le([Lb,O2e],(e,t)=>e.filter(T2e).find(n=>n.id===t)),M2e=le([Ut,mK,gK,pK,vK,P2e,A2e,CA],(e,t,n,r,i,a,o,l)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:m}=l;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:d,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=c==null?void 0:c.slice(f,m+1),v!=null)return eTe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:v})}});function D2e(e){var t=dc(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 R2e=["id"],I2e=["type","layout","connectNulls","needClip","shape"],L2e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},np.apply(null,arguments)}function t5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function po(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t5(Object(n),!0).forEach(function(r){z2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z2e(e,t,n){return(t=$2e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $2e(e){var t=B2e(e,"string");return typeof t=="symbol"?t:t+""}function B2e(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 n2(e,t){if(e==null)return{};var n,r,i=F2e(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 F2e(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 U2e=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Hd(n,t),payload:e}]},H2e=y.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:f,id:m}=e,d={dataDefinedOnItem:n,getPosition:eu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Hd(o,t),hide:l,type:f,color:r,unit:c,graphicalItemId:m}};return y.createElement(XO,{tooltipEntrySettings:d})}),yK=(e,t)=>"".concat(t,"px ").concat(e,"px");function q2e(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var V2e=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return yK(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,m=n[l];if(m!=null&&c+m>a){o=[...n.slice(0,l),a-c];break}}var d=o.length%2===0?[0,t]:[t];return[...q2e(n,i),...o,...d].map(g=>"".concat(g,"px")).join(", ")};function K2e(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=n2(r,R2e),f=$i(c);return y.createElement(GAe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:o,clipPathId:t})}function Y2e(e){var{showLabels:t,children:n,points:r}=e,i=y.useMemo(()=>r==null?void 0:r.map(a=>{var o,l,c={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return po(po({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return y.createElement(HV,{value:t?i:void 0},n)}function n5(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:c,needClip:f,shape:m}=a,d=n2(a,I2e),g=po(po({},ni(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:l,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return y.createElement(y.Fragment,null,(r==null?void 0:r.length)>1&&y.createElement(VO,np({shapeType:"curve",option:m},g,{pathRef:n})),y.createElement(K2e,{points:r,clipPathId:t,props:a}))}function G2e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function X2e(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:f,animationDuration:m,animationEasing:d,animateNewValues:g,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,j=i.current,C=tg(o,"recharts-line-"),_=y.useRef(C),[k,O]=y.useState(!1),A=!k,T=y.useCallback(()=>{typeof w=="function"&&w(),O(!1)},[w]),P=y.useCallback(()=>{typeof S=="function"&&S(),O(!0)},[S]),L=G2e(r.current),I=y.useRef(0);_.current!==C&&(I.current=a.current,_.current=C);var F=I.current;return y.createElement(Y2e,{points:o,showLabels:A},n.children,y.createElement(eg,{animationId:C,begin:f,duration:m,isActive:c,easing:d,onAnimationEnd:T,onAnimationStart:P,key:C},$=>{var X=wn(F,L+F,$),D=Math.min(X,L),V;if(c)if(l){var z="".concat(l).split(/[,\s]+/gim).map(K=>parseFloat(K));V=V2e(D,L,z)}else V=yK(L,D);else V=l==null?void 0:String(l);if($>0&&L>0&&(i.current=o,a.current=Math.max(a.current,D)),j){var q=j.length/o.length,G=$===1?o:o.map((K,R)=>{var H=Math.floor(R*q);if(j[H]){var U=j[H];return po(po({},K),{},{x:wn(U.x,K.x,$),y:wn(U.y,K.y,$)})}return g?po(po({},K),{},{x:wn(v*2,K.x,$),y:wn(b/2,K.y,$)}):po(po({},K),{},{x:K.x,y:K.y})});return i.current=G,y.createElement(n5,{props:n,points:G,clipPathId:t,pathRef:r,strokeDasharray:V})}return y.createElement(n5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:V})}),y.createElement(FO,{label:n.label}))}function W2e(e){var{clipPathId:t,props:n}=e,r=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(X2e,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var Q2e=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:en(e.payload,t)}};class Z2e extends y.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:c,width:f,height:m,id:d,needClip:g,zIndex:v}=this.props;if(t)return null;var b=Rt("recharts-line",i),w=d,{r:S,strokeWidth:j}=D2e(n),C=ZV(n),_=S*2+j,k=g?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return y.createElement(wi,{zIndex:v},y.createElement(ur,{className:b},g&&y.createElement("defs",null,y.createElement(hK,{clipPathId:w,xAxisId:a,yAxisId:o}),!C&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:c-_/2,y:l-_/2,width:f+_,height:m+_}))),y.createElement(dK,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:Q2e,errorBarOffset:0},y.createElement(W2e,{props:this.props,clipPathId:w}))),y.createElement(mOe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var xK={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Wn.line,type:"linear"};function J2e(e){var t=Zn(e,xK),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,hide:f,isAnimationActive:m,label:d,legendType:g,xAxisId:v,yAxisId:b,id:w}=t,S=n2(t,L2e),{needClip:j}=t2(v,b),C=QO(),_=Pc(),k=Yr(),O=$e(I=>M2e(I,v,b,k,w));if(_!=="horizontal"&&_!=="vertical"||O==null||C==null)return null;var{height:A,width:T,x:P,y:L}=C;return y.createElement(Z2e,np({},S,{id:w,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:m,hide:f,label:d,legendType:g,xAxisId:v,yAxisId:b,points:O,layout:_,height:A,width:T,left:P,top:L,needClip:j}))}function eTe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((f,m)=>{var d=en(f,o);if(t==="horizontal"){var g=zL({axis:n,ticks:i,bandSize:l,entry:f,index:m}),v=En(d)?null:r.scale.map(d);return{x:g,y:v??null,value:d,payload:f}}var b=En(d)?null:n.scale.map(d),w=zL({axis:r,ticks:a,bandSize:l,entry:f,index:m});return b==null||w==null?null:{x:b,y:w,value:d,payload:f}}).filter(Boolean)}function tTe(e){var t=Zn(e,xK),n=Yr();return y.createElement(WO,{id:t.id,type:"line"},r=>y.createElement(y.Fragment,null,y.createElement(JV,{legendPayload:U2e(t)}),y.createElement(H2e,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),y.createElement(tK,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),y.createElement(J2e,np({},t,{id:r}))))}var bK=y.memo(tTe,qd);bK.displayName="Line";function Rc(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:rK}function Ic(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:rK}var nTe="Invariant failed";function rTe(e,t){throw new Error(nTe)}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 r2(e){return y.createElement(VO,YC({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var iTe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Re(t))return t;var a=Re(r)||En(r);return a?t(r,i):(a||rTe(),n)}},aTe=(e,t,n)=>n,oTe=(e,t)=>t,pg=le([Lb,oTe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),sTe=le([pg],e=>e==null?void 0:e.maxBarSize),lTe=(e,t,n,r)=>r,uTe=le([Ut,Lb,Rc,Ic,aTe],(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")),cTe=(e,t,n)=>{var r=Ut(e),i=Rc(e,t),a=Ic(e,t);if(!(i==null||a==null))return r==="horizontal"?FC(e,"yAxis",a,n):FC(e,"xAxis",i,n)},fTe=(e,t)=>{var n=Ut(e),r=Rc(e,t),i=Ic(e,t);if(!(r==null||i==null))return n==="horizontal"?Kz(e,"xAxis",r):Kz(e,"yAxis",i)},dTe=le([uTe,e1e,fTe],pOe),hTe=(e,t,n)=>{var r,i,a=pg(e,t);if(a==null)return 0;var o=Rc(e,t),l=Ic(e,t);if(o==null||l==null)return 0;var c=Ut(e),f=I9(e),{maxBarSize:m}=a,d=En(m)?f:m,g,v;return c==="horizontal"?(g=Vl(e,"xAxis",o,n),v=ql(e,"xAxis",o,n)):(g=Vl(e,"yAxis",l,n),v=ql(e,"yAxis",l,n)),(r=(i=vd(g,v,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},wK=(e,t,n)=>{var r=Ut(e),i=Rc(e,t),a=Ic(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Vl(e,"xAxis",i,n),l=ql(e,"xAxis",i,n)):(o=Vl(e,"yAxis",a,n),l=ql(e,"yAxis",a,n)),vd(o,l)}},mTe=le([dTe,I9,Jwe,L9,hTe,wK,sTe],bOe),pTe=(e,t,n)=>{var r=Rc(e,t);if(r!=null)return Vl(e,"xAxis",r,n)},gTe=(e,t,n)=>{var r=Ic(e,t);if(r!=null)return Vl(e,"yAxis",r,n)},vTe=(e,t,n)=>{var r=Rc(e,t);if(r!=null)return ql(e,"xAxis",r,n)},yTe=(e,t,n)=>{var r=Ic(e,t);if(r!=null)return ql(e,"yAxis",r,n)},xTe=le([mTe,pg],SOe),bTe=le([cTe,pg],wOe),wTe=le([cr,vA,pTe,gTe,vTe,yTe,xTe,Ut,Ywe,wK,bTe,pg,lTe],(e,t,n,r,i,a,o,l,c,f,m,d,g)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=c;if(!(d==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:S}=d,j;if(S!=null&&S.length>0?j=S:j=v==null?void 0:v.slice(b,w+1),j!=null)return XTe({layout:l,barSettings:d,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:m,displayedData:j,offset:e,cells:g,dataStartIndex:b})}}),STe=["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 jTe(e,t){if(e==null)return{};var n,r,i=ETe(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 ETe(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 SK=y.createContext(void 0),_Te=e=>{var t=y.useContext(SK);if(t!=null)return t.stackId;if(e!=null)return Kxe(e)},CTe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),NTe=e=>{var t=y.useContext(SK);if(t!=null){var{stackId:n}=t;return"url(#".concat(CTe(n,e),")")}},jK=e=>{var{index:t}=e,n=jTe(e,STe),r=NTe(t);return y.createElement(ur,GC({className:"recharts-bar-stack-layer",clipPath:r},n))},kTe=["onMouseEnter","onMouseLeave","onClick"],ATe=["value","background","tooltipPosition"],OTe=["id"],TTe=["onMouseEnter","onClick","onMouseLeave"];function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(null,arguments)}function r5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(n),!0).forEach(function(r){PTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PTe(e,t,n){return(t=MTe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MTe(e){var t=DTe(e,"string");return typeof t=="symbol"?t:t+""}function DTe(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 t0(e,t){if(e==null)return{};var n,r,i=RTe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function RTe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ITe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Hd(n,t),payload:e}]},LTe=y.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:c,id:f}=e,m={dataDefinedOnItem:void 0,getPosition:eu,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Hd(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:f}};return y.createElement(XO,{tooltipEntrySettings:m})});function zTe(e){var t=$e(Kl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,f=t0(a,kTe),m=KO(o,r,a.id),d=YO(l),g=GO(c,r,a.id);if(!i||n==null)return null;var v=dc(i);return y.createElement(wi,{zIndex:jOe(i,Wn.barBackground)},n.map((b,w)=>{var{value:S,background:j,tooltipPosition:C}=b,_=t0(b,ATe);if(!j)return null;var k=m(b,w),O=d(b,w),A=g(b,w),T=Jr(Jr(Jr(Jr(Jr({option:i,isActive:String(w)===t},_),{},{fill:"#eee"},j),v),Yp(f,b,w)),{},{onMouseEnter:k,onMouseLeave:O,onClick:A,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(r2,Gl({key:"background-bar-".concat(w)},T))}))}function $Te(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Jr(Jr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return y.createElement(HV,{value:t?i:void 0},n)}function BTe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=$e(Kl),c=$e(DO),f=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[m,d]=y.useState(!1),[g,v]=y.useState(!1);y.useEffect(()=>{var _;return f?(d(!0),_=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(_)}},[f]);var b=y.useCallback(()=>{f||d(!1)},[f]),w=f&&g,S=f||m,j;f?n===!0?j=t:j=n:j=t;var C=y.createElement(r2,Gl({},r,{name:String(r.name)},i,{isActive:w,option:j,index:a,dataKey:o,onTransitionEnd:b}));return S?y.createElement(wi,{zIndex:Wn.activeBar},y.createElement(jK,{index:i.originalDataIndex},C)):C}function FTe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return y.createElement(r2,Gl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function UTe(e){var t,{data:n,props:r}=e,i=(t=$i(r))!==null&&t!==void 0?t:{},{id:a}=i,o=t0(i,OTe),{shape:l,dataKey:c,activeBar:f}=r,{onMouseEnter:m,onClick:d,onMouseLeave:g}=r,v=t0(r,TTe),b=KO(m,c,a),w=YO(g),S=GO(d,c,a);return n?y.createElement(y.Fragment,null,n.map((j,C)=>y.createElement(jK,Gl({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(C),className:"recharts-bar-rectangle"},Yp(v,j,C),{onMouseEnter:b(j,C),onMouseLeave:w(j,C),onClick:S(j,C)}),f?y.createElement(BTe,{shape:l,activeBar:f,baseProps:o,entry:j,index:C,dataKey:c}):y.createElement(FTe,{shape:l,baseProps:o,entry:j,index:C,dataKey:c})))):null}function HTe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:f,onAnimationStart:m}=t,d=n.current,g=tg(t,"recharts-bar-"),[v,b]=y.useState(!1),w=!v,S=y.useCallback(()=>{typeof f=="function"&&f(),b(!1)},[f]),j=y.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);return y.createElement($Te,{showLabels:w,rects:r},y.createElement(eg,{animationId:g,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:j,key:g},C=>{var _=C===1?r:r==null?void 0:r.map((k,O)=>{var A=d&&d[O];if(A)return Jr(Jr({},k),{},{x:wn(A.x,k.x,C),y:wn(A.y,k.y,C),width:wn(A.width,k.width,C),height:wn(A.height,k.height,C)});if(i==="horizontal"){var T=wn(0,k.height,C),P=wn(k.stackedBarStart,k.y,C);return Jr(Jr({},k),{},{y:P,height:T})}var L=wn(0,k.width,C),I=wn(k.stackedBarStart,k.x,C);return Jr(Jr({},k),{},{width:L,x:I})});return C>0&&(n.current=_??null),_==null?null:y.createElement(ur,null,y.createElement(UTe,{props:t,data:_}))}),y.createElement(FO,{label:t.label}),t.children)}function qTe(e){var t=y.useRef(null);return y.createElement(HTe,{previousRectanglesRef:t,props:e})}var EK=0,VTe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:en(e,t)}};class KTe extends y.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:c,id:f}=this.props;if(t||n==null)return null;var m=Rt("recharts-bar",i),d=f;return y.createElement(ur,{className:m,id:f},l&&y.createElement("defs",null,y.createElement(hK,{clipPathId:d,xAxisId:a,yAxisId:o})),y.createElement(ur,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},y.createElement(zTe,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),y.createElement(qTe,this.props)))}}var YTe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:EK,xAxisId:0,yAxisId:0,zIndex:Wn.bar};function GTe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:f,isAnimationActive:m}=e,{needClip:d}=t2(t,n),g=Pc(),v=Yr(),b=qO(e.children,mg),w=$e(C=>wTe(C,e.id,v,b));if(g!=="vertical"&&g!=="horizontal")return null;var S,j=w==null?void 0:w[0];return j==null||j.height==null||j.width==null?S=0:S=g==="vertical"?j.height/2:j.width/2,y.createElement(dK,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:VTe,errorBarOffset:S},y.createElement(KTe,Gl({},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:m})))}function XTe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:f,yAxisTicks:m,stackedData:d,displayedData:g,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?c:l,C=d?j.scale.domain():null,_=Yxe({numericAxis:j}),k=j.scale.map(_);return g.map((O,A)=>{var T,P,L,I,F,$;if(d){var X=d[A+S];if(X==null)return null;T=Fxe(X,C)}else T=en(O,n),Array.isArray(T)||(T=[_,T]);var D=iTe(r,EK)(T[1],A);if(t==="horizontal"){var V,z=c.scale.map(T[0]),q=c.scale.map(T[1]);if(z==null||q==null)return null;P=$L({axis:l,ticks:f,bandSize:o,offset:a.offset,entry:O,index:A}),L=(V=q??z)!==null&&V!==void 0?V:void 0,I=a.size;var G=z-q;if(F=_o(G)?0:G,$={x:P,y:v.top,width:I,height:v.height},Math.abs(D)>0&&Math.abs(F)<Math.abs(D)){var K=xr(F||D)*(Math.abs(D)-Math.abs(F));L-=K,F+=K}}else{var R=l.scale.map(T[0]),H=l.scale.map(T[1]);if(R==null||H==null)return null;if(P=R,L=$L({axis:c,ticks:m,bandSize:o,offset:a.offset,entry:O,index:A}),I=H-R,F=a.size,$={x:v.left,y:L,width:v.width,height:F},Math.abs(D)>0&&Math.abs(I)<Math.abs(D)){var U=xr(I||D)*(Math.abs(D)-Math.abs(I));I+=U}}if(P==null||L==null||I==null||F==null||!i&&(I===0||F===0))return null;var B=Jr(Jr({},O),{},{stackedBarStart:k,x:P,y:L,width:I,height:F,value:d?T:T[1],payload:O,background:$,tooltipPosition:{x:P+I/2,y:L+F/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return B}).filter(Boolean)}function WTe(e){var t=Zn(e,YTe),n=_Te(t.stackId),r=Yr();return y.createElement(WO,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(JV,{legendPayload:ITe(t)}),y.createElement(LTe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),y.createElement(tK,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),y.createElement(wi,{zIndex:t.zIndex},y.createElement(GTe,Gl({},t,{id:i})))))}var XC=y.memo(WTe,qd);XC.displayName="Bar";var QTe=["domain","range"],ZTe=["domain","range"];function i5(e,t){if(e==null)return{};var n,r,i=JTe(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 JTe(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 a5(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 _K(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=i5(e,QTe),{domain:a,range:o}=t,l=i5(t,ZTe);return!a5(n,a)||!a5(r,o)?!1:qd(i,l)}var ePe=["type"],tPe=["dangerouslySetInnerHTML","ticks","scale"],nPe=["id","scale"];function WC(){return WC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WC.apply(null,arguments)}function o5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function s5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(n),!0).forEach(function(r){rPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rPe(e,t,n){return(t=iPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iPe(e){var t=aPe(e,"string");return typeof t=="symbol"?t:t+""}function aPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QC(e,t){if(e==null)return{};var n,r,i=oPe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oPe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sPe(e){var t=tn(),n=y.useRef(null),r=e9(),{type:i}=e,a=QC(e,ePe),o=Cb(r,"xAxis",i),l=y.useMemo(()=>{if(o!=null)return s5(s5({},a),{},{type:o})},[a,o]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(JAe(l)):n.current!==l&&t(eOe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(tOe(n.current)),n.current=null)},[t]),null}var lPe=e=>{var{xAxisId:t,className:n}=e,r=$e(vA),i=Yr(),a="xAxis",o=$e(j=>J7(j,a,t,i)),l=$e(j=>W7(j,t)),c=$e(j=>$Ee(j,t)),f=$e(j=>T7(j,t));if(l==null||c==null||f==null)return null;var{dangerouslySetInnerHTML:m,ticks:d,scale:g}=e,v=QC(e,tPe),{id:b,scale:w}=f,S=QC(f,nPe);return y.createElement(JO,WC({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:Rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},uPe={allowDataOverflow:rr.allowDataOverflow,allowDecimals:rr.allowDecimals,allowDuplicatedCategory:rr.allowDuplicatedCategory,angle:rr.angle,axisLine:hs.axisLine,height:rr.height,hide:!1,includeHidden:rr.includeHidden,interval:rr.interval,label:!1,minTickGap:rr.minTickGap,mirror:rr.mirror,orientation:rr.orientation,padding:rr.padding,reversed:rr.reversed,scale:rr.scale,tick:rr.tick,tickCount:rr.tickCount,tickLine:hs.tickLine,tickSize:hs.tickSize,type:rr.type,niceTicks:rr.niceTicks,xAxisId:0},cPe=e=>{var t=Zn(e,uPe);return y.createElement(y.Fragment,null,y.createElement(sPe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),y.createElement(lPe,t))},i2=y.memo(cPe,_K);i2.displayName="XAxis";var fPe=["type"],dPe=["dangerouslySetInnerHTML","ticks","scale"],hPe=["id","scale"];function ZC(){return ZC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZC.apply(null,arguments)}function l5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function u5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l5(Object(n),!0).forEach(function(r){mPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mPe(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=gPe(e,"string");return typeof t=="symbol"?t:t+""}function gPe(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 JC(e,t){if(e==null)return{};var n,r,i=vPe(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 vPe(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 yPe(e){var t=tn(),n=y.useRef(null),r=e9(),{type:i}=e,a=JC(e,fPe),o=Cb(r,"yAxis",i),l=y.useMemo(()=>{if(o!=null)return u5(u5({},a),{},{type:o})},[o,a]);return y.useLayoutEffect(()=>{l!=null&&(n.current===null?t(nOe(l)):n.current!==l&&t(rOe({prev:n.current,next:l})),n.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{n.current&&(t(iOe(n.current)),n.current=null)},[t]),null}function xPe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=y.useRef(null),o=y.useRef(null),l=$e(vA),c=Yr(),f=tn(),m="yAxis",d=$e(A=>Q7(A,t)),g=$e(A=>FEe(A,t)),v=$e(A=>J7(A,m,t,c)),b=$e(A=>P7(A,t));if(y.useLayoutEffect(()=>{if(!(r!=="auto"||!d||BO(i)||y.isValidElement(i)||b==null)){var A=a.current;if(A){var T=A.getCalculatedWidth();Math.round(d.width)!==Math.round(T)&&f(aOe({id:t,width:T}))}}},[v,d,f,i,t,r,b]),d==null||g==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:j}=e,C=JC(e,dPe),{id:_,scale:k}=b,O=JC(b,hPe);return y.createElement(JO,ZC({},C,O,{ref:a,labelRef:o,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:Rt("recharts-".concat(m," ").concat(m),n),viewBox:l,ticks:v,axisType:m,axisId:t}))}var bPe={allowDataOverflow:ir.allowDataOverflow,allowDecimals:ir.allowDecimals,allowDuplicatedCategory:ir.allowDuplicatedCategory,angle:ir.angle,axisLine:hs.axisLine,hide:!1,includeHidden:ir.includeHidden,interval:ir.interval,label:!1,minTickGap:ir.minTickGap,mirror:ir.mirror,orientation:ir.orientation,padding:ir.padding,reversed:ir.reversed,scale:ir.scale,tick:ir.tick,tickCount:ir.tickCount,tickLine:hs.tickLine,tickSize:hs.tickSize,type:ir.type,niceTicks:ir.niceTicks,width:ir.width,yAxisId:0},wPe=e=>{var t=Zn(e,bPe);return y.createElement(y.Fragment,null,y.createElement(yPe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),y.createElement(xPe,t))},a2=y.memo(wPe,_K);a2.displayName="YAxis";var SPe=(e,t)=>t,o2=le([SPe,Ut,q9,Sr,gV,Ds,uCe,cr],gCe);function jPe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function s2(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(jPe(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 CK=Bi("mouseClick"),NK=Xp();NK.startListening({actionCreator:CK,effect:(e,t)=>{var n=e.payload,r=o2(t.getState(),s2(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(r_e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var eN=Bi("mouseMove"),kK=Xp(),kf=null,Nu=null,$E=null;kK.startListening({actionCreator:eN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||(a==null?void 0:a.includes("mousemove"));kf!==null&&(cancelAnimationFrame(kf),kf=null),Nu!==null&&(typeof i!="number"||!o)&&(clearTimeout(Nu),Nu=null),$E=s2(n);var l=()=>{var c=t.getState(),f=kO(c,c.tooltip.settings.shared);if(!$E){kf=null,Nu=null;return}if(f==="axis"){var m=o2(c,$E);(m==null?void 0:m.activeIndex)!=null?t.dispatch(sV({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):t.dispatch(oV())}kf=null,Nu=null};if(!o){l();return}i==="raf"?kf=requestAnimationFrame(l):typeof i=="number"&&Nu===null&&(Nu=setTimeout(l,i))}});function EPe(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 c5={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},AK=Kr({name:"rootProps",initialState:c5,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:c5.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}}}),_Pe=AK.reducer,{updateOptions:CPe}=AK.actions,NPe=null,kPe={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)},OK=Kr({name:"polarOptions",initialState:NPe,reducers:kPe}),{updatePolarOptions:APe}=OK.actions,OPe=OK.reducer,TK=Bi("keyDown"),PK=Bi("focus"),MK=Bi("blur"),Kb=Xp(),Af=null,ku=null,gy=null;Kb.startListening({actionCreator:TK,effect:(e,t)=>{gy=e.payload,Af!==null&&(cancelAnimationFrame(Af),Af=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");ku!==null&&(typeof r!="number"||!a)&&(clearTimeout(ku),ku=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:f}=l.tooltip,m=gy;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var d=AO(f,Zd(l),cg(l),dg(l)),g=d==null?-1:Number(d);if(!Number.isFinite(g)||g<0)return;var v=Ds(l);if(m==="Enter"){var b=Xx(l,"axis","hover",String(f.index));t.dispatch(Gx({active:!f.active,activeIndex:f.index,activeCoordinate:b}));return}var w=KEe(l),S=w==="left-to-right"?1:-1,j=m==="ArrowRight"?1:-1,C=g+j*S;if(v==null||C>=v.length||C<0)return;var _=Xx(l,"axis","hover",String(C));t.dispatch(Gx({active:!0,activeIndex:C.toString(),activeCoordinate:_}))}finally{Af=null,ku=null}};if(!a){o();return}r==="raf"?Af=requestAnimationFrame(o):typeof r=="number"&&ku===null&&(o(),gy=null,ku=setTimeout(()=>{gy?o():(ku=null,Af=null)},r))}});Kb.startListening({actionCreator:PK,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=Xx(n,"axis","hover",String(a));t.dispatch(Gx({active:!0,activeIndex:a,activeCoordinate:o}))}}}});Kb.startListening({actionCreator:MK,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Gx({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function DK(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var ta=Bi("externalEvent"),RK=Xp(),vy=new Map,fm=new Map,BE=new Map;RK.startListening({actionCreator:ta,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=DK(r);BE.set(i,{handler:n,reactEvent:a});var o=vy.get(i);o!==void 0&&(cancelAnimationFrame(o),vy.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:f}=l.eventSettings,m=f,d=m==="all"||(m==null?void 0:m.includes(i)),g=fm.get(i);g!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(g),fm.delete(i));var v=()=>{var S=BE.get(i);try{if(!S)return;var{handler:j,reactEvent:C}=S,_=t.getState(),k={activeCoordinate:Y_e(_),activeDataKey:DO(_),activeIndex:Kl(_),activeLabel:xV(_),activeTooltipIndex:Kl(_),isTooltipActive:G_e(_)};j&&j(k,C)}finally{vy.delete(i),fm.delete(i),BE.delete(i)}};if(!d){v();return}if(c==="raf"){var b=requestAnimationFrame(v);vy.set(i,b)}else if(typeof c=="number"){if(!fm.has(i)){v();var w=setTimeout(v,c);fm.set(i,w)}}else v()}}});var TPe=le([Wd],e=>e.tooltipItemPayloads),PPe=le([TPe,(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)}}}),IK=Bi("touchMove"),LK=Xp(),Au=null,pl=null,f5=null,dm=null;LK.startListening({actionCreator:IK,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){dm=DK(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Au!==null&&(cancelAnimationFrame(Au),Au=null),pl!==null&&(typeof i!="number"||!o)&&(clearTimeout(pl),pl=null),f5=Array.from(n.touches).map(c=>s2({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(dm!=null){var c=t.getState(),f=kO(c,c.tooltip.settings.shared);if(f==="axis"){var m,d=(m=f5)===null||m===void 0?void 0:m[0];if(d==null){Au=null,pl=null;return}var g=o2(c,d);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(sV({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,b=dm.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(Gq),j=(v=w.getAttribute(Xq))!==null&&v!==void 0?v:void 0,C=Qd(c).find(O=>O.id===j);if(S==null||C==null||j==null)return;var{dataKey:_}=C,k=PPe(c,S,j);t.dispatch(aV({activeDataKey:_,activeIndex:S,activeCoordinate:k,activeGraphicalItemId:j}))}Au=null,pl=null}};if(!o){l();return}i==="raf"?Au=requestAnimationFrame(l):typeof i=="number"&&pl===null&&(l(),dm=null,pl=setTimeout(()=>{dm?l():(pl=null,Au=null)},i))}}});var l2={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},zK=Kr({name:"eventSettings",initialState:l2,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:MPe}=zK.actions,DPe=zK.reducer,RPe=gq({brush:EOe,cartesianAxis:oOe,chartData:YCe,errorBars:j2e,eventSettings:DPe,graphicalItems:cAe,layout:Ixe,legend:H0e,options:UCe,polarAxis:jke,polarOptions:OPe,referenceElements:kOe,renderedTicks:VOe,rootProps:_Pe,tooltip:i_e,zIndex:OCe}),IPe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return sxe({reducer:RPe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([NK.middleware,kK.middleware,Kb.middleware,RK.middleware,LK.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Tq({type:"raf"}))},devTools:{serialize:{replacer:EPe},name:"recharts-".concat(n)}})};function $K(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Yr(),a=y.useRef(null);if(i)return n;a.current==null&&(a.current=IPe(t,r));var o=cA;return y.createElement(abe,{context:o,store:a.current},n)}function LPe(e){var{layout:t,margin:n}=e,r=tn(),i=Yr();return y.useEffect(()=>{i||(r(Mxe(t)),r(Pxe(n)))},[r,i,t,n]),null}var BK=y.memo(LPe,qd);function FK(e){var t=tn();return y.useEffect(()=>{t(CPe(e))},[t,e]),null}var zPe=e=>{var t=tn();return y.useEffect(()=>{t(MPe(e))},[t,e]),null},UK=y.memo(zPe,qd);function d5(e){var{zIndex:t,isPanorama:n}=e,r=y.useRef(null),i=tn();return y.useLayoutEffect(()=>(r.current&&i(kCe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(ACe({zIndex:t,isPanorama:n}))}),[i,t,n]),y.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function h5(e){var{children:t,isPanorama:n}=e,r=$e(yCe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return y.createElement(y.Fragment,null,i.map(o=>y.createElement(d5,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>y.createElement(d5,{key:o,zIndex:o,isPanorama:n})))}var $Pe=["children"];function BPe(e,t){if(e==null)return{};var n,r,i=FPe(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 FPe(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 n0(){return n0=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},n0.apply(null,arguments)}var UPe={width:"100%",height:"100%",display:"block"},HPe=y.forwardRef((e,t)=>{var n=wA(),r=SA(),i=m9();if(!No(n)||!No(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=e,f,m;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?m=o.role:m=i?"application":void 0),y.createElement(eA,n0({},o,{title:l,desc:c,role:m,tabIndex:f,width:n,height:r,style:UPe,ref:t}),a)}),qPe=e=>{var{children:t}=e,n=$e(xb);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return y.createElement(eA,{width:r,height:i,x:o,y:a},t)},m5=y.forwardRef((e,t)=>{var{children:n}=e,r=BPe(e,$Pe),i=Yr();return i?y.createElement(qPe,null,y.createElement(h5,{isPanorama:!0},n)):y.createElement(HPe,n0({ref:t},r),y.createElement(h5,{isPanorama:!1},n))});function VPe(){var e=tn(),[t,n]=y.useState(null),r=$e(Jxe);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Pt(a)&&a!==r&&e(Rxe(a))}},[t,e,r]),n}function p5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KPe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(n),!0).forEach(function(r){YPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YPe(e,t,n){return(t=GPe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GPe(e){var t=XPe(e,"string");return typeof t=="symbol"?t:t+""}function XPe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zl(){return zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zl.apply(null,arguments)}var WPe=()=>(nNe(),null);function r0(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QPe=y.forwardRef((e,t)=>{var n,r,i=y.useRef(null),[a,o]=y.useState({containerWidth:r0((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:r0((r=e.style)===null||r===void 0?void 0:r.height)}),l=y.useCallback((f,m)=>{o(d=>{var g=Math.round(f),v=Math.round(m);return d.containerWidth===g&&d.containerHeight===v?d:{containerWidth:g,containerHeight:v}})},[]),c=y.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null&&typeof ResizeObserver<"u"){var{width:m,height:d}=f.getBoundingClientRect();l(m,d);var g=b=>{var w=b[0];if(w!=null){var{width:S,height:j}=w.contentRect;l(S,j)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,l]);return y.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[l]),y.createElement(y.Fragment,null,y.createElement(Qp,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",zl({ref:c},e)))}),ZPe=y.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=y.useState({containerWidth:r0(n),containerHeight:r0(r)}),o=y.useCallback((c,f)=>{a(m=>{var d=Math.round(c),g=Math.round(f);return m.containerWidth===d&&m.containerHeight===g?m:{containerWidth:d,containerHeight:g}})},[]),l=y.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:f,height:m}=c.getBoundingClientRect();o(f,m)}},[t,o]);return y.createElement(y.Fragment,null,y.createElement(Qp,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",zl({ref:l},e)))}),JPe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return y.createElement(y.Fragment,null,y.createElement(Qp,{width:n,height:r}),y.createElement("div",zl({ref:t},e)))}),eMe=y.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?y.createElement(ZPe,zl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?y.createElement(JPe,zl({},e,{width:n,height:r,ref:t})):y.createElement(y.Fragment,null,y.createElement(Qp,{width:n,height:r}),y.createElement("div",zl({ref:t},e)))});function tMe(e){return e?QPe:eMe}var nMe=y.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:f,onMouseLeave:m,onMouseMove:d,onMouseUp:g,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:j,responsive:C,dispatchTouchEvents:_=!0}=e,k=y.useRef(null),O=tn(),[A,T]=y.useState(null),[P,L]=y.useState(null),I=VPe(),F=yA(),$=(F==null?void 0:F.width)>0?F.width:j,X=(F==null?void 0:F.height)>0?F.height:i,D=y.useCallback(se=>{I(se),typeof t=="function"&&t(se),T(se),L(se),se!=null&&(k.current=se)},[I,t,T,L]),V=y.useCallback(se=>{O(CK(se)),O(ta({handler:a,reactEvent:se}))},[O,a]),z=y.useCallback(se=>{O(eN(se)),O(ta({handler:f,reactEvent:se}))},[O,f]),q=y.useCallback(se=>{O(oV()),O(ta({handler:m,reactEvent:se}))},[O,m]),G=y.useCallback(se=>{O(eN(se)),O(ta({handler:d,reactEvent:se}))},[O,d]),K=y.useCallback(()=>{O(PK())},[O]),R=y.useCallback(()=>{O(MK())},[O]),H=y.useCallback(se=>{O(TK(se.key))},[O]),U=y.useCallback(se=>{O(ta({handler:o,reactEvent:se}))},[O,o]),B=y.useCallback(se=>{O(ta({handler:l,reactEvent:se}))},[O,l]),Q=y.useCallback(se=>{O(ta({handler:c,reactEvent:se}))},[O,c]),Z=y.useCallback(se=>{O(ta({handler:g,reactEvent:se}))},[O,g]),te=y.useCallback(se=>{O(ta({handler:w,reactEvent:se}))},[O,w]),ae=y.useCallback(se=>{_&&O(IK(se)),O(ta({handler:b,reactEvent:se}))},[O,_,b]),re=y.useCallback(se=>{O(ta({handler:v,reactEvent:se}))},[O,v]),ee=tMe(C);return y.createElement(NV.Provider,{value:A},y.createElement(OH.Provider,{value:P},y.createElement(ee,{width:$??(S==null?void 0:S.width),height:X??(S==null?void 0:S.height),className:Rt("recharts-wrapper",r),style:KPe({position:"relative",cursor:"default",width:$,height:X},S),onClick:V,onContextMenu:U,onDoubleClick:B,onFocus:K,onBlur:R,onKeyDown:H,onMouseDown:Q,onMouseEnter:z,onMouseLeave:q,onMouseMove:G,onMouseUp:Z,onTouchEnd:re,onTouchMove:ae,onTouchStart:te,ref:D},y.createElement(WPe,null),n)))}),rMe=["width","height","responsive","children","className","style","compact","title","desc"];function iMe(e,t){if(e==null)return{};var n,r,i=aMe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aMe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var HK=y.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:f,desc:m}=e,d=iMe(e,rMe),g=$i(d);return c?y.createElement(y.Fragment,null,y.createElement(Qp,{width:n,height:r}),y.createElement(m5,{otherAttributes:g,title:f,desc:m},a)):y.createElement(nMe,{className:o,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},y.createElement(m5,{otherAttributes:g,title:f,desc:m,ref:t},y.createElement(OOe,null,a)))});function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tN.apply(null,arguments)}function g5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){sMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sMe(e,t,n){return(t=lMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lMe(e){var t=uMe(e,"string");return typeof t=="symbol"?t:t+""}function uMe(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 cMe={top:5,right:5,bottom:5,left:5},fMe=oMe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:cMe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},l2),qK=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,fMe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:f}=t,m={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return y.createElement($K,{preloadedState:{options:m},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},y.createElement(aK,{chartData:f.data}),y.createElement(BK,{layout:i.layout,margin:i.margin}),y.createElement(UK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(FK,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(HK,tN({},i,{ref:n})))}),dMe=["axis"],hMe=y.forwardRef((e,t)=>y.createElement(qK,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:dMe,tooltipPayloadSearcher:$O,categoricalChartProps:e,ref:t})),mMe=["axis","item"],pMe=y.forwardRef((e,t)=>y.createElement(qK,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:mMe,tooltipPayloadSearcher:$O,categoricalChartProps:e,ref:t}));function gMe(e){var t=tn();return y.useEffect(()=>{t(APe(e))},[t,e]),null}var vMe=["layout"];function nN(){return nN=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},nN.apply(null,arguments)}function yMe(e,t){if(e==null)return{};var n,r,i=xMe(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 xMe(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 v5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bMe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){wMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wMe(e,t,n){return(t=SMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SMe(e){var t=jMe(e,"string");return typeof t=="symbol"?t:t+""}function jMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EMe={top:5,right:5,bottom:5,left:5},VK=bMe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:EMe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},l2),_Me=y.forwardRef(function(t,n){var r,i=Zn(t.categoricalChartProps,VK),{layout:a}=i,o=yMe(i,vMe),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:m}=t,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:m,eventEmitter:void 0};return y.createElement($K,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},y.createElement(aK,{chartData:i.data}),y.createElement(BK,{layout:a,margin:i.margin}),y.createElement(UK,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),y.createElement(FK,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(gMe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(HK,nN({},o,{ref:n})))});function y5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(n),!0).forEach(function(r){CMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CMe(e,t,n){return(t=NMe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NMe(e){var t=kMe(e,"string");return typeof t=="symbol"?t:t+""}function kMe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AMe=["item"],OMe=x5(x5({},VK),{},{layout:"centric",startAngle:0,endAngle:360}),TMe=y.forwardRef((e,t)=>{var n=Zn(e,OMe);return y.createElement(_Me,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:AMe,tooltipPayloadSearcher:$O,categoricalChartProps:n,ref:t})});function PMe({completed:e,failed:t}){const n=e+t;if(n===0)return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsxs("div",{className:"relative h-32 w-32",children:[h.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:h.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("span",{className:"text-sm text-muted-foreground",children:"N/A"})})]})});const r=Math.round(e/n*1e3)/10,i=[{name:"Completed",value:e},{name:"Failed",value:t}],a=["#2e7d32","#c62828"];return h.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[h.jsx(xA,{width:140,height:140,children:h.jsx(TMe,{children:h.jsx(nK,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>h.jsx(mg,{fill:a[l]},l))})})}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function b5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function MMe({data:e}){return e.some(n=>n.total>0)?h.jsx(xA,{width:"100%",height:280,children:h.jsxs(pMe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[h.jsx(e2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),h.jsx(i2,{dataKey:"date",tickFormatter:b5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(a2,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(OV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>b5(String(n))}),h.jsx(d9,{wrapperStyle:{fontSize:12,paddingTop:8}}),h.jsx(XC,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),h.jsx(XC,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):h.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function w5(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function DMe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function RMe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return h.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"});const n=e.map(r=>({...r,avg_minutes:r.avg_duration_ms!==null?r.avg_duration_ms/6e4:null}));return h.jsx(xA,{width:"100%",height:280,children:h.jsxs(hMe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[h.jsx(e2,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),h.jsx(i2,{dataKey:"date",tickFormatter:w5,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),h.jsx(a2,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),h.jsx(OV,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>w5(String(r)),formatter:r=>[DMe(Number(r)*6e4),"Avg Duration"]}),h.jsx(bK,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const IMe=["7d","30d","90d"];function LMe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function KK({projectId:e}){const[t,n]=y.useState("30d"),{data:r,isLoading:i}=Ege(e,t);return i?h.jsxs("div",{className:"space-y-4",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(ln,{className:"h-32"}),h.jsx(ln,{className:"h-32"}),h.jsx(ln,{className:"h-32"})]}),h.jsx(ln,{className:"h-72"})]}):r?h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"flex gap-1",children:IMe.map(a=>h.jsx(we,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),h.jsxs(kn,{children:[h.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),h.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),h.jsx(kn,{className:"h-36",children:h.jsx(PMe,{completed:r.completed,failed:r.failed})})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{className:"pb-2",children:h.jsx(Qh,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),h.jsxs(kn,{children:[h.jsx("div",{className:"text-3xl font-bold",children:LMe(r.avg_duration_ms)}),h.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{children:h.jsx(Qh,{className:"text-base",children:"Run Frequency"})}),h.jsx(kn,{children:h.jsx(MMe,{data:r.daily})})]}),h.jsxs(Nn,{children:[h.jsx(Wh,{children:h.jsx(Qh,{className:"text-base",children:"Duration Trends"})}),h.jsx(kn,{children:h.jsx(RMe,{data:r.daily})})]})]}):null}function zMe(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-24 rounded-lg"}),h.jsx(ln,{className:"h-64 rounded-lg"})]})}function $Me({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=y.useState(!1),[o,l]=y.useState(""),c=y.useRef(null),f=Nk(e);function m(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?h.jsx(Xe,{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}):h.jsxs("div",{className:"flex items-center gap-1.5 group",children:[h.jsx("span",{className:"font-medium",children:n??r}),h.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:m,"aria-label":"Rename",children:h.jsx(Rp,{className:"h-3 w-3"})})]})}function BMe({projectId:e,conversationId:t,label:n}){const[r,i]=y.useState(!1),a=JF(e);return r?h.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[h.jsx(we,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):h.jsx(we,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),i(!0)},"aria-label":`Delete ${n}`,children:h.jsx(Ea,{className:"h-3.5 w-3.5"})})}const S5={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function FMe(){var I,F,$;const{projectId:e}=bp(),t=Number(e),n=Sa(),r=Ek(t),[i,a]=y.useState(1),[o]=y.useState(1),l=tU(t,i),c=Bd(t),f=Ck(t,o),m=GF(),[d,g]=y.useState(!1),[v,b]=y.useState(!1),[w,S]=y.useState("conversations"),j=r.isLoading||l.isLoading,C=r.error||l.error;if(j)return h.jsx(zMe,{});if(C)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",C.message]})]});if(!r.data)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsx("span",{children:"Project not found"})]});const _=r.data,k=l.data,O=(k==null?void 0:k.items)??[],A=(k==null?void 0:k.total)??0,T=k?Math.ceil(k.total/k.per_page):0,P=c.data??[],L=P.reduce((X,D)=>(X[D.type]=(X[D.type]||0)+1,X),{});return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(we,{variant:"outline",size:"sm",asChild:!0,children:h.jsxs(lr,{to:"/projects",children:[h.jsx(z0,{className:"mr-2 h-4 w-4"}),"Back"]})}),h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:_.display_name})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(we,{disabled:!_.dir_exists||m.isPending,onClick:()=>{m.mutate({project_id:t},{onSuccess:X=>n(`/projects/${t}/conversations/${X.id}`)})},children:[h.jsx(Dp,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),h.jsxs(we,{variant:"outline",onClick:()=>g(!0),disabled:!_.dir_exists,children:[h.jsx(Ip,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),h.jsxs(we,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),h.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[_.working_dir,_.dir_exists?h.jsx(ht,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):h.jsx(ht,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})]}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),h.jsx("dd",{children:new Date(_.created_at).toLocaleString()}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),h.jsx("dd",{children:P.length===0?h.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(L).map(([X,D])=>h.jsxs(ht,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[D," ",D===1?S5[X]??X:`${S5[X]??X}s`]},X))})})]})})}),h.jsx(Mue,{projectId:t,open:d,onOpenChange:g}),h.jsx(Zk,{open:v,onOpenChange:b,projectId:t}),h.jsxs(Fp,{value:w,onValueChange:S,children:[h.jsxs(Up,{children:[h.jsxs(or,{value:"conversations",children:["Conversations (",((I=f.data)==null?void 0:I.total)??0,")"]}),h.jsxs(or,{value:"sessions",children:["Sessions (",A,")"]}),h.jsx(or,{value:"activity",children:"Activity"}),h.jsxs(or,{value:"resources",children:["Resources (",P.length,")"]}),h.jsx(or,{value:"files",children:"Files"})]}),h.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:A===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(rx,{sessions:O})})}),h.jsx(Mk,{page:i,totalPages:T,onPageChange:a})]})}),h.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(((F=f.data)==null?void 0:F.items)??[]).length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[h.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),h.jsx("th",{className:"px-4 py-2"})]})}),h.jsx("tbody",{children:((($=f.data)==null?void 0:$.items)??[]).map(X=>h.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${X.id}`),children:[h.jsx("td",{className:"px-4 py-2",children:h.jsx($Me,{projectId:t,conversationId:X.id,title:X.title,fallback:`Conversation #${X.id}`})}),h.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:X.session_count}),h.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:X.last_activity?new Date(X.last_activity).toLocaleString():"—"}),h.jsx("td",{className:"px-4 py-2 text-right",children:h.jsx(BMe,{projectId:t,conversationId:X.id,label:X.title??`Conversation #${X.id}`})})]},X.id))})]})})})}),h.jsx(sr,{value:"activity",className:"mt-4",children:h.jsx(KK,{projectId:t})}),h.jsx(sr,{value:"resources",className:"mt-4",children:h.jsx(Sge,{projectId:t,installOpen:v,onInstallOpenChange:b})}),h.jsx(sr,{value:"files",className:"mt-4",children:h.jsx(mU,{projectId:t})})]})]})}function Jn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Jn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var UMe={value:()=>{}};function Yb(){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 zy(n)}function zy(e){this._=e}function HMe(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}})}zy.prototype=Yb.prototype={constructor:zy,on:function(e,t){var n=this._,r=HMe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=qMe(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]=j5(n[i],e.name,t);else if(t==null)for(i in n)n[i]=j5(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 zy(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 qMe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function j5(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=UMe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var rN="http://www.w3.org/1999/xhtml";const E5={svg:"http://www.w3.org/2000/svg",xhtml:rN,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),E5.hasOwnProperty(t)?{space:E5[t],local:e}:e}function VMe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===rN&&t.documentElement.namespaceURI===rN?t.createElement(e):t.createElementNS(n,e)}}function KMe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function YK(e){var t=Gb(e);return(t.local?KMe:VMe)(t)}function YMe(){}function u2(e){return e==null?YMe:function(){return this.querySelector(e)}}function GMe(e){typeof e!="function"&&(e=u2(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,m=0;m<o;++m)(c=a[m])&&(f=e.call(c,c.__data__,m,a))&&("__data__"in c&&(f.__data__=c.__data__),l[m]=f);return new Ui(r,this._parents)}function XMe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function WMe(){return[]}function GK(e){return e==null?WMe:function(){return this.querySelectorAll(e)}}function QMe(e){return function(){return XMe(e.apply(this,arguments))}}function ZMe(e){typeof e=="function"?e=QMe(e):e=GK(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new Ui(r,i)}function XK(e){return function(){return this.matches(e)}}function WK(e){return function(t){return t.matches(e)}}var JMe=Array.prototype.find;function eDe(e){return function(){return JMe.call(this.children,e)}}function tDe(){return this.firstElementChild}function nDe(e){return this.select(e==null?tDe:eDe(typeof e=="function"?e:WK(e)))}var rDe=Array.prototype.filter;function iDe(){return Array.from(this.children)}function aDe(e){return function(){return rDe.call(this.children,e)}}function oDe(e){return this.selectAll(e==null?iDe:aDe(typeof e=="function"?e:WK(e)))}function sDe(e){typeof e!="function"&&(e=XK(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new Ui(r,this._parents)}function QK(e){return new Array(e.length)}function lDe(){return new Ui(this._enter||this._groups.map(QK),this._parents)}function i0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}i0.prototype={constructor:i0,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 uDe(e){return function(){return e}}function cDe(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 i0(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function fDe(e,t,n,r,i,a,o){var l,c,f=new Map,m=t.length,d=a.length,g=new Array(m),v;for(l=0;l<m;++l)(c=t[l])&&(g[l]=v=o.call(c,c.__data__,l,t)+"",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 i0(e,a[l]);for(l=0;l<m;++l)(c=t[l])&&f.get(g[l])===c&&(i[l]=c)}function dDe(e){return e.__data__}function hDe(e,t){if(!arguments.length)return Array.from(this,dDe);var n=t?fDe:cDe,r=this._parents,i=this._groups;typeof e!="function"&&(e=uDe(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),f=0;f<a;++f){var m=r[f],d=i[f],g=d.length,v=mDe(e.call(m,m&&m.__data__,f,r)),b=v.length,w=l[f]=new Array(b),S=o[f]=new Array(b),j=c[f]=new Array(g);n(m,d,w,S,j,v,t);for(var C=0,_=0,k,O;C<b;++C)if(k=w[C]){for(C>=_&&(_=C+1);!(O=S[_])&&++_<b;);k._next=O||null}}return o=new Ui(o,r),o._enter=l,o._exit=c,o}function mDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pDe(){return new Ui(this._exit||this._groups.map(QK),this._parents)}function gDe(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 vDe(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],m=r[c],d=f.length,g=l[c]=new Array(d),v,b=0;b<d;++b)(v=f[b]||m[b])&&(g[b]=v);for(;c<i;++c)l[c]=n[c];return new Ui(l,this._parents)}function yDe(){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 xDe(e){e||(e=bDe);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,m=0;m<l;++m)(f=o[m])&&(c[m]=f);c.sort(t)}return new Ui(i,this._parents).order()}function bDe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function wDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function SDe(){return Array.from(this)}function jDe(){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 EDe(){let e=0;for(const t of this)++e;return e}function _De(){return!this.node()}function CDe(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 NDe(e){return function(){this.removeAttribute(e)}}function kDe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ADe(e,t){return function(){this.setAttribute(e,t)}}function ODe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function TDe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function PDe(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 MDe(e,t){var n=Gb(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?kDe:NDe:typeof t=="function"?n.local?PDe:TDe:n.local?ODe:ADe)(n,t))}function ZK(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function DDe(e){return function(){this.style.removeProperty(e)}}function RDe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function IDe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function LDe(e,t,n){return arguments.length>1?this.each((t==null?DDe:typeof t=="function"?IDe:RDe)(e,t,n??"")):jd(this.node(),e)}function jd(e,t){return e.style.getPropertyValue(t)||ZK(e).getComputedStyle(e,null).getPropertyValue(t)}function zDe(e){return function(){delete this[e]}}function $De(e,t){return function(){this[e]=t}}function BDe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function FDe(e,t){return arguments.length>1?this.each((t==null?zDe:typeof t=="function"?BDe:$De)(e,t)):this.node()[e]}function JK(e){return e.trim().split(/^|\s+/)}function c2(e){return e.classList||new eY(e)}function eY(e){this._node=e,this._names=JK(e.getAttribute("class")||"")}eY.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 tY(e,t){for(var n=c2(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function nY(e,t){for(var n=c2(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function UDe(e){return function(){tY(this,e)}}function HDe(e){return function(){nY(this,e)}}function qDe(e,t){return function(){(t.apply(this,arguments)?tY:nY)(this,e)}}function VDe(e,t){var n=JK(e+"");if(arguments.length<2){for(var r=c2(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?qDe:t?UDe:HDe)(n,t))}function KDe(){this.textContent=""}function YDe(e){return function(){this.textContent=e}}function GDe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function XDe(e){return arguments.length?this.each(e==null?KDe:(typeof e=="function"?GDe:YDe)(e)):this.node().textContent}function WDe(){this.innerHTML=""}function QDe(e){return function(){this.innerHTML=e}}function ZDe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function JDe(e){return arguments.length?this.each(e==null?WDe:(typeof e=="function"?ZDe:QDe)(e)):this.node().innerHTML}function eRe(){this.nextSibling&&this.parentNode.appendChild(this)}function tRe(){return this.each(eRe)}function nRe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rRe(){return this.each(nRe)}function iRe(e){var t=typeof e=="function"?e:YK(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function aRe(){return null}function oRe(e,t){var n=typeof e=="function"?e:YK(e),r=t==null?aRe:typeof t=="function"?t:u2(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function sRe(){var e=this.parentNode;e&&e.removeChild(this)}function lRe(){return this.each(sRe)}function uRe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cRe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fRe(e){return this.select(e?cRe:uRe)}function dRe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hRe(e){return function(t){e.call(this,t,this.__data__)}}function mRe(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 pRe(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 gRe(e,t,n){return function(){var r=this.__on,i,a=hRe(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 vRe(e,t,n){var r=mRe(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,m;c<f;++c)for(i=0,m=l[c];i<a;++i)if((o=r[i]).type===m.type&&o.name===m.name)return m.value}return}for(l=t?gRe:pRe,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function rY(e,t,n){var r=ZK(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 yRe(e,t){return function(){return rY(this,e,t)}}function xRe(e,t){return function(){return rY(this,e,t.apply(this,arguments))}}function bRe(e,t){return this.each((typeof t=="function"?xRe:yRe)(e,t))}function*wRe(){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 iY=[null];function Ui(e,t){this._groups=e,this._parents=t}function gg(){return new Ui([[document.documentElement]],iY)}function SRe(){return this}Ui.prototype=gg.prototype={constructor:Ui,select:GMe,selectAll:ZMe,selectChild:nDe,selectChildren:oDe,filter:sDe,data:hDe,enter:lDe,exit:pDe,join:gDe,merge:vDe,selection:SRe,order:yDe,sort:xDe,call:wDe,nodes:SDe,node:jDe,size:EDe,empty:_De,each:CDe,attr:MDe,style:LDe,property:FDe,classed:VDe,text:XDe,html:JDe,raise:tRe,lower:rRe,append:iRe,insert:oRe,remove:lRe,clone:fRe,datum:dRe,on:vRe,dispatch:bRe,[Symbol.iterator]:wRe};function Mi(e){return typeof e=="string"?new Ui([[document.querySelector(e)]],[document.documentElement]):new Ui([[e]],iY)}function jRe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function $a(e,t){if(e=jRe(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 ERe={passive:!1},rp={capture:!0,passive:!1};function FE(e){e.stopImmediatePropagation()}function Kf(e){e.preventDefault(),e.stopImmediatePropagation()}function aY(e){var t=e.document.documentElement,n=Mi(e).on("dragstart.drag",Kf,rp);"onselectstart"in t?n.on("selectstart.drag",Kf,rp):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function oY(e,t){var n=e.document.documentElement,r=Mi(e).on("dragstart.drag",null);t&&(r.on("click.drag",Kf,rp),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const yy=e=>()=>e;function iN(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:f,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:m}})}iN.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function _Re(e){return!e.ctrlKey&&!e.button}function CRe(){return this.parentNode}function NRe(e,t){return t??{x:e.x,y:e.y}}function kRe(){return navigator.maxTouchPoints||"ontouchstart"in this}function sY(){var e=_Re,t=CRe,n=NRe,r=kRe,i={},a=Yb("start","drag","end"),o=0,l,c,f,m,d=0;function g(k){k.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",j,ERe).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(k,O){if(!(m||!e.call(this,k,O))){var A=_(this,t.call(this,k,O),k,O,"mouse");A&&(Mi(k.view).on("mousemove.drag",b,rp).on("mouseup.drag",w,rp),aY(k.view),FE(k),f=!1,l=k.clientX,c=k.clientY,A("start",k))}}function b(k){if(Kf(k),!f){var O=k.clientX-l,A=k.clientY-c;f=O*O+A*A>d}i.mouse("drag",k)}function w(k){Mi(k.view).on("mousemove.drag mouseup.drag",null),oY(k.view,f),Kf(k),i.mouse("end",k)}function S(k,O){if(e.call(this,k,O)){var A=k.changedTouches,T=t.call(this,k,O),P=A.length,L,I;for(L=0;L<P;++L)(I=_(this,T,k,O,A[L].identifier,A[L]))&&(FE(k),I("start",k,A[L]))}}function j(k){var O=k.changedTouches,A=O.length,T,P;for(T=0;T<A;++T)(P=i[O[T].identifier])&&(Kf(k),P("drag",k,O[T]))}function C(k){var O=k.changedTouches,A=O.length,T,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),T=0;T<A;++T)(P=i[O[T].identifier])&&(FE(k),P("end",k,O[T]))}function _(k,O,A,T,P,L){var I=a.copy(),F=$a(L||A,O),$,X,D;if((D=n.call(k,new iN("beforestart",{sourceEvent:A,target:g,identifier:P,active:o,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),T))!=null)return $=D.x-F[0]||0,X=D.y-F[1]||0,function V(z,q,G){var K=F,R;switch(z){case"start":i[P]=V,R=o++;break;case"end":delete i[P],--o;case"drag":F=$a(G||q,O),R=o;break}I.call(z,k,new iN(z,{sourceEvent:q,subject:D,target:g,identifier:P,active:R,x:F[0]+$,y:F[1]+X,dx:F[0]-K[0],dy:F[1]-K[1],dispatch:I}),T)}}return g.filter=function(k){return arguments.length?(e=typeof k=="function"?k:yy(!!k),g):e},g.container=function(k){return arguments.length?(t=typeof k=="function"?k:yy(k),g):t},g.subject=function(k){return arguments.length?(n=typeof k=="function"?k:yy(k),g):n},g.touchable=function(k){return arguments.length?(r=typeof k=="function"?k:yy(!!k),g):r},g.on=function(){var k=a.on.apply(a,arguments);return k===a?g:k},g.clickDistance=function(k){return arguments.length?(d=(k=+k)*k,g):Math.sqrt(d)},g}var Ed=0,Sm=0,hm=0,lY=1e3,a0,jm,o0=0,Sc=0,Xb=0,ip=typeof performance=="object"&&performance.now?performance:Date,uY=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function f2(){return Sc||(uY(ARe),Sc=ip.now()+Xb)}function ARe(){Sc=0}function s0(){this._call=this._time=this._next=null}s0.prototype=cY.prototype={constructor:s0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?f2():+n)+(t==null?0:+t),!this._next&&jm!==this&&(jm?jm._next=this:a0=this,jm=this),this._call=e,this._time=n,aN()},stop:function(){this._call&&(this._call=null,this._time=1/0,aN())}};function cY(e,t,n){var r=new s0;return r.restart(e,t,n),r}function ORe(){f2(),++Ed;for(var e=a0,t;e;)(t=Sc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ed}function _5(){Sc=(o0=ip.now())+Xb,Ed=Sm=0;try{ORe()}finally{Ed=0,PRe(),Sc=0}}function TRe(){var e=ip.now(),t=e-o0;t>lY&&(Xb-=t,o0=e)}function PRe(){for(var e,t=a0,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:a0=n);jm=e,aN(r)}function aN(e){if(!Ed){Sm&&(Sm=clearTimeout(Sm));var t=e-Sc;t>24?(e<1/0&&(Sm=setTimeout(_5,e-ip.now()-Xb)),hm&&(hm=clearInterval(hm))):(hm||(o0=ip.now(),hm=setInterval(TRe,lY)),Ed=1,uY(_5))}}function C5(e,t,n){var r=new s0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var MRe=Yb("start","end","cancel","interrupt"),DRe=[],fY=0,N5=1,oN=2,$y=3,k5=4,sN=5,By=6;function Wb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;RRe(e,n,{name:t,index:r,group:i,on:MRe,tween:DRe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:fY})}function d2(e,t){var n=Ja(e,t);if(n.state>fY)throw new Error("too late; already scheduled");return n}function Mo(e,t){var n=Ja(e,t);if(n.state>$y)throw new Error("too late; already running");return n}function Ja(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function RRe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=cY(a,0,n.time);function a(f){n.state=N5,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var m,d,g,v;if(n.state!==N5)return c();for(m in r)if(v=r[m],v.name===n.name){if(v.state===$y)return C5(o);v.state===k5?(v.state=By,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[m]):+m<t&&(v.state=By,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[m])}if(C5(function(){n.state===$y&&(n.state=k5,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=oN,n.on.call("start",e,e.__data__,n.index,n.group),n.state===oN){for(n.state=$y,i=new Array(g=n.tween.length),m=0,d=-1;m<g;++m)(v=n.tween[m].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=v);i.length=d+1}}function l(f){for(var m=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=sN,1),d=-1,g=i.length;++d<g;)i[d].call(e,m);n.state===sN&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=By,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Fy(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>oN&&r.state<sN,r.state=By,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function IRe(e){return this.each(function(){Fy(this,e)})}function LRe(e,t){var n,r;return function(){var i=Mo(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function zRe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Mo(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=l;break}c===f&&i.push(l)}a.tween=i}}function $Re(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ja(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?LRe:zRe)(n,e,t))}function h2(e,t,n){var r=e._id;return e.each(function(){var i=Mo(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ja(i,r).value[t]}}function dY(e,t){var n;return(typeof t=="number"?Ba:t instanceof bc?$x:(n=bc(t))?(t=n,$x):e7)(e,t)}function BRe(e){return function(){this.removeAttribute(e)}}function FRe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function URe(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 HRe(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 qRe(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 VRe(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 KRe(e,t){var n=Gb(e),r=n==="transform"?G1e:dY;return this.attrTween(e,typeof t=="function"?(n.local?VRe:qRe)(n,r,h2(this,"attr."+e,t)):t==null?(n.local?FRe:BRe)(n):(n.local?HRe:URe)(n,r,t))}function YRe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function GRe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function XRe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&GRe(e,a)),n}return i._value=t,i}function WRe(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&YRe(e,a)),n}return i._value=t,i}function QRe(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=Gb(e);return this.tween(n,(r.local?XRe:WRe)(r,t))}function ZRe(e,t){return function(){d2(this,e).delay=+t.apply(this,arguments)}}function JRe(e,t){return t=+t,function(){d2(this,e).delay=t}}function eIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ZRe:JRe)(t,e)):Ja(this.node(),t).delay}function tIe(e,t){return function(){Mo(this,e).duration=+t.apply(this,arguments)}}function nIe(e,t){return t=+t,function(){Mo(this,e).duration=t}}function rIe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tIe:nIe)(t,e)):Ja(this.node(),t).duration}function iIe(e,t){if(typeof t!="function")throw new Error;return function(){Mo(this,e).ease=t}}function aIe(e){var t=this._id;return arguments.length?this.each(iIe(t,e)):Ja(this.node(),t).ease}function oIe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Mo(this,e).ease=n}}function sIe(e){if(typeof e!="function")throw new Error;return this.each(oIe(this._id,e))}function lIe(e){typeof e!="function"&&(e=XK(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new Es(r,this._parents,this._name,this._id)}function uIe(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],m=c.length,d=o[l]=new Array(m),g,v=0;v<m;++v)(g=c[v]||f[v])&&(d[v]=g);for(;l<r;++l)o[l]=t[l];return new Es(o,this._parents,this._name,this._id)}function cIe(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 fIe(e,t,n){var r,i,a=cIe(t)?d2:Mo;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function dIe(e,t){var n=this._id;return arguments.length<2?Ja(this.node(),n).on.on(e):this.each(fIe(n,e,t))}function hIe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function mIe(){return this.on("end.remove",hIe(this._id))}function pIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=u2(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),m,d,g=0;g<c;++g)(m=l[g])&&(d=e.call(m,m.__data__,g,l))&&("__data__"in m&&(d.__data__=m.__data__),f[g]=d,Wb(f[g],t,n,g,f,Ja(m,n)));return new Es(a,this._parents,t,n)}function gIe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=GK(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],f=c.length,m,d=0;d<f;++d)if(m=c[d]){for(var g=e.call(m,m.__data__,d,c),v,b=Ja(m,n),w=0,S=g.length;w<S;++w)(v=g[w])&&Wb(v,t,n,w,g,b);a.push(g),o.push(m)}return new Es(a,o,t,n)}var vIe=gg.prototype.constructor;function yIe(){return new vIe(this._groups,this._parents)}function xIe(e,t){var n,r,i;return function(){var a=jd(this,e),o=(this.style.removeProperty(e),jd(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function hY(e){return function(){this.style.removeProperty(e)}}function bIe(e,t,n){var r,i=n+"",a;return function(){var o=jd(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function wIe(e,t,n){var r,i,a;return function(){var o=jd(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),jd(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function SIe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=Mo(this,e),f=c.on,m=c.value[a]==null?l||(l=hY(t)):void 0;(f!==n||i!==m)&&(r=(n=f).copy()).on(o,i=m),c.on=r}}function jIe(e,t,n){var r=(e+="")=="transform"?Y1e:dY;return t==null?this.styleTween(e,xIe(e,r)).on("end.style."+e,hY(e)):typeof t=="function"?this.styleTween(e,wIe(e,r,h2(this,"style."+e,t))).each(SIe(this._id,e)):this.styleTween(e,bIe(e,r,t),n).on("end.style."+e,null)}function EIe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _Ie(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&EIe(e,o,n)),r}return a._value=t,a}function CIe(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,_Ie(e,t,n??""))}function NIe(e){return function(){this.textContent=e}}function kIe(e){return function(){var t=e(this);this.textContent=t??""}}function AIe(e){return this.tween("text",typeof e=="function"?kIe(h2(this,"text",e)):NIe(e==null?"":e+""))}function OIe(e){return function(t){this.textContent=e.call(this,t)}}function TIe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&OIe(i)),t}return r._value=e,r}function PIe(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,TIe(e))}function MIe(){for(var e=this._name,t=this._id,n=mY(),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 m=Ja(c,t);Wb(c,e,n,f,o,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Es(r,this._parents,e,n)}function DIe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var f=Mo(this,r),m=f.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),f.on=t}),i===0&&a()})}var RIe=0;function Es(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function mY(){return++RIe}var es=gg.prototype;Es.prototype={constructor:Es,select:pIe,selectAll:gIe,selectChild:es.selectChild,selectChildren:es.selectChildren,filter:lIe,merge:uIe,selection:yIe,transition:MIe,call:es.call,nodes:es.nodes,node:es.node,size:es.size,empty:es.empty,each:es.each,on:dIe,attr:KRe,attrTween:QRe,style:jIe,styleTween:CIe,text:AIe,textTween:PIe,remove:mIe,tween:$Re,delay:eIe,duration:rIe,ease:aIe,easeVarying:sIe,end:DIe,[Symbol.iterator]:es[Symbol.iterator]};function IIe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LIe={time:null,delay:0,duration:250,ease:IIe};function zIe(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 $Ie(e){var t,n;e instanceof Es?(t=e._id,e=e._name):(t=mY(),(n=LIe).time=f2(),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])&&Wb(c,e,t,f,o,n||zIe(c,t));return new Es(r,this._parents,e,t)}gg.prototype.interrupt=IRe;gg.prototype.transition=$Ie;const xy=e=>()=>e;function BIe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function cs(e,t,n){this.k=e,this.x=t,this.y=n}cs.prototype={constructor:cs,scale:function(e){return e===1?this:new cs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qb=new cs(1,0,0);pY.prototype=cs.prototype;function pY(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qb;return e.__zoom}function UE(e){e.stopImmediatePropagation()}function mm(e){e.preventDefault(),e.stopImmediatePropagation()}function FIe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function UIe(){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 A5(){return this.__zoom||Qb}function HIe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function VIe(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 gY(){var e=FIe,t=UIe,n=VIe,r=HIe,i=qIe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ry,f=Yb("start","zoom","end"),m,d,g,v=500,b=150,w=0,S=10;function j(D){D.property("__zoom",A5).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}j.transform=function(D,V,z,q){var G=D.selection?D.selection():D;G.property("__zoom",A5),D!==G?O(D,V,z,q):G.interrupt().each(function(){A(this,arguments).event(q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},j.scaleBy=function(D,V,z,q){j.scaleTo(D,function(){var G=this.__zoom.k,K=typeof V=="function"?V.apply(this,arguments):V;return G*K},z,q)},j.scaleTo=function(D,V,z,q){j.transform(D,function(){var G=t.apply(this,arguments),K=this.__zoom,R=z==null?k(G):typeof z=="function"?z.apply(this,arguments):z,H=K.invert(R),U=typeof V=="function"?V.apply(this,arguments):V;return n(_(C(K,U),R,H),G,o)},z,q)},j.translateBy=function(D,V,z,q){j.transform(D,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),o)},null,q)},j.translateTo=function(D,V,z,q,G){j.transform(D,function(){var K=t.apply(this,arguments),R=this.__zoom,H=q==null?k(K):typeof q=="function"?q.apply(this,arguments):q;return n(Qb.translate(H[0],H[1]).scale(R.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof z=="function"?-z.apply(this,arguments):-z),K,o)},q,G)};function C(D,V){return V=Math.max(a[0],Math.min(a[1],V)),V===D.k?D:new cs(V,D.x,D.y)}function _(D,V,z){var q=V[0]-z[0]*D.k,G=V[1]-z[1]*D.k;return q===D.x&&G===D.y?D:new cs(D.k,q,G)}function k(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function O(D,V,z,q){D.on("start.zoom",function(){A(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(q).end()}).tween("zoom",function(){var G=this,K=arguments,R=A(G,K).event(q),H=t.apply(G,K),U=z==null?k(H):typeof z=="function"?z.apply(G,K):z,B=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=G.__zoom,Z=typeof V=="function"?V.apply(G,K):V,te=c(Q.invert(U).concat(B/Q.k),Z.invert(U).concat(B/Z.k));return function(ae){if(ae===1)ae=Z;else{var re=te(ae),ee=B/re[2];ae=new cs(ee,U[0]-re[0]*ee,U[1]-re[1]*ee)}R.zoom(null,ae)}})}function A(D,V,z){return!z&&D.__zooming||new T(D,V)}function T(D,V){this.that=D,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,V),this.taps=0}T.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,V){return this.mouse&&D!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var V=Mi(this.that).datum();f.call(D,this.that,new BIe(D,{sourceEvent:this.sourceEvent,target:j,transform:this.that.__zoom,dispatch:f}),V)}};function P(D,...V){if(!e.apply(this,arguments))return;var z=A(this,V).event(D),q=this.__zoom,G=Math.max(a[0],Math.min(a[1],q.k*Math.pow(2,r.apply(this,arguments)))),K=$a(D);if(z.wheel)(z.mouse[0][0]!==K[0]||z.mouse[0][1]!==K[1])&&(z.mouse[1]=q.invert(z.mouse[0]=K)),clearTimeout(z.wheel);else{if(q.k===G)return;z.mouse=[K,q.invert(K)],Fy(this),z.start()}mm(D),z.wheel=setTimeout(R,b),z.zoom("mouse",n(_(C(q,G),z.mouse[0],z.mouse[1]),z.extent,o));function R(){z.wheel=null,z.end()}}function L(D,...V){if(g||!e.apply(this,arguments))return;var z=D.currentTarget,q=A(this,V,!0).event(D),G=Mi(D.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",B,!0),K=$a(D,z),R=D.clientX,H=D.clientY;aY(D.view),UE(D),q.mouse=[K,this.__zoom.invert(K)],Fy(this),q.start();function U(Q){if(mm(Q),!q.moved){var Z=Q.clientX-R,te=Q.clientY-H;q.moved=Z*Z+te*te>w}q.event(Q).zoom("mouse",n(_(q.that.__zoom,q.mouse[0]=$a(Q,z),q.mouse[1]),q.extent,o))}function B(Q){G.on("mousemove.zoom mouseup.zoom",null),oY(Q.view,q.moved),mm(Q),q.event(Q).end()}}function I(D,...V){if(e.apply(this,arguments)){var z=this.__zoom,q=$a(D.changedTouches?D.changedTouches[0]:D,this),G=z.invert(q),K=z.k*(D.shiftKey?.5:2),R=n(_(C(z,K),q,G),t.apply(this,V),o);mm(D),l>0?Mi(this).transition().duration(l).call(O,R,q,D):Mi(this).call(j.transform,R,q,D)}}function F(D,...V){if(e.apply(this,arguments)){var z=D.touches,q=z.length,G=A(this,V,D.changedTouches.length===q).event(D),K,R,H,U;for(UE(D),R=0;R<q;++R)H=z[R],U=$a(H,this),U=[U,this.__zoom.invert(U),H.identifier],G.touch0?!G.touch1&&G.touch0[2]!==U[2]&&(G.touch1=U,G.taps=0):(G.touch0=U,K=!0,G.taps=1+!!m);m&&(m=clearTimeout(m)),K&&(G.taps<2&&(d=U[0],m=setTimeout(function(){m=null},v)),Fy(this),G.start())}}function $(D,...V){if(this.__zooming){var z=A(this,V).event(D),q=D.changedTouches,G=q.length,K,R,H,U;for(mm(D),K=0;K<G;++K)R=q[K],H=$a(R,this),z.touch0&&z.touch0[2]===R.identifier?z.touch0[0]=H:z.touch1&&z.touch1[2]===R.identifier&&(z.touch1[0]=H);if(R=z.that.__zoom,z.touch1){var B=z.touch0[0],Q=z.touch0[1],Z=z.touch1[0],te=z.touch1[1],ae=(ae=Z[0]-B[0])*ae+(ae=Z[1]-B[1])*ae,re=(re=te[0]-Q[0])*re+(re=te[1]-Q[1])*re;R=C(R,Math.sqrt(ae/re)),H=[(B[0]+Z[0])/2,(B[1]+Z[1])/2],U=[(Q[0]+te[0])/2,(Q[1]+te[1])/2]}else if(z.touch0)H=z.touch0[0],U=z.touch0[1];else return;z.zoom("touch",n(_(R,H,U),z.extent,o))}}function X(D,...V){if(this.__zooming){var z=A(this,V).event(D),q=D.changedTouches,G=q.length,K,R;for(UE(D),g&&clearTimeout(g),g=setTimeout(function(){g=null},v),K=0;K<G;++K)R=q[K],z.touch0&&z.touch0[2]===R.identifier?delete z.touch0:z.touch1&&z.touch1[2]===R.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(R=$a(R,this),Math.hypot(d[0]-R[0],d[1]-R[1])<S)){var H=Mi(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return j.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:xy(+D),j):r},j.filter=function(D){return arguments.length?(e=typeof D=="function"?D:xy(!!D),j):e},j.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:xy(!!D),j):i},j.extent=function(D){return arguments.length?(t=typeof D=="function"?D:xy([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),j):t},j.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],j):[a[0],a[1]]},j.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],j):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},j.constrain=function(D){return arguments.length?(n=D,j):n},j.duration=function(D){return arguments.length?(l=+D,j):l},j.interpolate=function(D){return arguments.length?(c=D,j):c},j.on=function(){var D=f.on.apply(f,arguments);return D===f?j:D},j.clickDistance=function(D){return arguments.length?(w=(D=+D)*D,j):Math.sqrt(w)},j.tapDistance=function(D){return arguments.length?(S=+D,j):S},j}const Ao={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ap=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vY=["Enter"," ","Escape"],yY={"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 _d;(function(e){e.Strict="strict",e.Loose="loose"})(_d||(_d={}));var ec;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ec||(ec={}));var op;(function(e){e.Partial="partial",e.Full="full"})(op||(op={}));const xY={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var El;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(El||(El={}));var Cd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Cd||(Cd={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const O5={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function bY(e){return e===null?null:e?"valid":"invalid"}const wY=e=>"id"in e&&"source"in e&&"target"in e,KIe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),m2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),vg=(e,t=[0,0])=>{const{width:n,height:r}=Rs(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},YIe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):m2(i)?i:t.nodeLookup.get(i.id));const l=o?l0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Zb(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Jb(n)},yg=(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=Zb(n,l0(i)),r=!0)}),r?Jb(n):{x:0,y:0,width:0,height:0}},p2=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...bg(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const f of e.values()){const{measured:m,selectable:d=!0,hidden:g=!1}=f;if(o&&!d||g)continue;const v=m.width??f.width??f.initialWidth??null,b=m.height??f.height??f.initialHeight??null,w=sp(l,kd(f)),S=(v??0)*(b??0),j=a&&w>0;(!f.internals.handleBounds||j||w>=S||f.dragging)&&c.push(f)}return c},GIe=(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 XIe(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 WIe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=XIe(e,o),c=yg(l),f=g2(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 SY({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},m=o.origin??r;let d=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",Ao.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(d=[[c,f],[c+v,f+b]])}else l&&Ad(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=Ad(d)?jc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",Ao.error015())),{position:{x:g.x-c+(o.measured.width??0)*m[0],y:g.y-f+(o.measured.height??0)*m[1]},positionAbsolute:g}}async function QIe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(g=>g.id)),o=[];for(const g of n){if(g.deletable===!1)continue;const v=a.has(g.id),b=!v&&g.parentId&&o.find(w=>w.id===g.parentId);(v||b)&&o.push(g)}const l=new Set(t.map(g=>g.id)),c=r.filter(g=>g.deletable!==!1),m=GIe(o,c);for(const g of c)l.has(g.id)&&!m.find(b=>b.id===g.id)&&m.push(g);if(!i)return{edges:m,nodes:o};const d=await i({nodes:o,edges:m});return typeof d=="boolean"?d?{edges:m,nodes:o}:{edges:[],nodes:[]}:d}const Nd=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),jc=(e={x:0,y:0},t,n)=>({x:Nd(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Nd(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function jY(e,t,n){const{width:r,height:i}=Rs(n),{x:a,y:o}=n.internals.positionAbsolute;return jc(e,[[a,o],[a+r,o+i]],t)}const T5=(e,t,n)=>e<t?Nd(Math.abs(e-t),1,t)/t:e>n?-Nd(Math.abs(e-n),1,t)/t:0,EY=(e,t,n=15,r=40)=>{const i=T5(e.x,r,t.width-r)*n,a=T5(e.y,r,t.height-r)*n;return[i,a]},Zb=(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)}),lN=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Jb=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),kd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=m2(e)?e.internals.positionAbsolute:vg(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}},l0=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=m2(e)?e.internals.positionAbsolute:vg(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)}},_Y=(e,t)=>Jb(Zb(lN(e),lN(t))),sp=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},P5=e=>qa(e.width)&&qa(e.height)&&qa(e.x)&&qa(e.y),qa=e=>!isNaN(e)&&isFinite(e),ZIe=(e,t)=>{},xg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bg=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?xg(l,o):l},u0=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Of(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 JIe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Of(e,n),i=Of(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Of(e.top??e.y??0,n),i=Of(e.bottom??e.y??0,n),a=Of(e.left??e.x??0,t),o=Of(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 eLe(e,t,n,r,i,a){const{x:o,y:l}=u0(e,[t,n,r]),{x:c,y:f}=u0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),m=i-c,d=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(m),bottom:Math.floor(d)}}const g2=(e,t,n,r,i,a)=>{const o=JIe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),m=Nd(f,r,i),d=e.x+e.width/2,g=e.y+e.height/2,v=t/2-d*m,b=n/2-g*m,w=eLe(e,v,b,m,t,n),S={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:m}},lp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ad(e){return e!=null&&e!=="parent"}function Rs(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function CY(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 NY(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 M5(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function tLe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function nLe(e){return{...yY,...e||{}}}function Tm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Va(e),l=bg({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?xg(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const v2=e=>({width:e.offsetWidth,height:e.offsetHeight}),kY=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},rLe=["INPUT","SELECT","TEXTAREA"];function AY(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:rLe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const OY=e=>"clientX"in e,Va=(e,t)=>{var a,o;const n=OY(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)}},D5=(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,...v2(o)}})};function TY({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,m=Math.abs(c-e),d=Math.abs(f-t);return[c,f,m,d]}function by(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function R5({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Ke.Left:return[t-by(t-r,a),n];case Ke.Right:return[t+by(r-t,a),n];case Ke.Top:return[t,n-by(n-i,a)];case Ke.Bottom:return[t,n+by(i-n,a)]}}function PY({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,curvature:o=.25}){const[l,c]=R5({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,m]=R5({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,g,v,b]=TY({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:m});return[`M${e},${t} C${l},${c} ${f},${m} ${r},${i}`,d,g,v,b]}function MY({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 iLe({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 aLe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Zb(l0(e),l0(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return sp(o,Jb(a))>0}const oLe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,sLe=(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)),lLe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||oLe;let i;return wY(e)?i={...e}:i={...e,id:r(e)},sLe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function DY({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=MY({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const I5={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},uLe=({source:e,sourcePosition:t=Ke.Bottom,target:n})=>t===Ke.Left||t===Ke.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},L5=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cLe({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:r=Ke.Top,center:i,offset:a,stepPosition:o}){const l=I5[t],c=I5[r],f={x:e.x+l.x*a,y:e.y+l.y*a},m={x:n.x+c.x*a,y:n.y+c.y*a},d=uLe({source:f,sourcePosition:t,target:m}),g=d.x!==0?"x":"y",v=d[g];let b=[],w,S;const j={x:0,y:0},C={x:0,y:0},[,,_,k]=MY({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+(m.x-f.x)*o,S=i.y??(f.y+m.y)/2):(w=i.x??(f.x+m.x)/2,S=i.y??f.y+(m.y-f.y)*o);const A=[{x:w,y:f.y},{x:w,y:m.y}],T=[{x:f.x,y:S},{x:m.x,y:S}];l[g]===v?b=g==="x"?A:T:b=g==="x"?T:A}else{const A=[{x:f.x,y:m.y}],T=[{x:m.x,y:f.y}];if(g==="x"?b=l.x===v?T:A:b=l.y===v?A:T,t===r){const $=Math.abs(e[g]-n[g]);if($<=a){const X=Math.min(a-1,a-$);l[g]===v?j[g]=(f[g]>e[g]?-1:1)*X:C[g]=(m[g]>n[g]?-1:1)*X}}if(t!==r){const $=g==="x"?"y":"x",X=l[g]===c[$],D=f[$]>m[$],V=f[$]<m[$];(l[g]===1&&(!X&&D||X&&V)||l[g]!==1&&(!X&&V||X&&D))&&(b=g==="x"?A:T)}const P={x:f.x+j.x,y:f.y+j.y},L={x:m.x+C.x,y:m.y+C.y},I=Math.max(Math.abs(P.x-b[0].x),Math.abs(L.x-b[0].x)),F=Math.max(Math.abs(P.y-b[0].y),Math.abs(L.y-b[0].y));I>=F?(w=(P.x+L.x)/2,S=b[0].y):(w=b[0].x,S=(P.y+L.y)/2)}return[[e,{x:f.x+j.x,y:f.y+j.y},...b,{x:m.x+C.x,y:m.y+C.y},n],w,S,_,k]}function fLe(e,t,n,r){const i=Math.min(L5(e,t)/2,L5(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,m=e.y<n.y?1:-1;return`L ${a+i*f},${o}Q ${a},${o} ${a},${o+i*m}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function uN({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20,stepPosition:m=.5}){const[d,g,v,b,w]=cLe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:f,stepPosition:m});return[d.reduce((j,C,_)=>{let k="";return _>0&&_<d.length-1?k=fLe(d[_-1],C,d[_+1],o):k=`${_===0?"M":"L"}${C.x} ${C.y}`,j+=k,j},""),g,v,b,w]}function z5(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function dLe(e){var d;const{sourceNode:t,targetNode:n}=e;if(!z5(t)||!z5(n))return null;const r=t.internals.handleBounds||$5(t.handles),i=n.internals.handleBounds||$5(n.handles),a=B5((r==null?void 0:r.source)??[],e.sourceHandle),o=B5(e.connectionMode===_d.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",Ao.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Ke.Bottom,c=(o==null?void 0:o.position)||Ke.Top,f=Ec(t,a,l),m=Ec(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:m.x,targetY:m.y,sourcePosition:l,targetPosition:c}}function $5(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Ec(e,t,n=Ke.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??Rs(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Ke.Top:return{x:i+o/2,y:a};case Ke.Right:return{x:i+o,y:a+l/2};case Ke.Bottom:return{x:i+o/2,y:a+l};case Ke.Left:return{x:i,y:a+l/2}}}function B5(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function cN(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function hLe(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=cN(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 RY=1e3,mLe=10,y2={nodeOrigin:[0,0],nodeExtent:ap,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},pLe={...y2,checkEquality:!0};function x2(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function gLe(e,t,n){const r=x2(y2,n);for(const i of e.values())if(i.parentId)w2(i,e,t,r);else{const a=vg(i,r.nodeOrigin),o=Ad(i.extent)?i.extent:r.nodeExtent,l=jc(a,o,Rs(i));i.internals.positionAbsolute=l}}function vLe(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 b2(e){return e==="manual"}function fN(e,t,n,r={}){var f,m;const i=x2(pLe,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!b2(i.zIndexMode)?RY: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=vg(d,i.nodeOrigin),b=Ad(d.extent)?d.extent:i.nodeExtent,w=jc(v,b,Rs(d));g={...i.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(m=d.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:vLe(d,g),z:IY(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&&w2(g,t,n,r,a)}return c}function yLe(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 w2(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=x2(y2,r),f=e.parentId,m=t.get(f);if(!m){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}yLe(e,n),i&&!m.parentId&&m.internals.rootParentIndex===void 0&&c==="auto"&&(m.internals.rootParentIndex=++i.i,m.internals.z=m.internals.z+i.i*mLe),i&&m.internals.rootParentIndex!==void 0&&(i.i=m.internals.rootParentIndex);const d=a&&!b2(c)?RY:0,{x:g,y:v,z:b}=xLe(e,m,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 IY(e,t,n){const r=qa(e.zIndex)?e.zIndex:0;return b2(n)?r:r+(e.selected?t:0)}function xLe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=Rs(e),f=vg(e,n),m=Ad(e.extent)?jc(f,e.extent,c):f;let d=jc({x:o+m.x,y:l+m.y},r,c);e.extent==="parent"&&(d=jY(d,c,t));const g=IY(e,i,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=g?v+1:g}}function S2(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??kd(c),m=_Y(f,l.rect);a.set(l.parentId,{expandedRect:m,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var _;const m=c.internals.positionAbsolute,d=Rs(c),g=c.origin??r,v=l.x<m.x?Math.round(Math.abs(m.x-l.x)):0,b=l.y<m.y?Math.round(Math.abs(m.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),j=(w-d.width)*g[0],C=(S-d.height)*g[1];(v>0||b>0||j||C)&&(i.push({id:f,type:"position",position:{x:c.position.x-v+j,y:c.position.y-b+C}}),(_=n.get(f))==null||_.forEach(k=>{e.some(O=>O.id===k.id)||i.push({id:k.id,type:"position",position:{x:k.position.x+v,y:k.position.y+b}})})),(d.width<l.width||d.height<l.height||v||b)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?g[0]*v-j:0),height:S+(b?g[1]*b-C:0)}})}),i}function bLe(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=[],m=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(m.transform),g=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const w=v2(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(),_=Ad(b.extent)?b.extent:a;let{positionAbsolute:k}=b.internals;b.parentId&&b.extent==="parent"?k=jY(k,w,t.get(b.parentId)):_&&(k=jc(k,_,w));const O={...b,measured:w,internals:{...b.internals,positionAbsolute:k,handleBounds:{source:D5("source",v.nodeElement,C,d,b.id),target:D5("target",v.nodeElement,C,d,b.id)}}};t.set(b.id,O),b.parentId&&w2(O,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,S&&(f.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&g.push({id:b.id,parentId:b.parentId,rect:kd(O,i)}))}}if(g.length>0){const v=S2(g,t,n,i);f.push(...v)}return{changes:f,updatedInternals:c}}async function wLe({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 F5(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 LY(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}`,m=`${a}-${l}--${i}-${o}`;F5("source",c,m,e,i,o),F5("target",c,f,e,a,l),t.set(r.id,r)}}function zY(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:zY(n,t):!1}function U5(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 SLe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!zY(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 HE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[f,m]of t){const d=(o=n.get(f))==null?void 0:o.internals.userNode;d&&i.push({...d,position:m.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function jLe({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=xg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function ELe({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},m=null,d=!1,g=null,v=!1,b=!1,w=null;function S({noDragClassName:C,handleSelector:_,domNode:k,isSelectable:O,nodeId:A,nodeClickDistance:T=0}){g=Mi(k);function P({x:$,y:X}){const{nodeLookup:D,nodeExtent:V,snapGrid:z,snapToGrid:q,nodeOrigin:G,onNodeDrag:K,onSelectionDrag:R,onError:H,updateNodePositions:U}=t();a={x:$,y:X};let B=!1;const Q=l.size>1,Z=Q&&V?lN(yg(l)):null,te=Q&&q?jLe({dragItems:l,snapGrid:z,x:$,y:X}):null;for(const[ae,re]of l){if(!D.has(ae))continue;let ee={x:$-re.distance.x,y:X-re.distance.y};q&&(ee=te?{x:Math.round(ee.x+te.x),y:Math.round(ee.y+te.y)}:xg(ee,z));let se=null;if(Q&&V&&!re.extent&&Z){const{positionAbsolute:Se}=re.internals,Ee=Se.x-Z.x+V[0][0],He=Se.x+re.measured.width-Z.x2+V[1][0],ke=Se.y-Z.y+V[0][1],it=Se.y+re.measured.height-Z.y2+V[1][1];se=[[Ee,ke],[He,it]]}const{position:ge,positionAbsolute:ie}=SY({nodeId:ae,nextPosition:ee,nodeLookup:D,nodeExtent:se||V,nodeOrigin:G,onError:H});B=B||re.position.x!==ge.x||re.position.y!==ge.y,re.position=ge,re.internals.positionAbsolute=ie}if(b=b||B,!!B&&(U(l,!0),w&&(r||K||!A&&R))){const[ae,re]=HE({nodeId:A,dragItems:l,nodeLookup:D});r==null||r(w,l,ae,re),K==null||K(w,ae,re),A||R==null||R(w,re)}}async function L(){if(!m)return;const{transform:$,panBy:X,autoPanSpeed:D,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(o);return}const[z,q]=EY(f,m,D);(z!==0||q!==0)&&(a.x=(a.x??0)-z/$[2],a.y=(a.y??0)-q/$[2],await X({x:z,y:q})&&P(a)),o=requestAnimationFrame(L)}function I($){var Q;const{nodeLookup:X,multiSelectionActive:D,nodesDraggable:V,transform:z,snapGrid:q,snapToGrid:G,selectNodesOnDrag:K,onNodeDragStart:R,onSelectionDragStart:H,unselectNodesAndEdges:U}=t();d=!0,(!K||!O)&&!D&&A&&((Q=X.get(A))!=null&&Q.selected||U()),O&&K&&A&&(e==null||e(A));const B=Tm($.sourceEvent,{transform:z,snapGrid:q,snapToGrid:G,containerBounds:m});if(a=B,l=SLe(X,V,B,A),l.size>0&&(n||R||!A&&H)){const[Z,te]=HE({nodeId:A,dragItems:l,nodeLookup:X});n==null||n($.sourceEvent,l,Z,te),R==null||R($.sourceEvent,Z,te),A||H==null||H($.sourceEvent,te)}}const F=sY().clickDistance(T).on("start",$=>{const{domNode:X,nodeDragThreshold:D,transform:V,snapGrid:z,snapToGrid:q}=t();m=(X==null?void 0:X.getBoundingClientRect())||null,v=!1,b=!1,w=$.sourceEvent,D===0&&I($),a=Tm($.sourceEvent,{transform:V,snapGrid:z,snapToGrid:q,containerBounds:m}),f=Va($.sourceEvent,m)}).on("drag",$=>{const{autoPanOnNodeDrag:X,transform:D,snapGrid:V,snapToGrid:z,nodeDragThreshold:q,nodeLookup:G}=t(),K=Tm($.sourceEvent,{transform:D,snapGrid:V,snapToGrid:z,containerBounds:m});if(w=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||A&&!G.has(A))&&(v=!0),!v){if(!c&&X&&d&&(c=!0,L()),!d){const R=Va($.sourceEvent,m),H=R.x-f.x,U=R.y-f.y;Math.sqrt(H*H+U*U)>q&&I($)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&l&&d&&(f=Va($.sourceEvent,m),P(K))}}).on("end",$=>{if(!(!d||v)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:X,updateNodePositions:D,onNodeDragStop:V,onSelectionDragStop:z}=t();if(b&&(D(l,!1),b=!1),i||V||!A&&z){const[q,G]=HE({nodeId:A,dragItems:l,nodeLookup:X,dragging:!1});i==null||i($.sourceEvent,l,q,G),V==null||V($.sourceEvent,q,G),A||z==null||z($.sourceEvent,G)}}}).filter($=>{const X=$.target;return!$.button&&(!C||!U5(X,`.${C}`,k))&&(!_||U5(X,_,k))});g.call(F)}function j(){g==null||g.on(".drag",null)}return{update:S,destroy:j}}function _Le(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())sp(i,kd(a))>0&&r.push(a);return r}const CLe=250;function NLe(e,t,n,r){var l,c;let i=[],a=1/0;const o=_Le(e,n,t+CLe);for(const f of o){const m=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of m){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:g,y:v}=Ec(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(m=>m.type===f)??i[0]}return i[0]}function $Y(e,t,n,r,i,a=!1){var f,m,d;const o=r.get(e);if(!o)return null;const l=i==="strict"?(f=o.internals.handleBounds)==null?void 0:f[t]:[...((m=o.internals.handleBounds)==null?void 0:m.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,...Ec(o,c,c.position,!0)}:c}function BY(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function kLe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const FY=()=>!0;function ALe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:m,flowId:d,panBy:g,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:j=FY,onReconnectEnd:C,updateConnection:_,getTransform:k,getFromHandle:O,autoPanSpeed:A,dragThreshold:T=1,handleDomNode:P}){const L=kY(e.target);let I=0,F;const{x:$,y:X}=Va(e),D=BY(a,P),V=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!V||!D)return;const q=$Y(i,D,r,c,t);if(!q)return;let G=Va(e,V),K=!1,R=null,H=!1,U=null;function B(){if(!m||!V)return;const[ge,ie]=EY(G,V,A);g({x:ge,y:ie}),I=requestAnimationFrame(B)}const Q={...q,nodeId:i,type:D,position:q.position},Z=c.get(i);let ae={inProgress:!0,isValid:null,from:Ec(Z,Q,Ke.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:Z,to:G,toHandle:null,toPosition:O5[Q.position],toNode:null,pointer:G};function re(){z=!0,_(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:D})}T===0&&re();function ee(ge){if(!z){const{x:it,y:Je}=Va(ge),We=it-$,zt=Je-X;if(!(We*We+zt*zt>T*T))return;re()}if(!O()||!Q){se(ge);return}const ie=k();G=Va(ge,V),F=NLe(bg(G,ie,!1,[1,1]),n,c,Q),K||(B(),K=!0);const Se=UY(ge,{handle:F,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:j,doc:L,lib:f,flowId:d,nodeLookup:c});U=Se.handleDomNode,R=Se.connection,H=kLe(!!F,Se.isValid);const Ee=c.get(i),He=Ee?Ec(Ee,Q,Ke.Left,!0):ae.from,ke={...ae,from:He,isValid:H,to:Se.toHandle&&H?u0({x:Se.toHandle.x,y:Se.toHandle.y},ie):G,toHandle:Se.toHandle,toPosition:H&&Se.toHandle?Se.toHandle.position:O5[Q.position],toNode:Se.toHandle?c.get(Se.toHandle.nodeId):null,pointer:G};_(ke),ae=ke}function se(ge){if(!("touches"in ge&&ge.touches.length>0)){if(z){(F||U)&&R&&H&&(w==null||w(R));const{inProgress:ie,...Se}=ae,Ee={...Se,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(ge,Ee),a&&(C==null||C(ge,Ee))}v(),cancelAnimationFrame(I),K=!1,H=!1,R=null,U=null,L.removeEventListener("mousemove",ee),L.removeEventListener("mouseup",se),L.removeEventListener("touchmove",ee),L.removeEventListener("touchend",se)}}L.addEventListener("mousemove",ee),L.addEventListener("mouseup",se),L.addEventListener("touchmove",ee),L.addEventListener("touchend",se)}function UY(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=FY,nodeLookup:m}){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}=Va(e),w=o.elementFromPoint(v,b),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:g,j={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const C=BY(void 0,S),_=S.getAttribute("data-nodeid"),k=S.getAttribute("data-handleid"),O=S.classList.contains("connectable"),A=S.classList.contains("connectableend");if(!_||!C)return j;const T={source:d?_:r,sourceHandle:d?k:i,target:d?r:_,targetHandle:d?i:k};j.connection=T;const L=O&&A&&(n===_d.Strict?d&&C==="source"||!d&&C==="target":_!==r||k!==i);j.isValid=L&&f(T),j.toHandle=$Y(_,C,k,m,n,!0)}return j}const dN={onPointerDown:ALe,isValid:UY};function OLe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Mi(e);function a({translateExtent:l,width:c,height:f,zoomStep:m=1,pannable:d=!0,zoomable:g=!0,inversePan:v=!1}){const b=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const k=n(),O=_.sourceEvent.ctrlKey&&lp()?10:1,A=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*m,T=k[2]*Math.pow(2,A*O);t.scaleTo(T)};let w=[0,0];const S=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},j=_=>{const k=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const O=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],A=[O[0]-w[0],O[1]-w[1]];w=O;const T=r()*Math.max(k[2],Math.log(k[2]))*(v?-1:1),P={x:k[0]-A[0]*T,y:k[1]-A[1]*T},L=[[0,0],[c,f]];t.setViewportConstrained({x:P.x,y:P.y,zoom:k[2]},L,l)},C=gY().on("start",S).on("zoom",d?j:null).on("zoom.wheel",g?b:null);i.call(C,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:$a}}const ew=e=>({x:e.x,y:e.y,zoom:e.k}),qE=({x:e,y:t,zoom:n})=>Qb.translate(e,t).scale(n),zf=(e,t)=>e.target.closest(`.${t}`),HY=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),TLe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,VE=(e,t=0,n=TLe,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},qY=e=>{const t=e.ctrlKey&&lp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function PLe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return m=>{if(zf(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(m.ctrlKey&&o){const S=$a(m),j=qY(m),C=d*Math.pow(2,j);r.scaleTo(n,C,S,m);return}const g=m.deltaMode===1?20:1;let v=i===ec.Vertical?0:m.deltaX*g,b=i===ec.Horizontal?0:m.deltaY*g;!lp()&&m.shiftKey&&i!==ec.Vertical&&(v=m.deltaY*g,b=0),r.translateBy(n,-(v/d)*a,-(b/d)*a,{internal:!0});const w=ew(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(m,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(m,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(m,w))}}function MLe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=zf(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function DLe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=ew(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 RLe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&HY(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,ew(a.transform)))}}function ILe({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&&HY(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=ew(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function LLe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:m}){return d=>{var S;const g=e||t,v=n&&d.ctrlKey,b=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(zf(d,`${f}-flow__node`)||zf(d,`${f}-flow__edge`)))return!0;if(!r&&!g&&!i&&!a&&!n||o||m&&!b||zf(d,l)&&b||zf(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 zLe({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},m=e.getBoundingClientRect(),d=gY().scaleExtent([t,n]).translateExtent(r),g=Mi(e).call(d);C({x:i.x,y:i.y,zoom:Nd(i.zoom,t,n)},[[0,0],[m.width,m.height]],r);const v=g.on("wheel.zoom"),b=g.on("dblclick.zoom");d.wheelDelta(qY);function w(F,$){return g?new Promise(X=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Ry).transform(VE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function S({noWheelClassName:F,noPanClassName:$,onPaneContextMenu:X,userSelectionActive:D,panOnScroll:V,panOnDrag:z,panOnScrollMode:q,panOnScrollSpeed:G,preventScrolling:K,zoomOnPinch:R,zoomOnScroll:H,zoomOnDoubleClick:U,zoomActivationKeyPressed:B,lib:Q,onTransformChange:Z,connectionInProgress:te,paneClickDistance:ae,selectionOnDrag:re}){D&&!f.isZoomingOrPanning&&j();const ee=V&&!B&&!D;d.clickDistance(re?1/0:!qa(ae)||ae<0?0:ae);const se=ee?PLe({zoomPanValues:f,noWheelClassName:F,d3Selection:g,d3Zoom:d,panOnScrollMode:q,panOnScrollSpeed:G,zoomOnPinch:R,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):MLe({noWheelClassName:F,preventScrolling:K,d3ZoomHandler:v});if(g.on("wheel.zoom",se,{passive:!1}),!D){const ie=DLe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});d.on("start",ie);const Se=RLe({zoomPanValues:f,panOnDrag:z,onPaneContextMenu:!!X,onPanZoom:a,onTransformChange:Z});d.on("zoom",Se);const Ee=ILe({zoomPanValues:f,panOnDrag:z,panOnScroll:V,onPaneContextMenu:X,onPanZoomEnd:l,onDraggingChange:c});d.on("end",Ee)}const ge=LLe({zoomActivationKeyPressed:B,panOnDrag:z,zoomOnScroll:H,panOnScroll:V,zoomOnDoubleClick:U,zoomOnPinch:R,userSelectionActive:D,noPanClassName:$,noWheelClassName:F,lib:Q,connectionInProgress:te});d.filter(ge),U?g.on("dblclick.zoom",b):g.on("dblclick.zoom",null)}function j(){d.on("zoom",null)}async function C(F,$,X){const D=qE(F),V=d==null?void 0:d.constrain()(D,$,X);return V&&await w(V),new Promise(z=>z(V))}async function _(F,$){const X=qE(F);return await w(X,$),new Promise(D=>D(X))}function k(F){if(g){const $=qE(F),X=g.property("__zoom");(X.k!==F.zoom||X.x!==F.x||X.y!==F.y)&&(d==null||d.transform(g,$,null,{sync:!0}))}}function O(){const F=g?pY(g.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function A(F,$){return g?new Promise(X=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Ry).scaleTo(VE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function T(F,$){return g?new Promise(X=>{d==null||d.interpolate(($==null?void 0:$.interpolate)==="linear"?ds:Ry).scaleBy(VE(g,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>X(!0)),F)}):Promise.resolve(!1)}function P(F){d==null||d.scaleExtent(F)}function L(F){d==null||d.translateExtent(F)}function I(F){const $=!qa(F)||F<0?0:F;d==null||d.clickDistance($)}return{update:S,destroy:j,setViewport:_,setViewportConstrained:C,getViewport:O,scaleTo:A,scaleBy:T,setScaleExtent:P,setTranslateExtent:L,syncViewport:k,setClickDistance:I}}var Od;(function(e){e.Line="line",e.Handle="handle"})(Od||(Od={}));function $Le({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 H5(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function gl(e,t){return Math.max(0,t-e)}function vl(e,t){return Math.max(0,e-t)}function wy(e,t,n){return Math.max(0,t-e,e-n)}function q5(e,t){return e?!t:t}function BLe(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:f}=t;const{isHorizontal:m,isVertical:d}=t,g=m&&d,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:j,maxHeight:C}=r,{x:_,y:k,width:O,height:A,aspectRatio:T}=e;let P=Math.floor(m?v-e.pointerX:0),L=Math.floor(d?b-e.pointerY:0);const I=O+(c?-P:P),F=A+(f?-L:L),$=-a[0]*O,X=-a[1]*A;let D=wy(I,w,S),V=wy(F,j,C);if(o){let G=0,K=0;c&&P<0?G=gl(_+P+$,o[0][0]):!c&&P>0&&(G=vl(_+I+$,o[1][0])),f&&L<0?K=gl(k+L+X,o[0][1]):!f&&L>0&&(K=vl(k+F+X,o[1][1])),D=Math.max(D,G),V=Math.max(V,K)}if(l){let G=0,K=0;c&&P>0?G=vl(_+P,l[0][0]):!c&&P<0&&(G=gl(_+I,l[1][0])),f&&L>0?K=vl(k+L,l[0][1]):!f&&L<0&&(K=gl(k+F,l[1][1])),D=Math.max(D,G),V=Math.max(V,K)}if(i){if(m){const G=wy(I/T,j,C)*T;if(D=Math.max(D,G),o){let K=0;!c&&!f||c&&!f&&g?K=vl(k+X+I/T,o[1][1])*T:K=gl(k+X+(c?P:-P)/T,o[0][1])*T,D=Math.max(D,K)}if(l){let K=0;!c&&!f||c&&!f&&g?K=gl(k+I/T,l[1][1])*T:K=vl(k+(c?P:-P)/T,l[0][1])*T,D=Math.max(D,K)}}if(d){const G=wy(F*T,w,S)/T;if(V=Math.max(V,G),o){let K=0;!c&&!f||f&&!c&&g?K=vl(_+F*T+$,o[1][0])/T:K=gl(_+(f?L:-L)*T+$,o[0][0])/T,V=Math.max(V,K)}if(l){let K=0;!c&&!f||f&&!c&&g?K=gl(_+F*T,l[1][0])/T:K=vl(_+(f?L:-L)*T,l[0][0])/T,V=Math.max(V,K)}}}L=L+(L<0?V:-V),P=P+(P<0?D:-D),i&&(g?I>F*T?L=(q5(c,f)?-P:P)/T:P=(q5(c,f)?-L:L)*T:m?(L=P/T,f=c):(P=L*T,c=f));const z=c?_+P:_,q=f?k+L:k;return{width:O+(c?-P:P),height:A+(f?-L:L),x:a[0]*P*(c?-1:1)+z,y:a[1]*L*(f?-1:1)+q}}const VY={width:0,height:0,x:0,y:0},FLe={...VY,pointerX:0,pointerY:0,aspectRatio:1};function ULe(e){return[[0,0],[e.measured.width,e.measured.height]]}function HLe(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 qLe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=Mi(e);let o={controlDirection:H5("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:m,keepAspectRatio:d,resizeDirection:g,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let j={...VY},C={...FLe};o={boundaries:m,resizeDirection:g,keepAspectRatio:d,controlDirection:H5(f)};let _,k=null,O=[],A,T,P,L=!1;const I=sY().on("start",F=>{const{nodeLookup:$,transform:X,snapGrid:D,snapToGrid:V,nodeOrigin:z,paneDomNode:q}=n();if(_=$.get(t),!_)return;k=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:K}=Tm(F.sourceEvent,{transform:X,snapGrid:D,snapToGrid:V,containerBounds:k});j={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...j,pointerX:G,pointerY:K,aspectRatio:j.width/j.height},A=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(A=$.get(_.parentId),T=A&&_.extent==="parent"?ULe(A):void 0),O=[],P=void 0;for(const[R,H]of $)if(H.parentId===t&&(O.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const U=HLe(H,_,H.origin??z);P?P=[[Math.min(U[0][0],P[0][0]),Math.min(U[0][1],P[0][1])],[Math.max(U[1][0],P[1][0]),Math.max(U[1][1],P[1][1])]]:P=U}v==null||v(F,{...j})}).on("drag",F=>{const{transform:$,snapGrid:X,snapToGrid:D,nodeOrigin:V}=n(),z=Tm(F.sourceEvent,{transform:$,snapGrid:X,snapToGrid:D,containerBounds:k}),q=[];if(!_)return;const{x:G,y:K,width:R,height:H}=j,U={},B=_.origin??V,{width:Q,height:Z,x:te,y:ae}=BLe(C,o.controlDirection,z,o.boundaries,o.keepAspectRatio,B,T,P),re=Q!==R,ee=Z!==H,se=te!==G&&re,ge=ae!==K&&ee;if(!se&&!ge&&!re&&!ee)return;if((se||ge||B[0]===1||B[1]===1)&&(U.x=se?te:j.x,U.y=ge?ae:j.y,j.x=U.x,j.y=U.y,O.length>0)){const He=te-G,ke=ae-K;for(const it of O)it.position={x:it.position.x-He+B[0]*(Q-R),y:it.position.y-ke+B[1]*(Z-H)},q.push(it)}if((re||ee)&&(U.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:j.width,U.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?Z:j.height,j.width=U.width,j.height=U.height),A&&_.expandParent){const He=B[0]*(U.width??0);U.x&&U.x<He&&(j.x=He,C.x=C.x-(U.x-He));const ke=B[1]*(U.height??0);U.y&&U.y<ke&&(j.y=ke,C.y=C.y-(U.y-ke))}const ie=$Le({width:j.width,prevWidth:R,height:j.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),Se={...j,direction:ie};(S==null?void 0:S(F,Se))!==!1&&(L=!0,b==null||b(F,Se),r(U,q))}).on("end",F=>{L&&(w==null||w(F,{...j}),i==null||i({...j}),L=!1)});a.call(I)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const VLe={},V5=e=>{let t;const n=new Set,r=(m,d)=>{const g=typeof m=="function"?m(t):m;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:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(VLe?"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},KLe=e=>e?V5(e):V5,{useDebugValue:YLe}=Ce,{useSyncExternalStoreWithSelector:GLe}=dye,XLe=e=>e;function KY(e,t=XLe,n){const r=GLe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return YLe(r),r}const K5=(e,t)=>{const n=KLe(e),r=(i,a=t)=>KY(n,i,a);return Object.assign(r,n),r},WLe=(e,t)=>e?K5(e,t):K5;function _n(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const tw=y.createContext(null),QLe=tw.Provider,YY=Ao.error001();function Dt(e,t){const n=y.useContext(tw);if(n===null)throw new Error(YY);return KY(n,e,t)}function Cn(){const e=y.useContext(tw);if(e===null)throw new Error(YY);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Y5={display:"none"},ZLe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},GY="react-flow__node-desc",XY="react-flow__edge-desc",JLe="react-flow__aria-live",e3e=e=>e.ariaLiveMessage,t3e=e=>e.ariaLabelConfig;function n3e({rfId:e}){const t=Dt(e3e);return h.jsx("div",{id:`${JLe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ZLe,children:t})}function r3e({rfId:e,disableKeyboardA11y:t}){const n=Dt(t3e);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${GY}-${e}`,style:Y5,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${XY}-${e}`,style:Y5,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(n3e,{rfId:e})]})}const nw=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return h.jsx("div",{className:Jn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});nw.displayName="Panel";function i3e({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(nw,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const a3e=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}},Sy=e=>e.id;function o3e(e,t){return _n(e.selectedNodes.map(Sy),t.selectedNodes.map(Sy))&&_n(e.selectedEdges.map(Sy),t.selectedEdges.map(Sy))}function s3e({onSelectionChange:e}){const t=Cn(),{selectedNodes:n,selectedEdges:r}=Dt(a3e,o3e);return y.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const l3e=e=>!!e.onSelectionChangeHandlers;function u3e({onSelectionChange:e}){const t=Dt(l3e);return e||t?h.jsx(s3e,{onSelectionChange:e}):null}const WY=[0,0],c3e={x:0,y:0,zoom:1},f3e=["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"],G5=[...f3e,"rfId"],d3e=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}),X5={translateExtent:ap,nodeOrigin:WY,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function h3e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Dt(d3e,_n),f=Cn();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{m.current=X5,l()}),[]);const m=y.useRef(X5);return y.useEffect(()=>{for(const d of G5){const g=e[d],v=m.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:nLe(g)}):d==="fitView"?f.setState({fitViewQueued:g}):d==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[d]:g})))}m.current=e},G5.map(d=>e[d])),null}function W5(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function m3e(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=W5(),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=W5())!=null&&r.matches?"dark":"light"}const Q5=typeof document<"u"?document:null;function up(e=null,t={target:Q5,actInsideInputWithModifier:!0}){const[n,r]=y.useState(!1),i=y.useRef(!1),a=y.useRef(new Set([])),[o,l]=y.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
`).replace(`

`,`
+`).split(`
`)),m=f.reduce((d,g)=>d.concat(...g),[]);return[f,m]}return[[],[]]},[e]);return y.useEffect(()=>{const c=(t==null?void 0:t.target)??Q5,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=v=>{var S,j;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!f)&&AY(v))return!1;const w=J5(v.code,l);if(a.current.add(v[w]),Z5(o,a.current,!1)){const C=((j=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:j[0])||v.target,_=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(i.current||!_)&&v.preventDefault(),r(!0)}},d=v=>{const b=J5(v.code,l);Z5(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(v[b]),v.key==="Meta"&&a.current.clear(),i.current=!1},g=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",m),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{c==null||c.removeEventListener("keydown",m),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,r]),n}function Z5(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function J5(e,t){return t.includes(e)?"code":"key"}const p3e=()=>{const e=Cn();return y.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=g2(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},m=n.snapGrid??i,d=n.snapToGrid??a;return bg(f,r,d,m)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=u0(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function QY(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)g3e(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 g3e(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 v3e(e,t){return QY(e,t)}function y3e(e,t){return QY(e,t)}function Ru(e,t){return{id:e,type:"select",selected:t}}function $f(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(Ru(a.id,o)))}return r}function e$({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 t$(e){return{id:e.id,type:"remove"}}const n$=e=>KIe(e),x3e=e=>wY(e);function ZY(e){return y.forwardRef(e)}const b3e=typeof window<"u"?y.useLayoutEffect:y.useEffect;function r$(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>w3e(()=>n(i=>i+BigInt(1))));return b3e(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function w3e(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const JY=y.createContext(null);function S3e({children:e}){const t=Cn(),n=y.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:m,onNodesChange:d,nodeLookup:g,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=c;for(const j of l)w=typeof j=="function"?j(w):j;let S=e$({items:w,lookup:g});for(const j of b.values())S=j(S);m&&f(w),S.length>0?d==null||d(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:j,nodes:C,setNodes:_}=t.getState();j&&_(C)})},[]),r=r$(n),i=y.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:m,onEdgesChange:d,edgeLookup:g}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;m?f(v):d&&d(e$({items:v,lookup:g}))},[]),a=r$(i),o=y.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return h.jsx(JY.Provider,{value:o,children:e})}function j3e(){const e=y.useContext(JY);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const E3e=e=>!!e.panZoom;function rw(){const e=p3e(),t=Cn(),n=j3e(),r=Dt(E3e),i=y.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var j,C;const{nodeLookup:g,nodeOrigin:v}=t.getState(),b=n$(d)?d:g.get(d.id),w=b.parentId?NY(b.position,b.measured,b.parentId,g,v):b.position,S={...b,position:w,width:((j=b.measured)==null?void 0:j.width)??b.width,height:((C=b.measured)==null?void 0:C.height)??b.height};return kd(S)},f=(d,g,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===d){const S=typeof g=="function"?g(w):g;return v.replace&&n$(S)?S:{...w,...S}}return w}))},m=(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&&x3e(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=a(d))==null?void 0:g.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(g=>({...g}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const g=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:d.map(j=>({...j})),edges:g.map(j=>({...j})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:j,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:k}=t.getState(),{nodes:O,edges:A}=await QIe({nodesToRemove:d,edgesToRemove:g,nodes:v,edges:b,onBeforeDelete:k}),T=A.length>0,P=O.length>0;if(T){const L=A.map(t$);S==null||S(A),C(L)}if(P){const L=O.map(t$);w==null||w(O),j(L)}return(P||T)&&(_==null||_({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(d,g=!0,v)=>{const b=P5(d),w=b?d:c(d),S=v!==void 0;return w?(v||t.getState().nodes).filter(j=>{const C=t.getState().nodeLookup.get(j.id);if(C&&!b&&(j.id===d.id||!C.internals.positionAbsolute))return!1;const _=kd(S?j:C),k=sp(_,w);return g&&k>0||k>=_.width*_.height||k>=w.width*w.height}):[]},isNodeIntersecting:(d,g,v=!0)=>{const w=P5(d)?d:c(d);if(!w)return!1;const S=sp(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:m,updateEdgeData:(d,g,v={replace:!1})=>{m(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 YIe(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??tLe();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),n.nodeQueue.push(v=>[...v]),g.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const i$=e=>e.selected,_3e=typeof window<"u"?window:void 0;function C3e({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Cn(),{deleteElements:r}=rw(),i=up(e,{actInsideInputWithModifier:!1}),a=up(t,{target:_3e});y.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(i$),edges:o.filter(i$)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function N3e(e){const t=Cn();y.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=v2(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",Ao.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const iw={position:"absolute",width:"100%",height:"100%",top:0,left:0},k3e=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function A3e({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=ec.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:m,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:j,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:k}){const O=Cn(),A=y.useRef(null),{userSelectionActive:T,lib:P,connectionInProgress:L}=Dt(k3e,_n),I=up(g),F=y.useRef();N3e(A);const $=y.useCallback(X=>{j==null||j({x:X[0],y:X[1],zoom:X[2]}),C||O.setState({transform:X})},[j,C]);return y.useEffect(()=>{if(A.current){F.current=zLe({domNode:A.current,minZoom:m,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:z=>O.setState(q=>q.paneDragging===z?q:{paneDragging:z}),onPanZoomStart:(z,q)=>{const{onViewportChangeStart:G,onMoveStart:K}=O.getState();K==null||K(z,q),G==null||G(q)},onPanZoom:(z,q)=>{const{onViewportChange:G,onMove:K}=O.getState();K==null||K(z,q),G==null||G(q)},onPanZoomEnd:(z,q)=>{const{onViewportChangeEnd:G,onMoveEnd:K}=O.getState();K==null||K(z,q),G==null||G(q)}});const{x:X,y:D,zoom:V}=F.current.getViewport();return O.setState({panZoom:F.current,transform:[X,D,V],domNode:A.current.closest(".react-flow")}),()=>{var z;(z=F.current)==null||z.destroy()}}},[]),y.useEffect(()=>{var X;(X=F.current)==null||X.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:P,onTransformChange:$,connectionInProgress:L,selectionOnDrag:k,paneClickDistance:_})},[e,t,n,r,i,a,o,l,I,v,S,T,w,P,$,L,k,_]),h.jsx("div",{className:"react-flow__renderer",ref:A,style:iw,children:b})}const O3e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function T3e(){const{userSelectionActive:e,userSelectionRect:t}=Dt(O3e,_n);return e&&t?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const KE=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},P3e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function M3e({isSelecting:e,selectionKeyPressed:t,selectionMode:n=op.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:m,onPaneMouseEnter:d,onPaneMouseMove:g,onPaneMouseLeave:v,children:b}){const w=Cn(),{userSelectionActive:S,elementsSelectable:j,dragging:C,connectionInProgress:_}=Dt(P3e,_n),k=j&&(e||S),O=y.useRef(null),A=y.useRef(),T=y.useRef(new Set),P=y.useRef(new Set),L=y.useRef(!1),I=G=>{if(L.current||_){L.current=!1;return}c==null||c(G),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},F=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}f==null||f(G)},$=m?G=>m(G):void 0,X=G=>{L.current&&(G.stopPropagation(),L.current=!1)},D=G=>{var Z,te;const{domNode:K}=w.getState();if(A.current=K==null?void 0:K.getBoundingClientRect(),!A.current)return;const R=G.target===O.current;if(!R&&!!G.target.closest(".nokey")||!e||!(a&&R||t)||G.button!==0||!G.isPrimary)return;(te=(Z=G.target)==null?void 0:Z.setPointerCapture)==null||te.call(Z,G.pointerId),L.current=!1;const{x:B,y:Q}=Va(G.nativeEvent,A.current);w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:Q,x:B,y:Q}}),R||(G.stopPropagation(),G.preventDefault())},V=G=>{const{userSelectionRect:K,transform:R,nodeLookup:H,edgeLookup:U,connectionLookup:B,triggerNodeChanges:Q,triggerEdgeChanges:Z,defaultEdgeOptions:te,resetSelectedElements:ae}=w.getState();if(!A.current||!K)return;const{x:re,y:ee}=Va(G.nativeEvent,A.current),{startX:se,startY:ge}=K;if(!L.current){const ke=t?0:i;if(Math.hypot(re-se,ee-ge)<=ke)return;ae(),o==null||o(G)}L.current=!0;const ie={startX:se,startY:ge,x:re<se?re:se,y:ee<ge?ee:ge,width:Math.abs(re-se),height:Math.abs(ee-ge)},Se=T.current,Ee=P.current;T.current=new Set(p2(H,ie,R,n===op.Partial,!0).map(ke=>ke.id)),P.current=new Set;const He=(te==null?void 0:te.selectable)??!0;for(const ke of T.current){const it=B.get(ke);if(it)for(const{edgeId:Je}of it.values()){const We=U.get(Je);We&&(We.selectable??He)&&P.current.add(Je)}}if(!M5(Se,T.current)){const ke=$f(H,T.current,!0);Q(ke)}if(!M5(Ee,P.current)){const ke=$f(U,P.current);Z(ke)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},z=G=>{var K,R;G.button===0&&((R=(K=G.target)==null?void 0:K.releasePointerCapture)==null||R.call(K,G.pointerId),!S&&G.target===O.current&&w.getState().userSelectionRect&&(I==null||I(G)),w.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(l==null||l(G),w.setState({nodesSelectionActive:T.current.size>0})))},q=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Jn(["react-flow__pane",{draggable:q,dragging:C,selection:e}]),onClick:k?void 0:KE(I,O),onContextMenu:KE(F,O),onWheel:KE($,O),onPointerEnter:k?void 0:d,onPointerMove:k?V:g,onPointerUp:k?z:void 0,onPointerDownCapture:k?D:void 0,onClickCapture:k?X:void 0,onPointerLeave:v,ref:O,style:iw,children:[b,h.jsx(T3e,{})]})}function hN({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",Ao.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var m;return(m=r==null?void 0:r.current)==null?void 0:m.blur()})):i([e])}function eG({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=Cn(),[c,f]=y.useState(!1),m=y.useRef();return y.useEffect(()=>{m.current=ELe({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{hN({id:d,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),y.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var d;(d=m.current)==null||d.destroy()}},[n,r,t,a,e,i,o]),c}const D3e=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function tG(){const e=Cn();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:m}=e.getState(),d=new Map,g=D3e(o),v=i?a[0]:5,b=i?a[1]:5,w=n.direction.x*v*n.factor,S=n.direction.y*b*n.factor;for(const[,j]of f){if(!g(j))continue;let C={x:j.internals.positionAbsolute.x+w,y:j.internals.positionAbsolute.y+S};i&&(C=xg(C,a));const{position:_,positionAbsolute:k}=SY({nodeId:j.id,nextPosition:C,nodeLookup:f,nodeExtent:r,nodeOrigin:m,onError:l});j.position=_,j.internals.positionAbsolute=k,d.set(j.id,j)}c(d)},[])}const j2=y.createContext(null),R3e=j2.Provider;j2.Consumer;const nG=()=>y.useContext(j2),I3e=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),L3e=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o,m=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:m,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===_d.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:m&&f}};function z3e({type:e="source",position:t=Ke.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:m,onTouchStart:d,...g},v){var V,z;const b=o||null,w=e==="target",S=Cn(),j=nG(),{connectOnClick:C,noPanClassName:_,rfId:k}=Dt(I3e,_n),{connectingFrom:O,connectingTo:A,clickConnecting:T,isPossibleEndHandle:P,connectionInProcess:L,clickConnectionInProcess:I,valid:F}=Dt(L3e(j,b,e),_n);j||(z=(V=S.getState()).onError)==null||z.call(V,"010",Ao.error010());const $=q=>{const{defaultEdgeOptions:G,onConnect:K,hasDefaultEdges:R}=S.getState(),H={...G,...q};if(R){const{edges:U,setEdges:B}=S.getState();B(lLe(H,U))}K==null||K(H),l==null||l(H)},X=q=>{if(!j)return;const G=OY(q.nativeEvent);if(i&&(G&&q.button===0||!G)){const K=S.getState();dN.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:w,handleId:b,nodeId:j,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...R)=>{var H,U;return(U=(H=S.getState()).onConnectEnd)==null?void 0:U.call(H,...R)},updateConnection:K.updateConnection,onConnect:$,isValidConnection:n||((...R)=>{var H,U;return((U=(H=S.getState()).isValidConnection)==null?void 0:U.call(H,...R))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}G?m==null||m(q):d==null||d(q)},D=q=>{const{onClickConnectStart:G,onClickConnectEnd:K,connectionClickStartHandle:R,connectionMode:H,isValidConnection:U,lib:B,rfId:Q,nodeLookup:Z,connection:te}=S.getState();if(!j||!R&&!i)return;if(!R){G==null||G(q.nativeEvent,{nodeId:j,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:j,type:e,id:b}});return}const ae=kY(q.target),re=n||U,{connection:ee,isValid:se}=dN.isValid(q.nativeEvent,{handle:{nodeId:j,id:b,type:e},connectionMode:H,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:re,flowId:Q,doc:ae,lib:B,nodeLookup:Z});se&&ee&&$(ee);const ge=structuredClone(te);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,K==null||K(q,ge),S.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":b,"data-nodeid":j,"data-handlepos":t,"data-id":`${k}-${j}-${b}-${e}`,className:Jn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:O,connectingto:A,valid:F,connectionindicator:r&&(!L||P)&&(L||I?a:i)}]),onMouseDown:X,onTouchStart:X,onClick:C?D:void 0,ref:v,...g,children:c})}const Td=y.memo(ZY(z3e));function $3e({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Td,{type:"source",position:n,isConnectable:t})]})}function B3e({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:r=Ke.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Td,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Td,{type:"source",position:r,isConnectable:t})]})}function F3e(){return null}function U3e({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Td,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const c0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},a$={input:$3e,default:B3e,output:U3e,group:F3e};function H3e(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 q3e=e=>{const{width:t,height:n,x:r,y:i}=yg(e.nodeLookup,{filter:a=>!!a.selected});return{width:qa(t)?t:null,height:qa(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 V3e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Cn(),{width:i,height:a,transformString:o,userSelectionActive:l}=Dt(q3e,_n),c=tG(),f=y.useRef(null);y.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const m=!l&&i!==null&&a!==null;if(eG({nodeRef:f,disabled:!m}),!m)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(c0,v.key)&&(v.preventDefault(),c({direction:c0[v.key],factor:v.shiftKey?4:1}))};return h.jsx("div",{className:Jn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:a}})})}const o$=typeof window<"u"?window:void 0,K3e=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function rG({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:m,selectionMode:d,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:k,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:P,defaultViewport:L,translateExtent:I,minZoom:F,maxZoom:$,preventScrolling:X,onSelectionContextMenu:D,noWheelClassName:V,noPanClassName:z,disableKeyboardA11y:q,onViewportChange:G,isControlledViewport:K}){const{nodesSelectionActive:R,userSelectionActive:H}=Dt(K3e,_n),U=up(f,{target:o$}),B=up(w,{target:o$}),Q=B||P,Z=B||k,te=m&&Q!==!0,ae=U||H||te;return C3e({deleteKeyCode:c,multiSelectionKeyCode:b}),h.jsx(A3e,{onPaneContextMenu:a,elementsSelectable:j,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:Z,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:T,panOnDrag:!U&&Q,defaultViewport:L,translateExtent:I,minZoom:F,maxZoom:$,zoomActivationKeyCode:S,preventScrolling:X,noWheelClassName:V,noPanClassName:z,onViewportChange:G,isControlledViewport:K,paneClickDistance:l,selectionOnDrag:te,children:h.jsxs(M3e,{onSelectionStart:g,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:te,children:[e,R&&h.jsx(V3e,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:q})]})})}rG.displayName="FlowRenderer";const Y3e=y.memo(rG),G3e=e=>t=>e?p2(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 X3e(e){return Dt(y.useCallback(G3e(e),[e]),_n)}const W3e=e=>e.updateNodeInternals;function Q3e(){const e=Dt(W3e),[t]=y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return y.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Z3e({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Cn(),a=y.useRef(null),o=y.useRef(null),l=y.useRef(e.sourcePosition),c=y.useRef(e.targetPosition),f=y.useRef(t),m=n&&!!e.internals.handleBounds;return y.useEffect(()=>{a.current&&!e.hidden&&(!m||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[m,e.hidden]),y.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),y.useEffect(()=>{if(a.current){const 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 J3e({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:m,resizeObserver:d,noDragClassName:g,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:j,onError:C}){const{node:_,internals:k,isParent:O}=Dt(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},_n);let A=_.type||"default",T=(S==null?void 0:S[A])||a$[A];T===void 0&&(C==null||C("003",Ao.error003(A)),A="default",T=(S==null?void 0:S.default)||a$.default);const P=!!(_.draggable||l&&typeof _.draggable>"u"),L=!!(_.selectable||c&&typeof _.selectable>"u"),I=!!(_.connectable||f&&typeof _.connectable>"u"),F=!!(_.focusable||m&&typeof _.focusable>"u"),$=Cn(),X=CY(_),D=Z3e({node:_,nodeType:A,hasDimensions:X,resizeObserver:d}),V=eG({nodeRef:D,disabled:_.hidden||!P,noDragClassName:g,handleSelector:_.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:j}),z=tG();if(_.hidden)return null;const q=Rs(_),G=H3e(_),K=L||P||t||n||r||i,R=n?re=>n(re,{...k.userNode}):void 0,H=r?re=>r(re,{...k.userNode}):void 0,U=i?re=>i(re,{...k.userNode}):void 0,B=a?re=>a(re,{...k.userNode}):void 0,Q=o?re=>o(re,{...k.userNode}):void 0,Z=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=$.getState();L&&(!ee||!P||se>0)&&hN({id:e,store:$,nodeRef:D}),t&&t(re,{...k.userNode})},te=re=>{if(!(AY(re.nativeEvent)||b)){if(vY.includes(re.key)&&L){const ee=re.key==="Escape";hN({id:e,store:$,unselect:ee,nodeRef:D})}else if(P&&_.selected&&Object.prototype.hasOwnProperty.call(c0,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=$.getState();$.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),z({direction:c0[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var Ee;if(b||!((Ee=D.current)!=null&&Ee.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:ge,setCenter:ie}=$.getState();if(!ge)return;p2(new Map([[e,_]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(_.position.x+q.width/2,_.position.y+q.height/2,{zoom:re[2]})};return h.jsx("div",{className:Jn(["react-flow__node",`react-flow__node-${A}`,{[v]:P},_.className,{selected:_.selected,selectable:L,parent:O,draggable:P,dragging:V}]),ref:D,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:X?"visible":"hidden",..._.style,...G},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:H,onMouseLeave:U,onContextMenu:B,onClick:Z,onDoubleClick:Q,onKeyDown:F?te:void 0,tabIndex:F?0:void 0,onFocus:F?ae:void 0,role:_.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${GY}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:h.jsx(R3e,{value:e,children:h.jsx(T,{id:e,data:_.data,type:A,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:_.selected??!1,selectable:L,draggable:P,deletable:_.deletable??!0,isConnectable:I,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:k.z,parentId:_.parentId,...q})})})}var eze=y.memo(J3e);const tze=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iG(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=Dt(tze,_n),o=X3e(e.onlyRenderVisibleElements),l=Q3e();return h.jsx("div",{className:"react-flow__nodes",style:iw,children:o.map(c=>h.jsx(eze,{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))})}iG.displayName="NodeRenderer";const nze=y.memo(iG);function rze(e){return Dt(y.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&aLe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),_n)}const ize=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aze=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},s$={[Cd.Arrow]:ize,[Cd.ArrowClosed]:aze};function oze(e){const t=Cn();return y.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(s$,e)?s$[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",Ao.error009(e)),null)},[e])}const sze=({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=oze(t);return c?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:h.jsx(c,{color:n,strokeWidth:o})}):null},aG=({defaultColor:e,rfId:t})=>{const n=Dt(a=>a.edges),r=Dt(a=>a.defaultEdgeOptions),i=y.useMemo(()=>hLe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(a=>h.jsx(sze,{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};aG.displayName="MarkerDefinitions";var lze=y.memo(aG);function oG({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,...m}){const[d,g]=y.useState({x:1,y:0,width:0,height:0}),v=Jn(["react-flow__edge-textwrapper",f]),b=y.useRef(null);return y.useEffect(()=>{if(b.current){const w=b.current.getBBox();g({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...m,children:[i&&h.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}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:b,style:r,children:n}),c]}):null}oG.displayName="EdgeText";const uze=y.memo(oG);function aw({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,...m}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...m,d:e,fill:"none",className:Jn(["react-flow__edge-path",m.className])}),f?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&qa(t)&&qa(n)?h.jsx(uze,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function l$({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ke.Left||e===Ke.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function sG({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:i,targetPosition:a=Ke.Top}){const[o,l]=l$({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=l$({pos:a,x1:r,y1:i,x2:e,y2:t}),[m,d,g,v]=TY({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}`,m,d,g,v]}function lG(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})=>{const[C,_,k]=sG({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),O=e.isInternal?void 0:t;return h.jsx(aw,{id:O,path:C,labelX:_,labelY:k,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const cze=lG({isInternal:!1}),uG=lG({isInternal:!0});cze.displayName="SimpleBezierEdge";uG.displayName="SimpleBezierEdgeInternal";function cG(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:d,style:g,sourcePosition:v=Ke.Bottom,targetPosition:b=Ke.Top,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,k,O]=uN({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:b,borderRadius:j==null?void 0:j.borderRadius,offset:j==null?void 0:j.offset,stepPosition:j==null?void 0:j.stepPosition}),A=e.isInternal?void 0:t;return h.jsx(aw,{id:A,path:_,labelX:k,labelY:O,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:w,markerStart:S,interactionWidth:C})})}const fG=cG({isInternal:!1}),dG=cG({isInternal:!0});fG.displayName="SmoothStepEdge";dG.displayName="SmoothStepEdgeInternal";function hG(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(fG,{...n,id:r,pathOptions:y.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const fze=hG({isInternal:!1}),mG=hG({isInternal:!0});fze.displayName="StepEdge";mG.displayName="StepEdgeInternal";function pG(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,j,C]=DY({sourceX:n,sourceY:r,targetX:i,targetY:a}),_=e.isInternal?void 0:t;return h.jsx(aw,{id:_,path:S,labelX:j,labelY:C,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:d,style:g,markerEnd:v,markerStart:b,interactionWidth:w})})}const dze=pG({isInternal:!1}),gG=pG({isInternal:!0});dze.displayName="StraightEdge";gG.displayName="StraightEdgeInternal";function vG(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Ke.Bottom,targetPosition:l=Ke.Top,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:j,interactionWidth:C})=>{const[_,k,O]=PY({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:j==null?void 0:j.curvature}),A=e.isInternal?void 0:t;return h.jsx(aw,{id:A,path:_,labelX:k,labelY:O,label:c,labelStyle:f,labelShowBg:m,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:C})})}const hze=vG({isInternal:!1}),yG=vG({isInternal:!0});hze.displayName="BezierEdge";yG.displayName="BezierEdgeInternal";const u$={default:yG,straight:gG,step:mG,smoothstep:dG,simplebezier:uG},c$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},mze=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,pze=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,f$="react-flow__edgeupdater";function d$({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Jn([f$,`${f$}-${l}`]),cx:mze(t,r,e),cy:pze(n,r,e),r,stroke:"transparent",fill:"transparent"})}function gze({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:m,onReconnectEnd:d,setReconnecting:g,setUpdateHover:v}){const b=Cn(),w=(k,O)=>{if(k.button!==0)return;const{autoPanOnConnect:A,domNode:T,connectionMode:P,connectionRadius:L,lib:I,onConnectStart:F,cancelConnection:$,nodeLookup:X,rfId:D,panBy:V,updateConnection:z}=b.getState(),q=O.type==="target",G=(H,U)=>{g(!1),d==null||d(H,n,O.type,U)},K=H=>f==null?void 0:f(n,H),R=(H,U)=>{g(!0),m==null||m(k,n,O.type),F==null||F(H,U)};dN.onPointerDown(k.nativeEvent,{autoPanOnConnect:A,connectionMode:P,connectionRadius:L,domNode:T,handleId:O.id,nodeId:O.nodeId,nodeLookup:X,isTarget:q,edgeUpdaterType:O.type,lib:I,flowId:D,cancelConnection:$,panBy:V,isValidConnection:(...H)=>{var U,B;return((B=(U=b.getState()).isValidConnection)==null?void 0:B.call(U,...H))??!0},onConnect:K,onConnectStart:R,onConnectEnd:(...H)=>{var U,B;return(B=(U=b.getState()).onConnectEnd)==null?void 0:B.call(U,...H)},onReconnectEnd:G,updateConnection:z,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},S=k=>w(k,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),j=k=>w(k,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>v(!0),_=()=>v(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(d$,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&h.jsx(d$,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:j,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function vze({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:j,disableKeyboardA11y:C}){let _=Dt(ie=>ie.edgeLookup.get(e));const k=Dt(ie=>ie.defaultEdgeOptions);_=k?{...k,..._}:_;let O=_.type||"default",A=(w==null?void 0:w[O])||u$[O];A===void 0&&(j==null||j("011",Ao.error011(O)),O="default",A=(w==null?void 0:w.default)||u$.default);const T=!!(_.focusable||t&&typeof _.focusable>"u"),P=typeof d<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),L=!!(_.selectable||r&&typeof _.selectable>"u"),I=y.useRef(null),[F,$]=y.useState(!1),[X,D]=y.useState(!1),V=Cn(),{zIndex:z,sourceX:q,sourceY:G,targetX:K,targetY:R,sourcePosition:H,targetPosition:U}=Dt(y.useCallback(ie=>{const Se=ie.nodeLookup.get(_.source),Ee=ie.nodeLookup.get(_.target);if(!Se||!Ee)return{zIndex:_.zIndex,...c$};const He=dLe({id:e,sourceNode:Se,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ie.connectionMode,onError:j});return{zIndex:iLe({selected:_.selected,zIndex:_.zIndex,sourceNode:Se,targetNode:Ee,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...He||c$}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),_n),B=y.useMemo(()=>_.markerStart?`url('#${cN(_.markerStart,b)}')`:void 0,[_.markerStart,b]),Q=y.useMemo(()=>_.markerEnd?`url('#${cN(_.markerEnd,b)}')`:void 0,[_.markerEnd,b]);if(_.hidden||q===null||G===null||K===null||R===null)return null;const Z=ie=>{var ke;const{addSelectedEdges:Se,unselectNodesAndEdges:Ee,multiSelectionActive:He}=V.getState();L&&(V.setState({nodesSelectionActive:!1}),_.selected&&He?(Ee({nodes:[],edges:[_]}),(ke=I.current)==null||ke.blur()):Se([e])),i&&i(ie,_)},te=a?ie=>{a(ie,{..._})}:void 0,ae=o?ie=>{o(ie,{..._})}:void 0,re=l?ie=>{l(ie,{..._})}:void 0,ee=c?ie=>{c(ie,{..._})}:void 0,se=f?ie=>{f(ie,{..._})}:void 0,ge=ie=>{var Se;if(!C&&vY.includes(ie.key)&&L){const{unselectNodesAndEdges:Ee,addSelectedEdges:He}=V.getState();ie.key==="Escape"?((Se=I.current)==null||Se.blur(),Ee({edges:[_]})):He([e])}};return h.jsx("svg",{style:{zIndex:z},children:h.jsxs("g",{className:Jn(["react-flow__edge",`react-flow__edge-${O}`,_.className,S,{selected:_.selected,animated:_.animated,inactive:!L&&!i,updating:F,selectable:L}]),onClick:Z,onDoubleClick:te,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?ge:void 0,tabIndex:T?0:void 0,role:_.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":T?`${XY}-${b}`:void 0,ref:I,..._.domAttributes,children:[!X&&h.jsx(A,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:L,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:q,sourceY:G,targetX:K,targetY:R,sourcePosition:H,targetPosition:U,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:B,markerEnd:Q,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),P&&h.jsx(gze,{edge:_,isReconnectable:P,reconnectRadius:m,onReconnect:d,onReconnectStart:g,onReconnectEnd:v,sourceX:q,sourceY:G,targetX:K,targetY:R,sourcePosition:H,targetPosition:U,setUpdateHover:$,setReconnecting:D})]})})}var yze=y.memo(vze);const xze=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xG({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:m,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,onError:_}=Dt(xze,_n),k=rze(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(lze,{defaultColor:e,rfId:n}),k.map(O=>h.jsx(yze,{id:O,edgesFocusable:S,edgesReconnectable:j,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:m,reconnectRadius:d,onDoubleClick:g,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:_,edgeTypes:r,disableKeyboardA11y:w},O))]})}xG.displayName="EdgeRenderer";const bze=y.memo(xG),wze=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Sze({children:e}){const t=Dt(wze);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function jze(e){const t=rw(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Eze=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function _ze(e){const t=Dt(Eze),n=Cn();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Cze(e){return e.connection.inProgress?{...e.connection,to:bg(e.connection.to,e.transform)}:{...e.connection}}function Nze(e){return Cze}function kze(e){const t=Nze();return Dt(t,_n)}const Aze=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Oze({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=Dt(Aze,_n);return!(a&&i&&c)?null:h.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Jn(["react-flow__connection",bY(l)]),children:h.jsx(bG,{style:t,type:n,CustomComponent:r,isValid:l})})})}const bG=({style:e,type:t=El.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:m,toHandle:d,toPosition:g,pointer:v}=kze();if(!i)return;if(n)return h.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:bY(r),toNode:m,toHandle:d,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:g};switch(t){case El.Bezier:[b]=PY(w);break;case El.SimpleBezier:[b]=sG(w);break;case El.Step:[b]=uN({...w,borderRadius:0});break;case El.SmoothStep:[b]=uN(w);break;default:[b]=DY(w)}return h.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};bG.displayName="ConnectionLine";const Tze={};function h$(e=Tze){y.useRef(e),Cn(),y.useEffect(()=>{},[e])}function Pze(){Cn(),y.useRef(!1),y.useEffect(()=>{},[])}function wG({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:m,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:j,selectionKeyCode:C,selectionOnDrag:_,selectionMode:k,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:L,elementsSelectable:I,defaultViewport:F,translateExtent:$,minZoom:X,maxZoom:D,preventScrolling:V,defaultMarkerColor:z,zoomOnScroll:q,zoomOnPinch:G,panOnScroll:K,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:B,onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:ge,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:ke,onReconnect:it,onReconnectStart:Je,onReconnectEnd:We,noDragClassName:zt,noWheelClassName:mt,noPanClassName:Et,disableKeyboardA11y:Kt,nodeExtent:It,rfId:fn,viewport:ce,onViewportChange:xe}){return h$(e),h$(t),Pze(),jze(n),_ze(ce),h.jsx(Y3e,{onPaneClick:Q,onPaneMouseEnter:Z,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:_,selectionMode:k,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:q,zoomOnPinch:G,zoomOnDoubleClick:U,panOnScroll:K,panOnScrollSpeed:R,panOnScrollMode:H,panOnDrag:B,defaultViewport:F,translateExtent:$,minZoom:X,maxZoom:D,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:zt,noWheelClassName:mt,noPanClassName:Et,disableKeyboardA11y:Kt,onViewportChange:xe,isControlledViewport:!!ce,children:h.jsxs(Sze,{children:[h.jsx(bze,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:it,onReconnectStart:Je,onReconnectEnd:We,onlyRenderVisibleElements:L,onEdgeContextMenu:ie,onEdgeMouseEnter:Se,onEdgeMouseMove:Ee,onEdgeMouseLeave:He,reconnectRadius:ke,defaultMarkerColor:z,noPanClassName:Et,disableKeyboardA11y:Kt,rfId:fn}),h.jsx(Oze,{style:w,type:b,component:S,containerStyle:j}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(nze,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:m,nodeClickDistance:ge,onlyRenderVisibleElements:L,noPanClassName:Et,noDragClassName:zt,disableKeyboardA11y:Kt,nodeExtent:It,rfId:fn}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}wG.displayName="GraphView";const Mze=y.memo(wG),m$=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:m,nodeExtent:d,zIndexMode:g="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,j=r??t??[],C=n??e??[],_=m??[0,0],k=d??ap;LY(w,S,j);const O=fN(C,v,b,{nodeOrigin:_,nodeExtent:k,zIndexMode:g});let A=[0,0,1];if(o&&i&&a){const T=yg(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:P,y:L,zoom:I}=g2(T,i,a,c,f,(l==null?void 0:l.padding)??.1);A=[P,L,I]}return{rfId:"1",width:i??0,height:a??0,transform:A,nodes:C,nodesInitialized:O,nodeLookup:v,parentLookup:b,edges:j,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:ap,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_d.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...xY},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ZIe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:yY,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Dze=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:m,nodeExtent:d,zIndexMode:g})=>WLe((v,b)=>{async function w(){const{nodeLookup:S,panZoom:j,fitViewOptions:C,fitViewResolver:_,width:k,height:O,minZoom:A,maxZoom:T}=b();j&&(await WIe({nodes:S,width:k,height:O,panZoom:j,minZoom:A,maxZoom:T},C),_==null||_.resolve(!0),v({fitViewResolver:null}))}return{...m$({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:m,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:g}),setNodes:S=>{const{nodeLookup:j,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:k,fitViewQueued:O,zIndexMode:A}=b(),T=fN(S,j,C,{nodeOrigin:_,nodeExtent:d,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:A});O&&T?(w(),v({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:T})},setEdges:S=>{const{connectionLookup:j,edgeLookup:C}=b();LY(j,C,S),v({edges:S})},setDefaultNodesAndEdges:(S,j)=>{if(S){const{setNodes:C}=b();C(S),v({hasDefaultNodes:!0})}if(j){const{setEdges:C}=b();C(j),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:j,nodeLookup:C,parentLookup:_,domNode:k,nodeOrigin:O,nodeExtent:A,debug:T,fitViewQueued:P,zIndexMode:L}=b(),{changes:I,updatedInternals:F}=bLe(S,C,_,k,O,A,L);F&&(gLe(C,_,{nodeOrigin:O,nodeExtent:A,zIndexMode:L}),P?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),j==null||j(I)))},updateNodePositions:(S,j=!1)=>{const C=[];let _=[];const{nodeLookup:k,triggerNodeChanges:O,connection:A,updateConnection:T,onNodesChangeMiddlewareMap:P}=b();for(const[L,I]of S){const F=k.get(L),$=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(I!=null&&I.position)),X={id:L,type:"position",position:$?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:j};if(F&&A.inProgress&&A.fromNode.id===F.id){const D=Ec(F,A.fromHandle,Ke.Left,!0);T({...A,from:D})}$&&F.parentId&&C.push({id:L,parentId:F.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),_.push(X)}if(C.length>0){const{parentLookup:L,nodeOrigin:I}=b(),F=S2(C,k,L,I);_.push(...F)}for(const L of P.values())_=L(_);O(_)},triggerNodeChanges:S=>{const{onNodesChange:j,setNodes:C,nodes:_,hasDefaultNodes:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=v3e(S,_);C(A)}O&&console.log("React Flow: trigger node changes",S),j==null||j(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:j,setEdges:C,edges:_,hasDefaultEdges:k,debug:O}=b();if(S!=null&&S.length){if(k){const A=y3e(S,_);C(A)}O&&console.log("React Flow: trigger edge changes",S),j==null||j(S)}},addSelectedNodes:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Ru(T,!0));k(A);return}k($f(_,new Set([...S]),!0)),O($f(C))},addSelectedEdges:S=>{const{multiSelectionActive:j,edgeLookup:C,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:O}=b();if(j){const A=S.map(T=>Ru(T,!0));O(A);return}O($f(C,new Set([...S]))),k($f(_,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:j}={})=>{const{edges:C,nodes:_,nodeLookup:k,triggerNodeChanges:O,triggerEdgeChanges:A}=b(),T=S||_,P=j||C,L=[];for(const F of T){if(!F.selected)continue;const $=k.get(F.id);$&&($.selected=!1),L.push(Ru(F.id,!1))}const I=[];for(const F of P)F.selected&&I.push(Ru(F.id,!1));O(L),A(I)},setMinZoom:S=>{const{panZoom:j,maxZoom:C}=b();j==null||j.setScaleExtent([S,C]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:j,minZoom:C}=b();j==null||j.setScaleExtent([C,S]),v({maxZoom:S})},setTranslateExtent:S=>{var j;(j=b().panZoom)==null||j.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:j,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:k}=b();if(!k)return;const O=j.reduce((T,P)=>P.selected?[...T,Ru(P.id,!1)]:T,[]),A=S.reduce((T,P)=>P.selected?[...T,Ru(P.id,!1)]:T,[]);C(O),_(A)},setNodeExtent:S=>{const{nodes:j,nodeLookup:C,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:T}=b();S[0][0]===A[0][0]&&S[0][1]===A[0][1]&&S[1][0]===A[1][0]&&S[1][1]===A[1][1]||(fN(j,C,_,{nodeOrigin:k,nodeExtent:S,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:j,width:C,height:_,panZoom:k,translateExtent:O}=b();return wLe({delta:S,panZoom:k,transform:j,translateExtent:O,width:C,height:_})},setCenter:async(S,j,C)=>{const{width:_,height:k,maxZoom:O,panZoom:A}=b();if(!A)return Promise.resolve(!1);const T=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:O;return await A.setViewport({x:_/2-S*T,y:k/2-j*T,zoom:T},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...xY}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...m$()})}},Object.is);function SG({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:m,nodeExtent:d,zIndexMode:g,children:v}){const[b]=y.useState(()=>Dze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:m,nodeExtent:d,zIndexMode:g}));return h.jsx(QLe,{value:b,children:h.jsx(S3e,{children:v})})}function Rze({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v}){return y.useContext(tw)?h.jsx(h.Fragment,{children:e}):h.jsx(SG,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:m,nodeOrigin:d,nodeExtent:g,zIndexMode:v,children:e})}const Ize={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Lze({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:m,onMoveStart:d,onMoveEnd:g,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:L,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onSelectionChange:X,onSelectionDragStart:D,onSelectionDrag:V,onSelectionDragStop:z,onSelectionContextMenu:q,onSelectionStart:G,onSelectionEnd:K,onBeforeDelete:R,connectionMode:H,connectionLineType:U=El.Bezier,connectionLineStyle:B,connectionLineComponent:Q,connectionLineContainerStyle:Z,deleteKeyCode:te="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=op.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ge=lp()?"Meta":"Control",zoomActivationKeyCode:ie=lp()?"Meta":"Control",snapToGrid:Se,snapGrid:Ee,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:ke,nodesDraggable:it,autoPanOnNodeFocus:Je,nodesConnectable:We,nodesFocusable:zt,nodeOrigin:mt=WY,edgesFocusable:Et,edgesReconnectable:Kt,elementsSelectable:It=!0,defaultViewport:fn=c3e,minZoom:ce=.5,maxZoom:xe=2,translateExtent:Me=ap,preventScrolling:et=!0,nodeExtent:tt,defaultMarkerColor:Xt="#b1b1b7",zoomOnScroll:nn=!0,zoomOnPinch:je=!0,panOnScroll:st=!1,panOnScrollSpeed:xt=.5,panOnScrollMode:ut=ec.Free,zoomOnDoubleClick:Bn=!0,panOnDrag:rn=!0,onPaneClick:hr,onPaneMouseEnter:Gr,onPaneMouseMove:Dr,onPaneMouseLeave:ai,onPaneScroll:Er,onPaneContextMenu:Qe,paneClickDistance:qt=1,nodeClickDistance:me=0,children:Ze,onReconnect:an,onReconnectStart:_t,onReconnectEnd:Pn,onEdgeContextMenu:Xr,onEdgeDoubleClick:mr,onEdgeMouseEnter:er,onEdgeMouseMove:eo,onEdgeMouseLeave:Wr,reconnectRadius:Is=10,onNodesChange:pe,onEdgesChange:pt,noDragClassName:Lt="nodrag",noWheelClassName:on="nowheel",noPanClassName:Oa="nopan",fitView:to,fitViewOptions:wg,connectOnClick:ow,attributionPosition:Sg,proOptions:iu,defaultEdgeOptions:Jd,elevateNodesOnSelect:Ls=!0,elevateEdgesOnSelect:zs=!1,disableKeyboardA11y:$s=!1,autoPanOnConnect:Bs,autoPanOnNodeDrag:Hn,autoPanSpeed:jg,connectionRadius:Eg,isValidConnection:Do,onError:Fs,style:sw,id:eh,nodeDragThreshold:_g,connectionDragThreshold:lw,viewport:Lc,onViewportChange:zc,width:Ta,height:oi,colorMode:Cg="light",debug:uw,onScroll:Us,ariaLabelConfig:Ng,zIndexMode:au="basic",...cw},si){const ou=eh||"1",kg=m3e(Cg),th=y.useCallback(Ro=>{Ro.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Us==null||Us(Ro)},[Us]);return h.jsx("div",{"data-testid":"rf__wrapper",...cw,onScroll:th,style:{...sw,...Ize},ref:si,className:Jn(["react-flow",i,kg]),id:eh,role:"application",children:h.jsxs(Rze,{nodes:e,edges:t,width:Ta,height:oi,fitView:to,fitViewOptions:wg,minZoom:ce,maxZoom:xe,nodeOrigin:mt,nodeExtent:tt,zIndexMode:au,children:[h.jsx(Mze,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:a,edgeTypes:o,connectionLineType:U,connectionLineStyle:B,connectionLineComponent:Q,connectionLineContainerStyle:Z,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:ee,deleteKeyCode:te,multiSelectionKeyCode:ge,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:He,defaultViewport:fn,translateExtent:Me,minZoom:ce,maxZoom:xe,preventScrolling:et,zoomOnScroll:nn,zoomOnPinch:je,zoomOnDoubleClick:Bn,panOnScroll:st,panOnScrollSpeed:xt,panOnScrollMode:ut,panOnDrag:rn,onPaneClick:hr,onPaneMouseEnter:Gr,onPaneMouseMove:Dr,onPaneMouseLeave:ai,onPaneScroll:Er,onPaneContextMenu:Qe,paneClickDistance:qt,nodeClickDistance:me,onSelectionContextMenu:q,onSelectionStart:G,onSelectionEnd:K,onReconnect:an,onReconnectStart:_t,onReconnectEnd:Pn,onEdgeContextMenu:Xr,onEdgeDoubleClick:mr,onEdgeMouseEnter:er,onEdgeMouseMove:eo,onEdgeMouseLeave:Wr,reconnectRadius:Is,defaultMarkerColor:Xt,noDragClassName:Lt,noWheelClassName:on,noPanClassName:Oa,rfId:ou,disableKeyboardA11y:$s,nodeExtent:tt,viewport:Lc,onViewportChange:zc}),h.jsx(h3e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:j,nodesDraggable:it,autoPanOnNodeFocus:Je,nodesConnectable:We,nodesFocusable:zt,edgesFocusable:Et,edgesReconnectable:Kt,elementsSelectable:It,elevateNodesOnSelect:Ls,elevateEdgesOnSelect:zs,minZoom:ce,maxZoom:xe,nodeExtent:tt,onNodesChange:pe,onEdgesChange:pt,snapToGrid:Se,snapGrid:Ee,connectionMode:H,translateExtent:Me,connectOnClick:ow,defaultEdgeOptions:Jd,fitView:to,fitViewOptions:wg,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onNodeDragStart:T,onNodeDrag:P,onNodeDragStop:L,onSelectionDrag:V,onSelectionDragStart:D,onSelectionDragStop:z,onMove:m,onMoveStart:d,onMoveEnd:g,noPanClassName:Oa,nodeOrigin:mt,rfId:ou,autoPanOnConnect:Bs,autoPanOnNodeDrag:Hn,autoPanSpeed:jg,onError:Fs,connectionRadius:Eg,isValidConnection:Do,selectNodesOnDrag:ke,nodeDragThreshold:_g,connectionDragThreshold:lw,onBeforeDelete:R,debug:uw,ariaLabelConfig:Ng,zIndexMode:au}),h.jsx(u3e,{onSelectionChange:X}),Ze,h.jsx(i3e,{proOptions:iu,position:Sg}),h.jsx(r3e,{rfId:ou,disableKeyboardA11y:$s})]})})}var zze=ZY(Lze);function $ze({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Jn(["react-flow__background-pattern",n,r])})}function Bze({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Jn(["react-flow__background-pattern","dots",t])})}var $l;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($l||($l={}));const Fze={[$l.Dots]:1,[$l.Lines]:1,[$l.Cross]:6},Uze=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jG({id:e,variant:t=$l.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:m}){const d=y.useRef(null),{transform:g,patternId:v}=Dt(Uze,_n),b=r||Fze[t],w=t===$l.Dots,S=t===$l.Cross,j=Array.isArray(n)?n:[n,n],C=[j[0]*g[2]||1,j[1]*g[2]||1],_=b*g[2],k=Array.isArray(a)?a:[a,a],O=S?[_,_]:C,A=[k[0]*g[2]||1+O[0]/2,k[1]*g[2]||1+O[1]/2],T=`${v}${e||""}`;return h.jsxs("svg",{className:Jn(["react-flow__background",f]),style:{...c,...iw,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:T,x:g[0]%C[0],y:g[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:w?h.jsx(Bze,{radius:_/2,className:m}):h.jsx($ze,{dimensions:O,lineWidth:i,variant:t,className:m})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}jG.displayName="Background";y.memo(jG);function Hze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function qze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Kze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Yze(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function jy({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Jn(["react-flow__controls-button",t]),...n,children:e})}const Gze=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function EG({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:m,position:d="bottom-left",orientation:g="vertical","aria-label":v}){const b=Cn(),{isInteractive:w,minZoomReached:S,maxZoomReached:j,ariaLabelConfig:C}=Dt(Gze,_n),{zoomIn:_,zoomOut:k,fitView:O}=rw(),A=()=>{_(),a==null||a()},T=()=>{k(),o==null||o()},P=()=>{O(i),l==null||l()},L=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},I=g==="horizontal"?"horizontal":"vertical";return h.jsxs(nw,{className:Jn(["react-flow__controls",I,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??C["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(jy,{onClick:A,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:j,children:h.jsx(Hze,{})}),h.jsx(jy,{onClick:T,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:S,children:h.jsx(qze,{})})]}),n&&h.jsx(jy,{className:"react-flow__controls-fitview",onClick:P,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:h.jsx(Vze,{})}),r&&h.jsx(jy,{className:"react-flow__controls-interactive",onClick:L,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?h.jsx(Yze,{}):h.jsx(Kze,{})}),m]})}EG.displayName="Controls";y.memo(EG);function Xze({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:m,shapeRendering:d,selected:g,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return h.jsx("rect",{className:Jn(["react-flow__minimap-node",{selected:g},f]),x:t,y:n,rx:m,ry:m,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:c},shapeRendering:d,onClick:v?j=>v(j,e):void 0})}const Wze=y.memo(Xze),Qze=e=>e.nodes.map(t=>t.id),YE=e=>e instanceof Function?e:()=>e;function Zze({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Wze,onClick:o}){const l=Dt(Qze,_n),c=YE(t),f=YE(e),m=YE(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(g=>h.jsx(e4e,{id:g,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:m,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},g))})}function Jze({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:m,y:d,width:g,height:v}=Dt(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:j,y:C}=w.internals.positionAbsolute,{width:_,height:k}=Rs(S);return{node:S,x:j,y:C,width:_,height:k}},_n);return!f||f.hidden||!CY(f)?null:h.jsx(l,{x:m,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 e4e=y.memo(Jze);var t4e=y.memo(Zze);const n4e=200,r4e=150,i4e=e=>!e.hidden,a4e=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?_Y(yg(e.nodeLookup,{filter:i4e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},o4e="react-flow__minimap-desc";function _G({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:m,maskStrokeWidth:d,position:g="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:j,inversePan:C,zoomStep:_=1,offsetScale:k=5}){const O=Cn(),A=y.useRef(null),{boundingRect:T,viewBB:P,rfId:L,panZoom:I,translateExtent:F,flowWidth:$,flowHeight:X,ariaLabelConfig:D}=Dt(a4e,_n),V=(e==null?void 0:e.width)??n4e,z=(e==null?void 0:e.height)??r4e,q=T.width/V,G=T.height/z,K=Math.max(q,G),R=K*V,H=K*z,U=k*K,B=T.x-(R-T.width)/2-U,Q=T.y-(H-T.height)/2-U,Z=R+U*2,te=H+U*2,ae=`${o4e}-${L}`,re=y.useRef(0),ee=y.useRef();re.current=K,y.useEffect(()=>{if(A.current&&I)return ee.current=OLe({domNode:A.current,panZoom:I,getTransform:()=>O.getState().transform,getViewScale:()=>re.current}),()=>{var Se;(Se=ee.current)==null||Se.destroy()}},[I]),y.useEffect(()=>{var Se;(Se=ee.current)==null||Se.update({translateExtent:F,width:$,height:X,inversePan:C,pannable:w,zoomStep:_,zoomable:S})},[w,S,C,_,F,$,X]);const se=v?Se=>{var ke;const[Ee,He]=((ke=ee.current)==null?void 0:ke.pointer(Se))||[0,0];v(Se,{x:Ee,y:He})}:void 0,ge=b?y.useCallback((Se,Ee)=>{const He=O.getState().nodeLookup.get(Ee).internals.userNode;b(Se,He)},[]):void 0,ie=j??D["minimap.ariaLabel"];return h.jsx(nw,{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 m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*K:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Jn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:V,height:z,viewBox:`${B} ${Q} ${Z} ${te}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:A,onClick:se,children:[ie&&h.jsx("title",{id:ae,children:ie}),h.jsx(t4e,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-U},${Q-U}h${Z+U*2}v${te+U*2}h${-Z-U*2}z
        M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}_G.displayName="MiniMap";y.memo(_G);const s4e=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,l4e={[Od.Line]:"right",[Od.Handle]:"bottom-right"};function u4e({nodeId:e,position:t,variant:n=Od.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:j}){const C=nG(),_=typeof e=="string"?e:C,k=Cn(),O=y.useRef(null),A=n===Od.Handle,T=Dt(y.useCallback(s4e(A&&v),[A,v]),_n),P=y.useRef(null),L=t??l4e[n];y.useEffect(()=>{if(!(!O.current||!_))return P.current||(P.current=qLe({domNode:O.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:F,transform:$,snapGrid:X,snapToGrid:D,nodeOrigin:V,domNode:z}=k.getState();return{nodeLookup:F,transform:$,snapGrid:X,snapToGrid:D,nodeOrigin:V,paneDomNode:z}},onChange:(F,$)=>{const{triggerNodeChanges:X,nodeLookup:D,parentLookup:V,nodeOrigin:z}=k.getState(),q=[],G={x:F.x,y:F.y},K=D.get(_);if(K&&K.expandParent&&K.parentId){const R=K.origin??z,H=F.width??K.measured.width??0,U=F.height??K.measured.height??0,B={id:K.id,parentId:K.parentId,rect:{width:H,height:U,...NY({x:F.x??K.position.x,y:F.y??K.position.y},{width:H,height:U},K.parentId,D,R)}},Q=S2([B],D,V,z);q.push(...Q),G.x=F.x?Math.max(R[0]*H,F.x):void 0,G.y=F.y?Math.max(R[1]*U,F.y):void 0}if(G.x!==void 0&&G.y!==void 0){const R={id:_,type:"position",position:{...G}};q.push(R)}if(F.width!==void 0&&F.height!==void 0){const H={id:_,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};q.push(H)}for(const R of $){const H={...R,type:"position"};q.push(H)}X(q)},onEnd:({width:F,height:$})=>{const X={id:_,type:"dimensions",resizing:!1,dimensions:{width:F,height:$}};k.getState().triggerNodeChanges([X])}})),P.current.update({controlPosition:L,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:m},keepAspectRatio:d,resizeDirection:g,onResizeStart:w,onResize:S,onResizeEnd:j,shouldResize:b}),()=>{var F;(F=P.current)==null||F.destroy()}},[L,l,c,f,m,d,w,S,j,b]);const I=L.split("-");return h.jsx("div",{className:Jn(["react-flow__resize-control","nodrag",...I,n,r]),ref:O,style:{...i,scale:T,...o&&{[A?"backgroundColor":"borderColor"]:o}},children:a})}y.memo(u4e);const CG=180,c4e=70,f0=24,f4e=60;function d4e({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${NR(e.status)}`;return h.jsxs("div",{className:t,children:[h.jsx(Td,{type:"target",position:Ke.Top}),h.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&h.jsxs("div",{className:"agent-flow-meta",children:[h.jsx("span",{className:`status-dot ${NR(e.status)}`}),h.jsx("span",{children:e.status}),e.duration_ms!=null&&h.jsx("span",{children:X0(e.duration_ms)}),e.exit_code!=null&&h.jsxs("span",{children:["exit ",e.exit_code]})]}),h.jsx(Td,{type:"source",position:Ke.Bottom})]})}const h4e={agent:d4e};function m4e(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(m=>({id:`pending-${m.span_id}`,children:[]}));return{id:l,children:[...c,...f]}}return(r.get(null)||[]).map(a)}function d0(e){return e.children.length===0?CG:e.children.reduce((t,n)=>t+d0(n)+f0,-f0)}function NG(e,t,n,r){if(r.set(e.id,{x:t-CG/2,y:n}),e.children.length===0)return;const i=d0(e);let a=t-i/2;for(const o of e.children){const l=d0(o),c=a+l/2;NG(o,c,n+c4e+f4e,r),a+=l+f0}}function p4e({treeData:e,connected:t}){return h.jsx(SG,{children:h.jsx(g4e,{treeData:e,connected:t})})}function g4e({treeData:e,connected:t}){const{fitView:n}=rw(),r=y.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=y.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=m4e(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=d0(v),w=c+b/2;NG(v,w,0,l),c+=b+f0*2}const f=new Map(e.nodes.map(v=>[v.agent_id,v])),m=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=m.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:Cd.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:Cd.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:d,flowEdges:g}},[e]);return e?h.jsxs("div",{children:[h.jsxs("div",{className:"react-flow-wrapper",children:[h.jsx(zze,{nodes:i,edges:a,nodeTypes:h4e,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),h.jsx("button",{className:"tree-reset-btn",onClick:r,children:"Reset View"})]}),e.denied_delegations.length>0&&h.jsxs("div",{className:"denied-list",children:[h.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(o=>h.jsxs("span",{className:"denied-item",children:[o.role," (",o.reason,")"]},o.span_id))]})]}):h.jsx("div",{className:"agent-tree",children:h.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Ou=18,p$=10;function v4e({runId:e,agents:t,active:n,agentLogs:r,wsConnected:i,subscribeLogs:a,unsubscribeLogs:o}){var H;const l=Object.keys(t),c=l.find(U=>t[U].parent===null)??l[0]??"",[f,m]=y.useState(c),d=y.useRef(null);y.useEffect(()=>{!f||!i||(d.current&&d.current!==f&&o(d.current),d.current=f,a(f))},[f,i,a,o]);const g=r.get(f),v=(g==null?void 0:g.lines)??[],b=(g==null?void 0:g.done)??!1,w=i,[S,j]=y.useState(""),C=S.toLowerCase(),_=S?v.reduce((U,B,Q)=>(B.toLowerCase().includes(C)&&U.push(Q),U),[]):[],k=y.useRef(null),[O,A]=y.useState(0),[T,P]=y.useState(0),[L,I]=y.useState(!0),F=y.useRef(0),$=v.length*Ou,X=Math.max(0,Math.floor(O/Ou)-p$),D=Math.ceil(T/Ou)+p$*2,V=Math.min(v.length,X+D),z=v.slice(X,V),q=String(v.length).length,G=y.useCallback(()=>{const U=k.current;if(!U)return;A(U.scrollTop),P(U.clientHeight);const B=U.scrollTop+U.clientHeight>=U.scrollHeight-Ou*2;I(B)},[]);y.useEffect(()=>{const U=k.current;U&&P(U.clientHeight)},[]),y.useEffect(()=>{if(L&&v.length>F.current){const U=k.current;U&&(U.scrollTop=U.scrollHeight)}F.current=v.length},[v.length,L]);const K=()=>{const U=k.current;U&&(U.scrollTop=U.scrollHeight,I(!0))},R=async()=>{try{const U=await fetch(`/api/sessions/${e}/logs/${f}/full`);if(!U.ok)return;const B=await U.text(),Q=new Blob([B],{type:"text/plain"}),Z=URL.createObjectURL(Q),te=document.createElement("a");te.href=Z,te.download=`${f}.log`,te.click(),URL.revokeObjectURL(Z)}catch{}};return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[l.length>1&&h.jsxs(pa,{value:f,onValueChange:m,children:[h.jsx(va,{className:"w-[220px]",children:h.jsx(ga,{})}),h.jsx(ya,{children:l.map(U=>h.jsxs(An,{value:U,children:[t[U].role," (",U.slice(0,8),")"]},U))})]}),l.length===1&&h.jsxs("span",{className:"text-sm text-muted-foreground",children:[(H=t[f])==null?void 0:H.role," (",f.slice(0,8),")"]}),h.jsxs("div",{className:"relative ml-auto",children:[h.jsx(Sk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),h.jsx(Xe,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:S,onChange:U=>j(U.target.value)})]}),S&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[_.length," match",_.length!==1?"es":""]}),h.jsxs(we,{variant:"outline",size:"sm",onClick:R,children:[h.jsx(Mp,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),h.jsx(y4e,{connected:w,done:b,active:n})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{ref:k,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:G,children:v.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!b?"Waiting for log output...":"No log output."}):h.jsx("div",{style:{height:$,position:"relative"},children:h.jsx("div",{style:{position:"absolute",top:X*Ou,left:0,right:0},children:z.map((U,B)=>{const Q=X+B,Z=S&&U.toLowerCase().includes(C);return h.jsxs("div",{className:Z?"bg-yellow-900/30":void 0,style:{height:Ou,lineHeight:`${Ou}px`,display:"flex",whiteSpace:"pre"},children:[h.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(q+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:Q+1}),h.jsx("span",{children:Z?h.jsx(x4e,{line:U,search:C}):U})]},Q)})})})}),!L&&v.length>0&&h.jsxs(we,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:K,children:[h.jsx(RF,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function y4e({connected:e,done:t,active:n}){return t||!n?h.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):h.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e?"animate-pulse bg-green-500":"bg-orange-400"}`}),e?"Live":"Connecting..."]})}function x4e({line:e,search:t}){const n=[],r=e.toLowerCase();let i=0,a=r.indexOf(t,i),o=0;for(;a!==-1;)a>i&&n.push(e.slice(i,a)),n.push(h.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(a,a+t.length)},o++)),i=a+t.length,a=r.indexOf(t,i);return i<e.length&&n.push(e.slice(i)),h.jsx(h.Fragment,{children:n})}function b4e({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=y.useState([]),[a,o]=y.useState(""),l=y.useRef(null),c=y.useRef(new Set);y.useEffect(()=>{!t||t.length===0||i(d=>{const g=new Set(d.map(w=>w.id)),v=t.filter(w=>!g.has(w.id));if(v.length===0)return d;const b=[...v,...d];b.sort((w,S)=>w.timestamp-S.timestamp);for(const w of b)c.current.add(w.id);return b})},[t]),y.useEffect(()=>{if(e.length===0)return;const d=[];for(const g of e)c.current.has(g.request_id)||(c.current.add(g.request_id),d.push({id:g.request_id,role:"agent",text:g.question,timestamp:g.timestamp}));d.length>0&&i(g=>[...g,...d])},[e]),y.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({behavior:"smooth"})},[r]);const f=(d,g)=>{if(!d.trim())return;const v=`user-${g.request_id}`;c.current.has(v)||(c.current.add(v),i(b=>[...b,{id:v,role:"user",text:d.trim(),timestamp:Date.now()/1e3}])),o(""),n(g.request_id,d.trim())},m=e.length>0?e[0]:null;return h.jsx(Nn,{className:"flex h-[500px] flex-col",children:h.jsxs(kn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[h.jsx(W0,{className:"flex-1",children:h.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[h.jsx(Dp,{className:"h-8 w-8"}),h.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 h.jsxs("div",{children:[h.jsx("div",{className:Te("flex",d.role==="user"?"justify-end":"justify-start"),children:h.jsx("div",{className:Te("max-w-[80%] rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:h.jsx(Li,{content:d.text,className:"whitespace-pre-wrap"})})}),(g==null?void 0:g.choices)&&g.choices.length>0&&h.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:g.choices.map(v=>h.jsx(we,{variant:"outline",size:"sm",onClick:()=>f(v,g),children:v},v))})]},d.id)}),h.jsx("div",{ref:l})]})}),e.length>0&&h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs(ht,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-400",children:[h.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-amber-500"}),e.length===1?"Waiting for response":`${e.length} questions waiting`]})}),h.jsxs("form",{className:"flex gap-2",onSubmit:d=>{d.preventDefault(),m&&f(a,m)},children:[h.jsx(Xe,{value:a,onChange:d=>o(d.target.value),placeholder:m?"Type your response...":"Waiting for agent question...",disabled:!m}),h.jsx(we,{type:"submit",size:"icon",disabled:!m||!a.trim(),children:h.jsx(mse,{className:"h-4 w-4"})})]})]})})}const GE=1e4;function E2(e,t){const[n,r]=y.useState([]),[i,a]=y.useState([]),[o,l]=y.useState([]),[c,f]=y.useState(null),[m,d]=y.useState(!1),[g,v]=y.useState(new Map),b=y.useRef(null),w=y.useRef(0),S=y.useRef(void 0),j=y.useRef(1e3),C=y.useRef(!1),_=y.useRef(new Set),k=y.useCallback((T,P)=>{var L;(L=b.current)==null||L.send(JSON.stringify({type:"ask_user_response",request_id:T,text:P}))},[]),O=y.useCallback((T,P)=>{var L;_.current.add(T),(L=b.current)==null||L.send(JSON.stringify({type:"subscribe_logs",agent_id:T,...P!=null&&{offset:P}}))},[]),A=y.useCallback(T=>{var P;_.current.delete(T),v(L=>{const I=new Map(L);return I.delete(T),I}),(P=b.current)==null||P.send(JSON.stringify({type:"unsubscribe_logs",agent_id:T}))},[]);return y.useEffect(()=>{r([]),a([]),l([]),f(null),v(new Map),_.current.clear(),C.current=!1,w.current=0},[e]),y.useEffect(()=>{if(!t){r([]),d(!1);return}function T(){if(C.current)return;const L=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,I=new WebSocket(L);b.current=I,I.onopen=()=>{d(!0),j.current=1e3,I.send(JSON.stringify({type:"init",trace_offset:w.current}));for(const F of _.current)I.send(JSON.stringify({type:"subscribe_logs",agent_id:F}))},I.onmessage=F=>{let $;try{$=JSON.parse(F.data)}catch{return}switch($.type){case"tree_snapshot":case"tree_delta":{const{type:X,...D}=$;f(D);break}case"trace_snapshot":Array.isArray($.events)&&l($.events),typeof $.next_offset=="number"&&(w.current=$.next_offset);break;case"trace_delta":Array.isArray($.events)&&l(X=>[...X,...$.events]),typeof $.next_offset=="number"&&(w.current=$.next_offset);break;case"ask_user":{const X=$;r(D=>D.some(V=>V.request_id===X.request_id)?D:[...D,X]);break}case"ask_user_resolved":typeof $.request_id=="string"?r(X=>X.filter(D=>D.request_id!==$.request_id)):r([]);break;case"chat_history":Array.isArray($.messages)&&a($.messages);break;case"agent_log_snapshot":{const X=$.agent_id,D=$.lines??[],V=$.offset??0;v(z=>{const q=new Map(z);return q.set(X,{lines:D.slice(-GE),offset:V,done:!1}),q});break}case"agent_log_delta":{const X=$.agent_id,D=$.lines??[],V=$.offset??0;D.length>0&&v(z=>{const q=new Map(z),G=q.get(X),K=[...(G==null?void 0:G.lines)??[],...D];return q.set(X,{lines:K.length>GE?K.slice(-GE):K,offset:V,done:(G==null?void 0:G.done)??!1}),q});break}case"agent_log_done":{const X=$.agent_id;v(D=>{const V=new Map(D),z=V.get(X);return z&&V.set(X,{...z,done:!0}),V});break}case"stream_complete":C.current=!0,r([]),I.close(),b.current=null,d(!1);break}},I.onclose=()=>{b.current=null,d(!1),!C.current&&(S.current=setTimeout(()=>{j.current=Math.min(j.current*2,15e3),T()},j.current))},I.onerror=()=>{I.close()}}return T(),()=>{var P;(P=b.current)==null||P.close(),b.current=null,S.current&&clearTimeout(S.current)}},[e,t]),{pendingAskUsers:n,chatMessages:i,traceEvents:o,treeData:c,connected:m,agentLogs:g,respond:k,subscribeLogs:O,unsubscribeLogs:A}}function w4e(){return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-64"}),h.jsx(ln,{className:"h-32 rounded-lg"}),h.jsx(ln,{className:"h-64 rounded-lg"})]})}function S4e(){const{projectId:e,runId:t}=bp(),[n]=wZ(),r=Number(e),i=I=>I==="starting"||I==="running",a=ule(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);y.useEffect(()=>{if(!l)return;const I=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(I)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:f,chatMessages:m,traceEvents:d,treeData:g,connected:v,agentLogs:b,respond:w,subscribeLogs:S,unsubscribeLogs:j}=E2(t??"",!0),C=g??(o==null?void 0:o.tree)??null,_=(o==null?void 0:o.events)??[],k=d.length>0?d:_,[O,A]=y.useState(void 0);if(y.useEffect(()=>{f.length>0&&A("chat")},[f]),a.isLoading)return h.jsx(w4e,{});if(a.error)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsx("span",{children:"Session not found"})]});const T=A4e(k),P=k4e(k),L=n.get("tab")??(l?"agent-tree":"overview");return h.jsxs("div",{className:"space-y-6",children:[h.jsx(j4e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),h.jsx(C4e,{session:o}),h.jsxs(Fp,{value:O??L,onValueChange:A,children:[h.jsxs(Up,{children:[h.jsx(or,{value:"overview",children:"Overview"}),c&&h.jsxs(or,{value:"chat",className:"relative",children:["Chat",f.length>0&&h.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),h.jsx(or,{value:"agent-tree",children:"Agent Tree"}),h.jsx(or,{value:"logs",children:"Logs"}),h.jsxs(or,{value:"trace",children:["Trace",k.length>0&&` (${k.length})`]}),h.jsxs(or,{value:"artifacts",children:["Artifacts",T.length>0&&` (${T.length})`]})]}),h.jsxs(sr,{value:"overview",className:"space-y-4",children:[o.user_task&&h.jsx(XE,{label:"User Task",defaultOpen:!0,children:h.jsx(g$,{content:o.user_task})}),o.task&&h.jsx(XE,{label:"Task",defaultOpen:!o.user_task,children:h.jsx(g$,{content:o.task})}),P&&h.jsx(XE,{label:"Output",defaultOpen:!0,children:h.jsx(N4e,{runId:o.run_id,hash:P})}),!o.user_task&&!o.task&&!P&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&h.jsx(sr,{value:"chat",children:h.jsx(b4e,{pendingAskUsers:f,initialMessages:m,respond:w})}),h.jsx(sr,{value:"agent-tree",children:h.jsx(p4e,{treeData:C,connected:v})}),h.jsx(sr,{value:"logs",children:Object.keys(o.agents).length>0?h.jsx(v4e,{runId:o.run_id,agents:o.agents,active:l,agentLogs:b,wsConnected:v,subscribeLogs:S,unsubscribeLogs:j}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),h.jsx(sr,{value:"trace",children:k.length>0?h.jsx(D4e,{events:k,runId:o.run_id}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),h.jsx(sr,{value:"artifacts",children:T.length>0?h.jsx(O4e,{artifacts:T,runId:o.run_id}):h.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function j4e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=y.useState(!1),o=Pk(),l=e.status==="starting"||e.status==="running";return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(we,{variant:"outline",size:"sm",asChild:!0,children:h.jsxs(lr,{to:t===0?"/imu":`/projects/${t}`,children:[h.jsx(z0,{className:"mr-2 h-4 w-4"}),"Back"]})}),h.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),h.jsx("div",{className:"flex gap-2",children:l&&(i?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(we,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):h.jsxs(we,{variant:"destructive",onClick:()=>a(!0),children:[h.jsx(BF,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function E4e({status:e}){const t=_4e(e);return h.jsxs(ht,{variant:"outline",className:Te("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&h.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function _4e(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 C4e({session:e}){return h.jsx(Nn,{children:h.jsx(kn,{className:"pt-6",children:h.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),h.jsx("dd",{children:h.jsx(E4e,{status:e.status})}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),h.jsx("dd",{children:e.role}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),h.jsx("dd",{children:e.runtime}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),h.jsx("dd",{children:e.isolation}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),h.jsx("dd",{children:ix(e.started_at)}),e.ended_at&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),h.jsx("dd",{children:ix(e.ended_at)})]}),h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),h.jsx("dd",{children:X0(e.duration_ms)}),e.exit_code!==null&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),h.jsx("dd",{children:e.exit_code})]})]})})})}function XE({label:e,defaultOpen:t,children:n}){return h.jsx(zp,{defaultOpen:t,children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs($p,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[h.jsx(Tp,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),e]}),h.jsx(Bp,{children:h.jsx(Nn,{children:h.jsx(kn,{className:"pt-4",children:n})})})]})})}function g$({content:e}){const[t,n]=y.useState("markdown");return h.jsxs(h.Fragment,{children:[h.jsx(nb,{view:t,onChange:n}),t==="markdown"?h.jsx(Li,{content:e,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:e})]})}function N4e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown");return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(c=>{if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return c.text()}).then(r).catch(c=>a(c.message))},[e,t]),i?h.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?h.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx(nb,{view:o,onChange:l}),o==="markdown"?h.jsx(Li,{content:n,className:"text-sm"}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-3 font-mono text-xs leading-relaxed",children:n})]})}function k4e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function A4e(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 O4e({artifacts:e,runId:t}){return h.jsx("div",{className:"space-y-1",children:e.map(n=>h.jsxs(zp,{children:[h.jsxs($p,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[h.jsx(Tp,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),h.jsx("span",{className:"font-medium text-primary",children:n.label})]}),h.jsx(Bp,{children:h.jsx(T4e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function T4e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null);return y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?h.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?h.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):h.jsx(W0,{className:"max-h-[300px] overflow-hidden",children:h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-b-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed",children:n})})}function P4e({event:e}){const t=M4e(e);return h.jsx(ht,{variant:"outline",className:Te("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:e})}function M4e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function D4e({events:e,runId:t}){const[n,r]=y.useState(null);return h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Time"}),h.jsx(Fe,{children:"Event"}),h.jsx(Fe,{children:"Span"}),h.jsx(Fe,{children:"Details"})]})}),h.jsx(ma,{children:e.map((i,a)=>h.jsxs(yn,{children:[h.jsx(ze,{className:"text-sm text-muted-foreground",children:ix(i.ts)}),h.jsx(ze,{children:h.jsx(P4e,{event:i.event})}),h.jsx(ze,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),h.jsx(ze,{className:"max-w-[400px] text-sm",children:I4e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),h.jsx(_a,{open:!!n,onOpenChange:()=>r(null),children:h.jsxs(Ca,{className:"max-w-3xl overflow-hidden",children:[h.jsx(Na,{children:h.jsx(ka,{children:n==null?void 0:n.label})}),n&&h.jsx(R4e,{runId:t,hash:n.hash})]})})]})}function R4e({runId:e,hash:t}){const[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState("markdown"),c=y.useRef(null),f=y.useRef(null);return y.useEffect(()=>{const m=d=>{const g=f.current??c.current;if(g&&(d.metaKey||d.ctrlKey)&&d.key==="a"){d.preventDefault();const v=window.getSelection();if(v){v.removeAllRanges();const b=document.createRange();b.selectNodeContents(g),v.addRange(b)}}};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),y.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(m=>{if(!m.ok)throw new Error(`${m.status} ${m.statusText}`);return m.text()}).then(r).catch(m=>a(m.message))},[e,t]),h.jsx("div",{ref:c,className:"space-y-2",children:i?h.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):h.jsxs(h.Fragment,{children:[h.jsx(nb,{view:o,onChange:l}),h.jsx("div",{ref:f,className:"max-h-[60vh] overflow-y-auto",children:o==="markdown"?h.jsx("div",{className:"p-4",children:h.jsx(Li,{content:n,className:"text-sm"})}):h.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})]})})}function I4e(e,t){const n=e.data,r=[];for(const[a,o]of Object.entries(n))if(a.endsWith("_ref")&&o){const l=a.replace(/_ref$/,"");r.push(h.jsx("button",{className:"rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 font-mono text-xs text-primary hover:bg-primary/10",onClick:()=>t(String(o),l),children:l},a))}const i=[];for(const[a,o]of Object.entries(n)){if(a.endsWith("_ref")||o==null||o==="")continue;const l=a==="duration_ms"?X0(o):Array.isArray(o)?o.join(", "):String(o);i.push(h.jsxs("span",{children:[h.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),h.jsx("span",{children:l})]},a))}return h.jsxs(h.Fragment,{children:[r.length>0&&h.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&h.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function L4e(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 z4e({status:e}){return e==="running"||e==="starting"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[h.jsx(Pr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[h.jsx(Pp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[h.jsx($0,{className:"h-3 w-3"}),"Failed"]}):h.jsx(ht,{variant:"outline",children:e})}function $4e({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),h.jsx(z4e,{status:e.status}),e.duration_ms!==null&&h.jsx("span",{className:"text-xs text-muted-foreground",children:L4e(e.duration_ms)}),h.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),h.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?h.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?h.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):h.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),h.jsxs("a",{href:`/projects/${t}/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[h.jsx(B0,{className:"h-3 w-3"}),"View session"]})]})}function B4e({task:e}){return h.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),h.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:h.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function F4e(){var Is;const{projectId:e,conversationId:t}=bp(),n=Number(e),r=Number(t),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState([]),[m,d]=y.useState(!1),[g,v]=y.useState(!1),[b,w]=y.useState(!1),[S,j]=y.useState(""),[C,_]=y.useState(!1),[k,O]=y.useState(""),[A,T]=y.useState(!1),[P,L]=y.useState(""),[I,F]=y.useState(""),[$,X]=y.useState(""),[D,V]=y.useState(""),[z,q]=y.useState(""),[G,K]=y.useState(""),[R,H]=y.useState(""),[U,B]=y.useState(!0),[Q,Z]=y.useState(""),te=y.useRef(null),ae=y.useRef(null),re=y.useRef(0),ee=y.useRef(void 0),se=y.useRef(0),ge=y.useRef(null),ie=y.useRef(null),Se=lt(),{data:Ee}=Bd(n),He=(Ee??[]).filter(pe=>pe.type==="roles").map(pe=>pe.name),ke=_k(n),it=H0(n),Je=(Is=ke.data)==null?void 0:Is.merged,{data:We,isLoading:zt,error:mt,fetchPreviousPage:Et,hasPreviousPage:Kt,isFetchingPreviousPage:It}=nx(r),fn=(We==null?void 0:We.pages.flatMap(pe=>pe.sessions))??[],ce=We==null?void 0:We.pages[We.pages.length-1],xe=fn[fn.length-1],Me=(xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="starting";nx(r,{refetchInterval:Me?2e3:!1});const et=XF(r),tt=Pk(),Xt=WF(r),nn=Nk(n),{pendingAskUsers:je,chatMessages:st,respond:xt}=E2((xe==null?void 0:xe.run_id)??"",Me&&U),ut=o.trim()&&!He.includes(o.trim())?"Role not found in installed roles":"",Bn=Me;y.useEffect(()=>{if(!te.current)return;const pe=te.current.scrollHeight-re.current;pe>0&&(te.current.scrollTop+=pe,re.current=0)},[We==null?void 0:We.pages.length]),y.useEffect(()=>{te.current&&((xe==null?void 0:xe.run_id)!==ee.current&&(te.current.scrollTop=te.current.scrollHeight),ee.current=xe==null?void 0:xe.run_id)},[xe==null?void 0:xe.run_id]),y.useEffect(()=>{te.current&&(st.length>se.current&&(te.current.scrollTop=te.current.scrollHeight),se.current=st.length)},[st.length]),y.useEffect(()=>{if(!ae.current||!te.current)return;const pe=new IntersectionObserver(([pt])=>{var Lt;pt.isIntersecting&&Kt&&!It&&(re.current=((Lt=te.current)==null?void 0:Lt.scrollHeight)??0,Et())},{root:te.current,threshold:.1});return pe.observe(ae.current),()=>pe.disconnect()},[Kt,It,Et]);const rn=(Ee??[]).filter(pe=>pe.type==="agents").map(pe=>pe.name),hr=[...new Set((Ee??[]).filter(pe=>pe.type==="memories").map(pe=>pe.name)),"none"].sort(),Gr=P.trim()&&rn.length>0&&!rn.includes(P.trim())?"Runtime not found in installed agents":"",Dr=I.trim()&&hr.length>0&&!hr.includes(I.trim())?"Memory not found in installed providers":"",ai=!!Gr||!!Dr,Er=[P,I,$,D,z,G,R].filter(pe=>pe.trim()).length,Qe=pe=>f(pt=>pt.includes(pe)?pt.filter(Lt=>Lt!==pe):[...pt,pe]),qt=pe=>{pe.preventDefault(),v(!0)},me=pe=>{pe.preventDefault(),v(!0)},Ze=pe=>{pe.preventDefault(),v(!1)},an=async pe=>{pe.preventDefault(),v(!1);const pt=Array.from(pe.dataTransfer.files);if(pt.length){w(!0);try{const Lt=await Pe.upload(`/projects/${n}/files`,pt);Se.invalidateQueries({queryKey:Oe.projects.files(n)}),f(on=>{const Oa=Lt.map(to=>to.path).filter(to=>!on.includes(to));return[...on,...Oa]})}catch{}finally{w(!1)}}};function _t(pe){pe.preventDefault();const pt=i.trim();if(!pt||ut||ai)return;const Lt={task:pt,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:U,system_prompt:$.trim()||void 0,runtime:P.trim()||void 0,memory:I.trim()||void 0,max_num_delegations:D.trim()?Number(D):void 0,cache_delegations:z?z==="true":void 0,cache_max_entries:G.trim()?Number(G):void 0,cache_ttl_seconds:R.trim()?Number(R):void 0};et.mutate(Lt,{onSuccess:()=>{a(""),f([]),d(!1),setTimeout(()=>{var on;return(on=ie.current)==null?void 0:on.focus()},0)}})}function Pn(pe,pt){pt.trim()&&(xt(pe.request_id,pt.trim()),Z(""))}function Xr(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),_t(pe))}function mr(){O((ce==null?void 0:ce.title)??""),_(!0),setTimeout(()=>{var pe;return(pe=ge.current)==null?void 0:pe.select()},0)}function er(){const pe=k.trim();nn.mutate({conversationId:r,title:pe||null}),_(!1)}function eo(pe){pe.key==="Enter"&&(pe.preventDefault(),er()),pe.key==="Escape"&&_(!1)}if(mt)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",mt.message]})]});const Wr=(ce==null?void 0:ce.title)??`Conversation #${r}`;return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[h.jsx("div",{className:"flex items-center gap-3",children:C?h.jsx(Xe,{ref:ge,value:k,onChange:pe=>O(pe.target.value),onBlur:er,onKeyDown:eo,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):h.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:mr,title:"Click to rename",children:Wr})}),fn.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[fn.length," session",fn.length!==1?"s":""]})]}),(ce==null?void 0:ce.parent)&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[h.jsx(Op,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:"Spawned from"}),h.jsxs(lr,{to:`/imu/${ce.parent.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[ce.parent.title||`imu conversation #${ce.parent.id}`,h.jsx(yR,{className:"h-3 w-3"})]})]}),(ce==null?void 0:ce.children)&&ce.children.length>0&&h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground bg-muted/50 rounded px-3 py-1.5 mb-3",children:[h.jsx(B0,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:"Delegated to:"}),ce.children.map(pe=>h.jsxs(lr,{to:`/projects/${pe.project_id}/conversations/${pe.id}`,className:"text-primary hover:underline inline-flex items-center gap-1",children:[pe.project_name,": ",pe.title||`#${pe.id}`,h.jsx(yR,{className:"h-3 w-3"})]},pe.id))]}),h.jsx("div",{ref:te,className:"min-h-0 flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[h.jsx("div",{ref:ae,className:"h-1"}),It&&h.jsx("div",{className:"flex justify-center py-2",children:h.jsx(Pr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!zt&&fn.length===0&&h.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),fn.map((pe,pt)=>{const Lt=pt===fn.length-1;return h.jsxs("div",{className:"space-y-4",children:[(pe.user_task??pe.task)&&h.jsx(B4e,{task:pe.user_task??pe.task}),(Lt&&Me?st:pe.chat_messages??[]).map(on=>h.jsx("div",{className:`flex ${on.role==="user"?"justify-end":"justify-start"}`,children:h.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${on.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:h.jsx(Li,{content:on.text,className:"whitespace-pre-wrap"})})},on.id)),h.jsx($4e,{session:pe,projectId:n})]},pe.run_id)})]})}),(ce==null?void 0:ce.pending_task)&&(()=>{const pe=ce.pending_task.split(`

`).filter(Boolean);return h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:h.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[pe.map((pt,Lt)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),h.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",pe.length>1?` (${Lt+1}/${pe.length})`:"",":"," ",h.jsx("span",{className:"text-foreground",children:pt.split(`
`)[0]})]})]},Lt)),h.jsx("div",{className:"flex justify-end",children:h.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>Xt.mutate(),disabled:Xt.isPending,children:[h.jsx(uc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),je.length>0&&h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:h.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:je.map(pe=>h.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[h.jsx(Li,{content:pe.question,className:"text-sm font-medium"}),pe.why&&h.jsx(Li,{content:pe.why,className:"text-xs text-muted-foreground"}),pe.choices&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:pe.choices.map(pt=>h.jsx(we,{type:"button",size:"sm",variant:"outline",onClick:()=>Pn(pe,pt),children:pt},pt))}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{value:Q,onChange:pt=>Z(pt.target.value),onKeyDown:pt=>{pt.key==="Enter"&&!pt.shiftKey&&(pt.preventDefault(),Pn(pe,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),h.jsx(we,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>Pn(pe,Q),children:h.jsx(tx,{className:"h-4 w-4"})})]})]},pe.request_id))})}),h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:h.jsxs("form",{onSubmit:_t,className:"mx-auto max-w-2xl space-y-2",children:[h.jsxs("div",{className:"relative",onDragOver:qt,onDragEnter:me,onDragLeave:Ze,onDrop:an,children:[h.jsx(Eo,{ref:ie,value:i,onChange:pe=>a(pe.target.value),onKeyDown:Xr,placeholder:Bn?"Queue a follow-up task… (Enter to queue, runs after current session)":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:et.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(g||b)&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:b?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(U0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(it.data??[]).length>0&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(dd,{children:[h.jsx(hd,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[h.jsx(wk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),h.jsxs(md,{align:"start",className:"w-64",onCloseAutoFocus:pe=>pe.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files…",value:S,onChange:pe=>j(pe.target.value),className:"h-7 text-xs",onKeyDown:pe=>pe.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(it.data??[]).filter(pe=>pe.path.toLowerCase().includes(S.toLowerCase())).map(pe=>h.jsx(Tk,{checked:c.includes(pe.path),onCheckedChange:()=>Qe(pe.path),onSelect:pt=>pt.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:pe.path})},pe.path))})]})]}),c.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," attached"]})]}),c.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[(m?c:c.slice(0,3)).map(pe=>h.jsxs(ht,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>Qe(pe),className:"mr-0.5 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),"@",pe]},pe)),!m&&c.length>3&&h.jsxs("button",{type:"button",onClick:()=>d(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",c.length-3," more"]}),m&&c.length>3&&h.jsx("button",{type:"button",onClick:()=>d(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsx("div",{className:"flex flex-col gap-1.5",children:h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx(Xe,{list:"datalist-role",value:o,onChange:pe=>l(pe.target.value),placeholder:"Default role",className:"w-48 text-sm"}),ut&&h.jsx("p",{className:"text-xs text-destructive",children:ut})]}),h.jsx("datalist",{id:"datalist-role",children:He.map(pe=>h.jsx("option",{value:pe},pe))}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(we,{type:"button",variant:U?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>B(pe=>!pe),title:U?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[h.jsx(Dp,{className:"h-3.5 w-3.5"}),U?"Interactive":"Auto"]}),h.jsxs(we,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>T(!0),title:"Advanced options",children:[h.jsx(F0,{className:"h-4 w-4"}),Er>0&&h.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Er})]}),Bn&&h.jsxs(we,{type:"button",variant:"destructive",onClick:()=>xe&&tt.mutate(xe.run_id),disabled:tt.isPending,children:[tt.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(jk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),h.jsx(we,{type:"submit",disabled:!i.trim()||et.isPending||!!ut||ai,variant:Bn?"outline":"default",title:Bn?"Queue task (runs after current session)":void 0,children:et.isPending?h.jsx(Pr,{className:"h-4 w-4 animate-spin"}):h.jsx(tx,{className:"h-4 w-4"})})]})]})})]})}),h.jsx(_a,{open:A,onOpenChange:T,children:h.jsxs(Ca,{className:"max-w-lg",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Advanced Options"})}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Runtime"}),h.jsx(Xe,{list:"adv-datalist-runtime",value:P,onChange:pe=>L(pe.target.value),placeholder:(Je==null?void 0:Je.runtime)??"default",className:"text-sm"}),h.jsx("datalist",{id:"adv-datalist-runtime",children:rn.map(pe=>h.jsx("option",{value:pe},pe))}),Gr&&h.jsx("p",{className:"text-xs text-destructive",children:Gr})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Memory"}),h.jsx(Xe,{list:"adv-datalist-memory",value:I,onChange:pe=>F(pe.target.value),placeholder:(Je==null?void 0:Je.memory)??"dial",className:"text-sm"}),h.jsx("datalist",{id:"adv-datalist-memory",children:hr.map(pe=>h.jsx("option",{value:pe},pe))}),Dr&&h.jsx("p",{className:"text-xs text-destructive",children:Dr})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"System Prompt"}),h.jsx(Eo,{value:$,onChange:pe=>X(pe.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:D,onChange:pe=>V(pe.target.value),placeholder:Je!=null&&Je.max_num_delegations?String(Je.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Delegations"}),h.jsxs(pa,{value:z||"__empty__",onValueChange:pe=>q(pe==="__empty__"?"":pe),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:`Default (${(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false"})`})}),h.jsxs(ya,{children:[h.jsxs(An,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Je==null?void 0:Je.cache_delegations)!==!1?"true":"false",")"]}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:G,onChange:pe=>K(pe.target.value),placeholder:Je!=null&&Je.cache_max_entries?String(Je.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:R,onChange:pe=>H(pe.target.value),placeholder:Je!=null&&Je.cache_ttl_seconds?String(Je.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{L(""),F(""),X(""),V(""),q(""),K(""),H("")},children:"Reset"}),h.jsx(we,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const WE="imu";function U4e(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 H4e({status:e}){return e==="running"||e==="starting"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[h.jsx(Pr,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[h.jsx(Pp,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?h.jsxs(ht,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[h.jsx($0,{className:"h-3 w-3"}),"Failed"]}):h.jsx(ht,{variant:"outline",children:e})}function q4e({session:e}){const t=e.status==="running"||e.status==="starting";return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Bot Imu"}),h.jsx(H4e,{status:e.status}),e.duration_ms!==null&&h.jsx("span",{className:"text-xs text-muted-foreground",children:U4e(e.duration_ms)})]}),h.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:t?h.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?h.jsx(Li,{content:e.summary,className:"text-sm text-foreground"}):h.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),h.jsxs("a",{href:`/projects/0/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[h.jsx(B0,{className:"h-3 w-3"}),"View session"]})]})}function V4e({task:e}){return h.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),h.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:h.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}const K4e=[{group:"Getting started",prompts:[{label:"What can you do?",text:"What can you do?"}]},{group:"Do something",prompts:[{label:"Show me all my projects",text:"Show me all my projects"},{label:"What roles and skills are available?",text:"What roles and skills are available?"},{label:"Register my project",text:"Register my project at ~/path/to/repo"}]}];function Y4e({onSelectPrompt:e}){return h.jsxs("div",{className:"flex flex-col items-center gap-6 py-12 px-4",children:[h.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[h.jsx(Op,{className:"h-10 w-10 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"Hi, I'm Imu"}),h.jsx("p",{className:"max-w-md text-sm text-muted-foreground",children:"Your StrawPot operator. I manage projects, run agents, and keep things on schedule."})]}),h.jsx("div",{className:"w-full max-w-md space-y-4",children:K4e.map(t=>h.jsxs("div",{className:"space-y-2",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.group}),h.jsx("div",{className:"flex flex-col gap-1.5",children:t.prompts.map(n=>h.jsx("button",{type:"button",onClick:()=>e(n.text),className:"rounded-lg border border-border px-3 py-2 text-left text-sm hover:bg-muted/50 transition-colors",children:n.label},n.label))})]},t.group))})]})}function G4e({cid:e}){const[t,n]=y.useState(""),[r,i]=y.useState(!0),[a,o]=y.useState(!1),[l,c]=y.useState(""),[f,m]=y.useState(!1),[d,g]=y.useState(""),[v,b]=y.useState(""),[w,S]=y.useState(""),[j,C]=y.useState(""),[_,k]=y.useState(""),[O,A]=y.useState(""),[T,P]=y.useState(""),[L,I]=y.useState(!1),[F,$]=y.useState(!1),[X,D]=y.useState([]),[V,z]=y.useState(!1),[q,G]=y.useState(""),[K,R]=y.useState(""),H=lt(),U=y.useRef(null),B=y.useRef(null),Q=y.useRef(0),Z=y.useRef(void 0),te=y.useRef(0),ae=y.useRef(null),re=y.useRef(null),{data:ee}=Wu("agents"),{data:se}=Wu("memories"),ge=H0(0),ie=me=>D(Ze=>Ze.includes(me)?Ze.filter(an=>an!==me):[...Ze,me]),{data:Se,isLoading:Ee,error:He,fetchPreviousPage:ke,hasPreviousPage:it,isFetchingPreviousPage:Je}=nx(e),We=(Se==null?void 0:Se.pages.flatMap(me=>me.sessions))??[],zt=Se==null?void 0:Se.pages[Se.pages.length-1],mt=We[We.length-1],Et=(mt==null?void 0:mt.status)==="running"||(mt==null?void 0:mt.status)==="starting";nx(e,{refetchInterval:Et?2e3:!1});const Kt=XF(e),It=Pk(),fn=WF(e),ce=kk(),{pendingAskUsers:xe,chatMessages:Me,respond:et}=E2((mt==null?void 0:mt.run_id)??"",Et&&r),tt=(ee??[]).map(me=>me.name),Xt=[...new Set((se??[]).map(me=>me.name)),"none"].sort(),nn=d.trim()&&tt.length>0&&!tt.includes(d.trim())?"Runtime not found in installed agents":"",je=v.trim()&&Xt.length>0&&!Xt.includes(v.trim())?"Memory not found in installed providers":"",st=!!nn||!!je,xt=[d,v,w,j,_,O,T].filter(me=>me.trim()).length;y.useEffect(()=>{if(!U.current)return;const me=U.current.scrollHeight-Q.current;me>0&&(U.current.scrollTop+=me,Q.current=0)},[Se==null?void 0:Se.pages.length]),y.useEffect(()=>{U.current&&((mt==null?void 0:mt.run_id)!==Z.current&&(U.current.scrollTop=U.current.scrollHeight),Z.current=mt==null?void 0:mt.run_id)},[mt==null?void 0:mt.run_id]),y.useEffect(()=>{U.current&&(Me.length>te.current&&(U.current.scrollTop=U.current.scrollHeight),te.current=Me.length)},[Me.length]),y.useEffect(()=>{if(!B.current||!U.current)return;const me=new IntersectionObserver(([Ze])=>{var an;Ze.isIntersecting&&it&&!Je&&(Q.current=((an=U.current)==null?void 0:an.scrollHeight)??0,ke())},{root:U.current,threshold:.1});return me.observe(B.current),()=>me.disconnect()},[it,Je,ke]);const ut=me=>{me.preventDefault(),I(!0)},Bn=me=>{me.preventDefault(),I(!0)},rn=me=>{me.preventDefault(),I(!1)},hr=async me=>{me.preventDefault(),I(!1);const Ze=Array.from(me.dataTransfer.files);if(Ze.length){$(!0);try{const an=await Pe.upload("/projects/0/files",Ze);H.invalidateQueries({queryKey:Oe.projects.files(0)}),D(_t=>{const Pn=an.map(Xr=>Xr.path).filter(Xr=>!_t.includes(Xr));return[..._t,...Pn]})}catch{}finally{$(!1)}}};function Gr(me){me.preventDefault();const Ze=t.trim();!Ze||st||Kt.mutate({task:Ze,role:WE,interactive:r,context_files:X.length>0?X:void 0,system_prompt:w.trim()||void 0,runtime:d.trim()||void 0,memory:v.trim()||void 0,max_num_delegations:j.trim()?Number(j):void 0,cache_delegations:_?_==="true":void 0,cache_max_entries:O.trim()?Number(O):void 0,cache_ttl_seconds:T.trim()?Number(T):void 0},{onSuccess:()=>{n(""),D([]),z(!1),setTimeout(()=>{var an;return(an=re.current)==null?void 0:an.focus()},0)}})}function Dr(me,Ze){Ze.trim()&&(et(me.request_id,Ze.trim()),R(""))}function ai(me){me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),Gr(me))}function Er(){c((zt==null?void 0:zt.title)??""),o(!0),setTimeout(()=>{var me;return(me=ae.current)==null?void 0:me.select()},0)}function Qe(){const me=l.trim();ce.mutate({conversationId:e,title:me||null}),o(!1)}if(He)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",He.message]})]});const qt=(zt==null?void 0:zt.title)??`Conversation #${e}`;return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[h.jsx("div",{className:"flex items-center gap-3",children:a?h.jsx(Xe,{ref:ae,value:l,onChange:me=>c(me.target.value),onBlur:Qe,onKeyDown:me=>{me.key==="Enter"&&(me.preventDefault(),Qe()),me.key==="Escape"&&o(!1)},className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${e}`}):h.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:Er,title:"Click to rename",children:qt})}),We.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[We.length," session",We.length!==1?"s":""]})]}),h.jsx("div",{ref:U,className:"min-h-0 flex-1 overflow-y-auto",children:h.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[h.jsx("div",{ref:B,className:"h-1"}),Je&&h.jsx("div",{className:"flex justify-center py-2",children:h.jsx(Pr,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Ee&&We.length===0&&h.jsx(Y4e,{onSelectPrompt:me=>{Kt.mutate({task:me,role:WE,interactive:r},{onSuccess:()=>{setTimeout(()=>{var Ze;return(Ze=re.current)==null?void 0:Ze.focus()},0)}})}}),We.map((me,Ze)=>{const an=Ze===We.length-1;return h.jsxs("div",{className:"space-y-4",children:[(me.user_task??me.task)&&h.jsx(V4e,{task:me.user_task??me.task}),(an&&Et?Me:me.chat_messages??[]).map(_t=>h.jsx("div",{className:`flex ${_t.role==="user"?"justify-end":"justify-start"}`,children:h.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${_t.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:h.jsx(Li,{content:_t.text,className:"whitespace-pre-wrap"})})},_t.id)),h.jsx(q4e,{session:me})]},me.run_id)})]})}),(zt==null?void 0:zt.pending_task)&&(()=>{const me=zt.pending_task.split(`

`).filter(Boolean);return h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-2",children:h.jsxs("div",{className:"mx-auto max-w-2xl space-y-1.5",children:[me.map((Ze,an)=>h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-primary/40 bg-primary/5 px-3 py-2",children:[h.jsx(Pr,{className:"h-3.5 w-3.5 animate-spin text-primary flex-shrink-0"}),h.jsxs("span",{className:"text-xs text-muted-foreground flex-1 truncate",children:["Queued",me.length>1?` (${an+1}/${me.length})`:"",":"," ",h.jsx("span",{className:"text-foreground",children:Ze.split(`
`)[0]})]})]},an)),h.jsx("div",{className:"flex justify-end",children:h.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive",onClick:()=>fn.mutate(),disabled:fn.isPending,children:[h.jsx(uc,{className:"h-3 w-3 mr-1"}),"Cancel all"]})})]})})})(),xe.length>0&&h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:h.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:xe.map(me=>h.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[h.jsx(Li,{content:me.question,className:"text-sm font-medium"}),me.why&&h.jsx(Li,{content:me.why,className:"text-xs text-muted-foreground"}),me.choices&&h.jsx("div",{className:"flex flex-wrap gap-1.5",children:me.choices.map(Ze=>h.jsx(we,{type:"button",size:"sm",variant:"outline",onClick:()=>Dr(me,Ze),children:Ze},Ze))}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Xe,{value:K,onChange:Ze=>R(Ze.target.value),onKeyDown:Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&(Ze.preventDefault(),Dr(me,K))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),h.jsx(we,{type:"button",size:"icon",disabled:!K.trim(),onClick:()=>Dr(me,K),children:h.jsx(tx,{className:"h-4 w-4"})})]})]},me.request_id))})}),h.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:h.jsxs("form",{onSubmit:Gr,className:"mx-auto max-w-2xl space-y-2",children:[h.jsxs("div",{className:"relative",onDragOver:ut,onDragEnter:Bn,onDragLeave:rn,onDrop:hr,children:[h.jsx(Eo,{ref:re,value:t,onChange:me=>n(me.target.value),onKeyDown:ai,placeholder:Et?"Queue a follow-up task… (Enter to queue, runs after current session)":"Ask Bot Imu anything… (Enter to send, Shift+Enter for new line, drag & drop files to attach)",disabled:Kt.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(L||F)&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:F?h.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[h.jsx(Pr,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):h.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[h.jsx(U0,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(dd,{children:[h.jsx(hd,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[h.jsx(wk,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),h.jsxs(md,{align:"start",className:"w-64",onCloseAutoFocus:me=>me.preventDefault(),children:[h.jsx("div",{className:"px-2 py-1.5",children:h.jsx(Xe,{placeholder:"Filter files…",value:q,onChange:me=>G(me.target.value),className:"h-7 text-xs",onKeyDown:me=>me.stopPropagation()})}),h.jsx("div",{className:"max-h-48 overflow-y-auto",children:(ge.data??[]).filter(me=>me.path.toLowerCase().includes(q.toLowerCase())).map(me=>h.jsx(Tk,{checked:X.includes(me.path),onCheckedChange:()=>ie(me.path),onSelect:Ze=>Ze.preventDefault(),children:h.jsx("span",{className:"font-mono text-xs",children:me.path})},me.path))})]})]}),X.length>0&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[X.length," attached"]})]}),X.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1",children:[(V?X:X.slice(0,3)).map(me=>h.jsxs(ht,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[h.jsx("button",{type:"button",onClick:()=>ie(me),className:"mr-0.5 rounded-sm hover:bg-muted",children:h.jsx(uc,{className:"h-3 w-3"})}),"@",me]},me)),!V&&X.length>3&&h.jsxs("button",{type:"button",onClick:()=>z(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",X.length-3," more"]}),V&&X.length>3&&h.jsx("button",{type:"button",onClick:()=>z(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"text-xs text-muted-foreground px-1",children:["Role: ",WE]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs(we,{type:"button",variant:r?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i(me=>!me),title:r?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[h.jsx(Dp,{className:"h-3.5 w-3.5"}),r?"Interactive":"Auto"]}),h.jsxs(we,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>m(!0),title:"Advanced options",children:[h.jsx(F0,{className:"h-4 w-4"}),xt>0&&h.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:xt})]}),Et&&h.jsxs(we,{type:"button",variant:"destructive",onClick:()=>mt&&It.mutate(mt.run_id),disabled:It.isPending,children:[It.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(jk,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}),h.jsx(we,{type:"submit",disabled:!t.trim()||Kt.isPending||st,variant:Et?"outline":"default",title:Et?"Queue task (runs after current session)":void 0,children:Kt.isPending?h.jsx(Pr,{className:"h-4 w-4 animate-spin"}):h.jsx(tx,{className:"h-4 w-4"})})]})]})]})}),h.jsx(_a,{open:f,onOpenChange:m,children:h.jsxs(Ca,{className:"max-w-lg",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Advanced Options"})}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Runtime"}),h.jsx(Xe,{list:"imu-adv-runtime",value:d,onChange:me=>g(me.target.value),placeholder:"default",className:"text-sm"}),h.jsx("datalist",{id:"imu-adv-runtime",children:tt.map(me=>h.jsx("option",{value:me},me))}),nn&&h.jsx("p",{className:"text-xs text-destructive",children:nn})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Memory"}),h.jsx(Xe,{list:"imu-adv-memory",value:v,onChange:me=>b(me.target.value),placeholder:"dial",className:"text-sm"}),h.jsx("datalist",{id:"imu-adv-memory",children:Xt.map(me=>h.jsx("option",{value:me},me))}),je&&h.jsx("p",{className:"text-xs text-destructive",children:je})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"System Prompt"}),h.jsx(Eo,{value:w,onChange:me=>S(me.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Max Delegations"}),h.jsx(Xe,{type:"number",min:"0",value:j,onChange:me=>C(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Delegations"}),h.jsxs(pa,{value:_||"__empty__",onValueChange:me=>k(me==="__empty__"?"":me),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:"Default (true)"})}),h.jsxs(ya,{children:[h.jsx(An,{value:"__empty__",className:"text-muted-foreground",children:"Default (true)"}),h.jsx(An,{value:"true",children:"true"}),h.jsx(An,{value:"false",children:"false"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache Max Entries"}),h.jsx(Xe,{type:"number",min:"0",value:O,onChange:me=>A(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{children:"Cache TTL (seconds)"}),h.jsx(Xe,{type:"number",min:"0",value:T,onChange:me=>P(me.target.value),placeholder:"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{g(""),b(""),S(""),C(""),k(""),A(""),P("")},children:"Reset"}),h.jsx(we,{size:"sm",onClick:()=>m(!1),children:"Done"})]})]})})]})}function X4e({conv:e}){const[t,n]=y.useState(!1),[r,i]=y.useState(""),a=y.useRef(null),o=kk();function l(f){f.stopPropagation(),i(e.title??""),n(!0),setTimeout(()=>{var m;return(m=a.current)==null?void 0:m.select()},0)}function c(f){f.stopPropagation(),o.mutate({conversationId:e.id,title:r.trim()||null}),n(!1)}return t?h.jsx(Xe,{ref:a,value:r,onChange:f=>i(f.target.value),onBlur:c,onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),c(f)),f.key==="Escape"&&(f.stopPropagation(),n(!1))},onClick:f=>f.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:`Conversation #${e.id}`}):h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-medium",children:e.title??`Conversation #${e.id}`}),h.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:l,"aria-label":"Rename",children:h.jsx(Rp,{className:"h-3 w-3"})})]})}function W4e({conv:e}){const[t,n]=y.useState(!1),r=ZF();return t?h.jsxs("div",{className:"flex justify-end gap-1",onClick:i=>i.stopPropagation(),children:[h.jsx(we,{size:"sm",variant:"destructive",disabled:r.isPending,onClick:i=>{i.stopPropagation(),r.mutate(e.id,{onSuccess:()=>n(!1),onError:()=>n(!1)})},children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:i=>{i.stopPropagation(),n(!1)},children:"No"})]}):h.jsx(we,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:i=>{i.stopPropagation(),n(!0)},"aria-label":"Delete conversation",children:h.jsx(Ea,{className:"h-3.5 w-3.5"})})}function Q4e(){var d,g,v;const e=Sa(),t=q0(),n=QF(),[r,i]=y.useState(1),a=tU(0,r),[o,l]=y.useState("conversations"),c=((d=a.data)==null?void 0:d.items)??[],f=((g=a.data)==null?void 0:g.total)??0,m=a.data?Math.ceil(a.data.total/a.data.per_page):0;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[h.jsx(Op,{className:"h-6 w-6"}),"Bot Imu"]}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Your personal StrawPot overlord. Ask it to manage projects, run agents, configure schedules, or anything else in your StrawPot workspace."})]}),h.jsxs(we,{onClick:()=>n.mutate(void 0,{onSuccess:b=>e(`/imu/${b.id}`)}),disabled:n.isPending,children:[n.isPending?h.jsx(Pr,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Dp,{className:"mr-2 h-4 w-4"}),"New Conversation"]})]}),h.jsxs(Fp,{value:o,onValueChange:l,children:[h.jsxs(Up,{children:[h.jsxs(or,{value:"conversations",children:["Conversations (",((v=t.data)==null?void 0:v.length)??0,")"]}),h.jsxs(or,{value:"sessions",children:["Sessions (",f,")"]}),h.jsx(or,{value:"activity",children:"Activity"}),h.jsx(or,{value:"files",children:"Files"})]}),h.jsx(sr,{value:"conversations",className:"mt-4 space-y-3",children:(t.data??[]).length===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[h.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),h.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),h.jsx("th",{className:"px-4 py-2"})]})}),h.jsx("tbody",{children:(t.data??[]).map(b=>h.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>e(`/imu/${b.id}`),children:[h.jsx("td",{className:"px-4 py-2",children:h.jsx(X4e,{conv:b})}),h.jsxs("td",{className:"px-4 py-2 text-muted-foreground",children:[b.session_count,b.spawned_count>0&&h.jsxs("span",{className:"ml-1.5 text-xs text-primary",title:`${b.spawned_count} delegated conversation${b.spawned_count!==1?"s":""}`,children:["+",b.spawned_count]})]}),h.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:b.updated_at?new Date(b.updated_at).toLocaleString():new Date(b.created_at).toLocaleString()}),h.jsx("td",{className:"px-4 py-2 text-right",children:h.jsx(W4e,{conv:b})})]},b.id))})]})})})}),h.jsx(sr,{value:"sessions",className:"mt-4 space-y-3",children:f===0?h.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):h.jsxs(h.Fragment,{children:[h.jsx(Nn,{children:h.jsx(kn,{className:"p-0",children:h.jsx(rx,{sessions:c})})}),h.jsx(Mk,{page:r,totalPages:m,onPageChange:i})]})}),h.jsx(sr,{value:"activity",className:"mt-4",children:h.jsx(KK,{projectId:0})}),h.jsx(sr,{value:"files",className:"mt-4",children:h.jsx(mU,{projectId:0})})]})]})}function v$(){const{conversationId:e}=bp(),t=e?Number(e):null;return t!==null?h.jsx(G4e,{cid:t}):h.jsx(Q4e,{})}const Z4e={skills:["denden","strawpot-session-recap"],roles:["imu","ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},J4e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function e5e(){const{resourceType:e="roles"}=bp(),{data:t,isLoading:n}=Wu(e),[r,i]=y.useState(null),[a,o]=y.useState(!1),[l,c]=y.useState(!1),{data:f}=vge(e,r??"",{enabled:a&&!!r}),m=J4e[e]??e;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:m}),h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",m.toLowerCase()," from StrawHub"]})]}),h.jsxs(we,{onClick:()=>c(!0),size:"sm",children:[h.jsx(Mp,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((d,g)=>h.jsx(ln,{className:"h-12 w-full"},g))}):!t||t.length===0?h.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",m.toLowerCase()," installed yet."]}):h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Version"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Source"}),h.jsx(Fe,{className:"w-24"})]})}),h.jsx(ma,{children:t.map(d=>{var g;return h.jsxs(yn,{className:"cursor-pointer",onClick:()=>{i(d.name),o(!0)},children:[h.jsx(ze,{className:"font-medium",children:d.name}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:d.version??"—"}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm",children:d.description||"—"}),h.jsx(ze,{children:h.jsx(ht,{variant:"outline",className:"text-xs",children:d.source})}),h.jsx(ze,{children:!((g=Z4e[e])!=null&&g.includes(d.name))&&h.jsx(t5e,{resourceType:e,name:d.name})})]},d.name)})})]}),h.jsx(CH,{resource:f??null,resourceType:e,open:a,onOpenChange:o}),h.jsx(Zk,{open:l,onOpenChange:c,defaultType:e})]})}function t5e({resourceType:e,name:t}){const[n,r]=y.useState(!1),i=xH(),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?h.jsxs("div",{className:"flex gap-1",children:[h.jsx(we,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),h.jsx(we,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):h.jsx(we,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:h.jsx(Ea,{className:"h-4 w-4"})})}function kG(e){return On({queryKey:e?[...Oe.schedules.all,e]:Oe.schedules.all,queryFn:()=>Pe.get(e?`/schedules?type=${e}`:"/schedules")})}function n5e(e=1,t=20){return On({queryKey:[...Oe.schedules.runs,e,t],queryFn:()=>Pe.get(`/schedules/runs?page=${e}&per_page=${t}`)})}function r5e(){const e=lt();return jt({mutationFn:t=>Pe.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.schedules.all})}})}function i5e(){const e=lt();return jt({mutationFn:t=>Pe.post("/schedules/one-time",t),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.schedules.all})}})}function a5e(){const e=lt();return jt({mutationFn:({id:t,...n})=>Pe.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.schedules.all})}})}function AG(){const e=lt();return jt({mutationFn:t=>Pe.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.schedules.all})}})}function OG(){const e=lt();return jt({mutationFn:({id:t,enable:n})=>Pe.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.schedules.all})}})}var QE={exports:{}},y$;function o5e(){return y$||(y$=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),m=(function(){function d(g,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return d.prototype.parse=function(){var g,v,b=(g=this.expression)!==null&&g!==void 0?g:"";if(b==="@reboot")return v=["@reboot","","","","","",""],v;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);v=this.extractParts(w)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},d.prototype.parseSpecial=function(g){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},b=v[g];if(!b)throw new Error("Unknown special expression.");return b},d.prototype.extractParts=function(g){if(!this.expression)throw new Error("cron expression is empty");for(var v=g.trim().split(/[ ]+/),b=0;b<v.length;b++)if(v[b].includes(",")){var w=v[b].split(",").map(function(j){return j.trim()}).filter(function(j){return j!==""}).map(function(j){return isNaN(Number(j))?j:Number(j)}).filter(function(j){return j!==null&&j!==""});w.length===0&&w.push("*"),w.sort(function(j,C){return j!==null&&C!==null?j-C:0}),v[b]=w.map(function(j){return j!==null?j.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var S=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";S?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},d.prototype.normalize=function(g){var v=this;if(g[3]=g[3].replace("?","*"),g[5]=g[5].replace("?","*"),g[2]=g[2].replace("?","*"),g[0].indexOf("0/")==0&&(g[0]=g[0].replace("0/","*/")),g[1].indexOf("0/")==0&&(g[1]=g[1].replace("0/","*/")),g[2].indexOf("0/")==0&&(g[2]=g[2].replace("0/","*/")),g[3].indexOf("1/")==0&&(g[3]=g[3].replace("1/","*/")),g[4].indexOf("1/")==0&&(g[4]=g[4].replace("1/","*/")),g[6].indexOf("1/")==0&&(g[6]=g[6].replace("1/","*/")),g[5]=g[5].replace(/(^\d)|([^#/\s]\d)/g,function(O){var A=O.replace(/\D/,""),T=A;return v.dayOfWeekStartIndexZero?A=="7"&&(T="0"):T=(parseInt(A)-1).toString(),O.replace(A,T)}),g[5]=="L"&&(g[5]="6"),g[3]=="?"&&(g[3]="*"),g[3].indexOf("W")>-1&&(g[3].indexOf(",")>-1||g[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var w in b)g[5]=g[5].replace(new RegExp(w,"gi"),b[w].toString());g[4]=g[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(O){var A=O.replace(/\D/,""),T=A;return v.monthStartIndexZero&&(T=(parseInt(A)+1).toString()),O.replace(A,T)});var S={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var j in S)g[4]=g[4].replace(new RegExp(j,"gi"),S[j].toString());g[0]=="0"&&(g[0]=""),!/\*|\-|\,|\//.test(g[2])&&(/\*|\//.test(g[1])||/\*|\//.test(g[0]))&&(g[2]+="-".concat(g[2]));for(var C=0;C<g.length;C++)if(g[C].indexOf(",")!=-1&&(g[C]=g[C].split(",").filter(function(O){return O!==""}).join(",")||"*"),g[C]=="*/1"&&(g[C]="*"),g[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[C])){var _=null;switch(C){case 4:_="12";break;case 5:_="6";break;case 6:_="9999";break;default:_=null;break}if(_!==null){var k=g[C].split("/");g[C]="".concat(k[0],"-").concat(_,"/").concat(k[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=m},333(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var f=c(823),m=c(949),d=(function(){function g(v,b){if(this.expression=v,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&g.defaultLocale&&(this.options.locale=g.defaultLocale),!g.locales[this.options.locale]){var w=Object.keys(g.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(w,"'.")),this.options.locale=w}this.i18n=g.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return g.toString=function(v,b){var w=b===void 0?{}:b,S=w.throwExceptionOnParseError,j=S===void 0?!0:S,C=w.verbose,_=C===void 0?!1:C,k=w.dayOfWeekStartIndexZero,O=k===void 0?!0:k,A=w.monthStartIndexZero,T=A===void 0?!1:A,P=w.use24HourTimeFormat,L=w.locale,I=L===void 0?null:L,F=w.logicalAndDayFields,$=F===void 0?!1:F,X={throwExceptionOnParseError:j,verbose:_,dayOfWeekStartIndexZero:O,monthStartIndexZero:T,use24HourTimeFormat:P,locale:I,logicalAndDayFields:$};X.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var D=new g(v,X);return D.getFullDescription()},g.initialize=function(v,b){b===void 0&&(b="en"),g.specialCharacters=["/","-",",","*"],g.defaultLocale=b,v.load(g.locales)},g.prototype.getFullDescription=function(){var v,b,w="";try{var S=new m.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=S.parse(),this.expressionParts[0]==="@reboot")return((b=(v=this.i18n).atReboot)===null||b===void 0?void 0:b.call(v))||"Run once, at startup";var j=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),_=this.getMonthDescription(),k=this.getDayOfWeekDescription(),O=this.getYearDescription();w+=j+C+k+_+O,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(A){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(A)}return w},g.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!f.StringUtilities.containsAny(b,g.specialCharacters)&&!f.StringUtilities.containsAny(w,g.specialCharacters)&&!f.StringUtilities.containsAny(v,g.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,v);else if(!v&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!f.StringUtilities.containsAny(w,g.specialCharacters)){var j=b.split("-");S+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,j[0],""),this.formatTime(w,j[1],""))}else if(!v&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!f.StringUtilities.containsAny(b,g.specialCharacters)){var C=w.split(",");S+=this.i18n.at();for(var _=0;_<C.length;_++)S+=" ",S+=this.formatTime(C[_],b,""),_<C.length-2&&(S+=","),_==C.length-2&&(S+=this.i18n.spaceAnd())}else{var k=this.getSecondsDescription(),O=this.getMinutesDescription(),A=this.getHoursDescription();if(S+=k,S&&O&&(S+=", "),S+=O,O===A)return S;S&&A&&(S+=", "),S+=A}return S},g.prototype.getSecondsDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return f.StringUtilities.format(v.i18n.everyX0Seconds(w),w)},function(w){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?v.i18n.atX0SecondsPastTheMinute(w):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(w)});return b},g.prototype.getMinutesDescription=function(){var v=this,b=this.expressionParts[0],w=this.expressionParts[2],S=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(j){return j},function(j){return f.StringUtilities.format(v.i18n.everyX0Minutes(j),j)},function(j){return v.i18n.minutesX0ThroughX1PastTheHour()},function(j){var C,_;try{return j=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():j=="0"?((_=(C=v.i18n).onTheHour)===null||_===void 0?void 0:_.call(C))||v.i18n.atX0MinutesPastTheHour(j):parseInt(j)<20?v.i18n.atX0MinutesPastTheHour(j):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(j)}catch{return v.i18n.atX0MinutesPastTheHour(j)}});return S},g.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(_){var k=_.split("-");k.length===2&&S.push({value:k[1],index:w+1}),w+=k.length});var j=0,C=this.getSegmentDescription(b,this.i18n.everyHour(),function(_){var k=S.find(function(A){return A.value===_&&A.index===j}),O=k&&v.expressionParts[1]!=="0";return j++,O?v.formatTime(_,"59",""):v.formatTime(_,"0","")},function(_){return f.StringUtilities.format(v.i18n.everyX0Hours(_),_)},function(_){return v.i18n.betweenX0AndX1()},function(_){return v.i18n.atX0()});return C},g.prototype.getDayOfWeekDescription=function(){var v=this,b=this.i18n.daysOfTheWeek(),w=null;return this.expressionParts[5]=="*"?w="":w=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(S,j){var C=S;S.indexOf("#")>-1?C=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(C=C.replace("L",""));var _=parseInt(C),k=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(j)[_]:b[_];if(S.indexOf("#")>-1){var O=null,A=S.substring(S.indexOf("#")+1),T=S.substring(0,S.indexOf("#"));switch(A){case"1":O=v.i18n.first(T);break;case"2":O=v.i18n.second(T);break;case"3":O=v.i18n.third(T);break;case"4":O=v.i18n.fourth(T);break;case"5":O=v.i18n.fifth(T);break}k=O+" "+k}return k},function(S){return parseInt(S)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var j=S.substring(0,S.indexOf("-")),C=v.expressionParts[3]!="*";return C?v.i18n.commaAndX0ThroughX1(j):v.i18n.commaX0ThroughX1(j)},function(S){var j=null;if(S.indexOf("#")>-1){var C=S.substring(S.indexOf("#")+1),_=S.substring(0,S.indexOf("#"));j=v.i18n.commaOnThe(C,_).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)j=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var k=v.expressionParts[3]!="*";k?v.options.logicalAndDayFields?j=v.i18n.commaOnlyOnX0(S):j=v.i18n.commaAndOnX0():j=v.i18n.commaOnlyOnX0(S)}return j}),w},g.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,j){return j&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(j)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0Months(S),S)},function(S){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(S){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return w},g.prototype.getDayOfMonthDescription=function(){var v=this,b=null,w=this.expressionParts[3];switch(w){case"L":b=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":b=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var S=w.match(/(\d{1,2}W)|(W\d{1,2})/);if(S){var j=parseInt(S[0].replace("W","")),C=j==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),j.toString());b=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var _=w.match(/L-(\d{1,2})/);if(_){var k=_[1];b=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(k),k);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(O){return O=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),O):O},function(O){return O=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(O)},function(O){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(O)},function(O){return v.i18n.commaOnDayX0OfTheMonth(O)})}break}}return b},g.prototype.getYearDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return f.StringUtilities.format(v.i18n.commaEveryX0Years(w),w)},function(w){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return b},g.prototype.getSegmentDescription=function(v,b,w,S,j,C){var _=null,k=v.indexOf("/")>-1,O=v.indexOf("-")>-1,A=v.indexOf(",")>-1;if(!v)_="";else if(v==="*")_=b;else if(!k&&!O&&!A)_=f.StringUtilities.format(C(v),w(v));else if(A){for(var T=v.split(","),P="",L=0;L<T.length;L++)if(L>0&&T.length>2&&(P+=",",L<T.length-1&&(P+=" ")),L>0&&T.length>1&&(L==T.length-1||T.length==2)&&(P+="".concat(this.i18n.spaceAnd()," ")),T[L].indexOf("/")>-1||T[L].indexOf("-")>-1){var I=T[L].indexOf("-")>-1&&T[L].indexOf("/")==-1,F=this.getSegmentDescription(T[L],b,w,S,I?this.i18n.commaX0ThroughX1:j,C);I&&(F=F.replace(", ","")),P+=F}else if(!k)P+=w(T[L]);else{var $=this.getSegmentDescription(T[L],b,w,S,j,C);$&&$.startsWith(", ")&&($=$.substring(2)),P+=$}k?_=P:_=f.StringUtilities.format(C(v),P)}else if(k){var T=v.split("/");if(_=f.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var X=this.generateRangeSegmentDescription(T[0],j,w);X.indexOf(", ")!=0&&(_+=", "),_+=X}else if(T[0].indexOf("*")==-1){var D=f.StringUtilities.format(C(T[0]),w(T[0]));D=D.replace(", ",""),_+=f.StringUtilities.format(this.i18n.commaStartingX0(),D)}}else O&&(_=this.generateRangeSegmentDescription(v,j,w));return _},g.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",j=v.split("-"),C=w(j[0],1),_=w(j[1],2),k=b(v);return S+=f.StringUtilities.format(k,C,_),S},g.prototype.formatTime=function(v,b,w){var S=0,j=0,C=parseInt(v)+S,_=parseInt(b)+j;_>=60?(_-=60,C+=1):_<0&&(_+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var k="",O=!1;this.options.use24HourTimeFormat||(O=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),k=O?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var A="";return w&&(A=":".concat(("00"+w).substring(w.length))),"".concat(O?k:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+_.toString()).substring(_.toString().length)).concat(A).concat(O?"":k)},g.prototype.transformVerbosity=function(v,b){if(!b&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var w=0,S=Object.entries(this.i18n.conciseVerbosityReplacements());w<S.length;w++){var j=S[w],C=j[0],_=j[1];v=v.replace(new RegExp(C,"g"),_)}return v},g.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},g.locales={},g})();l.ExpressionDescriptor=d},747(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var f=c(486),m=(function(){function d(){}return d.prototype.load=function(g){g.en=new f.en},d})();l.enLocaleLoader=m},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(m,d){if(!m)throw new Error(d)}var f=(function(){function m(){}return m.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")}},m.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")}},m.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")}},m.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")}},m.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")}},m.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")}},m})();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(m){for(var d=[],g=1;g<arguments.length;g++)d[g-1]=arguments[g];return m.replace(/%s/g,function(v){return d.shift()})},f.containsAny=function(m,d){return d.some(function(g){return m.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})())})(QE)),QE.exports}var s5e=o5e();const l5e=Hi(s5e),u5e=[{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 c5e({open:e,onOpenChange:t,editing:n}){const{data:r}=Oc(),i=r5e(),a=a5e(),[o,l]=y.useState(""),[c,f]=y.useState(""),[m,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(""),[C,_]=y.useState(!0),[k,O]=y.useState(!1),A=n?n.project_id:Number(c)||0,{data:T}=Bd(A),P=y.useMemo(()=>(T??[]).filter(D=>D.type==="roles").map(D=>D.name),[T]);y.useEffect(()=>{e&&n?(l(n.name),f(String(n.project_id)),d(n.task),v(n.cron_expr??""),w(n.role??""),j(n.system_prompt??""),_(n.skip_if_running)):e&&!n&&L()},[e,n]);function L(){l(""),f(""),d(""),v(""),w(""),j(""),_(!0),O(!1)}async function I(D){D.preventDefault();try{const V={name:o.trim(),task:m.trim(),cron_expr:g.trim(),role:b.trim()||void 0,system_prompt:S.trim()||void 0,skip_if_running:C};n?await a.mutateAsync({id:n.id,...V}):await i.mutateAsync({...V,project_id:Number(c)}),L(),t(!1)}catch{}}const F=y.useMemo(()=>{if(!g.trim())return null;try{return l5e.toString(g.trim())}catch{return null}},[g]),$=i.isPending||a.isPending,X=i.error||a.error;return h.jsx(_a,{open:e,onOpenChange:t,children:h.jsxs(Ca,{className:"max-w-lg",children:[h.jsx(Na,{children:h.jsx(ka,{children:n?"Edit Schedule":"Create Schedule"})}),h.jsxs("form",{onSubmit:I,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"sched-name",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"sched-name",value:o,onChange:D=>l(D.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"sched-project",children:["Project ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(pa,{value:c,onValueChange:f,required:!0,children:[h.jsx(va,{id:"sched-project",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(r??[]).map(D=>h.jsx(An,{value:String(D.id),children:D.display_name},D.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"sched-task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Eo,{id:"sched-task",value:m,onChange:D=>d(D.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs(ot,{htmlFor:"sched-cron",children:["Cron Expression ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(dd,{children:[h.jsx(hd,{asChild:!0,children:h.jsxs(we,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",h.jsx(fd,{className:"ml-1 h-3 w-3"})]})}),h.jsx(md,{align:"end",children:u5e.map(D=>h.jsxs(ym,{onClick:()=>v(D.value),children:[h.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:D.value}),D.label]},D.value))})]})]}),h.jsx(Xe,{id:"sched-cron",value:g,onChange:D=>v(D.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),F&&h.jsx("p",{className:"text-xs text-muted-foreground",children:F})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"sched-role",children:"Role"}),h.jsx(Xe,{id:"sched-role",value:b,onChange:D=>w(D.target.value),placeholder:P[0]??"orchestrator",list:"sched-role-list"}),h.jsx("datalist",{id:"sched-role-list",children:P.map(D=>h.jsx("option",{value:D},D))}),b.trim()&&P.length>0&&!P.includes(b.trim())&&h.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:C,onChange:D=>_(D.target.checked),className:"rounded border-input"}),h.jsx("span",{className:"text-sm",children:"Skip if already running"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),h.jsxs(zp,{open:k,onOpenChange:O,children:[h.jsx($p,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[h.jsx(fd,{className:`h-3 w-3 transition-transform ${k?"rotate-180":""}`}),"Advanced Options"]})}),h.jsx(Bp,{className:"space-y-4 pt-2",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"sched-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"sched-prompt",value:S,onChange:D=>j(D.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),X&&h.jsx("p",{className:"text-sm text-destructive",children:X.message}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(we,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{type:"submit",disabled:$||!!b.trim()&&P.length>0&&!P.includes(b.trim()),children:$?"Saving...":n?"Update":"Create"})]})]})]})})}function x$(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 f5e({schedule:e}){return e.enabled?e.last_error?h.jsx(xk,{children:h.jsxs(TF,{children:[h.jsx(PF,{children:h.jsx(ht,{variant:"destructive",children:"Error"})}),h.jsx(MF,{className:"max-w-xs",children:h.jsx("p",{className:"text-xs",children:e.last_error})})]})}):h.jsx(ht,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):h.jsx(ht,{variant:"secondary",children:"Disabled"})}function d5e(){const{data:e,isLoading:t,error:n}=kG("recurring"),[r,i]=y.useState(!1),[a,o]=y.useState(null),l=AG(),c=OG();if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const f=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Recurring Schedules"}),h.jsxs(we,{onClick:()=>{o(null),i(!0)},children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),f.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No recurring schedules yet."}),h.jsxs(we,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):h.jsx("div",{className:"rounded-lg border",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Cron"}),h.jsx(Fe,{children:"Next Run"}),h.jsx(Fe,{children:"Last Run"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[120px]",children:"Actions"})]})}),h.jsx(ma,{children:f.map(m=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:m.name}),h.jsx(ze,{className:"text-muted-foreground",children:m.project_name}),h.jsx(ze,{children:h.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:m.cron_expr})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:x$(m.next_run_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:x$(m.last_run_at)}),h.jsx(ze,{children:h.jsx(f5e,{schedule:m})}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(m),i(!0)},children:h.jsx(Rp,{className:"h-3.5 w-3.5"})}),h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:m.id,enable:!m.enabled}),children:m.enabled?h.jsx(FF,{className:"h-3.5 w-3.5"}):h.jsx(Ip,{className:"h-3.5 w-3.5"})}),h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${m.name}"?`)&&l.mutate(m.id)},children:h.jsx(Ea,{className:"h-3.5 w-3.5"})})]})})]},m.id))})]})}),h.jsx(c5e,{open:r,onOpenChange:i,editing:a})]})}function h5e({open:e,onOpenChange:t}){const{data:n}=Oc(),r=i5e(),[i,a]=y.useState(""),[o,l]=y.useState(""),[c,f]=y.useState(""),[m,d]=y.useState(""),[g,v]=y.useState(""),[b,w]=y.useState(""),[S,j]=y.useState(!1),C=Number(o)||0,{data:_}=Bd(C),k=y.useMemo(()=>(_??[]).filter(P=>P.type==="roles").map(P=>P.name),[_]);y.useEffect(()=>{e&&O()},[e]);function O(){a(""),l(""),f(""),d(""),v(""),w(""),j(!1)}async function A(P){P.preventDefault();try{const L=new Date(m);await r.mutateAsync({name:i.trim(),project_id:Number(o),task:c.trim(),run_at:L.toISOString(),role:g.trim()||void 0,system_prompt:b.trim()||void 0}),O(),t(!1)}catch{}}const T=y.useMemo(()=>{const P=new Date(Date.now()+6e4);return P.setSeconds(0,0),P.toISOString().slice(0,16)},[e]);return h.jsx(_a,{open:e,onOpenChange:t,children:h.jsxs(Ca,{className:"max-w-lg",children:[h.jsx(Na,{children:h.jsx(ka,{children:"Create One-Time Schedule"})}),h.jsxs("form",{onSubmit:A,className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"ot-name",children:["Name ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"ot-name",value:i,onChange:P=>a(P.target.value),placeholder:"e.g. deploy-tonight",required:!0,autoFocus:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"ot-project",children:["Project ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsxs(pa,{value:o,onValueChange:l,required:!0,children:[h.jsx(va,{id:"ot-project",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(n??[]).map(P=>h.jsx(An,{value:String(P.id),children:P.display_name},P.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"ot-task",children:["Task ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Eo,{id:"ot-task",value:c,onChange:P=>f(P.target.value),placeholder:"What should the agent do?",required:!0,rows:3})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(ot,{htmlFor:"ot-run-at",children:["Run At ",h.jsx("span",{className:"text-destructive",children:"*"})]}),h.jsx(Xe,{id:"ot-run-at",type:"datetime-local",value:m,onChange:P=>d(P.target.value),min:T,required:!0}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"Schedule will fire once at this time and then auto-disable."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"ot-role",children:"Role"}),h.jsx(Xe,{id:"ot-role",value:g,onChange:P=>v(P.target.value),placeholder:k[0]??"orchestrator",list:"ot-role-list"}),h.jsx("datalist",{id:"ot-role-list",children:k.map(P=>h.jsx("option",{value:P},P))}),g.trim()&&k.length>0&&!k.includes(g.trim())&&h.jsx("p",{className:"text-xs text-destructive",children:"Role not found in installed roles"})]}),h.jsxs(zp,{open:S,onOpenChange:j,children:[h.jsx($p,{asChild:!0,children:h.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[h.jsx(fd,{className:`h-3 w-3 transition-transform ${S?"rotate-180":""}`}),"Advanced Options"]})}),h.jsx(Bp,{className:"space-y-4 pt-2",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(ot,{htmlFor:"ot-prompt",children:"System Prompt"}),h.jsx(Eo,{id:"ot-prompt",value:b,onChange:P=>w(P.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),r.error&&h.jsx("p",{className:"text-sm text-destructive",children:r.error.message}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(we,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{type:"submit",disabled:r.isPending||!!g.trim()&&k.length>0&&!k.includes(g.trim()),children:r.isPending?"Creating...":"Create"})]})]})]})})}function b$(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function m5e({schedule:e}){return!e.enabled&&e.last_run_at?h.jsx(ht,{variant:"secondary",children:"Fired"}):e.enabled?e.last_error?h.jsx(xk,{children:h.jsxs(TF,{children:[h.jsx(PF,{children:h.jsx(ht,{variant:"destructive",children:"Error"})}),h.jsx(MF,{className:"max-w-xs",children:h.jsx("p",{className:"text-xs",children:e.last_error})})]})}):h.jsx(ht,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Pending"}):h.jsx(ht,{variant:"secondary",children:"Disabled"})}function p5e(){const{data:e,isLoading:t,error:n}=kG("one_time"),[r,i]=y.useState(!1),a=AG(),o=OG();if(t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(n)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",n.message]})]});const l=e??[];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"One-Time Schedules"}),h.jsxs(we,{onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create One-Time Schedule"]})]}),l.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No one-time schedules yet."}),h.jsxs(we,{variant:"outline",className:"mt-4",onClick:()=>i(!0),children:[h.jsx(lc,{className:"mr-2 h-4 w-4"}),"Create your first one-time schedule"]})]}):h.jsx("div",{className:"rounded-lg border",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Scheduled For"}),h.jsx(Fe,{children:"Last Run"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-[100px]",children:"Actions"})]})}),h.jsx(ma,{children:l.map(c=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:c.name}),h.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:b$(c.run_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:b$(c.last_run_at)}),h.jsx(ze,{children:h.jsx(m5e,{schedule:c})}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o.mutate({id:c.id,enable:!c.enabled}),children:c.enabled?h.jsx(FF,{className:"h-3.5 w-3.5"}):h.jsx(Ip,{className:"h-3.5 w-3.5"})}),h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${c.name}"?`)&&a.mutate(c.id)},children:h.jsx(Ea,{className:"h-3.5 w-3.5"})})]})})]},c.id))})]})}),h.jsx(h5e,{open:r,onOpenChange:i})]})}function g5e(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}}function v5e(e){if(e==null)return"—";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function y5e({status:e}){switch(e){case"completed":return h.jsx(ht,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Completed"});case"running":case"starting":return h.jsx(ht,{className:"bg-blue-600 hover:bg-blue-600",children:"Running"});case"failed":return h.jsx(ht,{variant:"destructive",children:"Failed"});default:return h.jsx(ht,{variant:"secondary",children:e})}}function x5e({type:e}){return h.jsx(ht,{variant:"outline",className:"text-xs",children:e==="one_time"?"One-Time":"Recurring"})}function b5e(e){return e.schedule_type==="one_time"?"/schedules/one-time":"/schedules/recurring"}function w5e(){const[e,t]=y.useState(1),{data:n,isLoading:r,error:i}=n5e(e),a=Sa();if(r)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(ln,{className:"h-8 w-48"}),h.jsx(ln,{className:"h-64 rounded-lg"})]});if(i)return h.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[h.jsx(fa,{className:"h-4 w-4"}),h.jsxs("span",{children:["Error: ",i.message]})]});const o=(n==null?void 0:n.items)??[],l=n?Math.ceil(n.total/n.per_page):0;return h.jsxs("div",{className:"space-y-6",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Run History"}),(n==null?void 0:n.total)===0?h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[h.jsx("p",{className:"text-muted-foreground",children:"No schedule runs yet."}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sessions triggered by schedules will appear here."})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"rounded-lg border",children:h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Schedule"}),h.jsx(Fe,{children:"Type"}),h.jsx(Fe,{children:"Project"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{children:"Started"}),h.jsx(Fe,{children:"Duration"}),h.jsx(Fe,{className:"w-[80px]",children:"Session"})]})}),h.jsx(ma,{children:o.map(c=>h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:h.jsx(lr,{to:b5e(c),className:"hover:underline text-foreground",children:c.schedule_name})}),h.jsx(ze,{children:h.jsx(x5e,{type:c.schedule_type})}),h.jsx(ze,{className:"text-muted-foreground",children:c.project_name}),h.jsx(ze,{children:h.jsx(y5e,{status:c.status})}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:g5e(c.started_at)}),h.jsx(ze,{className:"text-sm text-muted-foreground",children:v5e(c.duration_ms)}),h.jsx(ze,{children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(`/projects/${c.project_id}/sessions/${c.run_id}`),children:h.jsx(B0,{className:"h-3.5 w-3.5"})})})]},c.run_id))})]})}),h.jsx(Mk,{page:e,totalPages:l,onPageChange:t})]})]})}function ZE(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Ir(e.runtime),isolation:Ir(e.isolation),memory:Ir(e.memory),orchestrator_role:Ir(t.role),orchestrator_permission_mode:Ir(t.permission_mode),policy_max_depth:Ir(n.max_depth),policy_agent_timeout:Ir(n.agent_timeout),policy_max_delegate_retries:Ir(n.max_delegate_retries),policy_cache_delegations:Ir(n.cache_delegations),policy_cache_max_entries:Ir(n.cache_max_entries),policy_cache_ttl_seconds:Ir(n.cache_ttl_seconds),policy_max_num_delegations:Ir(n.max_num_delegations),session_merge_strategy:Ir(r.merge_strategy),session_pull_before_session:Ir(r.pull_before_session),session_pr_command:Ir(r.pr_command),trace_enabled:Ir(i.enabled)}}function Ir(e){return e==null?"":String(e)}function S5e(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 j5e=["none","worktree"],E5e=["default","plan","bypassPermissions"],_5e=["auto","local","pr"],C5e=["prompt","always","never"],w$=["true","false"],JE="__empty__";function S$({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=y.useState(ZE(e)),{data:o}=Wu("agents"),{data:l}=Wu("roles"),{data:c}=Wu("memories"),f=t?ZE(t):void 0,m=JSON.stringify(e);y.useEffect(()=>{a(ZE(e))},[m]);const d=O=>A=>a(T=>({...T,[O]:A})),g=()=>{n(S5e(i))},v=(o??[]).map(O=>O.name),b=(l??[]).map(O=>O.name),w=new Set((c??[]).map(O=>O.name));w.add("none");const S=[...w].sort(),j=i.runtime&&v.length>0&&!v.includes(i.runtime)?"Runtime not found in installed agents":"",C=i.orchestrator_role&&b.length>0&&!b.includes(i.orchestrator_role)?"Role not found in installed roles":"",_=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",k=!!j||!!C||!!_;return h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"General"}),h.jsx(Sl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsxs(Lr,{label:"Runtime",children:[h.jsx(Xe,{list:"cfg-dl-runtime",value:i.runtime,onChange:O=>d("runtime")(O.target.value),placeholder:(f==null?void 0:f.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&h.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(O=>h.jsx("option",{value:O},O))}),j&&h.jsx("p",{className:"text-xs text-destructive",children:j})]}),h.jsx(Lr,{label:"Isolation",children:h.jsx(Tf,{value:i.isolation,onChange:d("isolation"),options:j5e,placeholder:(f==null?void 0:f.isolation)||"none",allowEmpty:!0})}),h.jsxs(Lr,{label:"Memory",children:[h.jsx(Xe,{list:"cfg-dl-memory",value:i.memory,onChange:O=>d("memory")(O.target.value),placeholder:(f==null?void 0:f.memory)||"dial",className:"h-8 text-xs"}),h.jsx("datalist",{id:"cfg-dl-memory",children:S.map(O=>h.jsx("option",{value:O},O))}),_&&h.jsx("p",{className:"text-xs text-destructive",children:_})]})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),h.jsx(Sl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsxs(Lr,{label:"Role",children:[h.jsx(Xe,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:O=>d("orchestrator_role")(O.target.value),placeholder:(f==null?void 0:f.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&h.jsx("datalist",{id:"cfg-dl-role",children:b.map(O=>h.jsx("option",{value:O},O))}),C&&h.jsx("p",{className:"text-xs text-destructive",children:C})]}),h.jsx(Lr,{label:"Permission Mode",children:h.jsx(Tf,{value:i.orchestrator_permission_mode,onChange:d("orchestrator_permission_mode"),options:E5e,placeholder:(f==null?void 0:f.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),h.jsx(Sl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(Lr,{label:"Max Depth",children:h.jsx(Xe,{type:"number",value:i.policy_max_depth,onChange:O=>d("policy_max_depth")(O.target.value),placeholder:(f==null?void 0:f.policy_max_depth)||"3",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Agent Timeout (seconds)",children:h.jsx(Xe,{type:"number",value:i.policy_agent_timeout,onChange:O=>d("policy_agent_timeout")(O.target.value),placeholder:(f==null?void 0:f.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Max Delegate Retries",children:h.jsx(Xe,{type:"number",value:i.policy_max_delegate_retries,onChange:O=>d("policy_max_delegate_retries")(O.target.value),placeholder:(f==null?void 0:f.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Cache Delegations",children:h.jsx(Tf,{value:i.policy_cache_delegations,onChange:d("policy_cache_delegations"),options:w$,placeholder:(f==null?void 0:f.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),h.jsx(Lr,{label:"Cache Max Entries",children:h.jsx(Xe,{value:i.policy_cache_max_entries,onChange:O=>d("policy_cache_max_entries")(O.target.value),placeholder:(f==null?void 0:f.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Cache TTL (seconds)",children:h.jsx(Xe,{value:i.policy_cache_ttl_seconds,onChange:O=>d("policy_cache_ttl_seconds")(O.target.value),placeholder:(f==null?void 0:f.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),h.jsx(Lr,{label:"Max Delegations",children:h.jsx(Xe,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:O=>d("policy_max_num_delegations")(O.target.value),placeholder:(f==null?void 0:f.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),h.jsx(Sl,{}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[h.jsx(Lr,{label:"Merge Strategy",children:h.jsx(Tf,{value:i.session_merge_strategy,onChange:d("session_merge_strategy"),options:_5e,placeholder:(f==null?void 0:f.session_merge_strategy)||"auto",allowEmpty:!0})}),h.jsx(Lr,{label:"Pull Before Session",children:h.jsx(Tf,{value:i.session_pull_before_session,onChange:d("session_pull_before_session"),options:C5e,placeholder:(f==null?void 0:f.session_pull_before_session)||"prompt",allowEmpty:!0})}),h.jsx(Lr,{label:"PR Command",className:"sm:col-span-3",children:h.jsx(Xe,{value:i.session_pr_command,onChange:O=>d("session_pr_command")(O.target.value),placeholder:(f==null?void 0:f.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),h.jsxs("section",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),h.jsx(Sl,{}),h.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:h.jsx(Lr,{label:"Enabled",children:h.jsx(Tf,{value:i.trace_enabled,onChange:d("trace_enabled"),options:w$,placeholder:(f==null?void 0:f.trace_enabled)||"true",allowEmpty:!0})})})]}),h.jsxs(we,{size:"sm",onClick:g,disabled:r||k,className:"self-start",children:[h.jsx(UF,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Lr({label:e,children:t,className:n}){return h.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[h.jsx(ot,{className:"text-xs",children:e}),t]})}function Tf({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return h.jsxs(pa,{value:e||(i?JE:""),onValueChange:a=>t(a===JE?"":a),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:r})}),h.jsxs(ya,{children:[i&&h.jsx(An,{value:JE,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>h.jsx(An,{value:a,children:a},a))]})]})}function N5e(){var g,v;const[e,t]=y.useState("global"),[n,r]=y.useState(null),i=lt(),a=fU(),o=Oc(),l=_k(n??0,{enabled:n!=null}),c=wue(),f=dU(),m=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 y.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:Oe.projects.config(n)})},[e,n,i]),h.jsxs("div",{className:"space-y-6",children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),h.jsxs(Fp,{value:e,onValueChange:t,children:[h.jsxs(Up,{children:[h.jsx(or,{value:"global",children:"Global"}),h.jsx(or,{value:"project",children:"Project"})]}),h.jsx(sr,{value:"global",className:"mt-4",children:a.isLoading?h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):h.jsx(S$,{values:((g=a.data)==null?void 0:g.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:m,saving:c.isPending})}),h.jsx(sr,{value:"project",className:"mt-4",children:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[h.jsx(ot,{className:"text-xs",children:"Project"}),h.jsxs(pa,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[h.jsx(va,{className:"h-8 text-xs",children:h.jsx(ga,{placeholder:"Select a project"})}),h.jsx(ya,{children:(o.data??[]).map(b=>h.jsx(An,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&h.jsx(S$,{values:l.data.project,placeholders:l.data.merged_nested,onSave:d,saving:f.isPending},n)]})})]})]})}function k5e(){return On({queryKey:Oe.integrations.all,queryFn:()=>Pe.get("/integrations"),refetchInterval:1e4})}function A5e(e,t){return On({queryKey:Oe.integrations.config(e),queryFn:()=>Pe.get(`/integrations/${e}/config`),enabled:(t==null?void 0:t.enabled)??!!e})}function O5e(){const e=lt();return jt({mutationFn:t=>Pe.post(`/integrations/${t}/start`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.integrations.all})}})}function T5e(){const e=lt();return jt({mutationFn:t=>Pe.post(`/integrations/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.integrations.all})}})}function P5e(){const e=lt();return jt({mutationFn:({name:t,config_values:n})=>Pe.put(`/integrations/${t}/config`,{config_values:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:Oe.integrations.config(n.name)}),e.invalidateQueries({queryKey:Oe.integrations.all})}})}function M5e(){const e=lt();return jt({mutationFn:t=>Pe.post("/integrations/install",{name:t}),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.integrations.all})}})}function D5e(){const e=lt();return jt({mutationFn:t=>Pe.delete(`/integrations/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Oe.integrations.all})}})}function R5e(e){const[t,n]=y.useState([]),[r,i]=y.useState(!1),[a,o]=y.useState(!1),l=y.useRef(null),c=y.useCallback(()=>{if(!e)return;const m=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/integrations/${e}/logs/ws`,d=new WebSocket(m);return l.current=d,d.onopen=()=>o(!0),d.onmessage=g=>{try{const v=JSON.parse(g.data);switch(v.type){case"log_snapshot":n(v.lines??[]);break;case"log_delta":n(b=>[...b,...v.lines??[]]);break;case"log_done":i(!0);break;case"error":i(!0);break}}catch{}},d.onclose=()=>{o(!1),l.current=null},d.onerror=()=>{o(!1)},d},[e]);return y.useEffect(()=>{n([]),i(!1),o(!1);const f=c();return()=>{f&&f.readyState<=WebSocket.OPEN&&f.close()}},[c]),{lines:t,done:r,connected:a}}const Tu=18,j$=10;function I5e({name:e,open:t,onOpenChange:n}){const r=t?e:null,{lines:i,done:a,connected:o}=R5e(r);return h.jsx(wH,{open:t,onOpenChange:n,children:h.jsxs(SH,{side:"right",className:"w-[700px] sm:max-w-[700px]",children:[h.jsxs(jH,{children:[h.jsxs(EH,{children:["Logs: ",e]}),h.jsx(_H,{children:"Adapter stdout/stderr output"})]}),h.jsx("div",{className:"mt-4",children:h.jsx(L5e,{lines:i,done:a,connected:o})})]})})}function L5e({lines:e,done:t,connected:n}){const[r,i]=y.useState(""),a=r.toLowerCase(),o=r?e.reduce((T,P,L)=>(P.toLowerCase().includes(a)&&T.push(L),T),[]):[],l=y.useRef(null),[c,f]=y.useState(0),[m,d]=y.useState(0),[g,v]=y.useState(!0),b=y.useRef(0),w=e.length*Tu,S=Math.max(0,Math.floor(c/Tu)-j$),j=Math.ceil(m/Tu)+j$*2,C=Math.min(e.length,S+j),_=e.slice(S,C),k=String(e.length).length,O=y.useCallback(()=>{const T=l.current;if(!T)return;f(T.scrollTop),d(T.clientHeight);const P=T.scrollTop+T.clientHeight>=T.scrollHeight-Tu*2;v(P)},[]);y.useEffect(()=>{const T=l.current;T&&d(T.clientHeight)},[]),y.useEffect(()=>{if(g&&e.length>b.current){const T=l.current;T&&(T.scrollTop=T.scrollHeight)}b.current=e.length},[e.length,g]);const A=()=>{const T=l.current;T&&(T.scrollTop=T.scrollHeight,v(!0))};return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(Sk,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),h.jsx(Xe,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:r,onChange:T=>i(T.target.value)})]}),r&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.length," match",o.length!==1?"es":""]}),h.jsx("span",{className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground",children:t?"Stream ended":h.jsxs(h.Fragment,{children:[h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n?"animate-pulse bg-green-500":"bg-orange-400"}`}),n?"Live":"Connecting..."]})})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{ref:l,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:O,children:e.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:t?"No log output.":"Waiting for log output..."}):h.jsx("div",{style:{height:w,position:"relative"},children:h.jsx("div",{style:{position:"absolute",top:S*Tu,left:0,right:0},children:_.map((T,P)=>{const L=S+P,I=r&&T.toLowerCase().includes(a);return h.jsxs("div",{className:I?"bg-yellow-900/30":void 0,style:{height:Tu,lineHeight:`${Tu}px`,display:"flex",whiteSpace:"pre"},children:[h.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(k+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:L+1}),h.jsx("span",{children:T})]},L)})})})}),!g&&e.length>0&&h.jsxs(we,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:A,children:[h.jsx(RF,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function z5e({status:e}){const t={running:{variant:"default",label:"Running"},stopped:{variant:"secondary",label:"Stopped"},error:{variant:"destructive",label:"Error"}},{variant:n,label:r}=t[e]??{variant:"outline",label:e};return h.jsx(ht,{variant:n,children:r})}function $5e(){const{data:e,isLoading:t}=k5e(),[n,r]=y.useState(null),[i,a]=y.useState(null),[o,l]=y.useState(!1);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat and community platform adapters"})]}),h.jsxs(we,{onClick:()=>l(!0),children:[h.jsx(Mp,{className:"mr-1.5 h-4 w-4"}),"Install"]})]}),t?h.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((c,f)=>h.jsx(ln,{className:"h-12 w-full"},f))}):!e||e.length===0?h.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:[h.jsx("p",{children:"No integrations installed yet."}),h.jsxs("p",{className:"mt-1 text-xs",children:["Install from Strawhub or place adapter directories in ",h.jsx("code",{className:"rounded bg-muted px-1",children:"~/.strawpot/integrations/"})]})]}):h.jsxs(da,{children:[h.jsx(ha,{children:h.jsxs(yn,{children:[h.jsx(Fe,{children:"Name"}),h.jsx(Fe,{children:"Description"}),h.jsx(Fe,{children:"Status"}),h.jsx(Fe,{className:"w-56"})]})}),h.jsx(ma,{children:e.map(c=>h.jsx(B5e,{integration:c,onConfigure:()=>r(c.name),onLogs:()=>a(c.name)},c.name))})]}),h.jsx(F5e,{open:o,onOpenChange:l}),h.jsx(U5e,{name:n,open:!!n,onOpenChange:c=>{c||r(null)}}),h.jsx(I5e,{name:i,open:!!i,onOpenChange:c=>{c||a(null)}})]})}function B5e({integration:e,onConfigure:t,onLogs:n}){const r=O5e(),i=T5e(),a=D5e(),o=e.status==="running",l=f=>{f.stopPropagation(),o?i.mutate(e.name,{onSuccess:()=>dt.success(`Stopped ${e.name}`),onError:m=>dt.error(`Failed to stop: ${m.message}`)}):r.mutate(e.name,{onSuccess:()=>dt.success(`Started ${e.name}`),onError:m=>dt.error(`Failed to start: ${m.message}`)})},c=f=>{f.stopPropagation(),confirm(`Uninstall ${e.name}? This will stop the adapter and remove all files.`)&&a.mutate(e.name,{onSuccess:m=>{m.exit_code===0?dt.success(`Uninstalled ${e.name}`):dt.error(`Uninstall failed: ${m.stderr||m.stdout}`)},onError:m=>dt.error(`Failed to uninstall: ${m.message}`)})};return h.jsxs(yn,{children:[h.jsx(ze,{className:"font-medium",children:e.name}),h.jsx(ze,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:e.description||"—"}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(z5e,{status:e.status}),o&&h.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"})]})}),h.jsx(ze,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(we,{size:"sm",variant:o?"destructive":"default",onClick:l,disabled:r.isPending||i.isPending,children:o?h.jsxs(h.Fragment,{children:[h.jsx(jk,{className:"mr-1 h-3.5 w-3.5"})," Stop"]}):h.jsxs(h.Fragment,{children:[h.jsx(Ip,{className:"mr-1 h-3.5 w-3.5"})," Start"]})}),h.jsx(we,{size:"sm",variant:"outline",onClick:f=>{f.stopPropagation(),t()},children:h.jsx(gse,{className:"h-3.5 w-3.5"})}),h.jsx(we,{size:"sm",variant:"outline",onClick:f=>{f.stopPropagation(),n()},children:h.jsx(fse,{className:"h-3.5 w-3.5"})}),h.jsx(we,{size:"sm",variant:"outline",onClick:c,disabled:a.isPending,children:h.jsx(Ea,{className:"h-3.5 w-3.5"})})]})})]})}function F5e({open:e,onOpenChange:t}){const n=M5e(),[r,i]=y.useState(""),[a,o]=y.useState(null),[l,c]=y.useState(null),f=(a==null?void 0:a.status)==="success",m=()=>{r.trim()&&(o(null),c(null),n.mutate(r.trim(),{onSuccess:g=>{g.exit_code===0?(dt.success(`Installed ${r.trim()}`),o({status:"success",message:`Successfully installed ${r.trim()}`}),c(g.stdout||null)):(o({status:"error",message:"Installation failed"}),c(g.stderr||g.stdout||"Unknown error."))},onError:()=>{o({status:"error",message:"Install request failed"}),dt.error("Install request failed")}}))},d=g=>{g||(o(null),c(null),i("")),t(g)};return h.jsx(_a,{open:e,onOpenChange:d,children:h.jsxs(Ca,{className:"sm:max-w-md",children:[h.jsxs(Na,{children:[h.jsx(ka,{children:"Install Integration"}),h.jsx(G0,{children:"Install a chat adapter from Strawhub by name."})]}),h.jsxs("div",{className:"flex flex-col gap-4",children:[a&&h.jsxs(Nm,{variant:a.status==="error"?"destructive":"default",className:a.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[a.status==="success"?h.jsx(Pp,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):h.jsx($0,{className:"h-4 w-4"}),h.jsx(km,{children:a.status==="success"?"Installed":"Error"}),h.jsx(Am,{children:a.message})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(ot,{htmlFor:"install-integration-name",children:"Package Name"}),h.jsx(Xe,{id:"install-integration-name",autoFocus:!0,value:r,onChange:g=>i(g.target.value),placeholder:"e.g. telegram",readOnly:f,onKeyDown:g=>{g.key==="Enter"&&m()}})]}),l&&h.jsxs("details",{className:"text-sm",children:[h.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:l})]})]}),h.jsx(Y0,{children:f?h.jsx(we,{onClick:()=>d(!1),children:"Done"}):h.jsx(we,{onClick:m,disabled:!r.trim()||n.isPending,children:n.isPending?"Installing...":"Install"})})]})})}function U5e({name:e,open:t,onOpenChange:n}){const{data:r}=A5e(e??"",{enabled:t&&!!e}),i=P5e(),[a,o]=y.useState({}),[l,c]=y.useState(!1);if(r&&!l){const g={};for(const v of Object.keys(r.env_schema))g[v]=r.config_values[v]??"";o(g),c(!0)}const f=g=>{g||(c(!1),o({})),n(g)},m=()=>{e&&i.mutate({name:e,config_values:a},{onSuccess:()=>{dt.success("Configuration saved"),f(!1)},onError:g=>dt.error(`Failed to save: ${g.message}`)})},d=(r==null?void 0:r.env_schema)??{};return h.jsx(_a,{open:t,onOpenChange:f,children:h.jsxs(Ca,{children:[h.jsxs(Na,{children:[h.jsxs(ka,{children:["Configure ",e]}),h.jsx(G0,{children:"Set configuration values for this integration."})]}),h.jsxs("div",{className:"space-y-4 py-2",children:[Object.entries(d).map(([g,v])=>h.jsx(H5e,{name:g,field:v,value:a[g]??"",onChange:b=>o(w=>({...w,[g]:b}))},g)),Object.keys(d).length===0&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"This integration has no configuration options."})]}),h.jsxs(Y0,{children:[h.jsx(we,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),h.jsx(we,{onClick:m,disabled:i.isPending,children:"Save"})]})]})})}function H5e({name:e,field:t,value:n,onChange:r}){return h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs(ot,{htmlFor:`config-${e}`,children:[e,t.required&&h.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),h.jsx(Xe,{id:`config-${e}`,type:"password",value:n,onChange:i=>r(i.target.value),placeholder:t.description}),t.description&&h.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})}function q5e(){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),h.jsx(we,{variant:"outline",asChild:!0,children:h.jsxs(lr,{to:"/",children:[h.jsx(qoe,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const V5e=3,K5e=1e4,Y5e=2e3;function G5e(){const e=lt(),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef(1e3),i=y.useRef(0),a=y.useRef({}),o=y.useRef(!0);y.useEffect(()=>{function l(m){const d=Date.now();if(d-i.current<Y5e)return!1;const g=(a.current[m]??[]).filter(v=>d-v<K5e);return g.length>=V5e?!1:(g.push(d),a.current[m]=g,!0)}function c(m){const d=m.type,g=(m.run_id??"unknown").slice(0,12);l(d)&&(d==="session_started"?dt.info(`Session ${g} started`):d==="session_completed"?dt.success(`Session ${g} completed`):d==="session_failed"?dt.error(`Session ${g} failed`):d==="session_stopped"&&dt.warning(`Session ${g} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),m.project_id&&(e.invalidateQueries({queryKey:Oe.projects.sessions(m.project_id)}),e.invalidateQueries({queryKey:Oe.conversations.all(m.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}function f(){const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/events`,g=new WebSocket(d);t.current=g,g.onopen=()=>{r.current=1e3,i.current=Date.now(),o.current||(e.invalidateQueries({queryKey:["sessions"]}),e.invalidateQueries({queryKey:["conversations"]})),o.current=!1},g.onmessage=v=>{let b;try{b=JSON.parse(v.data)}catch{return}b.type!=="ping"&&c(b)},g.onclose=()=>{t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),f()},r.current)},g.onerror=()=>{g.close()}}return f(),()=>{var m;(m=t.current)==null||m.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function X5e(){return G5e(),h.jsx(KQ,{children:h.jsxs(gr,{element:h.jsx(aue,{}),children:[h.jsx(gr,{index:!0,element:h.jsx(ED,{to:"/imu",replace:!0})}),h.jsx(gr,{path:"dashboard",element:h.jsx(gue,{})}),h.jsx(gr,{path:"projects",element:h.jsx(Cue,{})}),h.jsx(gr,{path:"projects/:projectId",element:h.jsx(FMe,{})}),h.jsx(gr,{path:"projects/:projectId/sessions/:runId",element:h.jsx(S4e,{})}),h.jsx(gr,{path:"projects/:projectId/conversations/:conversationId",element:h.jsx(F4e,{})}),h.jsx(gr,{path:"imu",element:h.jsx(v$,{})}),h.jsx(gr,{path:"imu/:conversationId",element:h.jsx(v$,{})}),h.jsx(gr,{path:"schedules",element:h.jsx(ED,{to:"/schedules/recurring",replace:!0})}),h.jsx(gr,{path:"schedules/recurring",element:h.jsx(d5e,{})}),h.jsx(gr,{path:"schedules/one-time",element:h.jsx(p5e,{})}),h.jsx(gr,{path:"schedules/runs",element:h.jsx(w5e,{})}),h.jsx(gr,{path:"resources/:resourceType",element:h.jsx(e5e,{})}),h.jsx(gr,{path:"integrations",element:h.jsx($5e,{})}),h.jsx(gr,{path:"settings",element:h.jsx(N5e,{})}),h.jsx(gr,{path:"*",element:h.jsx(q5e,{})})]})})}YW.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(uJ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:h.jsx(eJ,{client:rle,children:h.jsxs(xk,{children:[h.jsx(vZ,{children:h.jsx(X5e,{})}),h.jsx(nle,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
