(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();function Zi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vu={exports:{}},Qr={};/**
 * @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 Eh;function qb(){if(Eh)return Qr;Eh=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,u,d){var f=null;if(d!==void 0&&(f=""+d),u.key!==void 0&&(f=""+u.key),"key"in u){d={};for(var x in u)x!=="key"&&(d[x]=u[x])}else d=u;return u=d.ref,{$$typeof:n,type:o,key:f,ref:u!==void 0?u:null,props:d}}return Qr.Fragment=r,Qr.jsx=s,Qr.jsxs=s,Qr}var Ah;function Yb(){return Ah||(Ah=1,vu.exports=qb()),vu.exports}var a=Yb(),ju={exports:{}},je={};/**
 * @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 Mh;function Vb(){if(Mh)return je;Mh=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function j(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,D={};function E(_,F,k){this.props=_,this.context=F,this.refs=D,this.updater=k||w}E.prototype.isReactComponent={},E.prototype.setState=function(_,F){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,F,"setState")},E.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function q(){}q.prototype=E.prototype;function H(_,F,k){this.props=_,this.context=F,this.refs=D,this.updater=k||w}var K=H.prototype=new q;K.constructor=H,S(K,E.prototype),K.isPureReactComponent=!0;var U=Array.isArray;function L(){}var $={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function P(_,F,k){var Z=k.ref;return{$$typeof:n,type:_,key:F,ref:Z!==void 0?Z:null,props:k}}function A(_,F){return P(_.type,F,_.props)}function ae(_){return typeof _=="object"&&_!==null&&_.$$typeof===n}function ne(_){var F={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(k){return F[k]})}var X=/\/+/g;function W(_,F){return typeof _=="object"&&_!==null&&_.key!=null?ne(""+_.key):F.toString(36)}function te(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(L,L):(_.status="pending",_.then(function(F){_.status==="pending"&&(_.status="fulfilled",_.value=F)},function(F){_.status==="pending"&&(_.status="rejected",_.reason=F)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function M(_,F,k,Z,pe){var he=typeof _;(he==="undefined"||he==="boolean")&&(_=null);var Ee=!1;if(_===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(_.$$typeof){case n:case r:Ee=!0;break;case y:return Ee=_._init,M(Ee(_._payload),F,k,Z,pe)}}if(Ee)return pe=pe(_),Ee=Z===""?"."+W(_,0):Z,U(pe)?(k="",Ee!=null&&(k=Ee.replace(X,"$&/")+"/"),M(pe,F,k,"",function(Xt){return Xt})):pe!=null&&(ae(pe)&&(pe=A(pe,k+(pe.key==null||_&&_.key===pe.key?"":(""+pe.key).replace(X,"$&/")+"/")+Ee)),F.push(pe)),1;Ee=0;var Pe=Z===""?".":Z+":";if(U(_))for(var Ye=0;Ye<_.length;Ye++)Z=_[Ye],he=Pe+W(Z,Ye),Ee+=M(Z,F,k,he,pe);else if(Ye=j(_),typeof Ye=="function")for(_=Ye.call(_),Ye=0;!(Z=_.next()).done;)Z=Z.value,he=Pe+W(Z,Ye++),Ee+=M(Z,F,k,he,pe);else if(he==="object"){if(typeof _.then=="function")return M(te(_),F,k,Z,pe);throw F=String(_),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function z(_,F,k){if(_==null)return _;var Z=[],pe=0;return M(_,Z,"","",function(he){return F.call(k,he,pe++)}),Z}function re(_){if(_._status===-1){var F=_._result;F=F(),F.then(function(k){(_._status===0||_._status===-1)&&(_._status=1,_._result=k)},function(k){(_._status===0||_._status===-1)&&(_._status=2,_._result=k)}),_._status===-1&&(_._status=0,_._result=F)}if(_._status===1)return _._result.default;throw _._result}var oe=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},C={map:z,forEach:function(_,F,k){z(_,function(){F.apply(this,arguments)},k)},count:function(_){var F=0;return z(_,function(){F++}),F},toArray:function(_){return z(_,function(F){return F})||[]},only:function(_){if(!ae(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return je.Activity=g,je.Children=C,je.Component=E,je.Fragment=s,je.Profiler=u,je.PureComponent=H,je.StrictMode=o,je.Suspense=p,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,je.__COMPILER_RUNTIME={__proto__:null,c:function(_){return $.H.useMemoCache(_)}},je.cache=function(_){return function(){return _.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(_,F,k){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var Z=S({},_.props),pe=_.key;if(F!=null)for(he in F.key!==void 0&&(pe=""+F.key),F)!ue.call(F,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&F.ref===void 0||(Z[he]=F[he]);var he=arguments.length-2;if(he===1)Z.children=k;else if(1<he){for(var Ee=Array(he),Pe=0;Pe<he;Pe++)Ee[Pe]=arguments[Pe+2];Z.children=Ee}return P(_.type,pe,Z)},je.createContext=function(_){return _={$$typeof:f,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:d,_context:_},_},je.createElement=function(_,F,k){var Z,pe={},he=null;if(F!=null)for(Z in F.key!==void 0&&(he=""+F.key),F)ue.call(F,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(pe[Z]=F[Z]);var Ee=arguments.length-2;if(Ee===1)pe.children=k;else if(1<Ee){for(var Pe=Array(Ee),Ye=0;Ye<Ee;Ye++)Pe[Ye]=arguments[Ye+2];pe.children=Pe}if(_&&_.defaultProps)for(Z in Ee=_.defaultProps,Ee)pe[Z]===void 0&&(pe[Z]=Ee[Z]);return P(_,he,pe)},je.createRef=function(){return{current:null}},je.forwardRef=function(_){return{$$typeof:x,render:_}},je.isValidElement=ae,je.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:re}},je.memo=function(_,F){return{$$typeof:h,type:_,compare:F===void 0?null:F}},je.startTransition=function(_){var F=$.T,k={};$.T=k;try{var Z=_(),pe=$.S;pe!==null&&pe(k,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(L,oe)}catch(he){oe(he)}finally{F!==null&&k.types!==null&&(F.types=k.types),$.T=F}},je.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},je.use=function(_){return $.H.use(_)},je.useActionState=function(_,F,k){return $.H.useActionState(_,F,k)},je.useCallback=function(_,F){return $.H.useCallback(_,F)},je.useContext=function(_){return $.H.useContext(_)},je.useDebugValue=function(){},je.useDeferredValue=function(_,F){return $.H.useDeferredValue(_,F)},je.useEffect=function(_,F){return $.H.useEffect(_,F)},je.useEffectEvent=function(_){return $.H.useEffectEvent(_)},je.useId=function(){return $.H.useId()},je.useImperativeHandle=function(_,F,k){return $.H.useImperativeHandle(_,F,k)},je.useInsertionEffect=function(_,F){return $.H.useInsertionEffect(_,F)},je.useLayoutEffect=function(_,F){return $.H.useLayoutEffect(_,F)},je.useMemo=function(_,F){return $.H.useMemo(_,F)},je.useOptimistic=function(_,F){return $.H.useOptimistic(_,F)},je.useReducer=function(_,F,k){return $.H.useReducer(_,F,k)},je.useRef=function(_){return $.H.useRef(_)},je.useState=function(_){return $.H.useState(_)},je.useSyncExternalStore=function(_,F,k){return $.H.useSyncExternalStore(_,F,k)},je.useTransition=function(){return $.H.useTransition()},je.version="19.2.4",je}var zh;function sd(){return zh||(zh=1,ju.exports=Vb()),ju.exports}var O=sd();const Jr=Zi(O);var Nu={exports:{}},Xr={},wu={exports:{}},ku={};/**
 * @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 Oh;function Gb(){return Oh||(Oh=1,(function(n){function r(M,z){var re=M.length;M.push(z);e:for(;0<re;){var oe=re-1>>>1,C=M[oe];if(0<u(C,z))M[oe]=z,M[re]=C,re=oe;else break e}}function s(M){return M.length===0?null:M[0]}function o(M){if(M.length===0)return null;var z=M[0],re=M.pop();if(re!==z){M[0]=re;e:for(var oe=0,C=M.length,_=C>>>1;oe<_;){var F=2*(oe+1)-1,k=M[F],Z=F+1,pe=M[Z];if(0>u(k,re))Z<C&&0>u(pe,k)?(M[oe]=pe,M[Z]=re,oe=Z):(M[oe]=k,M[F]=re,oe=F);else if(Z<C&&0>u(pe,re))M[oe]=pe,M[Z]=re,oe=Z;else break e}}return z}function u(M,z){var re=M.sortIndex-z.sortIndex;return re!==0?re:M.id-z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,x=f.now();n.unstable_now=function(){return f.now()-x}}var p=[],h=[],y=1,g=null,v=3,j=!1,w=!1,S=!1,D=!1,E=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function K(M){for(var z=s(h);z!==null;){if(z.callback===null)o(h);else if(z.startTime<=M)o(h),z.sortIndex=z.expirationTime,r(p,z);else break;z=s(h)}}function U(M){if(S=!1,K(M),!w)if(s(p)!==null)w=!0,L||(L=!0,ne());else{var z=s(h);z!==null&&te(U,z.startTime-M)}}var L=!1,$=-1,ue=5,P=-1;function A(){return D?!0:!(n.unstable_now()-P<ue)}function ae(){if(D=!1,L){var M=n.unstable_now();P=M;var z=!0;try{e:{w=!1,S&&(S=!1,q($),$=-1),j=!0;var re=v;try{t:{for(K(M),g=s(p);g!==null&&!(g.expirationTime>M&&A());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,v=g.priorityLevel;var C=oe(g.expirationTime<=M);if(M=n.unstable_now(),typeof C=="function"){g.callback=C,K(M),z=!0;break t}g===s(p)&&o(p),K(M)}else o(p);g=s(p)}if(g!==null)z=!0;else{var _=s(h);_!==null&&te(U,_.startTime-M),z=!1}}break e}finally{g=null,v=re,j=!1}z=void 0}}finally{z?ne():L=!1}}}var ne;if(typeof H=="function")ne=function(){H(ae)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,W=X.port2;X.port1.onmessage=ae,ne=function(){W.postMessage(null)}}else ne=function(){E(ae,0)};function te(M,z){$=E(function(){M(n.unstable_now())},z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(M){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var re=v;v=z;try{return M()}finally{v=re}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(M,z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var re=v;v=M;try{return z()}finally{v=re}},n.unstable_scheduleCallback=function(M,z,re){var oe=n.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?oe+re:oe):re=oe,M){case 1:var C=-1;break;case 2:C=250;break;case 5:C=1073741823;break;case 4:C=1e4;break;default:C=5e3}return C=re+C,M={id:y++,callback:z,priorityLevel:M,startTime:re,expirationTime:C,sortIndex:-1},re>oe?(M.sortIndex=re,r(h,M),s(p)===null&&M===s(h)&&(S?(q($),$=-1):S=!0,te(U,re-oe))):(M.sortIndex=C,r(p,M),w||j||(w=!0,L||(L=!0,ne()))),M},n.unstable_shouldYield=A,n.unstable_wrapCallback=function(M){var z=v;return function(){var re=v;v=z;try{return M.apply(this,arguments)}finally{v=re}}}})(ku)),ku}var Dh;function $b(){return Dh||(Dh=1,wu.exports=Gb()),wu.exports}var Su={exports:{}},yt={};/**
 * @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 Rh;function Qb(){if(Rh)return yt;Rh=1;var n=sd();function r(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(p,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:g==null?null:""+g,children:p,containerInfo:h,implementation:y}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yt.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return d(p,h,null,y)},yt.flushSync=function(p){var h=f.T,y=o.p;try{if(f.T=null,o.p=2,p)return p()}finally{f.T=h,o.p=y,o.d.f()}},yt.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},yt.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},yt.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,g=x(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:j}):y==="script"&&o.d.X(p,{crossOrigin:g,integrity:v,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},yt.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=x(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},yt.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=x(y,h.crossOrigin);o.d.L(p,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},yt.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=x(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},yt.requestFormReset=function(p){o.d.r(p)},yt.unstable_batchedUpdates=function(p,h){return p(h)},yt.useFormState=function(p,h,y){return f.H.useFormState(p,h,y)},yt.useFormStatus=function(){return f.H.useHostTransitionStatus()},yt.version="19.2.4",yt}var Lh;function Xb(){if(Lh)return Su.exports;Lh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Su.exports=Qb(),Su.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 Uh;function Fb(){if(Uh)return Xr;Uh=1;var n=$b(),r=sd(),s=Xb();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(d(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,i=t;;){var c=l.return;if(c===null)break;var m=c.alternate;if(m===null){if(i=c.return,i!==null){l=i;continue}break}if(c.child===m.child){for(m=c.child;m;){if(m===l)return p(c),e;if(m===i)return p(c),t;m=m.sibling}throw Error(o(188))}if(l.return!==i.return)l=c,i=m;else{for(var b=!1,N=c.child;N;){if(N===l){b=!0,l=c,i=m;break}if(N===i){b=!0,i=c,l=m;break}N=N.sibling}if(!b){for(N=m.child;N;){if(N===l){b=!0,l=m,i=c;break}if(N===i){b=!0,i=m,l=c;break}N=N.sibling}if(!b)throw Error(o(189))}}if(l.alternate!==i)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),H=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),A=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case D:return"StrictMode";case U:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case H:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case K:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case ue:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var te=Array.isArray,M=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},oe=[],C=-1;function _(e){return{current:e}}function F(e){0>C||(e.current=oe[C],oe[C]=null,C--)}function k(e,t){C++,oe[C]=e.current,e.current=t}var Z=_(null),pe=_(null),he=_(null),Ee=_(null);function Pe(e,t){switch(k(he,t),k(pe,e),k(Z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pm(t),e=Wm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(Z),k(Z,e)}function Ye(){F(Z),F(pe),F(he)}function Xt(e){e.memoizedState!==null&&k(Ee,e);var t=Z.current,l=Wm(t,e.type);t!==l&&(k(pe,e),k(Z,l))}function Nn(e){pe.current===e&&(F(Z),F(pe)),Ee.current===e&&(F(Ee),Yr._currentValue=re)}var Pa,ms;function wn(e){if(Pa===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Pa=t&&t[1]||"",ms=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Pa+e+ms}var Xl=!1;function Fl(e,t){if(!e||Xl)return"";Xl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(Q){var G=Q}Reflect.construct(e,[],le)}else{try{le.call()}catch(Q){G=Q}e.call(le.prototype)}}else{try{throw Error()}catch(Q){G=Q}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),b=m[0],N=m[1];if(b&&N){var T=b.split(`
`),V=N.split(`
`);for(c=i=0;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;for(;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;if(i===T.length||c===V.length)for(i=T.length-1,c=V.length-1;1<=i&&0<=c&&T[i]!==V[c];)c--;for(;1<=i&&0<=c;i--,c--)if(T[i]!==V[c]){if(i!==1||c!==1)do if(i--,c--,0>c||T[i]!==V[c]){var I=`
`+T[i].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=i&&0<=c);break}}}finally{Xl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?wn(l):""}function hs(e,t){switch(e.tag){case 26:case 27:case 5:return wn(e.type);case 16:return wn("Lazy");case 13:return e.child!==t&&t!==null?wn("Suspense Fallback"):wn("Suspense");case 19:return wn("SuspenseList");case 0:case 15:return Fl(e.type,!1);case 11:return Fl(e.type.render,!1);case 1:return Fl(e.type,!0);case 31:return wn("Activity");default:return""}}function xs(e){try{var t="",l=null;do t+=hs(e,l),l=e,e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var Zl=Object.prototype.hasOwnProperty,Il=n.unstable_scheduleCallback,Wa=n.unstable_cancelCallback,ao=n.unstable_shouldYield,ro=n.unstable_requestPaint,jt=n.unstable_now,so=n.unstable_getCurrentPriorityLevel,J=n.unstable_ImmediatePriority,ce=n.unstable_UserBlockingPriority,ve=n.unstable_NormalPriority,Se=n.unstable_LowPriority,Ue=n.unstable_IdlePriority,Rt=n.log,kn=n.unstable_setDisableYieldValue,Nt=null,ct=null;function St(e){if(typeof Rt=="function"&&kn(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(Nt,e)}catch{}}var Qe=Math.clz32?Math.clz32:Cg,Qn=Math.log,sn=Math.LN2;function Cg(e){return e>>>=0,e===0?32:31-(Qn(e)/sn|0)|0}var ps=256,gs=262144,ys=4194304;function jl(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bs(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var c=0,m=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~m,i!==0?c=jl(i):(b&=N,b!==0?c=jl(b):l||(l=N&~e,l!==0&&(c=jl(l))))):(N=i&~m,N!==0?c=jl(N):b!==0?c=jl(b):l||(l=i&~e,l!==0&&(c=jl(l)))),c===0?0:t!==0&&t!==c&&(t&m)===0&&(m=c&-c,l=t&-t,m>=l||m===32&&(l&4194048)!==0)?t:c}function er(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _g(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 zd(){var e=ys;return ys<<=1,(ys&62914560)===0&&(ys=4194304),e}function io(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function tr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Tg(e,t,l,i,c,m){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var N=e.entanglements,T=e.expirationTimes,V=e.hiddenUpdates;for(l=b&~l;0<l;){var I=31-Qe(l),le=1<<I;N[I]=0,T[I]=-1;var G=V[I];if(G!==null)for(V[I]=null,I=0;I<G.length;I++){var Q=G[I];Q!==null&&(Q.lane&=-536870913)}l&=~le}i!==0&&Od(e,i,0),m!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=m&~(b&~t))}function Od(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Qe(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&261930}function Dd(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-Qe(l),c=1<<i;c&t|e[i]&t&&(e[i]|=t),l&=~c}}function Rd(e,t){var l=t&-t;return l=(l&42)!==0?1:oo(l),(l&(e.suspendedLanes|t))!==0?0:l}function oo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function co(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ld(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Nh(e.type))}function Ud(e,t){var l=z.p;try{return z.p=e,t()}finally{z.p=l}}var Xn=Math.random().toString(36).slice(2),mt="__reactFiber$"+Xn,Ct="__reactProps$"+Xn,Kl="__reactContainer$"+Xn,uo="__reactEvents$"+Xn,Eg="__reactListeners$"+Xn,Ag="__reactHandles$"+Xn,Hd="__reactResources$"+Xn,nr="__reactMarker$"+Xn;function fo(e){delete e[mt],delete e[Ct],delete e[uo],delete e[Eg],delete e[Ag]}function Jl(e){var t=e[mt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Kl]||l[mt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=sh(e);e!==null;){if(l=e[mt])return l;e=sh(e)}return t}e=l,l=e.parentNode}return null}function Pl(e){if(e=e[mt]||e[Kl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Wl(e){var t=e[Hd];return t||(t=e[Hd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function dt(e){e[nr]=!0}var Bd=new Set,qd={};function Nl(e,t){ea(e,t),ea(e+"Capture",t)}function ea(e,t){for(qd[e]=t,e=0;e<t.length;e++)Bd.add(t[e])}var Mg=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]*$"),Yd={},Vd={};function zg(e){return Zl.call(Vd,e)?!0:Zl.call(Yd,e)?!1:Mg.test(e)?Vd[e]=!0:(Yd[e]=!0,!1)}function vs(e,t,l){if(zg(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function js(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Sn(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Og(e,t,l){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mo(e){if(!e._valueTracker){var t=Gd(e)?"checked":"value";e._valueTracker=Og(e,t,""+e[t])}}function $d(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=Gd(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function Ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Dg=/[\n"\\]/g;function Zt(e){return e.replace(Dg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ho(e,t,l,i,c,m,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?xo(e,b,Ft(t)):l!=null?xo(e,b,Ft(l)):i!=null&&e.removeAttribute("value"),c==null&&m!=null&&(e.defaultChecked=!!m),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Ft(N):e.removeAttribute("name")}function Qd(e,t,l,i,c,m,b,N){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){mo(e);return}l=l!=null?""+Ft(l):"",t=t!=null?""+Ft(t):l,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),mo(e)}function xo(e,t,l){t==="number"&&Ns(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ta(e,t,l,i){if(e=e.options,t){t={};for(var c=0;c<l.length;c++)t["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=t.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&i&&(e[l].defaultSelected=!0)}else{for(l=""+Ft(l),t=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Xd(e,t,l){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ft(l):""}function Fd(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(o(92));if(te(i)){if(1<i.length)throw Error(o(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=Ft(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i),mo(e)}function na(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Rg=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 Zd(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||Rg.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Id(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in t)i=t[c],t.hasOwnProperty(c)&&l[c]!==i&&Zd(e,c,i)}else for(var m in t)t.hasOwnProperty(m)&&Zd(e,m,t[m])}function po(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Lg=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"]]),Ug=/^[\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 ws(e){return Ug.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Cn(){}var go=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var la=null,aa=null;function Kd(e){var t=Pl(e);if(t&&(e=t.stateNode)){var l=e[Ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(ho(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var c=i[Ct]||null;if(!c)throw Error(o(90));ho(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&$d(i)}break e;case"textarea":Xd(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&ta(e,!!l.multiple,t,!1)}}}var bo=!1;function Jd(e,t,l){if(bo)return e(t,l);bo=!0;try{var i=e(t);return i}finally{if(bo=!1,(la!==null||aa!==null)&&(ui(),la&&(t=la,e=aa,aa=la=null,Kd(t),e)))for(t=0;t<e.length;t++)Kd(e[t])}}function ar(e,t){var l=e.stateNode;if(l===null)return null;var i=l[Ct]||null;if(i===null)return null;l=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vo=!1;if(_n)try{var rr={};Object.defineProperty(rr,"passive",{get:function(){vo=!0}}),window.addEventListener("test",rr,rr),window.removeEventListener("test",rr,rr)}catch{vo=!1}var Fn=null,jo=null,ks=null;function Pd(){if(ks)return ks;var e,t=jo,l=t.length,i,c="value"in Fn?Fn.value:Fn.textContent,m=c.length;for(e=0;e<l&&t[e]===c[e];e++);var b=l-e;for(i=1;i<=b&&t[l-i]===c[m-i];i++);return ks=c.slice(e,1<i?1-i:void 0)}function Ss(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cs(){return!0}function Wd(){return!1}function _t(e){function t(l,i,c,m,b){this._reactName=l,this._targetInst=c,this.type=i,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(l=e[N],this[N]=l?l(m):m[N]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Cs:Wd,this.isPropagationStopped=Wd,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Cs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Cs)},persist:function(){},isPersistent:Cs}),t}var wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_s=_t(wl),sr=g({},wl,{view:0,detail:0}),Hg=_t(sr),No,wo,ir,Ts=g({},sr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:So,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ir&&(ir&&e.type==="mousemove"?(No=e.screenX-ir.screenX,wo=e.screenY-ir.screenY):wo=No=0,ir=e),No)},movementY:function(e){return"movementY"in e?e.movementY:wo}}),ef=_t(Ts),Bg=g({},Ts,{dataTransfer:0}),qg=_t(Bg),Yg=g({},sr,{relatedTarget:0}),ko=_t(Yg),Vg=g({},wl,{animationName:0,elapsedTime:0,pseudoElement:0}),Gg=_t(Vg),$g=g({},wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qg=_t($g),Xg=g({},wl,{data:0}),tf=_t(Xg),Fg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zg={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"},Ig={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ig[e])?!!t[e]:!1}function So(){return Kg}var Jg=g({},sr,{key:function(e){if(e.key){var t=Fg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ss(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:So,charCode:function(e){return e.type==="keypress"?Ss(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ss(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pg=_t(Jg),Wg=g({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nf=_t(Wg),ey=g({},sr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:So}),ty=_t(ey),ny=g({},wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),ly=_t(ny),ay=g({},Ts,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ry=_t(ay),sy=g({},wl,{newState:0,oldState:0}),iy=_t(sy),oy=[9,13,27,32],Co=_n&&"CompositionEvent"in window,or=null;_n&&"documentMode"in document&&(or=document.documentMode);var cy=_n&&"TextEvent"in window&&!or,lf=_n&&(!Co||or&&8<or&&11>=or),af=" ",rf=!1;function sf(e,t){switch(e){case"keyup":return oy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function of(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ra=!1;function uy(e,t){switch(e){case"compositionend":return of(t);case"keypress":return t.which!==32?null:(rf=!0,af);case"textInput":return e=t.data,e===af&&rf?null:e;default:return null}}function dy(e,t){if(ra)return e==="compositionend"||!Co&&sf(e,t)?(e=Pd(),ks=jo=Fn=null,ra=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lf&&t.locale!=="ko"?null:t.data;default:return null}}var fy={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 cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fy[e.type]:t==="textarea"}function uf(e,t,l,i){la?aa?aa.push(i):aa=[i]:la=i,t=gi(t,"onChange"),0<t.length&&(l=new _s("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var cr=null,ur=null;function my(e){Xm(e,0)}function Es(e){var t=lr(e);if($d(t))return e}function df(e,t){if(e==="change")return t}var ff=!1;if(_n){var _o;if(_n){var To="oninput"in document;if(!To){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),To=typeof mf.oninput=="function"}_o=To}else _o=!1;ff=_o&&(!document.documentMode||9<document.documentMode)}function hf(){cr&&(cr.detachEvent("onpropertychange",xf),ur=cr=null)}function xf(e){if(e.propertyName==="value"&&Es(ur)){var t=[];uf(t,ur,e,yo(e)),Jd(my,t)}}function hy(e,t,l){e==="focusin"?(hf(),cr=t,ur=l,cr.attachEvent("onpropertychange",xf)):e==="focusout"&&hf()}function xy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(ur)}function py(e,t){if(e==="click")return Es(t)}function gy(e,t){if(e==="input"||e==="change")return Es(t)}function yy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:yy;function dr(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var c=l[i];if(!Zl.call(t,c)||!Lt(e[c],t[c]))return!1}return!0}function pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gf(e,t){var l=pf(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=pf(l)}}function yf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ns(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ns(e.document)}return t}function Eo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var by=_n&&"documentMode"in document&&11>=document.documentMode,sa=null,Ao=null,fr=null,Mo=!1;function vf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mo||sa==null||sa!==Ns(i)||(i=sa,"selectionStart"in i&&Eo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),fr&&dr(fr,i)||(fr=i,i=gi(Ao,"onSelect"),0<i.length&&(t=new _s("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=sa)))}function kl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ia={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionrun:kl("Transition","TransitionRun"),transitionstart:kl("Transition","TransitionStart"),transitioncancel:kl("Transition","TransitionCancel"),transitionend:kl("Transition","TransitionEnd")},zo={},jf={};_n&&(jf=document.createElement("div").style,"AnimationEvent"in window||(delete ia.animationend.animation,delete ia.animationiteration.animation,delete ia.animationstart.animation),"TransitionEvent"in window||delete ia.transitionend.transition);function Sl(e){if(zo[e])return zo[e];if(!ia[e])return e;var t=ia[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in jf)return zo[e]=t[l];return e}var Nf=Sl("animationend"),wf=Sl("animationiteration"),kf=Sl("animationstart"),vy=Sl("transitionrun"),jy=Sl("transitionstart"),Ny=Sl("transitioncancel"),Sf=Sl("transitionend"),Cf=new Map,Oo="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(" ");Oo.push("scrollEnd");function on(e,t){Cf.set(e,t),Nl(t,[e])}var As=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},It=[],oa=0,Do=0;function Ms(){for(var e=oa,t=Do=oa=0;t<e;){var l=It[t];It[t++]=null;var i=It[t];It[t++]=null;var c=It[t];It[t++]=null;var m=It[t];if(It[t++]=null,i!==null&&c!==null){var b=i.pending;b===null?c.next=c:(c.next=b.next,b.next=c),i.pending=c}m!==0&&_f(l,c,m)}}function zs(e,t,l,i){It[oa++]=e,It[oa++]=t,It[oa++]=l,It[oa++]=i,Do|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ro(e,t,l,i){return zs(e,t,l,i),Os(e)}function Cl(e,t){return zs(e,null,null,t),Os(e)}function _f(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var c=!1,m=e.return;m!==null;)m.childLanes|=l,i=m.alternate,i!==null&&(i.childLanes|=l),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(c=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,c&&t!==null&&(c=31-Qe(l),e=m.hiddenUpdates,i=e[c],i===null?e[c]=[t]:i.push(t),t.lane=l|536870912),m):null}function Os(e){if(50<Dr)throw Dr=0,$c=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ca={};function wy(e,t,l,i){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(e,t,l,i){return new wy(e,t,l,i)}function Lo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tn(e,t){var l=e.alternate;return l===null?(l=Ut(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Tf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ds(e,t,l,i,c,m){var b=0;if(i=e,typeof e=="function")Lo(e)&&(b=1);else if(typeof e=="string")b=Tb(e,l,Z.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Ut(31,l,t,c),e.elementType=P,e.lanes=m,e;case S:return _l(l.children,c,m,t);case D:b=8,c|=24;break;case E:return e=Ut(12,l,t,c|2),e.elementType=E,e.lanes=m,e;case U:return e=Ut(13,l,t,c),e.elementType=U,e.lanes=m,e;case L:return e=Ut(19,l,t,c),e.elementType=L,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:b=10;break e;case q:b=9;break e;case K:b=11;break e;case $:b=14;break e;case ue:b=16,i=null;break e}b=29,l=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Ut(b,l,t,c),t.elementType=e,t.type=i,t.lanes=m,t}function _l(e,t,l,i){return e=Ut(7,e,i,t),e.lanes=l,e}function Uo(e,t,l){return e=Ut(6,e,null,t),e.lanes=l,e}function Ef(e){var t=Ut(18,null,null,0);return t.stateNode=e,t}function Ho(e,t,l){return t=Ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Af=new WeakMap;function Kt(e,t){if(typeof e=="object"&&e!==null){var l=Af.get(e);return l!==void 0?l:(t={value:e,source:t,stack:xs(t)},Af.set(e,t),t)}return{value:e,source:t,stack:xs(t)}}var ua=[],da=0,Rs=null,mr=0,Jt=[],Pt=0,Zn=null,fn=1,mn="";function En(e,t){ua[da++]=mr,ua[da++]=Rs,Rs=e,mr=t}function Mf(e,t,l){Jt[Pt++]=fn,Jt[Pt++]=mn,Jt[Pt++]=Zn,Zn=e;var i=fn;e=mn;var c=32-Qe(i)-1;i&=~(1<<c),l+=1;var m=32-Qe(t)+c;if(30<m){var b=c-c%5;m=(i&(1<<b)-1).toString(32),i>>=b,c-=b,fn=1<<32-Qe(t)+c|l<<c|i,mn=m+e}else fn=1<<m|l<<c|i,mn=e}function Bo(e){e.return!==null&&(En(e,1),Mf(e,1,0))}function qo(e){for(;e===Rs;)Rs=ua[--da],ua[da]=null,mr=ua[--da],ua[da]=null;for(;e===Zn;)Zn=Jt[--Pt],Jt[Pt]=null,mn=Jt[--Pt],Jt[Pt]=null,fn=Jt[--Pt],Jt[Pt]=null}function zf(e,t){Jt[Pt++]=fn,Jt[Pt++]=mn,Jt[Pt++]=Zn,fn=t.id,mn=t.overflow,Zn=e}var ht=null,Ke=null,ze=!1,In=null,Wt=!1,Yo=Error(o(519));function Kn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hr(Kt(t,e)),Yo}function Of(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[mt]=e,t[Ct]=i,l){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(l=0;l<Lr.length;l++)_e(Lr[l],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),Qd(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),Fd(t,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||Km(t.textContent,l)?(i.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),i.onScroll!=null&&_e("scroll",t),i.onScrollEnd!=null&&_e("scrollend",t),i.onClick!=null&&(t.onclick=Cn),t=!0):t=!1,t||Kn(e,!0)}function Df(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:Wt=!1;return;case 27:case 3:Wt=!0;return;default:ht=ht.return}}function fa(e){if(e!==ht)return!1;if(!ze)return Df(e),ze=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ru(e.type,e.memoizedProps)),l=!l),l&&Ke&&Kn(e),Df(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ke=rh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ke=rh(e)}else t===27?(t=Ke,ul(e.type)?(e=uu,uu=null,Ke=e):Ke=t):Ke=ht?tn(e.stateNode.nextSibling):null;return!0}function Tl(){Ke=ht=null,ze=!1}function Vo(){var e=In;return e!==null&&(Mt===null?Mt=e:Mt.push.apply(Mt,e),In=null),e}function hr(e){In===null?In=[e]:In.push(e)}var Go=_(null),El=null,An=null;function Jn(e,t,l){k(Go,t._currentValue),t._currentValue=l}function Mn(e){e._currentValue=Go.current,F(Go)}function $o(e,t,l){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===l)break;e=e.return}}function Qo(e,t,l,i){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var m=c.dependencies;if(m!==null){var b=c.child;m=m.firstContext;e:for(;m!==null;){var N=m;m=c;for(var T=0;T<t.length;T++)if(N.context===t[T]){m.lanes|=l,N=m.alternate,N!==null&&(N.lanes|=l),$o(m.return,l,e),i||(b=null);break e}m=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),$o(b,l,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function ma(e,t,l,i){e=null;for(var c=t,m=!1;c!==null;){if(!m){if((c.flags&524288)!==0)m=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var N=c.type;Lt(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===Ee.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Yr):e=[Yr])}c=c.return}e!==null&&Qo(t,e,l,i),t.flags|=262144}function Ls(e){for(e=e.firstContext;e!==null;){if(!Lt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Al(e){El=e,An=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return Rf(El,e)}function Us(e,t){return El===null&&Al(e),Rf(e,t)}function Rf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},An===null){if(e===null)throw Error(o(308));An=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else An=An.next=t;return l}var ky=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Sy=n.unstable_scheduleCallback,Cy=n.unstable_NormalPriority,at={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xo(){return{controller:new ky,data:new Map,refCount:0}}function xr(e){e.refCount--,e.refCount===0&&Sy(Cy,function(){e.controller.abort()})}var pr=null,Fo=0,ha=0,xa=null;function _y(e,t){if(pr===null){var l=pr=[];Fo=0,ha=Kc(),xa={status:"pending",value:void 0,then:function(i){l.push(i)}}}return Fo++,t.then(Lf,Lf),t}function Lf(){if(--Fo===0&&pr!==null){xa!==null&&(xa.status="fulfilled");var e=pr;pr=null,ha=0,xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ty(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var c=0;c<l.length;c++)(0,l[c])(t)},function(c){for(i.status="rejected",i.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),i}var Uf=M.S;M.S=function(e,t){vm=jt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_y(e,t),Uf!==null&&Uf(e,t)};var Ml=_(null);function Zo(){var e=Ml.current;return e!==null?e:Xe.pooledCache}function Hs(e,t){t===null?k(Ml,Ml.current):k(Ml,t.pool)}function Hf(){var e=Zo();return e===null?null:{parent:at._currentValue,pool:e}}var pa=Error(o(460)),Io=Error(o(474)),Bs=Error(o(542)),qs={then:function(){}};function Bf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Cn,Cn),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e;default:if(typeof t.status=="string")t.then(Cn,Cn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=i}},function(i){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e}throw Ol=t,pa}}function zl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ol=l,pa):l}}var Ol=null;function Yf(){if(Ol===null)throw Error(o(459));var e=Ol;return Ol=null,e}function Vf(e){if(e===pa||e===Bs)throw Error(o(483))}var ga=null,gr=0;function Ys(e){var t=gr;return gr+=1,ga===null&&(ga=[]),qf(ga,e,t)}function yr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vs(e,t){throw t.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gf(e){function t(B,R){if(e){var Y=B.deletions;Y===null?(B.deletions=[R],B.flags|=16):Y.push(R)}}function l(B,R){if(!e)return null;for(;R!==null;)t(B,R),R=R.sibling;return null}function i(B){for(var R=new Map;B!==null;)B.key!==null?R.set(B.key,B):R.set(B.index,B),B=B.sibling;return R}function c(B,R){return B=Tn(B,R),B.index=0,B.sibling=null,B}function m(B,R,Y){return B.index=Y,e?(Y=B.alternate,Y!==null?(Y=Y.index,Y<R?(B.flags|=67108866,R):Y):(B.flags|=67108866,R)):(B.flags|=1048576,R)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function N(B,R,Y,ee){return R===null||R.tag!==6?(R=Uo(Y,B.mode,ee),R.return=B,R):(R=c(R,Y),R.return=B,R)}function T(B,R,Y,ee){var ge=Y.type;return ge===S?I(B,R,Y.props.children,ee,Y.key):R!==null&&(R.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===ue&&zl(ge)===R.type)?(R=c(R,Y.props),yr(R,Y),R.return=B,R):(R=Ds(Y.type,Y.key,Y.props,null,B.mode,ee),yr(R,Y),R.return=B,R)}function V(B,R,Y,ee){return R===null||R.tag!==4||R.stateNode.containerInfo!==Y.containerInfo||R.stateNode.implementation!==Y.implementation?(R=Ho(Y,B.mode,ee),R.return=B,R):(R=c(R,Y.children||[]),R.return=B,R)}function I(B,R,Y,ee,ge){return R===null||R.tag!==7?(R=_l(Y,B.mode,ee,ge),R.return=B,R):(R=c(R,Y),R.return=B,R)}function le(B,R,Y){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Uo(""+R,B.mode,Y),R.return=B,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case j:return Y=Ds(R.type,R.key,R.props,null,B.mode,Y),yr(Y,R),Y.return=B,Y;case w:return R=Ho(R,B.mode,Y),R.return=B,R;case ue:return R=zl(R),le(B,R,Y)}if(te(R)||ne(R))return R=_l(R,B.mode,Y,null),R.return=B,R;if(typeof R.then=="function")return le(B,Ys(R),Y);if(R.$$typeof===H)return le(B,Us(B,R),Y);Vs(B,R)}return null}function G(B,R,Y,ee){var ge=R!==null?R.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return ge!==null?null:N(B,R,""+Y,ee);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case j:return Y.key===ge?T(B,R,Y,ee):null;case w:return Y.key===ge?V(B,R,Y,ee):null;case ue:return Y=zl(Y),G(B,R,Y,ee)}if(te(Y)||ne(Y))return ge!==null?null:I(B,R,Y,ee,null);if(typeof Y.then=="function")return G(B,R,Ys(Y),ee);if(Y.$$typeof===H)return G(B,R,Us(B,Y),ee);Vs(B,Y)}return null}function Q(B,R,Y,ee,ge){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return B=B.get(Y)||null,N(R,B,""+ee,ge);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case j:return B=B.get(ee.key===null?Y:ee.key)||null,T(R,B,ee,ge);case w:return B=B.get(ee.key===null?Y:ee.key)||null,V(R,B,ee,ge);case ue:return ee=zl(ee),Q(B,R,Y,ee,ge)}if(te(ee)||ne(ee))return B=B.get(Y)||null,I(R,B,ee,ge,null);if(typeof ee.then=="function")return Q(B,R,Y,Ys(ee),ge);if(ee.$$typeof===H)return Q(B,R,Y,Us(R,ee),ge);Vs(R,ee)}return null}function me(B,R,Y,ee){for(var ge=null,De=null,xe=R,we=R=0,Me=null;xe!==null&&we<Y.length;we++){xe.index>we?(Me=xe,xe=null):Me=xe.sibling;var Re=G(B,xe,Y[we],ee);if(Re===null){xe===null&&(xe=Me);break}e&&xe&&Re.alternate===null&&t(B,xe),R=m(Re,R,we),De===null?ge=Re:De.sibling=Re,De=Re,xe=Me}if(we===Y.length)return l(B,xe),ze&&En(B,we),ge;if(xe===null){for(;we<Y.length;we++)xe=le(B,Y[we],ee),xe!==null&&(R=m(xe,R,we),De===null?ge=xe:De.sibling=xe,De=xe);return ze&&En(B,we),ge}for(xe=i(xe);we<Y.length;we++)Me=Q(xe,B,we,Y[we],ee),Me!==null&&(e&&Me.alternate!==null&&xe.delete(Me.key===null?we:Me.key),R=m(Me,R,we),De===null?ge=Me:De.sibling=Me,De=Me);return e&&xe.forEach(function(xl){return t(B,xl)}),ze&&En(B,we),ge}function be(B,R,Y,ee){if(Y==null)throw Error(o(151));for(var ge=null,De=null,xe=R,we=R=0,Me=null,Re=Y.next();xe!==null&&!Re.done;we++,Re=Y.next()){xe.index>we?(Me=xe,xe=null):Me=xe.sibling;var xl=G(B,xe,Re.value,ee);if(xl===null){xe===null&&(xe=Me);break}e&&xe&&xl.alternate===null&&t(B,xe),R=m(xl,R,we),De===null?ge=xl:De.sibling=xl,De=xl,xe=Me}if(Re.done)return l(B,xe),ze&&En(B,we),ge;if(xe===null){for(;!Re.done;we++,Re=Y.next())Re=le(B,Re.value,ee),Re!==null&&(R=m(Re,R,we),De===null?ge=Re:De.sibling=Re,De=Re);return ze&&En(B,we),ge}for(xe=i(xe);!Re.done;we++,Re=Y.next())Re=Q(xe,B,we,Re.value,ee),Re!==null&&(e&&Re.alternate!==null&&xe.delete(Re.key===null?we:Re.key),R=m(Re,R,we),De===null?ge=Re:De.sibling=Re,De=Re);return e&&xe.forEach(function(Bb){return t(B,Bb)}),ze&&En(B,we),ge}function $e(B,R,Y,ee){if(typeof Y=="object"&&Y!==null&&Y.type===S&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case j:e:{for(var ge=Y.key;R!==null;){if(R.key===ge){if(ge=Y.type,ge===S){if(R.tag===7){l(B,R.sibling),ee=c(R,Y.props.children),ee.return=B,B=ee;break e}}else if(R.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===ue&&zl(ge)===R.type){l(B,R.sibling),ee=c(R,Y.props),yr(ee,Y),ee.return=B,B=ee;break e}l(B,R);break}else t(B,R);R=R.sibling}Y.type===S?(ee=_l(Y.props.children,B.mode,ee,Y.key),ee.return=B,B=ee):(ee=Ds(Y.type,Y.key,Y.props,null,B.mode,ee),yr(ee,Y),ee.return=B,B=ee)}return b(B);case w:e:{for(ge=Y.key;R!==null;){if(R.key===ge)if(R.tag===4&&R.stateNode.containerInfo===Y.containerInfo&&R.stateNode.implementation===Y.implementation){l(B,R.sibling),ee=c(R,Y.children||[]),ee.return=B,B=ee;break e}else{l(B,R);break}else t(B,R);R=R.sibling}ee=Ho(Y,B.mode,ee),ee.return=B,B=ee}return b(B);case ue:return Y=zl(Y),$e(B,R,Y,ee)}if(te(Y))return me(B,R,Y,ee);if(ne(Y)){if(ge=ne(Y),typeof ge!="function")throw Error(o(150));return Y=ge.call(Y),be(B,R,Y,ee)}if(typeof Y.then=="function")return $e(B,R,Ys(Y),ee);if(Y.$$typeof===H)return $e(B,R,Us(B,Y),ee);Vs(B,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,R!==null&&R.tag===6?(l(B,R.sibling),ee=c(R,Y),ee.return=B,B=ee):(l(B,R),ee=Uo(Y,B.mode,ee),ee.return=B,B=ee),b(B)):l(B,R)}return function(B,R,Y,ee){try{gr=0;var ge=$e(B,R,Y,ee);return ga=null,ge}catch(xe){if(xe===pa||xe===Bs)throw xe;var De=Ut(29,xe,null,B.mode);return De.lanes=ee,De.return=B,De}finally{}}}var Dl=Gf(!0),$f=Gf(!1),Pn=!1;function Ko(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Le&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=Os(e),_f(e,null,l),t}return zs(e,i,t,l),Os(e)}function br(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Dd(e,l)}}function Po(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var c=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?c=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?c=m=t:m=m.next=t}else c=m=t;l={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Wo=!1;function vr(){if(Wo){var e=xa;if(e!==null)throw e}}function jr(e,t,l,i){Wo=!1;var c=e.updateQueue;Pn=!1;var m=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var T=N,V=T.next;T.next=null,b===null?m=V:b.next=V,b=T;var I=e.alternate;I!==null&&(I=I.updateQueue,N=I.lastBaseUpdate,N!==b&&(N===null?I.firstBaseUpdate=V:N.next=V,I.lastBaseUpdate=T))}if(m!==null){var le=c.baseState;b=0,I=V=T=null,N=m;do{var G=N.lane&-536870913,Q=G!==N.lane;if(Q?(Ae&G)===G:(i&G)===G){G!==0&&G===ha&&(Wo=!0),I!==null&&(I=I.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var me=e,be=N;G=t;var $e=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){le=me.call($e,le,G);break e}le=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,G=typeof me=="function"?me.call($e,le,G):me,G==null)break e;le=g({},le,G);break e;case 2:Pn=!0}}G=N.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:N.tag,payload:N.payload,callback:N.callback,next:null},I===null?(V=I=Q,T=le):I=I.next=Q,b|=G;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);I===null&&(T=le),c.baseState=T,c.firstBaseUpdate=V,c.lastBaseUpdate=I,m===null&&(c.shared.lanes=0),rl|=b,e.lanes=b,e.memoizedState=le}}function Qf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Qf(l[e],t)}var ya=_(null),Gs=_(0);function Ff(e,t){e=qn,k(Gs,e),k(ya,t),qn=e|t.baseLanes}function ec(){k(Gs,qn),k(ya,ya.current)}function tc(){qn=Gs.current,F(ya),F(Gs)}var Ht=_(null),en=null;function tl(e){var t=e.alternate;k(nt,nt.current&1),k(Ht,e),en===null&&(t===null||ya.current!==null||t.memoizedState!==null)&&(en=e)}function nc(e){k(nt,nt.current),k(Ht,e),en===null&&(en=e)}function Zf(e){e.tag===22?(k(nt,nt.current),k(Ht,e),en===null&&(en=e)):nl()}function nl(){k(nt,nt.current),k(Ht,Ht.current)}function Bt(e){F(Ht),en===e&&(en=null),F(nt)}var nt=_(0);function $s(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ou(l)||cu(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zn=0,Ne=null,Ve=null,rt=null,Qs=!1,ba=!1,Rl=!1,Xs=0,Nr=0,va=null,Ey=0;function et(){throw Error(o(321))}function lc(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Lt(e[l],t[l]))return!1;return!0}function ac(e,t,l,i,c,m){return zn=m,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?M0:bc,Rl=!1,m=l(i,c),Rl=!1,ba&&(m=Kf(t,l,i,c)),If(e),m}function If(e){M.H=Sr;var t=Ve!==null&&Ve.next!==null;if(zn=0,rt=Ve=Ne=null,Qs=!1,Nr=0,va=null,t)throw Error(o(300));e===null||st||(e=e.dependencies,e!==null&&Ls(e)&&(st=!0))}function Kf(e,t,l,i){Ne=e;var c=0;do{if(ba&&(va=null),Nr=0,ba=!1,25<=c)throw Error(o(301));if(c+=1,rt=Ve=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}M.H=z0,m=t(l,i)}while(ba);return m}function Ay(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?wr(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ne.flags|=1024),t}function rc(){var e=Xs!==0;return Xs=0,e}function sc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ic(e){if(Qs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qs=!1}zn=0,rt=Ve=Ne=null,ba=!1,Nr=Xs=0,va=null}function wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ne.memoizedState=rt=e:rt=rt.next=e,rt}function lt(){if(Ve===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=rt===null?Ne.memoizedState:rt.next;if(t!==null)rt=t,Ve=e;else{if(e===null)throw Ne.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},rt===null?Ne.memoizedState=rt=e:rt=rt.next=e}return rt}function Fs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wr(e){var t=Nr;return Nr+=1,va===null&&(va=[]),e=qf(va,e,t),t=Ne,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?M0:bc),e}function Zs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wr(e);if(e.$$typeof===H)return xt(e)}throw Error(o(438,String(e)))}function oc(e){var t=null,l=Ne.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=Ne.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Fs(),Ne.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=A;return t.index++,l}function On(e,t){return typeof t=="function"?t(e):t}function Is(e){var t=lt();return cc(t,Ve,e)}function cc(e,t,l){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=l;var c=e.baseQueue,m=i.pending;if(m!==null){if(c!==null){var b=c.next;c.next=m.next,m.next=b}t.baseQueue=c=m,i.pending=null}if(m=e.baseState,c===null)e.memoizedState=m;else{t=c.next;var N=b=null,T=null,V=t,I=!1;do{var le=V.lane&-536870913;if(le!==V.lane?(Ae&le)===le:(zn&le)===le){var G=V.revertLane;if(G===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),le===ha&&(I=!0);else if((zn&G)===G){V=V.next,G===ha&&(I=!0);continue}else le={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},T===null?(N=T=le,b=m):T=T.next=le,Ne.lanes|=G,rl|=G;le=V.action,Rl&&l(m,le),m=V.hasEagerState?V.eagerState:l(m,le)}else G={lane:le,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},T===null?(N=T=G,b=m):T=T.next=G,Ne.lanes|=le,rl|=le;V=V.next}while(V!==null&&V!==t);if(T===null?b=m:T.next=N,!Lt(m,e.memoizedState)&&(st=!0,I&&(l=xa,l!==null)))throw l;e.memoizedState=m,e.baseState=b,e.baseQueue=T,i.lastRenderedState=m}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function uc(e){var t=lt(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var i=l.dispatch,c=l.pending,m=t.memoizedState;if(c!==null){l.pending=null;var b=c=c.next;do m=e(m,b.action),b=b.next;while(b!==c);Lt(m,t.memoizedState)||(st=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),l.lastRenderedState=m}return[m,i]}function Jf(e,t,l){var i=Ne,c=lt(),m=ze;if(m){if(l===void 0)throw Error(o(407));l=l()}else l=t();var b=!Lt((Ve||c).memoizedState,l);if(b&&(c.memoizedState=l,st=!0),c=c.queue,mc(e0.bind(null,i,c,e),[e]),c.getSnapshot!==t||b||rt!==null&&rt.memoizedState.tag&1){if(i.flags|=2048,ja(9,{destroy:void 0},Wf.bind(null,i,c,l,t),null),Xe===null)throw Error(o(349));m||(zn&127)!==0||Pf(i,t,l)}return l}function Pf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Ne.updateQueue,t===null?(t=Fs(),Ne.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Wf(e,t,l,i){t.value=l,t.getSnapshot=i,t0(t)&&n0(e)}function e0(e,t,l){return l(function(){t0(t)&&n0(e)})}function t0(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Lt(e,l)}catch{return!0}}function n0(e){var t=Cl(e,2);t!==null&&zt(t,e,2)}function dc(e){var t=wt();if(typeof e=="function"){var l=e;if(e=l(),Rl){St(!0);try{l()}finally{St(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:e},t}function l0(e,t,l,i){return e.baseState=l,cc(e,Ve,typeof i=="function"?i:On)}function My(e,t,l,i,c){if(Ps(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};M.T!==null?l(!0):m.isTransition=!1,i(m),l=t.pending,l===null?(m.next=t.pending=m,a0(t,m)):(m.next=l.next,t.pending=l.next=m)}}function a0(e,t){var l=t.action,i=t.payload,c=e.state;if(t.isTransition){var m=M.T,b={};M.T=b;try{var N=l(c,i),T=M.S;T!==null&&T(b,N),r0(e,t,N)}catch(V){fc(e,t,V)}finally{m!==null&&b.types!==null&&(m.types=b.types),M.T=m}}else try{m=l(c,i),r0(e,t,m)}catch(V){fc(e,t,V)}}function r0(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){s0(e,t,i)},function(i){return fc(e,t,i)}):s0(e,t,l)}function s0(e,t,l){t.status="fulfilled",t.value=l,i0(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,a0(e,l)))}function fc(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,i0(t),t=t.next;while(t!==i)}e.action=null}function i0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function o0(e,t){return t}function c0(e,t){if(ze){var l=Xe.formState;if(l!==null){e:{var i=Ne;if(ze){if(Ke){t:{for(var c=Ke,m=Wt;c.nodeType!==8;){if(!m){c=null;break t}if(c=tn(c.nextSibling),c===null){c=null;break t}}m=c.data,c=m==="F!"||m==="F"?c:null}if(c){Ke=tn(c.nextSibling),i=c.data==="F!";break e}}Kn(i)}i=!1}i&&(t=l[0])}}return l=wt(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o0,lastRenderedState:t},l.queue=i,l=T0.bind(null,Ne,i),i.dispatch=l,i=dc(!1),m=yc.bind(null,Ne,!1,i.queue),i=wt(),c={state:t,dispatch:null,action:e,pending:null},i.queue=c,l=My.bind(null,Ne,c,m,l),c.dispatch=l,i.memoizedState=e,[t,l,!1]}function u0(e){var t=lt();return d0(t,Ve,e)}function d0(e,t,l){if(t=cc(e,t,o0)[0],e=Is(On)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=wr(t)}catch(b){throw b===pa?Bs:b}else i=t;t=lt();var c=t.queue,m=c.dispatch;return l!==t.memoizedState&&(Ne.flags|=2048,ja(9,{destroy:void 0},zy.bind(null,c,l),null)),[i,m,e]}function zy(e,t){e.action=t}function f0(e){var t=lt(),l=Ve;if(l!==null)return d0(t,l,e);lt(),t=t.memoizedState,l=lt();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function ja(e,t,l,i){return e={tag:e,create:l,deps:i,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Fs(),Ne.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function m0(){return lt().memoizedState}function Ks(e,t,l,i){var c=wt();Ne.flags|=e,c.memoizedState=ja(1|t,{destroy:void 0},l,i===void 0?null:i)}function Js(e,t,l,i){var c=lt();i=i===void 0?null:i;var m=c.memoizedState.inst;Ve!==null&&i!==null&&lc(i,Ve.memoizedState.deps)?c.memoizedState=ja(t,m,l,i):(Ne.flags|=e,c.memoizedState=ja(1|t,m,l,i))}function h0(e,t){Ks(8390656,8,e,t)}function mc(e,t){Js(2048,8,e,t)}function Oy(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Fs(),Ne.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function x0(e){var t=lt().memoizedState;return Oy({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function p0(e,t){return Js(4,2,e,t)}function g0(e,t){return Js(4,4,e,t)}function y0(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function b0(e,t,l){l=l!=null?l.concat([e]):null,Js(4,4,y0.bind(null,t,e),l)}function hc(){}function v0(e,t){var l=lt();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&lc(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function j0(e,t){var l=lt();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&lc(t,i[1]))return i[0];if(i=e(),Rl){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[i,t],i}function xc(e,t,l){return l===void 0||(zn&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Nm(),Ne.lanes|=e,rl|=e,l)}function N0(e,t,l,i){return Lt(l,t)?l:ya.current!==null?(e=xc(e,l,i),Lt(e,t)||(st=!0),e):(zn&42)===0||(zn&1073741824)!==0&&(Ae&261930)===0?(st=!0,e.memoizedState=l):(e=Nm(),Ne.lanes|=e,rl|=e,t)}function w0(e,t,l,i,c){var m=z.p;z.p=m!==0&&8>m?m:8;var b=M.T,N={};M.T=N,yc(e,!1,t,l);try{var T=c(),V=M.S;if(V!==null&&V(N,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var I=Ty(T,i);kr(e,t,I,Vt(e))}else kr(e,t,i,Vt(e))}catch(le){kr(e,t,{then:function(){},status:"rejected",reason:le},Vt())}finally{z.p=m,b!==null&&N.types!==null&&(b.types=N.types),M.T=b}}function Dy(){}function pc(e,t,l,i){if(e.tag!==5)throw Error(o(476));var c=k0(e).queue;w0(e,c,t,re,l===null?Dy:function(){return S0(e),l(i)})}function k0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:re},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function S0(e){var t=k0(e);t.next===null&&(t=e.alternate.memoizedState),kr(e,t.next.queue,{},Vt())}function gc(){return xt(Yr)}function C0(){return lt().memoizedState}function _0(){return lt().memoizedState}function Ry(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=Wn(l);var i=el(t,e,l);i!==null&&(zt(i,t,l),br(i,t,l)),t={cache:Xo()},e.payload=t;return}t=t.return}}function Ly(e,t,l){var i=Vt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ps(e)?E0(t,l):(l=Ro(e,t,l,i),l!==null&&(zt(l,e,i),A0(l,t,i)))}function T0(e,t,l){var i=Vt();kr(e,t,l,i)}function kr(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))E0(t,c);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var b=t.lastRenderedState,N=m(b,l);if(c.hasEagerState=!0,c.eagerState=N,Lt(N,b))return zs(e,t,c,0),Xe===null&&Ms(),!1}catch{}finally{}if(l=Ro(e,t,c,i),l!==null)return zt(l,e,i),A0(l,t,i),!0}return!1}function yc(e,t,l,i){if(i={lane:2,revertLane:Kc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(o(479))}else t=Ro(e,l,i,2),t!==null&&zt(t,e,2)}function Ps(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function E0(e,t){ba=Qs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function A0(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Dd(e,l)}}var Sr={readContext:xt,use:Zs,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};Sr.useEffectEvent=et;var M0={readContext:xt,use:Zs,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:h0,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ks(4194308,4,y0.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var l=wt();t=t===void 0?null:t;var i=e();if(Rl){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=wt();if(l!==void 0){var c=l(t);if(Rl){St(!0);try{l(t)}finally{St(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=Ly.bind(null,Ne,e),[i.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:function(e){e=dc(e);var t=e.queue,l=T0.bind(null,Ne,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:hc,useDeferredValue:function(e,t){var l=wt();return xc(l,e,t)},useTransition:function(){var e=dc(!1);return e=w0.bind(null,Ne,e.queue,!0,!1),wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ne,c=wt();if(ze){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Xe===null)throw Error(o(349));(Ae&127)!==0||Pf(i,t,l)}c.memoizedState=l;var m={value:l,getSnapshot:t};return c.queue=m,h0(e0.bind(null,i,m,e),[e]),i.flags|=2048,ja(9,{destroy:void 0},Wf.bind(null,i,m,l,t),null),l},useId:function(){var e=wt(),t=Xe.identifierPrefix;if(ze){var l=mn,i=fn;l=(i&~(1<<32-Qe(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Xs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ey++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:c0,useActionState:c0,useOptimistic:function(e){var t=wt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=yc.bind(null,Ne,!0,l),l.dispatch=t,[e,t]},useMemoCache:oc,useCacheRefresh:function(){return wt().memoizedState=Ry.bind(null,Ne)},useEffectEvent:function(e){var t=wt(),l={impl:e};return t.memoizedState=l,function(){if((Le&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},bc={readContext:xt,use:Zs,useCallback:v0,useContext:xt,useEffect:mc,useImperativeHandle:b0,useInsertionEffect:p0,useLayoutEffect:g0,useMemo:j0,useReducer:Is,useRef:m0,useState:function(){return Is(On)},useDebugValue:hc,useDeferredValue:function(e,t){var l=lt();return N0(l,Ve.memoizedState,e,t)},useTransition:function(){var e=Is(On)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:Jf,useId:C0,useHostTransitionStatus:gc,useFormState:u0,useActionState:u0,useOptimistic:function(e,t){var l=lt();return l0(l,Ve,e,t)},useMemoCache:oc,useCacheRefresh:_0};bc.useEffectEvent=x0;var z0={readContext:xt,use:Zs,useCallback:v0,useContext:xt,useEffect:mc,useImperativeHandle:b0,useInsertionEffect:p0,useLayoutEffect:g0,useMemo:j0,useReducer:uc,useRef:m0,useState:function(){return uc(On)},useDebugValue:hc,useDeferredValue:function(e,t){var l=lt();return Ve===null?xc(l,e,t):N0(l,Ve.memoizedState,e,t)},useTransition:function(){var e=uc(On)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:Jf,useId:C0,useHostTransitionStatus:gc,useFormState:f0,useActionState:f0,useOptimistic:function(e,t){var l=lt();return Ve!==null?l0(l,Ve,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:oc,useCacheRefresh:_0};z0.useEffectEvent=x0;function vc(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var jc={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=Vt(),c=Wn(i);c.payload=t,l!=null&&(c.callback=l),t=el(e,c,i),t!==null&&(zt(t,e,i),br(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=Vt(),c=Wn(i);c.tag=1,c.payload=t,l!=null&&(c.callback=l),t=el(e,c,i),t!==null&&(zt(t,e,i),br(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),i=Wn(l);i.tag=2,t!=null&&(i.callback=t),t=el(e,i,l),t!==null&&(zt(t,e,l),br(t,e,l))}};function O0(e,t,l,i,c,m,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,b):t.prototype&&t.prototype.isPureReactComponent?!dr(l,i)||!dr(c,m):!0}function D0(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&jc.enqueueReplaceState(t,t.state,null)}function Ll(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function R0(e){As(e)}function L0(e){console.error(e)}function U0(e){As(e)}function Ws(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function H0(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Nc(e,t,l){return l=Wn(l),l.tag=3,l.payload={element:null},l.callback=function(){Ws(e,t)},l}function B0(e){return e=Wn(e),e.tag=3,e}function q0(e,t,l,i){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var m=i.value;e.payload=function(){return c(m)},e.callback=function(){H0(t,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){H0(t,l,i),typeof c!="function"&&(sl===null?sl=new Set([this]):sl.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Uy(e,t,l,i,c){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&ma(t,l,c,!0),l=Ht.current,l!==null){switch(l.tag){case 31:case 13:return en===null?di():l.alternate===null&&tt===0&&(tt=3),l.flags&=-257,l.flags|=65536,l.lanes=c,i===qs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),Fc(e,i,c)),!1;case 22:return l.flags|=65536,i===qs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),Fc(e,i,c)),!1}throw Error(o(435,l.tag))}return Fc(e,i,c),di(),!1}if(ze)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,i!==Yo&&(e=Error(o(422),{cause:i}),hr(Kt(e,l)))):(i!==Yo&&(t=Error(o(423),{cause:i}),hr(Kt(t,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=Kt(i,l),c=Nc(e.stateNode,i,c),Po(e,c),tt!==4&&(tt=2)),!1;var m=Error(o(520),{cause:i});if(m=Kt(m,l),Or===null?Or=[m]:Or.push(m),tt!==4&&(tt=2),t===null)return!0;i=Kt(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=Nc(l.stateNode,i,e),Po(l,e),!1;case 1:if(t=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(sl===null||!sl.has(m))))return l.flags|=65536,c&=-c,l.lanes|=c,c=B0(c),q0(c,e,l,i),Po(l,c),!1}l=l.return}while(l!==null);return!1}var wc=Error(o(461)),st=!1;function pt(e,t,l,i){t.child=e===null?$f(t,null,l,i):Dl(t,e.child,l,i)}function Y0(e,t,l,i,c){l=l.render;var m=t.ref;if("ref"in i){var b={};for(var N in i)N!=="ref"&&(b[N]=i[N])}else b=i;return Al(t),i=ac(e,t,l,b,m,c),N=rc(),e!==null&&!st?(sc(e,t,c),Dn(e,t,c)):(ze&&N&&Bo(t),t.flags|=1,pt(e,t,i,c),t.child)}function V0(e,t,l,i,c){if(e===null){var m=l.type;return typeof m=="function"&&!Lo(m)&&m.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=m,G0(e,t,m,i,c)):(e=Ds(l.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Mc(e,c)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:dr,l(b,i)&&e.ref===t.ref)return Dn(e,t,c)}return t.flags|=1,e=Tn(m,i),e.ref=t.ref,e.return=t,t.child=e}function G0(e,t,l,i,c){if(e!==null){var m=e.memoizedProps;if(dr(m,i)&&e.ref===t.ref)if(st=!1,t.pendingProps=i=m,Mc(e,c))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Dn(e,t,c)}return kc(e,t,l,i,c)}function $0(e,t,l,i){var c=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,e!==null){for(i=t.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~m}else i=0,t.child=null;return Q0(e,t,m,l,i)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Hs(t,m!==null?m.cachePool:null),m!==null?Ff(t,m):ec(),Zf(t);else return i=t.lanes=536870912,Q0(e,t,m!==null?m.baseLanes|l:l,l,i)}else m!==null?(Hs(t,m.cachePool),Ff(t,m),nl(),t.memoizedState=null):(e!==null&&Hs(t,null),ec(),nl());return pt(e,t,c,l),t.child}function Cr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Q0(e,t,l,i,c){var m=Zo();return m=m===null?null:{parent:at._currentValue,pool:m},t.memoizedState={baseLanes:l,cachePool:m},e!==null&&Hs(t,null),ec(),Zf(t),e!==null&&ma(e,t,i,!0),t.childLanes=c,null}function ei(e,t){return t=ni({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function X0(e,t,l){return Dl(t,e.child,null,l),e=ei(t,t.pendingProps),e.flags|=2,Bt(t),t.memoizedState=null,e}function Hy(e,t,l){var i=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(i.mode==="hidden")return e=ei(t,i),t.lanes=536870912,Cr(null,e);if(nc(t),(e=Ke)?(e=ah(e,Wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:fn,overflow:mn}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,ht=t,Ke=null)):e=null,e===null)throw Kn(t);return t.lanes=536870912,null}return ei(t,i)}var m=e.memoizedState;if(m!==null){var b=m.dehydrated;if(nc(t),c)if(t.flags&256)t.flags&=-257,t=X0(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(st||ma(e,t,l,!1),c=(l&e.childLanes)!==0,st||c){if(i=Xe,i!==null&&(b=Rd(i,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,Cl(e,b),zt(i,e,b),wc;di(),t=X0(e,t,l)}else e=m.treeContext,Ke=tn(b.nextSibling),ht=t,ze=!0,In=null,Wt=!1,e!==null&&zf(t,e),t=ei(t,i),t.flags|=4096;return t}return e=Tn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ti(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function kc(e,t,l,i,c){return Al(t),l=ac(e,t,l,i,void 0,c),i=rc(),e!==null&&!st?(sc(e,t,c),Dn(e,t,c)):(ze&&i&&Bo(t),t.flags|=1,pt(e,t,l,c),t.child)}function F0(e,t,l,i,c,m){return Al(t),t.updateQueue=null,l=Kf(t,i,l,c),If(e),i=rc(),e!==null&&!st?(sc(e,t,m),Dn(e,t,m)):(ze&&i&&Bo(t),t.flags|=1,pt(e,t,l,m),t.child)}function Z0(e,t,l,i,c){if(Al(t),t.stateNode===null){var m=ca,b=l.contextType;typeof b=="object"&&b!==null&&(m=xt(b)),m=new l(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=jc,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},Ko(t),b=l.contextType,m.context=typeof b=="object"&&b!==null?xt(b):ca,m.state=t.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(vc(t,l,b,i),m.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&jc.enqueueReplaceState(m,m.state,null),jr(t,i,m,c),vr(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var N=t.memoizedProps,T=Ll(l,N);m.props=T;var V=m.context,I=l.contextType;b=ca,typeof I=="object"&&I!==null&&(b=xt(I));var le=l.getDerivedStateFromProps;I=typeof le=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,I||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||V!==b)&&D0(t,m,i,b),Pn=!1;var G=t.memoizedState;m.state=G,jr(t,i,m,c),vr(),V=t.memoizedState,N||G!==V||Pn?(typeof le=="function"&&(vc(t,l,le,i),V=t.memoizedState),(T=Pn||O0(t,l,T,i,G,V,b))?(I||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=V),m.props=i,m.state=V,m.context=b,i=T):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,Jo(e,t),b=t.memoizedProps,I=Ll(l,b),m.props=I,le=t.pendingProps,G=m.context,V=l.contextType,T=ca,typeof V=="object"&&V!==null&&(T=xt(V)),N=l.getDerivedStateFromProps,(V=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==le||G!==T)&&D0(t,m,i,T),Pn=!1,G=t.memoizedState,m.state=G,jr(t,i,m,c),vr();var Q=t.memoizedState;b!==le||G!==Q||Pn||e!==null&&e.dependencies!==null&&Ls(e.dependencies)?(typeof N=="function"&&(vc(t,l,N,i),Q=t.memoizedState),(I=Pn||O0(t,l,I,i,G,Q,T)||e!==null&&e.dependencies!==null&&Ls(e.dependencies))?(V||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,Q,T),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,Q,T)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Q),m.props=i,m.state=Q,m.context=T,i=I):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,ti(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Dl(t,e.child,null,c),t.child=Dl(t,null,l,c)):pt(e,t,l,c),t.memoizedState=m.state,e=t.child):e=Dn(e,t,c),e}function I0(e,t,l,i){return Tl(),t.flags|=256,pt(e,t,l,i),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:Hf()}}function _c(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Yt),e}function K0(e,t,l){var i=t.pendingProps,c=!1,m=(t.flags&128)!==0,b;if((b=m)||(b=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(c?tl(t):nl(),(e=Ke)?(e=ah(e,Wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:fn,overflow:mn}:null,retryLane:536870912,hydrationErrors:null},l=Ef(e),l.return=t,t.child=l,ht=t,Ke=null)):e=null,e===null)throw Kn(t);return cu(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,c?(nl(),c=t.mode,N=ni({mode:"hidden",children:N},c),i=_l(i,c,l,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=Cc(l),i.childLanes=_c(e,b,l),t.memoizedState=Sc,Cr(null,i)):(tl(t),Tc(t,N))}var T=e.memoizedState;if(T!==null&&(N=T.dehydrated,N!==null)){if(m)t.flags&256?(tl(t),t.flags&=-257,t=Ec(e,t,l)):t.memoizedState!==null?(nl(),t.child=e.child,t.flags|=128,t=null):(nl(),N=i.fallback,c=t.mode,i=ni({mode:"visible",children:i.children},c),N=_l(N,c,l,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Dl(t,e.child,null,l),i=t.child,i.memoizedState=Cc(l),i.childLanes=_c(e,b,l),t.memoizedState=Sc,t=Cr(null,i));else if(tl(t),cu(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var V=b.dgst;b=V,i=Error(o(419)),i.stack="",i.digest=b,hr({value:i,source:null,stack:null}),t=Ec(e,t,l)}else if(st||ma(e,t,l,!1),b=(l&e.childLanes)!==0,st||b){if(b=Xe,b!==null&&(i=Rd(b,l),i!==0&&i!==T.retryLane))throw T.retryLane=i,Cl(e,i),zt(b,e,i),wc;ou(N)||di(),t=Ec(e,t,l)}else ou(N)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ke=tn(N.nextSibling),ht=t,ze=!0,In=null,Wt=!1,e!==null&&zf(t,e),t=Tc(t,i.children),t.flags|=4096);return t}return c?(nl(),N=i.fallback,c=t.mode,T=e.child,V=T.sibling,i=Tn(T,{mode:"hidden",children:i.children}),i.subtreeFlags=T.subtreeFlags&65011712,V!==null?N=Tn(V,N):(N=_l(N,c,l,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Cr(null,i),i=t.child,N=e.child.memoizedState,N===null?N=Cc(l):(c=N.cachePool,c!==null?(T=at._currentValue,c=c.parent!==T?{parent:T,pool:T}:c):c=Hf(),N={baseLanes:N.baseLanes|l,cachePool:c}),i.memoizedState=N,i.childLanes=_c(e,b,l),t.memoizedState=Sc,Cr(e.child,i)):(tl(t),l=e.child,e=l.sibling,l=Tn(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=l,t.memoizedState=null,l)}function Tc(e,t){return t=ni({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ni(e,t){return e=Ut(22,e,null,t),e.lanes=0,e}function Ec(e,t,l){return Dl(t,e.child,null,l),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function J0(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,l)}function Ac(e,t,l,i,c,m){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:c,treeForkCount:m}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=l,b.tailMode=c,b.treeForkCount=m)}function P0(e,t,l){var i=t.pendingProps,c=i.revealOrder,m=i.tail;i=i.children;var b=nt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,k(nt,b),pt(e,t,i,l),i=ze?mr:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&J0(e,l,t);else if(e.tag===19)J0(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(l=t.child,c=null;l!==null;)e=l.alternate,e!==null&&$s(e)===null&&(c=l),l=l.sibling;l=c,l===null?(c=t.child,t.child=null):(c=l.sibling,l.sibling=null),Ac(t,!1,c,l,m,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&$s(e)===null){t.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}Ac(t,!0,l,null,m,i);break;case"together":Ac(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Dn(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),rl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ma(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Tn(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Tn(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ls(e)))}function By(e,t,l){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),Jn(t,at,e.memoizedState.cache),Tl();break;case 27:case 5:Xt(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:Jn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,nc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(tl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?K0(e,t,l):(tl(t),e=Dn(e,t,l),e!==null?e.sibling:null);tl(t);break;case 19:var c=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(ma(e,t,l,!1),i=(l&t.childLanes)!==0),c){if(i)return P0(e,t,l);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),k(nt,nt.current),i)break;return null;case 22:return t.lanes=0,$0(e,t,l,t.pendingProps);case 24:Jn(t,at,e.memoizedState.cache)}return Dn(e,t,l)}function W0(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!Mc(e,l)&&(t.flags&128)===0)return st=!1,By(e,t,l);st=(e.flags&131072)!==0}else st=!1,ze&&(t.flags&1048576)!==0&&Mf(t,mr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=zl(t.elementType),t.type=e,typeof e=="function")Lo(e)?(i=Ll(e,i),t.tag=1,t=Z0(null,t,e,i,l)):(t.tag=0,t=kc(null,t,e,i,l));else{if(e!=null){var c=e.$$typeof;if(c===K){t.tag=11,t=Y0(null,t,e,i,l);break e}else if(c===$){t.tag=14,t=V0(null,t,e,i,l);break e}}throw t=W(e)||e,Error(o(306,t,""))}}return t;case 0:return kc(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,c=Ll(i,t.pendingProps),Z0(e,t,i,c,l);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;c=m.element,Jo(e,t),jr(t,i,null,l);var b=t.memoizedState;if(i=b.cache,Jn(t,at,i),i!==m.cache&&Qo(t,[at],l,!0),vr(),i=b.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=I0(e,t,i,l);break e}else if(i!==c){c=Kt(Error(o(424)),t),hr(c),t=I0(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ke=tn(e.firstChild),ht=t,ze=!0,In=null,Wt=!0,l=$f(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Tl(),i===c){t=Dn(e,t,l);break e}pt(e,t,i,l)}t=t.child}return t;case 26:return ti(e,t),e===null?(l=uh(t.type,null,t.pendingProps,null))?t.memoizedState=l:ze||(l=t.type,e=t.pendingProps,i=yi(he.current).createElement(l),i[mt]=t,i[Ct]=e,gt(i,l,e),dt(i),t.stateNode=i):t.memoizedState=uh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xt(t),e===null&&ze&&(i=t.stateNode=ih(t.type,t.pendingProps,he.current),ht=t,Wt=!0,c=Ke,ul(t.type)?(uu=c,Ke=tn(i.firstChild)):Ke=c),pt(e,t,t.pendingProps.children,l),ti(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((c=i=Ke)&&(i=xb(i,t.type,t.pendingProps,Wt),i!==null?(t.stateNode=i,ht=t,Ke=tn(i.firstChild),Wt=!1,c=!0):c=!1),c||Kn(t)),Xt(t),c=t.type,m=t.pendingProps,b=e!==null?e.memoizedProps:null,i=m.children,ru(c,m)?i=null:b!==null&&ru(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=ac(e,t,Ay,null,null,l),Yr._currentValue=c),ti(e,t),pt(e,t,i,l),t.child;case 6:return e===null&&ze&&((e=l=Ke)&&(l=pb(l,t.pendingProps,Wt),l!==null?(t.stateNode=l,ht=t,Ke=null,e=!0):e=!1),e||Kn(t)),null;case 13:return K0(e,t,l);case 4:return Pe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Dl(t,null,i,l):pt(e,t,i,l),t.child;case 11:return Y0(e,t,t.type,t.pendingProps,l);case 7:return pt(e,t,t.pendingProps,l),t.child;case 8:return pt(e,t,t.pendingProps.children,l),t.child;case 12:return pt(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Jn(t,t.type,i.value),pt(e,t,i.children,l),t.child;case 9:return c=t.type._context,i=t.pendingProps.children,Al(t),c=xt(c),i=i(c),t.flags|=1,pt(e,t,i,l),t.child;case 14:return V0(e,t,t.type,t.pendingProps,l);case 15:return G0(e,t,t.type,t.pendingProps,l);case 19:return P0(e,t,l);case 31:return Hy(e,t,l);case 22:return $0(e,t,l,t.pendingProps);case 24:return Al(t),i=xt(at),e===null?(c=Zo(),c===null&&(c=Xe,m=Xo(),c.pooledCache=m,m.refCount++,m!==null&&(c.pooledCacheLanes|=l),c=m),t.memoizedState={parent:i,cache:c},Ko(t),Jn(t,at,c)):((e.lanes&l)!==0&&(Jo(e,t),jr(t,null,null,l),vr()),c=e.memoizedState,m=t.memoizedState,c.parent!==i?(c={parent:i,cache:i},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Jn(t,at,i)):(i=m.cache,Jn(t,at,i),i!==c.cache&&Qo(t,[at],l,!0))),pt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Rn(e){e.flags|=4}function zc(e,t,l,i,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Cm())e.flags|=8192;else throw Ol=qs,Io}else e.flags&=-16777217}function em(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xh(t))if(Cm())e.flags|=8192;else throw Ol=qs,Io}function li(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zd():536870912,e.lanes|=t,Sa|=t)}function _r(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var c=e.child;c!==null;)l|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)l|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function qy(e,t,l){var i=t.pendingProps;switch(qo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Mn(at),Ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(fa(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vo())),Je(t),null;case 26:var c=t.type,m=t.memoizedState;return e===null?(Rn(t),m!==null?(Je(t),em(t,m)):(Je(t),zc(t,c,null,i,l))):m?m!==e.memoizedState?(Rn(t),Je(t),em(t,m)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Rn(t),Je(t),zc(t,c,e,i,l)),null;case 27:if(Nn(t),l=he.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Je(t),null}e=Z.current,fa(t)?Of(t):(e=ih(c,i,l),t.stateNode=e,Rn(t))}return Je(t),null;case 5:if(Nn(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Je(t),null}if(m=Z.current,fa(t))Of(t);else{var b=yi(he.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?b.createElement(c,{is:i.is}):b.createElement(c)}}m[mt]=t,m[Ct]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=m;e:switch(gt(m,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Rn(t)}}return Je(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,fa(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,c=ht,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[mt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Km(e.nodeValue,l)),e||Kn(t,!0)}else e=yi(e).createTextNode(i),e[mt]=t,t.stateNode=e}return Je(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=fa(t),l!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[mt]=t}else Tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else l=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Bt(t),t):(Bt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Je(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=fa(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[mt]=t}else Tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else c=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Bt(t),t):(Bt(t),null)}return Bt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),li(t,t.updateQueue),Je(t),null);case 4:return Ye(),e===null&&eu(t.stateNode.containerInfo),Je(t),null;case 10:return Mn(t.type),Je(t),null;case 19:if(F(nt),i=t.memoizedState,i===null)return Je(t),null;if(c=(t.flags&128)!==0,m=i.rendering,m===null)if(c)_r(i,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=$s(e),m!==null){for(t.flags|=128,_r(i,!1),e=m.updateQueue,t.updateQueue=e,li(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Tf(l,e),l=l.sibling;return k(nt,nt.current&1|2),ze&&En(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&jt()>oi&&(t.flags|=128,c=!0,_r(i,!1),t.lanes=4194304)}else{if(!c)if(e=$s(m),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,li(t,e),_r(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!ze)return Je(t),null}else 2*jt()-i.renderingStartTime>oi&&l!==536870912&&(t.flags|=128,c=!0,_r(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=jt(),e.sibling=null,l=nt.current,k(nt,c?l&1|2:l&1),ze&&En(t,i.treeForkCount),e):(Je(t),null);case 22:case 23:return Bt(t),tc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),l=t.updateQueue,l!==null&&li(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&F(Ml),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Mn(at),Je(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Yy(e,t){switch(qo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(at),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nn(t),null;case 31:if(t.memoizedState!==null){if(Bt(t),t.alternate===null)throw Error(o(340));Tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(nt),null;case 4:return Ye(),null;case 10:return Mn(t.type),null;case 22:case 23:return Bt(t),tc(),e!==null&&F(Ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mn(at),null;case 25:return null;default:return null}}function tm(e,t){switch(qo(t),t.tag){case 3:Mn(at),Ye();break;case 26:case 27:case 5:Nn(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Bt(t);break;case 13:Bt(t);break;case 19:F(nt);break;case 10:Mn(t.type);break;case 22:case 23:Bt(t),tc(),e!==null&&F(Ml);break;case 24:Mn(at)}}function Tr(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){i=void 0;var m=l.create,b=l.inst;i=m(),b.destroy=i}l=l.next}while(l!==c)}}catch(N){Be(t,t.return,N)}}function ll(e,t,l){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var m=c.next;i=m;do{if((i.tag&e)===e){var b=i.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var T=l,V=N;try{V()}catch(I){Be(c,T,I)}}}i=i.next}while(i!==m)}}catch(I){Be(t,t.return,I)}}function nm(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Xf(t,l)}catch(i){Be(e,e.return,i)}}}function lm(e,t,l){l.props=Ll(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Be(e,t,i)}}function Er(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(c){Be(e,t,c)}}function hn(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(c){Be(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){Be(e,t,c)}else l.current=null}function am(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(c){Be(e,e.return,c)}}function Oc(e,t,l){try{var i=e.stateNode;cb(i,e.type,l,t),i[Ct]=t}catch(c){Be(e,e.return,c)}}function rm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ul(e.type)||e.tag===4}function Dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ul(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rc(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Cn));else if(i!==4&&(i===27&&ul(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Rc(e,t,l),e=e.sibling;e!==null;)Rc(e,t,l),e=e.sibling}function ai(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&ul(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(ai(e,t,l),e=e.sibling;e!==null;)ai(e,t,l),e=e.sibling}function sm(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);gt(t,i,l),t[mt]=e,t[Ct]=l}catch(m){Be(e,e.return,m)}}var Ln=!1,it=!1,Lc=!1,im=typeof WeakSet=="function"?WeakSet:Set,ft=null;function Vy(e,t){if(e=e.containerInfo,lu=Si,e=bf(e),Eo(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var c=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,N=-1,T=-1,V=0,I=0,le=e,G=null;t:for(;;){for(var Q;le!==l||c!==0&&le.nodeType!==3||(N=b+c),le!==m||i!==0&&le.nodeType!==3||(T=b+i),le.nodeType===3&&(b+=le.nodeValue.length),(Q=le.firstChild)!==null;)G=le,le=Q;for(;;){if(le===e)break t;if(G===l&&++V===c&&(N=b),G===m&&++I===i&&(T=b),(Q=le.nextSibling)!==null)break;le=G,G=le.parentNode}le=Q}l=N===-1||T===-1?null:{start:N,end:T}}else l=null}l=l||{start:0,end:0}}else l=null;for(au={focusedElem:e,selectionRange:l},Si=!1,ft=t;ft!==null;)if(t=ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ft=e;else for(;ft!==null;){switch(t=ft,m=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)c=e[l],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,l=t,c=m.memoizedProps,m=m.memoizedState,i=l.stateNode;try{var me=Ll(l.type,c);e=i.getSnapshotBeforeUpdate(me,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(be){Be(l,l.return,be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)iu(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":iu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,ft=e;break}ft=t.return}}function om(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Hn(e,l),i&4&&Tr(5,l);break;case 1:if(Hn(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(b){Be(l,l.return,b)}else{var c=Ll(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Be(l,l.return,b)}}i&64&&nm(l),i&512&&Er(l,l.return);break;case 3:if(Hn(e,l),i&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Xf(e,t)}catch(b){Be(l,l.return,b)}}break;case 27:t===null&&i&4&&sm(l);case 26:case 5:Hn(e,l),t===null&&i&4&&am(l),i&512&&Er(l,l.return);break;case 12:Hn(e,l);break;case 31:Hn(e,l),i&4&&dm(e,l);break;case 13:Hn(e,l),i&4&&fm(e,l),i&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Jy.bind(null,l),gb(e,l))));break;case 22:if(i=l.memoizedState!==null||Ln,!i){t=t!==null&&t.memoizedState!==null||it,c=Ln;var m=it;Ln=i,(it=t)&&!m?Bn(e,l,(l.subtreeFlags&8772)!==0):Hn(e,l),Ln=c,it=m}break;case 30:break;default:Hn(e,l)}}function cm(e){var t=e.alternate;t!==null&&(e.alternate=null,cm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&fo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var We=null,Tt=!1;function Un(e,t,l){for(l=l.child;l!==null;)um(e,t,l),l=l.sibling}function um(e,t,l){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(Nt,l)}catch{}switch(l.tag){case 26:it||hn(l,t),Un(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:it||hn(l,t);var i=We,c=Tt;ul(l.type)&&(We=l.stateNode,Tt=!1),Un(e,t,l),Hr(l.stateNode),We=i,Tt=c;break;case 5:it||hn(l,t);case 6:if(i=We,c=Tt,We=null,Un(e,t,l),We=i,Tt=c,We!==null)if(Tt)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(l.stateNode)}catch(m){Be(l,t,m)}else try{We.removeChild(l.stateNode)}catch(m){Be(l,t,m)}break;case 18:We!==null&&(Tt?(e=We,nh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Oa(e)):nh(We,l.stateNode));break;case 4:i=We,c=Tt,We=l.stateNode.containerInfo,Tt=!0,Un(e,t,l),We=i,Tt=c;break;case 0:case 11:case 14:case 15:ll(2,l,t),it||ll(4,l,t),Un(e,t,l);break;case 1:it||(hn(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&lm(l,t,i)),Un(e,t,l);break;case 21:Un(e,t,l);break;case 22:it=(i=it)||l.memoizedState!==null,Un(e,t,l),it=i;break;default:Un(e,t,l)}}function dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Oa(e)}catch(l){Be(t,t.return,l)}}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Oa(e)}catch(l){Be(t,t.return,l)}}function Gy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new im),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new im),t;default:throw Error(o(435,e.tag))}}function ri(e,t){var l=Gy(e);t.forEach(function(i){if(!l.has(i)){l.add(i);var c=Py.bind(null,e,i);i.then(c,c)}})}function Et(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var c=l[i],m=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(ul(N.type)){We=N.stateNode,Tt=!1;break e}break;case 5:We=N.stateNode,Tt=!1;break e;case 3:case 4:We=N.stateNode.containerInfo,Tt=!0;break e}N=N.return}if(We===null)throw Error(o(160));um(m,b,c),We=null,Tt=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)mm(t,e),t=t.sibling}var cn=null;function mm(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Et(t,e),At(e),i&4&&(ll(3,e,e.return),Tr(3,e),ll(5,e,e.return));break;case 1:Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),i&64&&Ln&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var c=cn;if(Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),i&4){var m=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":m=c.getElementsByTagName("title")[0],(!m||m[nr]||m[mt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=c.createElement(i),c.head.insertBefore(m,c.querySelector("head > title"))),gt(m,i,l),m[mt]=e,dt(m),i=m;break e;case"link":var b=mh("link","href",c).get(i+(l.href||""));if(b){for(var N=0;N<b.length;N++)if(m=b[N],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(N,1);break t}}m=c.createElement(i),gt(m,i,l),c.head.appendChild(m);break;case"meta":if(b=mh("meta","content",c).get(i+(l.content||""))){for(N=0;N<b.length;N++)if(m=b[N],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(N,1);break t}}m=c.createElement(i),gt(m,i,l),c.head.appendChild(m);break;default:throw Error(o(468,i))}m[mt]=e,dt(m),i=m}e.stateNode=i}else hh(c,e.type,e.stateNode);else e.stateNode=fh(c,i,e.memoizedProps);else m!==i?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,i===null?hh(c,e.type,e.stateNode):fh(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Oc(e,e.memoizedProps,l.memoizedProps)}break;case 27:Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),l!==null&&i&4&&Oc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),e.flags&32){c=e.stateNode;try{na(c,"")}catch(me){Be(e,e.return,me)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,Oc(e,c,l!==null?l.memoizedProps:c)),i&1024&&(Lc=!0);break;case 6:if(Et(t,e),At(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(me){Be(e,e.return,me)}}break;case 3:if(ji=null,c=cn,cn=bi(t.containerInfo),Et(t,e),cn=c,At(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{Oa(t.containerInfo)}catch(me){Be(e,e.return,me)}Lc&&(Lc=!1,hm(e));break;case 4:i=cn,cn=bi(e.stateNode.containerInfo),Et(t,e),At(e),cn=i;break;case 12:Et(t,e),At(e);break;case 31:Et(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ri(e,i)));break;case 13:Et(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ii=jt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ri(e,i)));break;case 22:c=e.memoizedState!==null;var T=l!==null&&l.memoizedState!==null,V=Ln,I=it;if(Ln=V||c,it=I||T,Et(t,e),it=I,Ln=V,At(e),i&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(l===null||T||Ln||it||Ul(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){T=l=t;try{if(m=T.stateNode,c)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=T.stateNode;var le=T.memoizedProps.style,G=le!=null&&le.hasOwnProperty("display")?le.display:null;N.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(me){Be(T,T.return,me)}}}else if(t.tag===6){if(l===null){T=t;try{T.stateNode.nodeValue=c?"":T.memoizedProps}catch(me){Be(T,T.return,me)}}}else if(t.tag===18){if(l===null){T=t;try{var Q=T.stateNode;c?lh(Q,!0):lh(T.stateNode,!1)}catch(me){Be(T,T.return,me)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,ri(e,l))));break;case 19:Et(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ri(e,i)));break;case 30:break;case 21:break;default:Et(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var l,i=e.return;i!==null;){if(rm(i)){l=i;break}i=i.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var c=l.stateNode,m=Dc(e);ai(e,m,c);break;case 5:var b=l.stateNode;l.flags&32&&(na(b,""),l.flags&=-33);var N=Dc(e);ai(e,N,b);break;case 3:case 4:var T=l.stateNode.containerInfo,V=Dc(e);Rc(e,V,T);break;default:throw Error(o(161))}}catch(I){Be(e,e.return,I)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)om(e,t.alternate,t),t=t.sibling}function Ul(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ll(4,t,t.return),Ul(t);break;case 1:hn(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&lm(t,t.return,l),Ul(t);break;case 27:Hr(t.stateNode);case 26:case 5:hn(t,t.return),Ul(t);break;case 22:t.memoizedState===null&&Ul(t);break;case 30:Ul(t);break;default:Ul(t)}e=e.sibling}}function Bn(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,c=e,m=t,b=m.flags;switch(m.tag){case 0:case 11:case 15:Bn(c,m,l),Tr(4,m);break;case 1:if(Bn(c,m,l),i=m,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(V){Be(i,i.return,V)}if(i=m,c=i.updateQueue,c!==null){var N=i.stateNode;try{var T=c.shared.hiddenCallbacks;if(T!==null)for(c.shared.hiddenCallbacks=null,c=0;c<T.length;c++)Qf(T[c],N)}catch(V){Be(i,i.return,V)}}l&&b&64&&nm(m),Er(m,m.return);break;case 27:sm(m);case 26:case 5:Bn(c,m,l),l&&i===null&&b&4&&am(m),Er(m,m.return);break;case 12:Bn(c,m,l);break;case 31:Bn(c,m,l),l&&b&4&&dm(c,m);break;case 13:Bn(c,m,l),l&&b&4&&fm(c,m);break;case 22:m.memoizedState===null&&Bn(c,m,l),Er(m,m.return);break;case 30:break;default:Bn(c,m,l)}t=t.sibling}}function Uc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&xr(l))}function Hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xr(e))}function un(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xm(e,t,l,i),t=t.sibling}function xm(e,t,l,i){var c=t.flags;switch(t.tag){case 0:case 11:case 15:un(e,t,l,i),c&2048&&Tr(9,t);break;case 1:un(e,t,l,i);break;case 3:un(e,t,l,i),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xr(e)));break;case 12:if(c&2048){un(e,t,l,i),e=t.stateNode;try{var m=t.memoizedProps,b=m.id,N=m.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){Be(t,t.return,T)}}else un(e,t,l,i);break;case 31:un(e,t,l,i);break;case 13:un(e,t,l,i);break;case 23:break;case 22:m=t.stateNode,b=t.alternate,t.memoizedState!==null?m._visibility&2?un(e,t,l,i):Ar(e,t):m._visibility&2?un(e,t,l,i):(m._visibility|=2,Na(e,t,l,i,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Uc(b,t);break;case 24:un(e,t,l,i),c&2048&&Hc(t.alternate,t);break;default:un(e,t,l,i)}}function Na(e,t,l,i,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,b=t,N=l,T=i,V=b.flags;switch(b.tag){case 0:case 11:case 15:Na(m,b,N,T,c),Tr(8,b);break;case 23:break;case 22:var I=b.stateNode;b.memoizedState!==null?I._visibility&2?Na(m,b,N,T,c):Ar(m,b):(I._visibility|=2,Na(m,b,N,T,c)),c&&V&2048&&Uc(b.alternate,b);break;case 24:Na(m,b,N,T,c),c&&V&2048&&Hc(b.alternate,b);break;default:Na(m,b,N,T,c)}t=t.sibling}}function Ar(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,c=i.flags;switch(i.tag){case 22:Ar(l,i),c&2048&&Uc(i.alternate,i);break;case 24:Ar(l,i),c&2048&&Hc(i.alternate,i);break;default:Ar(l,i)}t=t.sibling}}var Mr=8192;function wa(e,t,l){if(e.subtreeFlags&Mr)for(e=e.child;e!==null;)pm(e,t,l),e=e.sibling}function pm(e,t,l){switch(e.tag){case 26:wa(e,t,l),e.flags&Mr&&e.memoizedState!==null&&Eb(l,cn,e.memoizedState,e.memoizedProps);break;case 5:wa(e,t,l);break;case 3:case 4:var i=cn;cn=bi(e.stateNode.containerInfo),wa(e,t,l),cn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Mr,Mr=16777216,wa(e,t,l),Mr=i):wa(e,t,l));break;default:wa(e,t,l)}}function gm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ft=i,bm(i,e)}gm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ym(e),e=e.sibling}function ym(e){switch(e.tag){case 0:case 11:case 15:zr(e),e.flags&2048&&ll(9,e,e.return);break;case 3:zr(e);break;case 12:zr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,si(e)):zr(e);break;default:zr(e)}}function si(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ft=i,bm(i,e)}gm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ll(8,t,t.return),si(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,si(t));break;default:si(t)}e=e.sibling}}function bm(e,t){for(;ft!==null;){var l=ft;switch(l.tag){case 0:case 11:case 15:ll(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:xr(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,ft=i;else e:for(l=e;ft!==null;){i=ft;var c=i.sibling,m=i.return;if(cm(i),i===l){ft=null;break e}if(c!==null){c.return=m,ft=c;break e}ft=m}}}var $y={getCacheForType:function(e){var t=xt(at),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return xt(at).controller.signal}},Qy=typeof WeakMap=="function"?WeakMap:Map,Le=0,Xe=null,Ce=null,Ae=0,He=0,qt=null,al=!1,ka=!1,Bc=!1,qn=0,tt=0,rl=0,Hl=0,qc=0,Yt=0,Sa=0,Or=null,Mt=null,Yc=!1,ii=0,vm=0,oi=1/0,ci=null,sl=null,ut=0,il=null,Ca=null,Yn=0,Vc=0,Gc=null,jm=null,Dr=0,$c=null;function Vt(){return(Le&2)!==0&&Ae!==0?Ae&-Ae:M.T!==null?Kc():Ld()}function Nm(){if(Yt===0)if((Ae&536870912)===0||ze){var e=gs;gs<<=1,(gs&3932160)===0&&(gs=262144),Yt=e}else Yt=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Yt}function zt(e,t,l){(e===Xe&&(He===2||He===9)||e.cancelPendingCommit!==null)&&(_a(e,0),ol(e,Ae,Yt,!1)),tr(e,l),((Le&2)===0||e!==Xe)&&(e===Xe&&((Le&2)===0&&(Hl|=l),tt===4&&ol(e,Ae,Yt,!1)),xn(e))}function wm(e,t,l){if((Le&6)!==0)throw Error(o(327));var i=!l&&(t&127)===0&&(t&e.expiredLanes)===0||er(e,t),c=i?Zy(e,t):Xc(e,t,!0),m=i;do{if(c===0){ka&&!i&&ol(e,t,0,!1);break}else{if(l=e.current.alternate,m&&!Xy(l)){c=Xc(e,t,!1),m=!1;continue}if(c===2){if(m=t,e.errorRecoveryDisabledLanes&m)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=Or;var T=N.current.memoizedState.isDehydrated;if(T&&(_a(N,b).flags|=256),b=Xc(N,b,!1),b!==2){if(Bc&&!T){N.errorRecoveryDisabledLanes|=m,Hl|=m,c=4;break e}m=Mt,Mt=c,m!==null&&(Mt===null?Mt=m:Mt.push.apply(Mt,m))}c=b}if(m=!1,c!==2)continue}}if(c===1){_a(e,0),ol(e,t,0,!0);break}e:{switch(i=e,m=c,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:ol(i,t,Yt,!al);break e;case 2:Mt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=ii+300-jt(),10<c)){if(ol(i,t,Yt,!al),bs(i,0,!0)!==0)break e;Yn=t,i.timeoutHandle=eh(km.bind(null,i,l,Mt,ci,Yc,t,Yt,Hl,Sa,al,m,"Throttled",-0,0),c);break e}km(i,l,Mt,ci,Yc,t,Yt,Hl,Sa,al,m,null,-0,0)}}break}while(!0);xn(e)}function km(e,t,l,i,c,m,b,N,T,V,I,le,G,Q){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},pm(t,m,le);var me=(m&62914560)===m?ii-jt():(m&4194048)===m?vm-jt():0;if(me=Ab(le,me),me!==null){Yn=m,e.cancelPendingCommit=me(zm.bind(null,e,t,m,l,i,c,b,N,T,I,le,null,G,Q)),ol(e,m,b,!V);return}}zm(e,t,m,l,i,c,b,N,T)}function Xy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var c=l[i],m=c.getSnapshot;c=c.value;try{if(!Lt(m(),c))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ol(e,t,l,i){t&=~qc,t&=~Hl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var c=t;0<c;){var m=31-Qe(c),b=1<<m;i[m]=-1,c&=~b}l!==0&&Od(e,l,t)}function ui(){return(Le&6)===0?(Rr(0),!1):!0}function Qc(){if(Ce!==null){if(He===0)var e=Ce.return;else e=Ce,An=El=null,ic(e),ga=null,gr=0,e=Ce;for(;e!==null;)tm(e.alternate,e),e=e.return;Ce=null}}function _a(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,fb(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Yn=0,Qc(),Xe=e,Ce=l=Tn(e.current,null),Ae=t,He=0,qt=null,al=!1,ka=er(e,t),Bc=!1,Sa=Yt=qc=Hl=rl=tt=0,Mt=Or=null,Yc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var c=31-Qe(i),m=1<<c;t|=e[c],i&=~m}return qn=t,Ms(),l}function Sm(e,t){Ne=null,M.H=Sr,t===pa||t===Bs?(t=Yf(),He=3):t===Io?(t=Yf(),He=4):He=t===wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qt=t,Ce===null&&(tt=1,Ws(e,Kt(t,e.current)))}function Cm(){var e=Ht.current;return e===null?!0:(Ae&4194048)===Ae?en===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===en:!1}function _m(){var e=M.H;return M.H=Sr,e===null?Sr:e}function Tm(){var e=M.A;return M.A=$y,e}function di(){tt=4,al||(Ae&4194048)!==Ae&&Ht.current!==null||(ka=!0),(rl&134217727)===0&&(Hl&134217727)===0||Xe===null||ol(Xe,Ae,Yt,!1)}function Xc(e,t,l){var i=Le;Le|=2;var c=_m(),m=Tm();(Xe!==e||Ae!==t)&&(ci=null,_a(e,t)),t=!1;var b=tt;e:do try{if(He!==0&&Ce!==null){var N=Ce,T=qt;switch(He){case 8:Qc(),b=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var V=He;if(He=0,qt=null,Ta(e,N,T,V),l&&ka){b=0;break e}break;default:V=He,He=0,qt=null,Ta(e,N,T,V)}}Fy(),b=tt;break}catch(I){Sm(e,I)}while(!0);return t&&e.shellSuspendCounter++,An=El=null,Le=i,M.H=c,M.A=m,Ce===null&&(Xe=null,Ae=0,Ms()),b}function Fy(){for(;Ce!==null;)Em(Ce)}function Zy(e,t){var l=Le;Le|=2;var i=_m(),c=Tm();Xe!==e||Ae!==t?(ci=null,oi=jt()+500,_a(e,t)):ka=er(e,t);e:do try{if(He!==0&&Ce!==null){t=Ce;var m=qt;t:switch(He){case 1:He=0,qt=null,Ta(e,t,m,1);break;case 2:case 9:if(Bf(m)){He=0,qt=null,Am(t);break}t=function(){He!==2&&He!==9||Xe!==e||(He=7),xn(e)},m.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:Bf(m)?(He=0,qt=null,Am(t)):(He=0,qt=null,Ta(e,t,m,7));break;case 5:var b=null;switch(Ce.tag){case 26:b=Ce.memoizedState;case 5:case 27:var N=Ce;if(b?xh(b):N.stateNode.complete){He=0,qt=null;var T=N.sibling;if(T!==null)Ce=T;else{var V=N.return;V!==null?(Ce=V,fi(V)):Ce=null}break t}}He=0,qt=null,Ta(e,t,m,5);break;case 6:He=0,qt=null,Ta(e,t,m,6);break;case 8:Qc(),tt=6;break e;default:throw Error(o(462))}}Iy();break}catch(I){Sm(e,I)}while(!0);return An=El=null,M.H=i,M.A=c,Le=l,Ce!==null?0:(Xe=null,Ae=0,Ms(),tt)}function Iy(){for(;Ce!==null&&!ao();)Em(Ce)}function Em(e){var t=W0(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?fi(e):Ce=t}function Am(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=F0(l,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=F0(l,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:ic(t);default:tm(l,t),t=Ce=Tf(t,qn),t=W0(l,t,qn)}e.memoizedProps=e.pendingProps,t===null?fi(e):Ce=t}function Ta(e,t,l,i){An=El=null,ic(t),ga=null,gr=0;var c=t.return;try{if(Uy(e,c,t,l,Ae)){tt=1,Ws(e,Kt(l,e.current)),Ce=null;return}}catch(m){if(c!==null)throw Ce=c,m;tt=1,Ws(e,Kt(l,e.current)),Ce=null;return}t.flags&32768?(ze||i===1?e=!0:ka||(Ae&536870912)!==0?e=!1:(al=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ht.current,i!==null&&i.tag===13&&(i.flags|=16384))),Mm(t,e)):fi(t)}function fi(e){var t=e;do{if((t.flags&32768)!==0){Mm(t,al);return}e=t.return;var l=qy(t.alternate,t,qn);if(l!==null){Ce=l;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);tt===0&&(tt=5)}function Mm(e,t){do{var l=Yy(e.alternate,e);if(l!==null){l.flags&=32767,Ce=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=l}while(e!==null);tt=6,Ce=null}function zm(e,t,l,i,c,m,b,N,T){e.cancelPendingCommit=null;do mi();while(ut!==0);if((Le&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=Do,Tg(e,l,m,b,N,T),e===Xe&&(Ce=Xe=null,Ae=0),Ca=t,il=e,Yn=l,Vc=m,Gc=c,jm=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Wy(ve,function(){return Um(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=M.T,M.T=null,c=z.p,z.p=2,b=Le,Le|=4;try{Vy(e,t,l)}finally{Le=b,z.p=c,M.T=i}}ut=1,Om(),Dm(),Rm()}}function Om(){if(ut===1){ut=0;var e=il,t=Ca,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var i=z.p;z.p=2;var c=Le;Le|=4;try{mm(t,e);var m=au,b=bf(e.containerInfo),N=m.focusedElem,T=m.selectionRange;if(b!==N&&N&&N.ownerDocument&&yf(N.ownerDocument.documentElement,N)){if(T!==null&&Eo(N)){var V=T.start,I=T.end;if(I===void 0&&(I=V),"selectionStart"in N)N.selectionStart=V,N.selectionEnd=Math.min(I,N.value.length);else{var le=N.ownerDocument||document,G=le&&le.defaultView||window;if(G.getSelection){var Q=G.getSelection(),me=N.textContent.length,be=Math.min(T.start,me),$e=T.end===void 0?be:Math.min(T.end,me);!Q.extend&&be>$e&&(b=$e,$e=be,be=b);var B=gf(N,be),R=gf(N,$e);if(B&&R&&(Q.rangeCount!==1||Q.anchorNode!==B.node||Q.anchorOffset!==B.offset||Q.focusNode!==R.node||Q.focusOffset!==R.offset)){var Y=le.createRange();Y.setStart(B.node,B.offset),Q.removeAllRanges(),be>$e?(Q.addRange(Y),Q.extend(R.node,R.offset)):(Y.setEnd(R.node,R.offset),Q.addRange(Y))}}}}for(le=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&le.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var ee=le[N];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Si=!!lu,au=lu=null}finally{Le=c,z.p=i,M.T=l}}e.current=t,ut=2}}function Dm(){if(ut===2){ut=0;var e=il,t=Ca,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var i=z.p;z.p=2;var c=Le;Le|=4;try{om(e,t.alternate,t)}finally{Le=c,z.p=i,M.T=l}}ut=3}}function Rm(){if(ut===4||ut===3){ut=0,ro();var e=il,t=Ca,l=Yn,i=jm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ut=5:(ut=0,Ca=il=null,Lm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(sl=null),co(l),t=t.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(Nt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=M.T,c=z.p,z.p=2,M.T=null;try{for(var m=e.onRecoverableError,b=0;b<i.length;b++){var N=i[b];m(N.value,{componentStack:N.stack})}}finally{M.T=t,z.p=c}}(Yn&3)!==0&&mi(),xn(e),c=e.pendingLanes,(l&261930)!==0&&(c&42)!==0?e===$c?Dr++:(Dr=0,$c=e):Dr=0,Rr(0)}}function Lm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xr(t)))}function mi(){return Om(),Dm(),Rm(),Um()}function Um(){if(ut!==5)return!1;var e=il,t=Vc;Vc=0;var l=co(Yn),i=M.T,c=z.p;try{z.p=32>l?32:l,M.T=null,l=Gc,Gc=null;var m=il,b=Yn;if(ut=0,Ca=il=null,Yn=0,(Le&6)!==0)throw Error(o(331));var N=Le;if(Le|=4,ym(m.current),xm(m,m.current,b,l),Le=N,Rr(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(Nt,m)}catch{}return!0}finally{z.p=c,M.T=i,Lm(e,t)}}function Hm(e,t,l){t=Kt(l,t),t=Nc(e.stateNode,t,2),e=el(e,t,2),e!==null&&(tr(e,2),xn(e))}function Be(e,t,l){if(e.tag===3)Hm(e,e,l);else for(;t!==null;){if(t.tag===3){Hm(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(sl===null||!sl.has(i))){e=Kt(l,e),l=B0(2),i=el(t,l,2),i!==null&&(q0(l,i,t,e),tr(i,2),xn(i));break}}t=t.return}}function Fc(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new Qy;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(l)||(Bc=!0,c.add(l),e=Ky.bind(null,e,t,l),t.then(e,e))}function Ky(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Xe===e&&(Ae&l)===l&&(tt===4||tt===3&&(Ae&62914560)===Ae&&300>jt()-ii?(Le&2)===0&&_a(e,0):qc|=l,Sa===Ae&&(Sa=0)),xn(e)}function Bm(e,t){t===0&&(t=zd()),e=Cl(e,t),e!==null&&(tr(e,t),xn(e))}function Jy(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Bm(e,l)}function Py(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Bm(e,l)}function Wy(e,t){return Il(e,t)}var hi=null,Ea=null,Zc=!1,xi=!1,Ic=!1,cl=0;function xn(e){e!==Ea&&e.next===null&&(Ea===null?hi=Ea=e:Ea=Ea.next=e),xi=!0,Zc||(Zc=!0,tb())}function Rr(e,t){if(!Ic&&xi){Ic=!0;do for(var l=!1,i=hi;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var m=0;else{var b=i.suspendedLanes,N=i.pingedLanes;m=(1<<31-Qe(42|e)+1)-1,m&=c&~(b&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Gm(i,m))}else m=Ae,m=bs(i,i===Xe?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||er(i,m)||(l=!0,Gm(i,m));i=i.next}while(l);Ic=!1}}function eb(){qm()}function qm(){xi=Zc=!1;var e=0;cl!==0&&db()&&(e=cl);for(var t=jt(),l=null,i=hi;i!==null;){var c=i.next,m=Ym(i,t);m===0?(i.next=null,l===null?hi=c:l.next=c,c===null&&(Ea=l)):(l=i,(e!==0||(m&3)!==0)&&(xi=!0)),i=c}ut!==0&&ut!==5||Rr(e),cl!==0&&(cl=0)}function Ym(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var b=31-Qe(m),N=1<<b,T=c[b];T===-1?((N&l)===0||(N&i)!==0)&&(c[b]=_g(N,t)):T<=t&&(e.expiredLanes|=N),m&=~N}if(t=Xe,l=Ae,l=bs(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,l===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Wa(i),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||er(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&Wa(i),co(l)){case 2:case 8:l=ce;break;case 32:l=ve;break;case 268435456:l=Ue;break;default:l=ve}return i=Vm.bind(null,e),l=Il(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&Wa(i),e.callbackPriority=2,e.callbackNode=null,2}function Vm(e,t){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(mi()&&e.callbackNode!==l)return null;var i=Ae;return i=bs(e,e===Xe?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(wm(e,i,t),Ym(e,jt()),e.callbackNode!=null&&e.callbackNode===l?Vm.bind(null,e):null)}function Gm(e,t){if(mi())return null;wm(e,t,!0)}function tb(){mb(function(){(Le&6)!==0?Il(J,eb):qm()})}function Kc(){if(cl===0){var e=ha;e===0&&(e=ps,ps<<=1,(ps&261888)===0&&(ps=256)),cl=e}return cl}function $m(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ws(""+e)}function Qm(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function nb(e,t,l,i,c){if(t==="submit"&&l&&l.stateNode===c){var m=$m((c[Ct]||null).action),b=i.submitter;b&&(t=(t=b[Ct]||null)?$m(t.formAction):b.getAttribute("formAction"),t!==null&&(m=t,b=null));var N=new _s("action","action",null,i,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(cl!==0){var T=b?Qm(c,b):new FormData(c);pc(l,{pending:!0,data:T,method:c.method,action:m},null,T)}}else typeof m=="function"&&(N.preventDefault(),T=b?Qm(c,b):new FormData(c),pc(l,{pending:!0,data:T,method:c.method,action:m},m,T))},currentTarget:c}]})}}for(var Jc=0;Jc<Oo.length;Jc++){var Pc=Oo[Jc],lb=Pc.toLowerCase(),ab=Pc[0].toUpperCase()+Pc.slice(1);on(lb,"on"+ab)}on(Nf,"onAnimationEnd"),on(wf,"onAnimationIteration"),on(kf,"onAnimationStart"),on("dblclick","onDoubleClick"),on("focusin","onFocus"),on("focusout","onBlur"),on(vy,"onTransitionRun"),on(jy,"onTransitionStart"),on(Ny,"onTransitionCancel"),on(Sf,"onTransitionEnd"),ea("onMouseEnter",["mouseout","mouseover"]),ea("onMouseLeave",["mouseout","mouseover"]),ea("onPointerEnter",["pointerout","pointerover"]),ea("onPointerLeave",["pointerout","pointerover"]),Nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lr="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(" "),rb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lr));function Xm(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],c=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var b=i.length-1;0<=b;b--){var N=i[b],T=N.instance,V=N.currentTarget;if(N=N.listener,T!==m&&c.isPropagationStopped())break e;m=N,c.currentTarget=V;try{m(c)}catch(I){As(I)}c.currentTarget=null,m=T}else for(b=0;b<i.length;b++){if(N=i[b],T=N.instance,V=N.currentTarget,N=N.listener,T!==m&&c.isPropagationStopped())break e;m=N,c.currentTarget=V;try{m(c)}catch(I){As(I)}c.currentTarget=null,m=T}}}}function _e(e,t){var l=t[uo];l===void 0&&(l=t[uo]=new Set);var i=e+"__bubble";l.has(i)||(Fm(t,e,2,!1),l.add(i))}function Wc(e,t,l){var i=0;t&&(i|=4),Fm(l,e,i,t)}var pi="_reactListening"+Math.random().toString(36).slice(2);function eu(e){if(!e[pi]){e[pi]=!0,Bd.forEach(function(l){l!=="selectionchange"&&(rb.has(l)||Wc(l,!1,e),Wc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pi]||(t[pi]=!0,Wc("selectionchange",!1,t))}}function Fm(e,t,l,i){switch(Nh(t)){case 2:var c=Ob;break;case 8:c=Db;break;default:c=xu}l=c.bind(null,t,l,e),c=void 0,!vo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,l,{capture:!0,passive:c}):e.addEventListener(t,l,!0):c!==void 0?e.addEventListener(t,l,{passive:c}):e.addEventListener(t,l,!1)}function tu(e,t,l,i,c){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var N=i.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=i.return;b!==null;){var T=b.tag;if((T===3||T===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=Jl(N),b===null)return;if(T=b.tag,T===5||T===6||T===26||T===27){i=m=b;continue e}N=N.parentNode}}i=i.return}Jd(function(){var V=m,I=yo(l),le=[];e:{var G=Cf.get(e);if(G!==void 0){var Q=_s,me=e;switch(e){case"keypress":if(Ss(l)===0)break e;case"keydown":case"keyup":Q=Pg;break;case"focusin":me="focus",Q=ko;break;case"focusout":me="blur",Q=ko;break;case"beforeblur":case"afterblur":Q=ko;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=ef;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=ty;break;case Nf:case wf:case kf:Q=Gg;break;case Sf:Q=ly;break;case"scroll":case"scrollend":Q=Hg;break;case"wheel":Q=ry;break;case"copy":case"cut":case"paste":Q=Qg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=nf;break;case"toggle":case"beforetoggle":Q=iy}var be=(t&4)!==0,$e=!be&&(e==="scroll"||e==="scrollend"),B=be?G!==null?G+"Capture":null:G;be=[];for(var R=V,Y;R!==null;){var ee=R;if(Y=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||Y===null||B===null||(ee=ar(R,B),ee!=null&&be.push(Ur(R,ee,Y))),$e)break;R=R.return}0<be.length&&(G=new Q(G,me,null,l,I),le.push({event:G,listeners:be}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&l!==go&&(me=l.relatedTarget||l.fromElement)&&(Jl(me)||me[Kl]))break e;if((Q||G)&&(G=I.window===I?I:(G=I.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(me=l.relatedTarget||l.toElement,Q=V,me=me?Jl(me):null,me!==null&&($e=d(me),be=me.tag,me!==$e||be!==5&&be!==27&&be!==6)&&(me=null)):(Q=null,me=V),Q!==me)){if(be=ef,ee="onMouseLeave",B="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(be=nf,ee="onPointerLeave",B="onPointerEnter",R="pointer"),$e=Q==null?G:lr(Q),Y=me==null?G:lr(me),G=new be(ee,R+"leave",Q,l,I),G.target=$e,G.relatedTarget=Y,ee=null,Jl(I)===V&&(be=new be(B,R+"enter",me,l,I),be.target=Y,be.relatedTarget=$e,ee=be),$e=ee,Q&&me)t:{for(be=sb,B=Q,R=me,Y=0,ee=B;ee;ee=be(ee))Y++;ee=0;for(var ge=R;ge;ge=be(ge))ee++;for(;0<Y-ee;)B=be(B),Y--;for(;0<ee-Y;)R=be(R),ee--;for(;Y--;){if(B===R||R!==null&&B===R.alternate){be=B;break t}B=be(B),R=be(R)}be=null}else be=null;Q!==null&&Zm(le,G,Q,be,!1),me!==null&&$e!==null&&Zm(le,$e,me,be,!0)}}e:{if(G=V?lr(V):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var De=df;else if(cf(G))if(ff)De=gy;else{De=xy;var xe=hy}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?V&&po(V.elementType)&&(De=df):De=py;if(De&&(De=De(e,V))){uf(le,De,l,I);break e}xe&&xe(e,G,V),e==="focusout"&&V&&G.type==="number"&&V.memoizedProps.value!=null&&xo(G,"number",G.value)}switch(xe=V?lr(V):window,e){case"focusin":(cf(xe)||xe.contentEditable==="true")&&(sa=xe,Ao=V,fr=null);break;case"focusout":fr=Ao=sa=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,vf(le,l,I);break;case"selectionchange":if(by)break;case"keydown":case"keyup":vf(le,l,I)}var we;if(Co)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ra?sf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(lf&&l.locale!=="ko"&&(ra||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ra&&(we=Pd()):(Fn=I,jo="value"in Fn?Fn.value:Fn.textContent,ra=!0)),xe=gi(V,Me),0<xe.length&&(Me=new tf(Me,e,null,l,I),le.push({event:Me,listeners:xe}),we?Me.data=we:(we=of(l),we!==null&&(Me.data=we)))),(we=cy?uy(e,l):dy(e,l))&&(Me=gi(V,"onBeforeInput"),0<Me.length&&(xe=new tf("onBeforeInput","beforeinput",null,l,I),le.push({event:xe,listeners:Me}),xe.data=we)),nb(le,e,V,l,I)}Xm(le,t)})}function Ur(e,t,l){return{instance:e,listener:t,currentTarget:l}}function gi(e,t){for(var l=t+"Capture",i=[];e!==null;){var c=e,m=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||m===null||(c=ar(e,l),c!=null&&i.unshift(Ur(e,c,m)),c=ar(e,t),c!=null&&i.push(Ur(e,c,m))),e.tag===3)return i;e=e.return}return[]}function sb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zm(e,t,l,i,c){for(var m=t._reactName,b=[];l!==null&&l!==i;){var N=l,T=N.alternate,V=N.stateNode;if(N=N.tag,T!==null&&T===i)break;N!==5&&N!==26&&N!==27||V===null||(T=V,c?(V=ar(l,m),V!=null&&b.unshift(Ur(l,V,T))):c||(V=ar(l,m),V!=null&&b.push(Ur(l,V,T)))),l=l.return}b.length!==0&&e.push({event:t,listeners:b})}var ib=/\r\n?/g,ob=/\u0000|\uFFFD/g;function Im(e){return(typeof e=="string"?e:""+e).replace(ib,`
`).replace(ob,"")}function Km(e,t){return t=Im(t),Im(e)===t}function Ge(e,t,l,i,c,m){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||na(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&na(e,""+i);break;case"className":js(e,"class",i);break;case"tabIndex":js(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":js(e,l,i);break;case"style":Id(e,i,m);break;case"data":if(t!=="object"){js(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=ws(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(l,"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 m=="function"&&(l==="formAction"?(t!=="input"&&Ge(e,t,"name",c.name,c,null),Ge(e,t,"formEncType",c.formEncType,c,null),Ge(e,t,"formMethod",c.formMethod,c,null),Ge(e,t,"formTarget",c.formTarget,c,null)):(Ge(e,t,"encType",c.encType,c,null),Ge(e,t,"method",c.method,c,null),Ge(e,t,"target",c.target,c,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=ws(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=Cn);break;case"onScroll":i!=null&&_e("scroll",e);break;case"onScrollEnd":i!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}l=ws(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""+i):e.removeAttribute(l);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":_e("beforetoggle",e),_e("toggle",e),vs(e,"popover",i);break;case"xlinkActuate":Sn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Sn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Sn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Sn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Sn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Sn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":vs(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Lg.get(l)||l,vs(e,l,i))}}function nu(e,t,l,i,c,m){switch(l){case"style":Id(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof i=="string"?na(e,i):(typeof i=="number"||typeof i=="bigint")&&na(e,""+i);break;case"onScroll":i!=null&&_e("scroll",e);break;case"onScrollEnd":i!=null&&_e("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qd.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),t=l.slice(2,c?l.length-7:void 0),m=e[Ct]||null,m=m!=null?m[l]:null,typeof m=="function"&&e.removeEventListener(t,m,c),typeof i=="function")){typeof m!="function"&&m!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,c);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):vs(e,l,i)}}}function gt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var i=!1,c=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ge(e,t,m,b,l,null)}}c&&Ge(e,t,"srcSet",l.srcSet,l,null),i&&Ge(e,t,"src",l.src,l,null);return;case"input":_e("invalid",e);var N=m=b=c=null,T=null,V=null;for(i in l)if(l.hasOwnProperty(i)){var I=l[i];if(I!=null)switch(i){case"name":c=I;break;case"type":b=I;break;case"checked":T=I;break;case"defaultChecked":V=I;break;case"value":m=I;break;case"defaultValue":N=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(o(137,t));break;default:Ge(e,t,i,I,l,null)}}Qd(e,m,N,T,V,b,c,!1);return;case"select":_e("invalid",e),i=b=m=null;for(c in l)if(l.hasOwnProperty(c)&&(N=l[c],N!=null))switch(c){case"value":m=N;break;case"defaultValue":b=N;break;case"multiple":i=N;default:Ge(e,t,c,N,l,null)}t=m,l=b,e.multiple=!!i,t!=null?ta(e,!!i,t,!1):l!=null&&ta(e,!!i,l,!0);return;case"textarea":_e("invalid",e),m=c=i=null;for(b in l)if(l.hasOwnProperty(b)&&(N=l[b],N!=null))switch(b){case"value":i=N;break;case"defaultValue":c=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Ge(e,t,b,N,l,null)}Fd(e,i,c,m);return;case"option":for(T in l)if(l.hasOwnProperty(T)&&(i=l[T],i!=null))switch(T){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ge(e,t,T,i,l,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(i=0;i<Lr.length;i++)_e(Lr[i],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in l)if(l.hasOwnProperty(V)&&(i=l[V],i!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ge(e,t,V,i,l,null)}return;default:if(po(t)){for(I in l)l.hasOwnProperty(I)&&(i=l[I],i!==void 0&&nu(e,t,I,i,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(i=l[N],i!=null&&Ge(e,t,N,i,l,null))}function cb(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,m=null,b=null,N=null,T=null,V=null,I=null;for(Q in l){var le=l[Q];if(l.hasOwnProperty(Q)&&le!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":T=le;default:i.hasOwnProperty(Q)||Ge(e,t,Q,null,i,le)}}for(var G in i){var Q=i[G];if(le=l[G],i.hasOwnProperty(G)&&(Q!=null||le!=null))switch(G){case"type":m=Q;break;case"name":c=Q;break;case"checked":V=Q;break;case"defaultChecked":I=Q;break;case"value":b=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:Q!==le&&Ge(e,t,G,Q,i,le)}}ho(e,b,N,T,V,I,m,c);return;case"select":Q=b=N=G=null;for(m in l)if(T=l[m],l.hasOwnProperty(m)&&T!=null)switch(m){case"value":break;case"multiple":Q=T;default:i.hasOwnProperty(m)||Ge(e,t,m,null,i,T)}for(c in i)if(m=i[c],T=l[c],i.hasOwnProperty(c)&&(m!=null||T!=null))switch(c){case"value":G=m;break;case"defaultValue":N=m;break;case"multiple":b=m;default:m!==T&&Ge(e,t,c,m,i,T)}t=N,l=b,i=Q,G!=null?ta(e,!!l,G,!1):!!i!=!!l&&(t!=null?ta(e,!!l,t,!0):ta(e,!!l,l?[]:"",!1));return;case"textarea":Q=G=null;for(N in l)if(c=l[N],l.hasOwnProperty(N)&&c!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ge(e,t,N,null,i,c)}for(b in i)if(c=i[b],m=l[b],i.hasOwnProperty(b)&&(c!=null||m!=null))switch(b){case"value":G=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==m&&Ge(e,t,b,c,i,m)}Xd(e,G,Q);return;case"option":for(var me in l)if(G=l[me],l.hasOwnProperty(me)&&G!=null&&!i.hasOwnProperty(me))switch(me){case"selected":e.selected=!1;break;default:Ge(e,t,me,null,i,G)}for(T in i)if(G=i[T],Q=l[T],i.hasOwnProperty(T)&&G!==Q&&(G!=null||Q!=null))switch(T){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ge(e,t,T,G,i,Q)}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 be in l)G=l[be],l.hasOwnProperty(be)&&G!=null&&!i.hasOwnProperty(be)&&Ge(e,t,be,null,i,G);for(V in i)if(G=i[V],Q=l[V],i.hasOwnProperty(V)&&G!==Q&&(G!=null||Q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:Ge(e,t,V,G,i,Q)}return;default:if(po(t)){for(var $e in l)G=l[$e],l.hasOwnProperty($e)&&G!==void 0&&!i.hasOwnProperty($e)&&nu(e,t,$e,void 0,i,G);for(I in i)G=i[I],Q=l[I],!i.hasOwnProperty(I)||G===Q||G===void 0&&Q===void 0||nu(e,t,I,G,i,Q);return}}for(var B in l)G=l[B],l.hasOwnProperty(B)&&G!=null&&!i.hasOwnProperty(B)&&Ge(e,t,B,null,i,G);for(le in i)G=i[le],Q=l[le],!i.hasOwnProperty(le)||G===Q||G==null&&Q==null||Ge(e,t,le,G,i,Q)}function Jm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ub(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var c=l[i],m=c.transferSize,b=c.initiatorType,N=c.duration;if(m&&N&&Jm(b)){for(b=0,N=c.responseEnd,i+=1;i<l.length;i++){var T=l[i],V=T.startTime;if(V>N)break;var I=T.transferSize,le=T.initiatorType;I&&Jm(le)&&(T=T.responseEnd,b+=I*(T<N?1:(N-V)/(T-V)))}if(--i,t+=8*(m+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var lu=null,au=null;function yi(e){return e.nodeType===9?e:e.ownerDocument}function Pm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ru(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var su=null;function db(){var e=window.event;return e&&e.type==="popstate"?e===su?!1:(su=e,!0):(su=null,!1)}var eh=typeof setTimeout=="function"?setTimeout:void 0,fb=typeof clearTimeout=="function"?clearTimeout:void 0,th=typeof Promise=="function"?Promise:void 0,mb=typeof queueMicrotask=="function"?queueMicrotask:typeof th<"u"?function(e){return th.resolve(null).then(e).catch(hb)}:eh;function hb(e){setTimeout(function(){throw e})}function ul(e){return e==="head"}function nh(e,t){var l=t,i=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(i===0){e.removeChild(c),Oa(t);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")Hr(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Hr(l);for(var m=l.firstChild;m;){var b=m.nextSibling,N=m.nodeName;m[nr]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&Hr(e.ownerDocument.body);l=c}while(l);Oa(t)}function lh(e,t){var l=e;e=0;do{var i=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=i}while(l)}function iu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":iu(l),fo(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function xb(e,t,l,i){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=tn(e.nextSibling),e===null)break}return null}function pb(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=tn(e.nextSibling),e===null))return null;return e}function ah(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=tn(e.nextSibling),e===null))return null;return e}function ou(e){return e.data==="$?"||e.data==="$~"}function cu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gb(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var i=function(){t(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var uu=null;function rh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return tn(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function sh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function ih(e,t,l){switch(t=yi(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Hr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);fo(e)}var nn=new Map,oh=new Set;function bi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Vn=z.d;z.d={f:yb,r:bb,D:vb,C:jb,L:Nb,m:wb,X:Sb,S:kb,M:Cb};function yb(){var e=Vn.f(),t=ui();return e||t}function bb(e){var t=Pl(e);t!==null&&t.tag===5&&t.type==="form"?S0(t):Vn.r(e)}var Aa=typeof document>"u"?null:document;function ch(e,t,l){var i=Aa;if(i&&typeof t=="string"&&t){var c=Zt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),oh.has(c)||(oh.add(c),e={rel:e,crossOrigin:l,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),gt(t,"link",e),dt(t),i.head.appendChild(t)))}}function vb(e){Vn.D(e),ch("dns-prefetch",e,null)}function jb(e,t){Vn.C(e,t),ch("preconnect",e,t)}function Nb(e,t,l){Vn.L(e,t,l);var i=Aa;if(i&&e&&t){var c='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+Zt(l.imageSizes)+'"]')):c+='[href="'+Zt(e)+'"]';var m=c;switch(t){case"style":m=Ma(e);break;case"script":m=za(e)}nn.has(m)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),nn.set(m,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(Br(m))||t==="script"&&i.querySelector(qr(m))||(t=i.createElement("link"),gt(t,"link",e),dt(t),i.head.appendChild(t)))}}function wb(e,t){Vn.m(e,t);var l=Aa;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Zt(i)+'"][href="'+Zt(e)+'"]',m=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=za(e)}if(!nn.has(m)&&(e=g({rel:"modulepreload",href:e},t),nn.set(m,e),l.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(qr(m)))return}i=l.createElement("link"),gt(i,"link",e),dt(i),l.head.appendChild(i)}}}function kb(e,t,l){Vn.S(e,t,l);var i=Aa;if(i&&e){var c=Wl(i).hoistableStyles,m=Ma(e);t=t||"default";var b=c.get(m);if(!b){var N={loading:0,preload:null};if(b=i.querySelector(Br(m)))N.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=nn.get(m))&&du(e,l);var T=b=i.createElement("link");dt(T),gt(T,"link",e),T._p=new Promise(function(V,I){T.onload=V,T.onerror=I}),T.addEventListener("load",function(){N.loading|=1}),T.addEventListener("error",function(){N.loading|=2}),N.loading|=4,vi(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(m,b)}}}function Sb(e,t){Vn.X(e,t);var l=Aa;if(l&&e){var i=Wl(l).hoistableScripts,c=za(e),m=i.get(c);m||(m=l.querySelector(qr(c)),m||(e=g({src:e,async:!0},t),(t=nn.get(c))&&fu(e,t),m=l.createElement("script"),dt(m),gt(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(c,m))}}function Cb(e,t){Vn.M(e,t);var l=Aa;if(l&&e){var i=Wl(l).hoistableScripts,c=za(e),m=i.get(c);m||(m=l.querySelector(qr(c)),m||(e=g({src:e,async:!0,type:"module"},t),(t=nn.get(c))&&fu(e,t),m=l.createElement("script"),dt(m),gt(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(c,m))}}function uh(e,t,l,i){var c=(c=he.current)?bi(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ma(l.href),l=Wl(c).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ma(l.href);var m=Wl(c).hoistableStyles,b=m.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,b),(m=c.querySelector(Br(e)))&&!m._p&&(b.instance=m,b.state.loading=5),nn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},nn.set(e,l),m||_b(c,e,l,b.state))),t&&i===null)throw Error(o(528,""));return b}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=za(l),l=Wl(c).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ma(e){return'href="'+Zt(e)+'"'}function Br(e){return'link[rel="stylesheet"]['+e+"]"}function dh(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function _b(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),gt(t,"link",l),dt(t),e.head.appendChild(t))}function za(e){return'[src="'+Zt(e)+'"]'}function qr(e){return"script[async]"+e}function fh(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(i)return t.instance=i,dt(i),i;var c=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),dt(i),gt(i,"style",c),vi(i,l.precedence,e),t.instance=i;case"stylesheet":c=Ma(l.href);var m=e.querySelector(Br(c));if(m)return t.state.loading|=4,t.instance=m,dt(m),m;i=dh(l),(c=nn.get(c))&&du(i,c),m=(e.ownerDocument||e).createElement("link"),dt(m);var b=m;return b._p=new Promise(function(N,T){b.onload=N,b.onerror=T}),gt(m,"link",i),t.state.loading|=4,vi(m,l.precedence,e),t.instance=m;case"script":return m=za(l.src),(c=e.querySelector(qr(m)))?(t.instance=c,dt(c),c):(i=l,(c=nn.get(m))&&(i=g({},l),fu(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),dt(c),gt(c,"link",i),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,vi(i,l.precedence,e));return t.instance}function vi(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,m=c,b=0;b<i.length;b++){var N=i[b];if(N.dataset.precedence===t)m=N;else if(m!==c)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ji=null;function mh(e,t,l){if(ji===null){var i=new Map,c=ji=new Map;c.set(l,i)}else c=ji,i=c.get(l),i||(i=new Map,c.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var m=l[c];if(!(m[nr]||m[mt]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(t)||"";b=e+b;var N=i.get(b);N?N.push(m):i.set(b,[m])}}return i}function hh(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Tb(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function xh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Eb(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=Ma(i.href),m=t.querySelector(Br(c));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ni.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=m,dt(m);return}m=t.ownerDocument||t,i=dh(i),(c=nn.get(c))&&du(i,c),m=m.createElement("link"),dt(m);var b=m;b._p=new Promise(function(N,T){b.onload=N,b.onerror=T}),gt(m,"link",i),l.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ni.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var mu=0;function Ab(e,t){return e.stylesheets&&e.count===0&&ki(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var i=setTimeout(function(){if(e.stylesheets&&ki(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&mu===0&&(mu=62500*ub());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ki(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>mu?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function Ni(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ki(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wi=null;function ki(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wi=new Map,t.forEach(Mb,e),wi=null,Ni.call(e))}function Mb(e,t){if(!(t.state.loading&4)){var l=wi.get(e);if(l)var i=l.get(null);else{l=new Map,wi.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<c.length;m++){var b=c[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),i=b)}i&&l.set(null,i)}c=t.instance,b=c.getAttribute("data-precedence"),m=l.get(b)||i,m===i&&l.set(null,c),l.set(b,c),this.count++,i=Ni.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),m?m.parentNode.insertBefore(c,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Yr={$$typeof:H,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function zb(e,t,l,i,c,m,b,N,T){this.tag=1,this.containerInfo=e,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=io(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=io(0),this.hiddenUpdates=io(null),this.identifierPrefix=i,this.onUncaughtError=c,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function ph(e,t,l,i,c,m,b,N,T,V,I,le){return e=new zb(e,t,l,b,T,V,I,le,N),t=1,m===!0&&(t|=24),m=Ut(3,null,null,t),e.current=m,m.stateNode=e,t=Xo(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:l,cache:t},Ko(m),e}function gh(e){return e?(e=ca,e):ca}function yh(e,t,l,i,c,m){c=gh(c),i.context===null?i.context=c:i.pendingContext=c,i=Wn(t),i.payload={element:l},m=m===void 0?null:m,m!==null&&(i.callback=m),l=el(e,i,t),l!==null&&(zt(l,e,t),br(l,e,t))}function bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function hu(e,t){bh(e,t),(e=e.alternate)&&bh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Cl(e,67108864);t!==null&&zt(t,e,67108864),hu(e,67108864)}}function jh(e){if(e.tag===13||e.tag===31){var t=Vt();t=oo(t);var l=Cl(e,t);l!==null&&zt(l,e,t),hu(e,t)}}var Si=!0;function Ob(e,t,l,i){var c=M.T;M.T=null;var m=z.p;try{z.p=2,xu(e,t,l,i)}finally{z.p=m,M.T=c}}function Db(e,t,l,i){var c=M.T;M.T=null;var m=z.p;try{z.p=8,xu(e,t,l,i)}finally{z.p=m,M.T=c}}function xu(e,t,l,i){if(Si){var c=pu(i);if(c===null)tu(e,t,i,Ci,l),wh(e,i);else if(Lb(c,e,t,l,i))i.stopPropagation();else if(wh(e,i),t&4&&-1<Rb.indexOf(e)){for(;c!==null;){var m=Pl(c);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=jl(m.pendingLanes);if(b!==0){var N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var T=1<<31-Qe(b);N.entanglements[1]|=T,b&=~T}xn(m),(Le&6)===0&&(oi=jt()+500,Rr(0))}}break;case 31:case 13:N=Cl(m,2),N!==null&&zt(N,m,2),ui(),hu(m,2)}if(m=pu(i),m===null&&tu(e,t,i,Ci,l),m===c)break;c=m}c!==null&&i.stopPropagation()}else tu(e,t,i,null,l)}}function pu(e){return e=yo(e),gu(e)}var Ci=null;function gu(e){if(Ci=null,e=Jl(e),e!==null){var t=d(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=f(t),e!==null)return e;e=null}else if(l===31){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ci=e,null}function Nh(e){switch(e){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(so()){case J:return 2;case ce:return 8;case ve:case Se:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var yu=!1,dl=null,fl=null,ml=null,Vr=new Map,Gr=new Map,hl=[],Rb="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 wh(e,t){switch(e){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":fl=null;break;case"mouseover":case"mouseout":ml=null;break;case"pointerover":case"pointerout":Vr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gr.delete(t.pointerId)}}function $r(e,t,l,i,c,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:m,targetContainers:[c]},t!==null&&(t=Pl(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Lb(e,t,l,i,c){switch(t){case"focusin":return dl=$r(dl,e,t,l,i,c),!0;case"dragenter":return fl=$r(fl,e,t,l,i,c),!0;case"mouseover":return ml=$r(ml,e,t,l,i,c),!0;case"pointerover":var m=c.pointerId;return Vr.set(m,$r(Vr.get(m)||null,e,t,l,i,c)),!0;case"gotpointercapture":return m=c.pointerId,Gr.set(m,$r(Gr.get(m)||null,e,t,l,i,c)),!0}return!1}function kh(e){var t=Jl(e.target);if(t!==null){var l=d(t);if(l!==null){if(t=l.tag,t===13){if(t=f(l),t!==null){e.blockedOn=t,Ud(e.priority,function(){jh(l)});return}}else if(t===31){if(t=x(l),t!==null){e.blockedOn=t,Ud(e.priority,function(){jh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _i(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=pu(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);go=i,l.target.dispatchEvent(i),go=null}else return t=Pl(l),t!==null&&vh(t),e.blockedOn=l,!1;t.shift()}return!0}function Sh(e,t,l){_i(e)&&l.delete(t)}function Ub(){yu=!1,dl!==null&&_i(dl)&&(dl=null),fl!==null&&_i(fl)&&(fl=null),ml!==null&&_i(ml)&&(ml=null),Vr.forEach(Sh),Gr.forEach(Sh)}function Ti(e,t){e.blockedOn===t&&(e.blockedOn=null,yu||(yu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Ub)))}var Ei=null;function Ch(e){Ei!==e&&(Ei=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ei===e&&(Ei=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],c=e[t+2];if(typeof i!="function"){if(gu(i||l)===null)continue;break}var m=Pl(l);m!==null&&(e.splice(t,3),t-=3,pc(m,{pending:!0,data:c,method:l.method,action:i},i,c))}}))}function Oa(e){function t(T){return Ti(T,e)}dl!==null&&Ti(dl,e),fl!==null&&Ti(fl,e),ml!==null&&Ti(ml,e),Vr.forEach(t),Gr.forEach(t);for(var l=0;l<hl.length;l++){var i=hl[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<hl.length&&(l=hl[0],l.blockedOn===null);)kh(l),l.blockedOn===null&&hl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var c=l[i],m=l[i+1],b=c[Ct]||null;if(typeof m=="function")b||Ch(l);else if(b){var N=null;if(m&&m.hasAttribute("formAction")){if(c=m,b=m[Ct]||null)N=b.formAction;else if(gu(c)!==null)continue}else N=b.action;typeof N=="function"?l[i+1]=N:(l.splice(i,3),i-=3),Ch(l)}}}function _h(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function bu(e){this._internalRoot=e}Ai.prototype.render=bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,i=Vt();yh(l,i,e,t,null,null)},Ai.prototype.unmount=bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yh(e.current,2,null,e,null,null),ui(),t[Kl]=null}};function Ai(e){this._internalRoot=e}Ai.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ld();e={blockedOn:null,target:e,priority:t};for(var l=0;l<hl.length&&t!==0&&t<hl[l].priority;l++);hl.splice(l,0,e),l===0&&kh(e)}};var Th=r.version;if(Th!=="19.2.4")throw Error(o(527,Th,"19.2.4"));z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Hb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mi.isDisabled&&Mi.supportsFiber)try{Nt=Mi.inject(Hb),ct=Mi}catch{}}return Xr.createRoot=function(e,t){if(!u(e))throw Error(o(299));var l=!1,i="",c=R0,m=L0,b=U0;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=ph(e,1,!1,null,null,l,i,null,c,m,b,_h),e[Kl]=t.current,eu(e),new bu(t)},Xr.hydrateRoot=function(e,t,l){if(!u(e))throw Error(o(299));var i=!1,c="",m=R0,b=L0,N=U0,T=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError),l.formState!==void 0&&(T=l.formState)),t=ph(e,1,!0,t,l??null,i,c,T,m,b,N,_h),t.context=gh(null),l=t.current,i=Vt(),i=oo(i),c=Wn(i),c.callback=null,el(l,c,i),l=i,t.current.lanes=l,tr(t,l),xn(t),e[Kl]=t.current,eu(e),new Ai(t)},Xr.version="19.2.4",Xr}var Hh;function Zb(){if(Hh)return Nu.exports;Hh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Nu.exports=Fb(),Nu.exports}var Ib=Zb();const Kb=Zi(Ib),Bh=n=>{let r;const s=new Set,o=(h,y)=>{const g=typeof h=="function"?h(r):h;if(!Object.is(g,r)){const v=r;r=y??(typeof g!="object"||g===null)?g:Object.assign({},r,g),s.forEach(j=>j(r,v))}},u=()=>r,x={setState:o,getState:u,getInitialState:()=>p,subscribe:h=>(s.add(h),()=>s.delete(h))},p=r=n(o,u,x);return x},Jb=(n=>n?Bh(n):Bh),Pb=n=>n;function Wb(n,r=Pb){const s=Jr.useSyncExternalStore(n.subscribe,Jr.useCallback(()=>r(n.getState()),[n,r]),Jr.useCallback(()=>r(n.getInitialState()),[n,r]));return Jr.useDebugValue(s),s}const qh=n=>{const r=Jb(n),s=o=>Wb(r,o);return Object.assign(s,r),s},e1=(n=>n?qh(n):qh),Ie=e1(n=>({view:"chat",setView:r=>n({view:r}),messages:[],addMessage:r=>n(s=>({messages:[...s.messages,r]})),appendToLastAssistant:r=>n(s=>{const o=[...s.messages],u=o[o.length-1];return u&&u.role==="assistant"&&(o[o.length-1]={...u,content:(u.content||"")+r}),{messages:o}}),clearMessages:()=>n({messages:[]}),isProcessing:!1,setProcessing:r=>n({isProcessing:r}),conversationId:null,setConversationId:r=>n({conversationId:r}),currentTier:"assistant",setCurrentTier:r=>n({currentTier:r}),pendingApprovals:[],addApproval:r=>n(s=>({pendingApprovals:[...s.pendingApprovals,r]})),removeApproval:r=>n(s=>({pendingApprovals:s.pendingApprovals.filter(o=>o.id!==r)})),keyConfigured:!0,setKeyConfigured:r=>n({keyConfigured:r}),connected:!1,setConnected:r=>n({connected:r}),onboardingCompleted:null,setOnboardingCompleted:r=>n({onboardingCompleted:r}),updateInfo:null,setUpdateInfo:r=>n({updateInfo:r})}));function t1(n){const r=O.useRef(null),[s,o]=O.useState(!1),u=O.useRef(n);return u.current=n,O.useEffect(()=>{const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;function p(){const h=new WebSocket(x);h.onopen=()=>{o(!0);const y=setInterval(()=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"ping"}))},3e4);h.addEventListener("close",()=>clearInterval(y))},h.onmessage=y=>{try{const g=JSON.parse(y.data);u.current(g)}catch{}},h.onclose=()=>{o(!1),setTimeout(p,2e3)},h.onerror=()=>{h.close()},r.current=h}return p(),()=>{var h;(h=r.current)==null||h.close()}},[]),{send:O.useCallback(f=>{var x;((x=r.current)==null?void 0:x.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify(f))},[]),connected:s}}/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const n1=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jx=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim();/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var l1={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.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const a1=O.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:u="",children:d,iconNode:f,...x},p)=>O.createElement("svg",{ref:p,...l1,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:Jx("lucide",u),...x},[...f.map(([h,y])=>O.createElement(h,y)),...Array.isArray(d)?d:[d]]));/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ie=(n,r)=>{const s=O.forwardRef(({className:o,...u},d)=>O.createElement(a1,{ref:d,iconNode:r,className:Jx(`lucide-${n1(n)}`,o),...u}));return s.displayName=`${n}`,s};/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pr=ie("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Px=ie("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wx=ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const r1=ie("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wr=ie("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const es=ie("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ep=ie("Bot",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const s1=ie("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const an=ie("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ba=ie("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tp=ie("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const np=ie("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ql=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gl=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ts=ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gn=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lp=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ap=ie("CircleAlert",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const i1=ie("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qe=ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yn=ie("CircleX",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rp=ie("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gn=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ii=ie("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const o1=ie("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qa=ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bl=ie("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sp=ie("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const c1=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u1=ie("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ip=ie("ExternalLink",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const id=ie("EyeOff",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $l=ie("Eye",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const od=ie("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yh=ie("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d1=ie("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const op=ie("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ki=ie("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cp=ie("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ji=ie("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bi=ie("History",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $a=ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f1=ie("KeyRound",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rs=ie("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const up=ie("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m1=ie("LayoutDashboard",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vh=ie("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qi=ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const h1=ie("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ua=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x1=ie("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dp=ie("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p1=ie("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fp=ie("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mp=ie("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fa=ie("Monitor",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gh=ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g1=ie("MousePointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xu=ie("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hp=ie("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y1=ie("Pencil",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b1=ie("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Za=ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gi=ie("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xp=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v1=ie("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $h=ie("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ya=ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j1=ie("RotateCcw",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pp=ie("Save",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ss=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cd=ie("Send",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gp=ie("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const N1=ie("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yp=ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bn=ie("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qh=ie("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ud=ie("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pi=ie("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Va=ie("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rn=ie("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ia=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yl=ie("TriangleAlert",[["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"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w1=ie("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k1=ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S1=ie("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xh=ie("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vn=ie("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qa=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $t=ie("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),C1="/api";async function de(n,r){const s=await fetch(`${C1}${n}`,{headers:{"Content-Type":"application/json"},...r});if(!s.ok){const o=await s.text();throw new Error(`API error ${s.status}: ${o}`)}return s.json()}const fe={getStatus:()=>de("/status"),getGuardrails:()=>de("/guardrails"),setTier:n=>de("/guardrails/tier",{method:"PUT",body:JSON.stringify({tier:n})}),setToolOverride:(n,r,s)=>de("/guardrails/override",{method:"PUT",body:JSON.stringify({tool_name:n,enabled:r,require_approval:s})}),getApprovals:()=>de("/approvals"),resolveApproval:(n,r)=>de("/approvals/resolve",{method:"POST",body:JSON.stringify({approval_id:n,approved:r})}),getAudit:(n=50,r=0)=>de(`/audit?limit=${n}&offset=${r}`),getConversations:(n=50)=>de(`/conversations?limit=${n}`),deleteConversation:n=>de(`/conversations/${n}`,{method:"DELETE"}),renameConversation:(n,r)=>de(`/conversations/${n}`,{method:"PATCH",body:JSON.stringify({title:r})}),getMessages:n=>de(`/conversations/${n}/messages`),cleanupConversations:()=>de("/conversations/cleanup",{method:"POST"}),getTools:()=>de("/tools"),getToolsDetails:()=>de("/tools/details"),getWorkers:()=>de("/workers"),getWorkerStatus:n=>de(`/workers/${n}`),cancelWorker:n=>de(`/workers/${n}/cancel`,{method:"POST"}),updateWorkerConfig:n=>de("/workers/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getScheduler:()=>de("/scheduler"),getScheduledJobs:()=>de("/scheduler/jobs"),getScheduledJob:n=>de(`/scheduler/jobs/${n}`),pauseJob:n=>de(`/scheduler/jobs/${n}/pause`,{method:"POST"}),resumeJob:n=>de(`/scheduler/jobs/${n}/resume`,{method:"POST"}),deleteJob:n=>de(`/scheduler/jobs/${n}`,{method:"DELETE"}),getSchedulerHistory:(n=50,r)=>de(`/scheduler/history?limit=${n}${r?`&job_id=${r}`:""}`),getModelRouting:()=>de("/models"),updateModelRouting:n=>de("/models/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getCustomTools:()=>de("/custom-tools"),createCustomTool:(n,r,s,o=!0)=>de("/custom-tools",{method:"POST",body:JSON.stringify({tool_name:n,description:r,code:s,register:o})}),deleteCustomTool:n=>de(`/custom-tools/${n}`,{method:"DELETE"}),getKeyStatus:()=>de("/keys/status"),setKey:(n,r)=>de("/keys",{method:"POST",body:JSON.stringify({provider:n,key:r})}),deleteKey:n=>de(`/keys/${n}`,{method:"DELETE"}),completeSetup:()=>de("/setup/complete",{method:"POST"}),getConfig:()=>de("/config"),updateConfig:n=>de("/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getHeartbeatStatus:()=>de("/heartbeat"),updateHeartbeat:n=>de("/heartbeat",{method:"PUT",body:JSON.stringify(n)}),startHeartbeat:()=>de("/heartbeat/start",{method:"POST"}),stopHeartbeat:()=>de("/heartbeat/stop",{method:"POST"}),getPlans:(n,r=20)=>de(`/plans?limit=${r}${n?`&conversation_id=${n}`:""}`),getActivePlan:n=>de(`/plans/active${n?`?conversation_id=${n}`:""}`),getPlan:n=>de(`/plans/${n}`),deletePlan:n=>de(`/plans/${n}`,{method:"DELETE"}),getPCStatus:()=>de("/pc/status"),getPCContext:()=>de("/pc/context"),getPCWorkflows:()=>de("/pc/workflows"),getPCShortcuts:()=>de("/pc/shortcuts"),getSkills:n=>de(n?`/skills?category=${n}`:"/skills"),getSkillDetail:n=>de(`/skills/${n}`),exportSkill:n=>de(`/skills/${n}/export`),importSkill:n=>de("/skills/import",{method:"POST",body:JSON.stringify({skill_data:n})}),deleteSkill:n=>de(`/skills/${n}`,{method:"DELETE"}),getSavedSkills:()=>de("/skills/saved"),getMemoryStats:()=>de("/memory/stats"),getFacts:(n,r=50)=>de(`/memory/facts?limit=${r}${n?`&category=${n}`:""}`),deleteFact:n=>de(`/memory/facts/${n}`,{method:"DELETE"}),getGoals:(n,r=50)=>de(`/memory/goals?limit=${r}${n?`&conversation_id=${n}`:""}`),getActiveGoals:n=>de(`/memory/goals/active${n?`?conversation_id=${n}`:""}`),getConversationSummary:n=>de(`/conversations/${n}/summary`),getCheckpoints:(n,r=10)=>de(`/conversations/${n}/checkpoints?limit=${r}`),getImprovementLog:(n=50)=>de(`/improvement/log?limit=${n}`),getImprovementStats:()=>de("/improvement/stats"),getConnectors:()=>de("/connectors"),getConnector:n=>de(`/connectors/${n}`),updateConnectorConfig:(n,r)=>de(`/connectors/${n}/config`,{method:"PUT",body:JSON.stringify({config:r})}),testConnector:n=>de(`/connectors/${n}/test`,{method:"POST"}),sendConnectorMessage:(n,r,s={})=>de(`/connectors/${n}/send`,{method:"POST",body:JSON.stringify({text:r,params:s})}),startConnector:n=>de(`/connectors/${n}/start`,{method:"POST"}),stopConnector:n=>de(`/connectors/${n}/stop`,{method:"POST"}),disconnectConnector:n=>de(`/connectors/${n}`,{method:"DELETE"}),getBridgeStatus:n=>de(`/connectors/${n}/bridge-status`),setConnectorAutoStart:(n,r)=>de(`/connectors/${n}/auto-start`,{method:"PUT",body:JSON.stringify({auto_start:r})}),getWSLStatus:()=>de("/wsl/status"),enableWSL:n=>de("/wsl/enable",{method:"PUT",body:JSON.stringify({enabled:n})}),completeWSLSetup:()=>de("/wsl/setup-complete",{method:"POST"}),getWSLSetupGuide:()=>de("/wsl/setup-guide"),checkForUpdate:()=>de("/updates/check"),dismissUpdate:n=>de("/updates/dismiss",{method:"POST",body:JSON.stringify({version:n})}),applyUpdate:()=>de("/updates/apply",{method:"POST"})};function _1({send:n}){const[r,s]=O.useState([]),[o,u]=O.useState(""),[d,f]=O.useState(!1),[x,p]=O.useState(null),[h,y]=O.useState(""),[g,v]=O.useState(null),[j,w]=O.useState(null),S=O.useRef(null),D=O.useRef(null),E=O.useRef(null),{conversationId:q,setConversationId:H,clearMessages:K,setView:U}=Ie(),L=O.useCallback(()=>{fe.getConversations(50).then(X=>s(X)).catch(()=>{})},[]);O.useEffect(()=>{L()},[L,q]),O.useEffect(()=>{const X=setInterval(L,3e4);return()=>clearInterval(X)},[L]),O.useEffect(()=>{x&&S.current&&(S.current.focus(),S.current.select())},[x]),O.useEffect(()=>{const X=W=>{E.current&&!E.current.contains(W.target)&&w(null)};return j&&document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[j]);const $=O.useMemo(()=>{if(!o.trim())return r;const X=o.toLowerCase();return r.filter(W=>(W.title||Cu(W)).toLowerCase().includes(X))},[r,o]),ue=O.useMemo(()=>E1($),[$]),P=X=>{X.id!==q&&(n({type:"resume_conversation",conversation_id:X.id}),U("chat"))},A=async X=>{try{await fe.deleteConversation(X),X===q&&(K(),H(null)),s(W=>W.filter(te=>te.id!==X)),v(null),w(null)}catch(W){console.error("Failed to delete conversation:",W)}},ae=async X=>{const W=h.trim();if(!W){p(null);return}try{await fe.renameConversation(X,W),s(te=>te.map(M=>M.id===X?{...M,title:W}:M))}catch(te){console.error("Failed to rename:",te)}p(null)},ne=X=>{p(X.id),y(X.title||Cu(X)),v(null),w(null)};return r.length===0?null:a.jsxs("div",{className:"flex flex-col min-h-0 flex-1",children:[a.jsx("div",{className:"px-3 pt-1 pb-3",children:a.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg transition-all duration-200 ${d?"bg-gray-800 ring-1 ring-plutus-500/30":"bg-gray-800/50 hover:bg-gray-800/80"}`,children:[a.jsx(ss,{className:"w-3.5 h-3.5 text-gray-500 shrink-0"}),a.jsx("input",{ref:D,type:"text",placeholder:"Search chats...",value:o,onChange:X=>u(X.target.value),onFocus:()=>f(!0),onBlur:()=>f(!1),className:"flex-1 bg-transparent text-xs text-gray-300 placeholder-gray-600 focus:outline-none min-w-0"}),o&&a.jsx("button",{onClick:()=>u(""),className:"p-0.5 rounded text-gray-500 hover:text-gray-300 transition-colors",children:a.jsx(Qa,{className:"w-3 h-3"})})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-2 pb-2 sidebar-scroll",children:$.length===0?a.jsxs("div",{className:"px-3 py-4 text-center",children:[a.jsx(ss,{className:"w-4 h-4 text-gray-700 mx-auto mb-1.5"}),a.jsx("p",{className:"text-[11px] text-gray-600",children:o?"No matches found":"No conversations yet"})]}):a.jsx("div",{className:"space-y-3",children:ue.map(X=>X.items.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-2 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold text-gray-600 uppercase tracking-wider whitespace-nowrap",children:X.label}),a.jsx("div",{className:"flex-1 h-px bg-gray-800/60"})]}),a.jsx("div",{className:"space-y-0.5",children:X.items.map(W=>{const te=W.id===q,M=x===W.id,z=g===W.id,re=j===W.id;return a.jsx("div",{className:"conv-item animate-fade-in",children:M?a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2 rounded-lg bg-gray-800/80 border border-gray-700/50",children:[a.jsx("input",{ref:S,className:"flex-1 bg-gray-900/50 border border-gray-700 rounded-md px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-plutus-500/50 min-w-0",value:h,onChange:oe=>y(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&ae(W.id),oe.key==="Escape"&&p(null)},onClick:oe=>oe.stopPropagation()}),a.jsx("button",{onClick:oe=>{oe.stopPropagation(),ae(W.id)},className:"p-1 rounded-md text-emerald-400 hover:text-emerald-300 hover:bg-emerald-500/10 transition-colors",children:a.jsx(ql,{className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:oe=>{oe.stopPropagation(),p(null)},className:"p-1 rounded-md text-gray-500 hover:text-gray-300 hover:bg-gray-700/50 transition-colors",children:a.jsx(Qa,{className:"w-3.5 h-3.5"})})]}):z?a.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-red-500/5 border border-red-500/20",children:[a.jsx("span",{className:"text-xs text-red-400 font-medium",children:"Delete this chat?"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:oe=>{oe.stopPropagation(),A(W.id)},className:"px-2 py-1 text-[11px] font-medium bg-red-500/20 text-red-400 rounded-md hover:bg-red-500/30 transition-colors",children:"Delete"}),a.jsx("button",{onClick:oe=>{oe.stopPropagation(),v(null)},className:"px-2 py-1 text-[11px] font-medium bg-gray-700/50 text-gray-400 rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]})]}):a.jsxs("div",{onClick:()=>P(W),className:`group relative flex items-center gap-2 pl-2.5 pr-1.5 py-1.5 rounded-md cursor-pointer transition-all duration-150 ${te?"bg-plutus-600/10 conv-active":"hover:bg-gray-800/60"}`,children:[te&&a.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-4 rounded-r-full bg-plutus-500 shadow-sm shadow-plutus-500/50"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`text-xs truncate font-medium leading-snug ${te?"text-plutus-300":"text-gray-400 group-hover:text-gray-200"}`,children:W.title||Cu(W)}),a.jsxs("span",{className:`text-[10px] leading-none ${te?"text-plutus-500/60":"text-gray-600"}`,children:[T1(W.last_activity),W.message_count>0&&` · ${W.message_count} msgs`]})]}),a.jsxs("div",{className:"relative shrink-0",ref:re?E:void 0,children:[a.jsx("button",{onClick:oe=>{oe.stopPropagation(),w(re?null:W.id)},className:`p-0.5 rounded transition-all ${re?"text-gray-300 bg-gray-700/50":"text-gray-700 opacity-0 group-hover:opacity-100 hover:text-gray-300 hover:bg-gray-700/50"}`,children:a.jsx(u1,{className:"w-3.5 h-3.5"})}),re&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 py-1 bg-gray-800 border border-gray-700/80 rounded-lg shadow-xl shadow-black/30 z-50 animate-fade-in",children:[a.jsxs("button",{onClick:oe=>{oe.stopPropagation(),ne(W)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-300 hover:bg-gray-700/60 hover:text-gray-100 transition-colors",children:[a.jsx(y1,{className:"w-3 h-3"}),"Rename"]}),a.jsx("div",{className:"h-px bg-gray-700/50 my-1"}),a.jsxs("button",{onClick:oe=>{oe.stopPropagation(),v(W.id),w(null)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-300 transition-colors",children:[a.jsx(Ia,{className:"w-3 h-3"}),"Delete"]})]})]})]})},W.id)})})]},X.label))})})]})}function Cu(n){return`Chat ${new Date(n.created_at*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function T1(n){const r=Math.floor(Date.now()/1e3-n);return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<172800?"yesterday":r<604800?`${Math.floor(r/86400)}d ago`:new Date(n*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function E1(n){const r=new Date;r.setHours(0,0,0,0);const s=r.getTime()/1e3,o=s-86400,u=s-7*86400,d=s-30*86400,f=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"This Week",items:[]},{label:"This Month",items:[]},{label:"Older",items:[]}];for(const x of n){const p=x.last_activity||x.created_at;p>=s?f[0].items.push(x):p>=o?f[1].items.push(x):p>=u?f[2].items.push(x):p>=d?f[3].items.push(x):f[4].items.push(x)}return f}const A1=[{label:"Main",items:[{id:"chat",label:"Chat",icon:fp},{id:"skills",label:"Skills",icon:an,badge:"New"},{id:"dashboard",label:"Dashboard",icon:m1}]},{label:"Agent",collapsible:!0,items:[{id:"memory",label:"Memory & Plans",icon:an},{id:"tools",label:"Tools",icon:vn},{id:"workers",label:"Workers",icon:bl},{id:"tool-creator",label:"Tool Creator",icon:ud}]},{label:"System",collapsible:!0,items:[{id:"connectors",label:"Connectors",icon:Gi,badge:"New"},{id:"guardrails",label:"Guardrails",icon:bn},{id:"settings",label:"Settings",icon:yp}]}];function M1({send:n}){const{view:r,setView:s,connected:o,currentTier:u}=Ie(),[d,f]=O.useState(new Set),x=h=>{f(y=>{const g=new Set(y);return g.has(h)?g.delete(h):g.add(h),g})},p=()=>{Ie.getState().clearMessages(),Ie.getState().setConversationId(null),s("chat"),n&&n({type:"new_conversation"})};return a.jsxs("aside",{className:"w-72 bg-gray-950 border-r border-gray-800/60 flex flex-col h-full",children:[a.jsx("div",{className:"px-4 pt-5 pb-4",children:a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-base shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold text-[15px] leading-none text-gray-100",children:"Plutus"}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o?"bg-emerald-400 shadow-sm shadow-emerald-400/60":"bg-red-400"}`}),a.jsx("span",{className:"text-[10px] text-gray-500",children:o?"Online":"Offline"}),a.jsx("span",{className:"text-gray-800 text-[10px]",children:"·"}),a.jsx("span",{className:"text-[10px] text-gray-500 capitalize",children:u})]})]})]})})}),a.jsx("div",{className:"px-3 pb-5",children:a.jsxs("button",{onClick:p,className:`w-full flex items-center justify-center gap-2 px-3 py-2.5 rounded-xl
                     bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium
                     transition-all duration-200 shadow-md shadow-plutus-600/20
                     hover:shadow-lg hover:shadow-plutus-500/25 active:scale-[0.98]`,children:[a.jsx(xp,{className:"w-4 h-4"}),"New Chat"]})}),a.jsx("div",{className:"max-h-[35vh] min-h-0 flex flex-col border-b border-gray-800/60 shrink-0",children:n&&a.jsx(_1,{send:n})}),a.jsx("nav",{className:"flex-1 p-3 space-y-2 overflow-y-auto sidebar-scroll min-h-0",children:A1.map(h=>{const y=d.has(h.label),g=h.items.some(v=>v.id===r);return a.jsxs("div",{children:[h.collapsible?a.jsxs("button",{onClick:()=>x(h.label),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-semibold text-gray-600 uppercase tracking-wider hover:text-gray-400 transition-colors",children:[y?a.jsx(gn,{className:"w-3 h-3"}):a.jsx(Gl,{className:"w-3 h-3"}),a.jsx("span",{children:h.label}),y&&g&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-plutus-500 ml-auto"})]}):a.jsx("p",{className:"px-3 py-1.5 text-[11px] font-semibold text-gray-600 uppercase tracking-wider",children:h.label}),!y&&a.jsx("div",{className:"space-y-0.5",children:h.items.map(v=>{const j=v.icon,w=r===v.id;return a.jsxs("button",{onClick:()=>s(v.id),className:`w-full relative flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-150 ${w?"bg-gray-800/80 text-gray-100":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/40"}`,children:[w&&a.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-plutus-500"}),a.jsx(j,{className:`w-[18px] h-[18px] ${w?"text-plutus-400":""}`}),a.jsx("span",{className:"flex-1 text-left",children:v.label}),v.badge&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-plutus-500/15 text-plutus-400 font-semibold ring-1 ring-plutus-500/20",children:v.badge})]},v.id)})})]},h.label)})})]})}const z1={chat:{title:"Chat",subtitle:"Talk to Plutus"},dashboard:{title:"Dashboard",subtitle:"Activity overview"},guardrails:{title:"Guardrails",subtitle:"Safety & permissions"},settings:{title:"Settings",subtitle:"Configuration"},tools:{title:"Tools",subtitle:"Agent capabilities"},workers:{title:"Workers & Automation",subtitle:"Workers, schedules & model routing"},"tool-creator":{title:"Tool Creator",subtitle:"Build custom tools"},skills:{title:"Skills",subtitle:"Browse, import, and share skills"},memory:{title:"Memory & Plans",subtitle:"What Plutus remembers"},connectors:{title:"Connectors",subtitle:"Link Plutus with external apps"}};function O1(){const{view:n,currentTier:r,pendingApprovals:s,isProcessing:o,keyConfigured:u}=Ie(),d=z1[n]||{title:"Plutus",subtitle:""};return a.jsxs("header",{className:"h-14 border-b border-gray-800 bg-gray-900/50 backdrop-blur-sm flex items-center justify-between px-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-gray-200",children:d.title}),d.subtitle&&a.jsx("p",{className:"text-[10px] text-gray-500 -mt-0.5",children:d.subtitle})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[!u&&a.jsxs("button",{onClick:()=>Ie.getState().setView("settings"),className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-amber-500/20 text-amber-400 text-xs font-medium animate-gentle-pulse",children:[a.jsx(rs,{className:"w-3 h-3"}),"No API key — click to configure"]}),o&&a.jsxs("div",{className:"flex items-center gap-2 text-xs text-plutus-400",children:[a.jsx(Pr,{className:"w-3.5 h-3.5 animate-pulse"}),a.jsx("span",{children:"Processing..."})]}),s.length>0&&a.jsxs("button",{onClick:()=>Ie.getState().setView("chat"),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-amber-500/20 text-amber-400 text-xs font-medium animate-gentle-pulse",children:[a.jsx(bn,{className:"w-3 h-3"}),s.length," pending"]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-800 text-xs",children:[a.jsx(bn,{className:"w-3 h-3 text-plutus-400"}),a.jsx("span",{className:"text-gray-300 capitalize",children:r})]})]})]})}function D1({message:n,send:r,approvalId:s}){const[o,u]=O.useState(null),d=()=>{r({type:"approve",approval_id:s,approved:!0}),u("approved")},f=()=>{r({type:"approve",approval_id:s,approved:!1}),u("denied")};return a.jsxs("div",{className:"flex gap-3 animate-fade-in",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/20 flex items-center justify-center flex-shrink-0 animate-gentle-pulse",children:a.jsx(bn,{className:"w-4 h-4 text-amber-400"})}),a.jsx("div",{className:"max-w-2xl w-full",children:a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl px-4 py-3",children:[a.jsx("p",{className:"text-sm text-amber-200 mb-3",children:n}),o?a.jsx("p",{className:`text-xs font-medium ${o==="approved"?"text-emerald-400":"text-red-400"}`,children:o==="approved"?"Approved":"Denied"}):a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:d,className:"btn-success flex items-center gap-1.5 text-xs py-1.5 px-3",children:[a.jsx(ql,{className:"w-3.5 h-3.5"}),"Approve"]}),a.jsxs("button",{onClick:f,className:"btn-danger flex items-center gap-1.5 text-xs py-1.5 px-3",children:[a.jsx(Qa,{className:"w-3.5 h-3.5"}),"Deny"]})]})]})})]})}function R1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const L1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H1={};function Fh(n,r){return(H1.jsx?U1:L1).test(n)}const B1=/[ \t\n\f\r]/g;function q1(n){return typeof n=="object"?n.type==="text"?Zh(n.value):!1:Zh(n)}function Zh(n){return n.replace(B1,"")===""}class cs{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}cs.prototype.normal={};cs.prototype.property={};cs.prototype.space=void 0;function bp(n,r){const s={},o={};for(const u of n)Object.assign(s,u.property),Object.assign(o,u.normal);return new cs(s,o,r)}function Fu(n){return n.toLowerCase()}class Dt{constructor(r,s){this.attribute=s,this.property=r}}Dt.prototype.attribute="";Dt.prototype.booleanish=!1;Dt.prototype.boolean=!1;Dt.prototype.commaOrSpaceSeparated=!1;Dt.prototype.commaSeparated=!1;Dt.prototype.defined=!1;Dt.prototype.mustUseProperty=!1;Dt.prototype.number=!1;Dt.prototype.overloadedBoolean=!1;Dt.prototype.property="";Dt.prototype.spaceSeparated=!1;Dt.prototype.space=void 0;let Y1=0;const ke=Ql(),ot=Ql(),Zu=Ql(),se=Ql(),Ze=Ql(),Ga=Ql(),Gt=Ql();function Ql(){return 2**++Y1}const Iu=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:ot,commaOrSpaceSeparated:Gt,commaSeparated:Ga,number:se,overloadedBoolean:Zu,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),_u=Object.keys(Iu);class dd extends Dt{constructor(r,s,o,u){let d=-1;if(super(r,s),Ih(this,"space",u),typeof o=="number")for(;++d<_u.length;){const f=_u[d];Ih(this,_u[d],(o&Iu[f])===Iu[f])}}}dd.prototype.defined=!0;function Ih(n,r,s){s&&(n[r]=s)}function Ka(n){const r={},s={};for(const[o,u]of Object.entries(n.properties)){const d=new dd(o,n.transform(n.attributes||{},o),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(d.mustUseProperty=!0),r[o]=d,s[Fu(o)]=o,s[Fu(d.attribute)]=o}return new cs(r,s,n.space)}const vp=Ka({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Ze,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:se,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Ze,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:ot,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function jp(n,r){return r in n?n[r]:r}function Np(n,r){return jp(n,r.toLowerCase())}const V1=Ka({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ga,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Ze,autoFocus:ke,autoPlay:ke,blocking:Ze,capture:null,charSet:null,checked:ke,cite:null,className:Ze,cols:se,colSpan:null,content:null,contentEditable:ot,controls:ke,controlsList:Ze,coords:se|Ga,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Zu,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Ze,height:se,hidden:Zu,high:se,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:ke,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,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:ke,optimum:se,pattern:null,ping:Ze,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:Ze,required:ke,reversed:ke,rows:se,rowSpan:se,sandbox:Ze,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:ot,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ke,disableRemotePlayback:ke,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:Np}),G1=Ka({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:Gt,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Ze,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Ga,g2:Ga,glyphName:Ga,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:Gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gt,rev:Gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gt,requiredFeatures:Gt,requiredFonts:Gt,requiredFormats:Gt,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:Gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gt,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:jp}),wp=Ka({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),kp=Ka({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Np}),Sp=Ka({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),$1={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"},Q1=/[A-Z]/g,Kh=/-[a-z]/g,X1=/^data[-\w.:]+$/i;function F1(n,r){const s=Fu(r);let o=r,u=Dt;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&X1.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Kh,I1);o="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Kh.test(d)){let f=d.replace(Q1,Z1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}u=dd}return new u(o,r)}function Z1(n){return"-"+n.toLowerCase()}function I1(n){return n.charAt(1).toUpperCase()}const K1=bp([vp,V1,wp,kp,Sp],"html"),fd=bp([vp,G1,wp,kp,Sp],"svg");function J1(n){return n.join(" ").trim()}var Da={},Tu,Jh;function P1(){if(Jh)return Tu;Jh=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,x=/^\s+|\s+$/g,p=`
`,h="/",y="*",g="",v="comment",j="declaration";function w(D,E){if(typeof D!="string")throw new TypeError("First argument must be a string");if(!D)return[];E=E||{};var q=1,H=1;function K(W){var te=W.match(r);te&&(q+=te.length);var M=W.lastIndexOf(p);H=~M?W.length-M:H+W.length}function U(){var W={line:q,column:H};return function(te){return te.position=new L(W),P(),te}}function L(W){this.start=W,this.end={line:q,column:H},this.source=E.source}L.prototype.content=D;function $(W){var te=new Error(E.source+":"+q+":"+H+": "+W);if(te.reason=W,te.filename=E.source,te.line=q,te.column=H,te.source=D,!E.silent)throw te}function ue(W){var te=W.exec(D);if(te){var M=te[0];return K(M),D=D.slice(M.length),te}}function P(){ue(s)}function A(W){var te;for(W=W||[];te=ae();)te!==!1&&W.push(te);return W}function ae(){var W=U();if(!(h!=D.charAt(0)||y!=D.charAt(1))){for(var te=2;g!=D.charAt(te)&&(y!=D.charAt(te)||h!=D.charAt(te+1));)++te;if(te+=2,g===D.charAt(te-1))return $("End of comment missing");var M=D.slice(2,te-2);return H+=2,K(M),D=D.slice(te),H+=2,W({type:v,comment:M})}}function ne(){var W=U(),te=ue(o);if(te){if(ae(),!ue(u))return $("property missing ':'");var M=ue(d),z=W({type:j,property:S(te[0].replace(n,g)),value:M?S(M[0].replace(n,g)):g});return ue(f),z}}function X(){var W=[];A(W);for(var te;te=ne();)te!==!1&&(W.push(te),A(W));return W}return P(),X()}function S(D){return D?D.replace(x,g):g}return Tu=w,Tu}var Ph;function W1(){if(Ph)return Da;Ph=1;var n=Da&&Da.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Da,"__esModule",{value:!0}),Da.default=s;const r=n(P1());function s(o,u){let d=null;if(!o||typeof o!="string")return d;const f=(0,r.default)(o),x=typeof u=="function";return f.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;x?u(h,y,p):y&&(d=d||{},d[h]=y)}),d}return Da}var Fr={},Wh;function ev(){if(Wh)return Fr;Wh=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,d=function(h){return!h||s.test(h)||n.test(h)},f=function(h,y){return y.toUpperCase()},x=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),d(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(u,x):h=h.replace(o,x),h.replace(r,f))};return Fr.camelCase=p,Fr}var Zr,ex;function tv(){if(ex)return Zr;ex=1;var n=Zr&&Zr.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},r=n(W1()),s=ev();function o(u,d){var f={};return!u||typeof u!="string"||(0,r.default)(u,function(x,p){x&&p&&(f[(0,s.camelCase)(x,d)]=p)}),f}return o.default=o,Zr=o,Zr}var nv=tv();const lv=Zi(nv),Cp=_p("end"),md=_p("start");function _p(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function av(n){const r=md(n),s=Cp(n);if(r&&s)return{start:r,end:s}}function ns(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?tx(n.position):"start"in n||"end"in n?tx(n):"line"in n||"column"in n?Ku(n):""}function Ku(n){return nx(n&&n.line)+":"+nx(n&&n.column)}function tx(n){return Ku(n&&n.start)+"-"+Ku(n&&n.end)}function nx(n){return n&&typeof n=="number"?n:1}class vt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let u="",d={},f=!1;if(s&&("line"in s&&"column"in s?d={place:s}:"start"in s&&"end"in s?d={place:s}:"type"in s?d={ancestors:[s],place:s.position}:d={...s}),typeof r=="string"?u=r:!d.cause&&r&&(f=!0,u=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof o=="string"){const p=o.indexOf(":");p===-1?d.ruleId=o:(d.source=o.slice(0,p),d.ruleId=o.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const x=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=x?x.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=x?x.line:void 0,this.name=ns(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const hd={}.hasOwnProperty,rv=new Map,sv=/[A-Z]/g,iv=new Set(["table","tbody","thead","tfoot","tr"]),ov=new Set(["td","th"]),Tp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cv(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=gv(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=pv(s,r.jsx,r.jsxs)}const u={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?fd:K1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=Ep(u,n,void 0);return d&&typeof d!="string"?d:u.create(n,u.Fragment,{children:d||void 0},void 0)}function Ep(n,r,s){if(r.type==="element")return uv(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return dv(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return mv(n,r,s);if(r.type==="mdxjsEsm")return fv(n,r);if(r.type==="root")return hv(n,r,s);if(r.type==="text")return xv(n,r)}function uv(n,r,s){const o=n.schema;let u=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(u=fd,n.schema=u),n.ancestors.push(r);const d=Mp(n,r.tagName,!1),f=yv(n,r);let x=pd(n,r);return iv.has(r.tagName)&&(x=x.filter(function(p){return typeof p=="string"?!q1(p):!0})),Ap(n,f,d,r),xd(f,x),n.ancestors.pop(),n.schema=o,n.create(r,d,f,s)}function dv(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}is(n,r.position)}function fv(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);is(n,r.position)}function mv(n,r,s){const o=n.schema;let u=o;r.name==="svg"&&o.space==="html"&&(u=fd,n.schema=u),n.ancestors.push(r);const d=r.name===null?n.Fragment:Mp(n,r.name,!0),f=bv(n,r),x=pd(n,r);return Ap(n,f,d,r),xd(f,x),n.ancestors.pop(),n.schema=o,n.create(r,d,f,s)}function hv(n,r,s){const o={};return xd(o,pd(n,r)),n.create(r,n.Fragment,o,s)}function xv(n,r){return r.value}function Ap(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function xd(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function pv(n,r,s){return o;function o(u,d,f,x){const h=Array.isArray(f.children)?s:r;return x?h(d,f,x):h(d,f)}}function gv(n,r){return s;function s(o,u,d,f){const x=Array.isArray(d.children),p=md(o);return r(u,d,f,x,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function yv(n,r){const s={};let o,u;for(u in r.properties)if(u!=="children"&&hd.call(r.properties,u)){const d=vv(n,u,r.properties[u]);if(d){const[f,x]=d;n.tableCellAlignToStyle&&f==="align"&&typeof x=="string"&&ov.has(r.tagName)?o=x:s[f]=x}}if(o){const d=s.style||(s.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function bv(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const d=o.data.estree.body[0];d.type;const f=d.expression;f.type;const x=f.properties[0];x.type,Object.assign(s,n.evaluater.evaluateExpression(x.argument))}else is(n,r.position);else{const u=o.name;let d;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const x=o.value.data.estree.body[0];x.type,d=n.evaluater.evaluateExpression(x.expression)}else is(n,r.position);else d=o.value===null?!0:o.value;s[u]=d}return s}function pd(n,r){const s=[];let o=-1;const u=n.passKeys?new Map:rv;for(;++o<r.children.length;){const d=r.children[o];let f;if(n.passKeys){const p=d.type==="element"?d.tagName:d.type==="mdxJsxFlowElement"||d.type==="mdxJsxTextElement"?d.name:void 0;if(p){const h=u.get(p)||0;f=p+"-"+h,u.set(p,h+1)}}const x=Ep(n,d,f);x!==void 0&&s.push(x)}return s}function vv(n,r,s){const o=F1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?R1(s):J1(s)),o.property==="style"){let u=typeof s=="object"?s:jv(n,String(s));return n.stylePropertyNameCase==="css"&&(u=Nv(u)),["style",u]}return[n.elementAttributeNameCase==="react"&&o.space?$1[o.property]||o.property:o.attribute,s]}}function jv(n,r){try{return lv(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,u=new vt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=n.filePath||void 0,u.url=Tp+"#cannot-parse-style-attribute",u}}function Mp(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const u=r.split(".");let d=-1,f;for(;++d<u.length;){const x=Fh(u[d])?{type:"Identifier",name:u[d]}:{type:"Literal",value:u[d]};f=f?{type:"MemberExpression",object:f,property:x,computed:!!(d&&x.type==="Literal"),optional:!1}:x}o=f}else o=Fh(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const u=o.value;return hd.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(o);is(n)}function is(n,r){const s=new vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=Tp+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Nv(n){const r={};let s;for(s in n)hd.call(n,s)&&(r[wv(s)]=n[s]);return r}function wv(n){let r=n.replace(sv,kv);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function kv(n){return"-"+n.toLowerCase()}const Eu={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"]},Sv={};function gd(n,r){const s=Sv,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,u=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return zp(n,o,u)}function zp(n,r,s){if(Cv(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return lx(n.children,r,s)}return Array.isArray(n)?lx(n,r,s):""}function lx(n,r,s){const o=[];let u=-1;for(;++u<n.length;)o[u]=zp(n[u],r,s);return o.join("")}function Cv(n){return!!(n&&typeof n=="object")}const ax=document.createElement("i");function yd(n){const r="&"+n+";";ax.innerHTML=r;const s=ax.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Qt(n,r,s,o){const u=n.length;let d=0,f;if(r<0?r=-r>u?0:u+r:r=r>u?u:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);d<o.length;)f=o.slice(d,d+1e4),f.unshift(r,0),n.splice(...f),d+=1e4,r+=1e4}function ln(n,r){return n.length>0?(Qt(n,n.length,0,r),n):r}const rx={}.hasOwnProperty;function Op(n){const r={};let s=-1;for(;++s<n.length;)_v(r,n[s]);return r}function _v(n,r){let s;for(s in r){const u=(rx.call(n,s)?n[s]:void 0)||(n[s]={}),d=r[s];let f;if(d)for(f in d){rx.call(u,f)||(u[f]=[]);const x=d[f];Tv(u[f],Array.isArray(x)?x:x?[x]:[])}}}function Tv(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);Qt(n,0,0,o)}function Dp(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function dn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kt=vl(/[A-Za-z]/),bt=vl(/[\dA-Za-z]/),Ev=vl(/[#-'*+\--9=?A-Z^-~]/);function $i(n){return n!==null&&(n<32||n===127)}const Ju=vl(/\d/),Av=vl(/[\dA-Fa-f]/),Mv=vl(/[!-/:-@[-`{-~]/);function ye(n){return n!==null&&n<-2}function Fe(n){return n!==null&&(n<0||n===32)}function Te(n){return n===-2||n===-1||n===32}const Wi=vl(new RegExp("\\p{P}|\\p{S}","u")),Vl=vl(/\s/);function vl(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Ja(n){const r=[];let s=-1,o=0,u=0;for(;++s<n.length;){const d=n.charCodeAt(s);let f="";if(d===37&&bt(n.charCodeAt(s+1))&&bt(n.charCodeAt(s+2)))u=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(f=String.fromCharCode(d));else if(d>55295&&d<57344){const x=n.charCodeAt(s+1);d<56320&&x>56319&&x<57344?(f=String.fromCharCode(d,x),u=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+u+1,f=""),u&&(s+=u,u=0)}return r.join("")+n.slice(o)}function Oe(n,r,s,o){const u=o?o-1:Number.POSITIVE_INFINITY;let d=0;return f;function f(p){return Te(p)?(n.enter(s),x(p)):r(p)}function x(p){return Te(p)&&d++<u?(n.consume(p),x):(n.exit(s),r(p))}}const zv={tokenize:Ov};function Ov(n){const r=n.attempt(this.parser.constructs.contentInitial,o,u);let s;return r;function o(x){if(x===null){n.consume(x);return}return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),Oe(n,r,"linePrefix")}function u(x){return n.enter("paragraph"),d(x)}function d(x){const p=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=p),s=p,f(x)}function f(x){if(x===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(x);return}return ye(x)?(n.consume(x),n.exit("chunkText"),d):(n.consume(x),f)}}const Dv={tokenize:Rv},sx={tokenize:Lv};function Rv(n){const r=this,s=[];let o=0,u,d,f;return x;function x(H){if(o<s.length){const K=s[o];return r.containerState=K[1],n.attempt(K[0].continuation,p,h)(H)}return h(H)}function p(H){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,u&&q();const K=r.events.length;let U=K,L;for(;U--;)if(r.events[U][0]==="exit"&&r.events[U][1].type==="chunkFlow"){L=r.events[U][1].end;break}E(o);let $=K;for(;$<r.events.length;)r.events[$][1].end={...L},$++;return Qt(r.events,U+1,0,r.events.slice(K)),r.events.length=$,h(H)}return x(H)}function h(H){if(o===s.length){if(!u)return v(H);if(u.currentConstruct&&u.currentConstruct.concrete)return w(H);r.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(sx,y,g)(H)}function y(H){return u&&q(),E(o),v(H)}function g(H){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,w(H)}function v(H){return r.containerState={},n.attempt(sx,j,w)(H)}function j(H){return o++,s.push([r.currentConstruct,r.containerState]),v(H)}function w(H){if(H===null){u&&q(),E(0),n.consume(H);return}return u=u||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:d}),S(H)}function S(H){if(H===null){D(n.exit("chunkFlow"),!0),E(0),n.consume(H);return}return ye(H)?(n.consume(H),D(n.exit("chunkFlow")),o=0,r.interrupt=void 0,x):(n.consume(H),S)}function D(H,K){const U=r.sliceStream(H);if(K&&U.push(null),H.previous=d,d&&(d.next=H),d=H,u.defineSkip(H.start),u.write(U),r.parser.lazy[H.start.line]){let L=u.events.length;for(;L--;)if(u.events[L][1].start.offset<f&&(!u.events[L][1].end||u.events[L][1].end.offset>f))return;const $=r.events.length;let ue=$,P,A;for(;ue--;)if(r.events[ue][0]==="exit"&&r.events[ue][1].type==="chunkFlow"){if(P){A=r.events[ue][1].end;break}P=!0}for(E(o),L=$;L<r.events.length;)r.events[L][1].end={...A},L++;Qt(r.events,ue+1,0,r.events.slice($)),r.events.length=L}}function E(H){let K=s.length;for(;K-- >H;){const U=s[K];r.containerState=U[1],U[0].exit.call(r,n)}s.length=H}function q(){u.write([null]),d=void 0,u=void 0,r.containerState._closeFlow=void 0}}function Lv(n,r,s){return Oe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xa(n){if(n===null||Fe(n)||Vl(n))return 1;if(Wi(n))return 2}function eo(n,r,s){const o=[];let u=-1;for(;++u<n.length;){const d=n[u].resolveAll;d&&!o.includes(d)&&(r=d(r,s),o.push(d))}return r}const Pu={name:"attention",resolveAll:Uv,tokenize:Hv};function Uv(n,r){let s=-1,o,u,d,f,x,p,h,y;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;p=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const g={...n[o][1].end},v={...n[s][1].start};ix(g,-p),ix(v,p),f={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...n[o][1].end}},x={type:p>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:v},d={type:p>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},u={type:p>1?"strong":"emphasis",start:{...f.start},end:{...x.end}},n[o][1].end={...f.start},n[s][1].start={...x.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=ln(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=ln(h,[["enter",u,r],["enter",f,r],["exit",f,r],["enter",d,r]]),h=ln(h,eo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=ln(h,[["exit",d,r],["enter",x,r],["exit",x,r],["exit",u,r]]),n[s][1].end.offset-n[s][1].start.offset?(y=2,h=ln(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):y=0,Qt(n,o-1,s-o+3,h),s=o+h.length-y-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function Hv(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,u=Xa(o);let d;return f;function f(p){return d=p,n.enter("attentionSequence"),x(p)}function x(p){if(p===d)return n.consume(p),x;const h=n.exit("attentionSequence"),y=Xa(p),g=!y||y===2&&u||s.includes(p),v=!u||u===2&&y||s.includes(o);return h._open=!!(d===42?g:g&&(u||!v)),h._close=!!(d===42?v:v&&(y||!g)),r(p)}}function ix(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const Bv={name:"autolink",tokenize:qv};function qv(n,r,s){let o=0;return u;function u(j){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),d}function d(j){return kt(j)?(n.consume(j),f):j===64?s(j):h(j)}function f(j){return j===43||j===45||j===46||bt(j)?(o=1,x(j)):h(j)}function x(j){return j===58?(n.consume(j),o=0,p):(j===43||j===45||j===46||bt(j))&&o++<32?(n.consume(j),x):(o=0,h(j))}function p(j){return j===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.exit("autolink"),r):j===null||j===32||j===60||$i(j)?s(j):(n.consume(j),p)}function h(j){return j===64?(n.consume(j),y):Ev(j)?(n.consume(j),h):s(j)}function y(j){return bt(j)?g(j):s(j)}function g(j){return j===46?(n.consume(j),o=0,y):j===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.exit("autolink"),r):v(j)}function v(j){if((j===45||bt(j))&&o++<63){const w=j===45?v:g;return n.consume(j),w}return s(j)}}const us={partial:!0,tokenize:Yv};function Yv(n,r,s){return o;function o(d){return Te(d)?Oe(n,u,"linePrefix")(d):u(d)}function u(d){return d===null||ye(d)?r(d):s(d)}}const Rp={continuation:{tokenize:Gv},exit:$v,name:"blockQuote",tokenize:Vv};function Vv(n,r,s){const o=this;return u;function u(f){if(f===62){const x=o.containerState;return x.open||(n.enter("blockQuote",{_container:!0}),x.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),d}return s(f)}function d(f){return Te(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function Gv(n,r,s){const o=this;return u;function u(f){return Te(f)?Oe(n,d,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):d(f)}function d(f){return n.attempt(Rp,r,s)(f)}}function $v(n){n.exit("blockQuote")}const Lp={name:"characterEscape",tokenize:Qv};function Qv(n,r,s){return o;function o(d){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(d),n.exit("escapeMarker"),u}function u(d){return Mv(d)?(n.enter("characterEscapeValue"),n.consume(d),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(d)}}const Up={name:"characterReference",tokenize:Xv};function Xv(n,r,s){const o=this;let u=0,d,f;return x;function x(g){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),p}function p(g){return g===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(g),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),d=31,f=bt,y(g))}function h(g){return g===88||g===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(g),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),d=6,f=Av,y):(n.enter("characterReferenceValue"),d=7,f=Ju,y(g))}function y(g){if(g===59&&u){const v=n.exit("characterReferenceValue");return f===bt&&!yd(o.sliceSerialize(v))?s(g):(n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(g)&&u++<d?(n.consume(g),y):s(g)}}const ox={partial:!0,tokenize:Zv},cx={concrete:!0,name:"codeFenced",tokenize:Fv};function Fv(n,r,s){const o=this,u={partial:!0,tokenize:U};let d=0,f=0,x;return p;function p(L){return h(L)}function h(L){const $=o.events[o.events.length-1];return d=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,x=L,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(L)}function y(L){return L===x?(f++,n.consume(L),y):f<3?s(L):(n.exit("codeFencedFenceSequence"),Te(L)?Oe(n,g,"whitespace")(L):g(L))}function g(L){return L===null||ye(L)?(n.exit("codeFencedFence"),o.interrupt?r(L):n.check(ox,S,K)(L)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),v(L))}function v(L){return L===null||ye(L)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),g(L)):Te(L)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Oe(n,j,"whitespace")(L)):L===96&&L===x?s(L):(n.consume(L),v)}function j(L){return L===null||ye(L)?g(L):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),w(L))}function w(L){return L===null||ye(L)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),g(L)):L===96&&L===x?s(L):(n.consume(L),w)}function S(L){return n.attempt(u,K,D)(L)}function D(L){return n.enter("lineEnding"),n.consume(L),n.exit("lineEnding"),E}function E(L){return d>0&&Te(L)?Oe(n,q,"linePrefix",d+1)(L):q(L)}function q(L){return L===null||ye(L)?n.check(ox,S,K)(L):(n.enter("codeFlowValue"),H(L))}function H(L){return L===null||ye(L)?(n.exit("codeFlowValue"),q(L)):(n.consume(L),H)}function K(L){return n.exit("codeFenced"),r(L)}function U(L,$,ue){let P=0;return A;function A(te){return L.enter("lineEnding"),L.consume(te),L.exit("lineEnding"),ae}function ae(te){return L.enter("codeFencedFence"),Te(te)?Oe(L,ne,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):ne(te)}function ne(te){return te===x?(L.enter("codeFencedFenceSequence"),X(te)):ue(te)}function X(te){return te===x?(P++,L.consume(te),X):P>=f?(L.exit("codeFencedFenceSequence"),Te(te)?Oe(L,W,"whitespace")(te):W(te)):ue(te)}function W(te){return te===null||ye(te)?(L.exit("codeFencedFence"),$(te)):ue(te)}}}function Zv(n,r,s){const o=this;return u;function u(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d)}function d(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Au={name:"codeIndented",tokenize:Kv},Iv={partial:!0,tokenize:Jv};function Kv(n,r,s){const o=this;return u;function u(h){return n.enter("codeIndented"),Oe(n,d,"linePrefix",5)(h)}function d(h){const y=o.events[o.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?p(h):ye(h)?n.attempt(Iv,f,p)(h):(n.enter("codeFlowValue"),x(h))}function x(h){return h===null||ye(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),x)}function p(h){return n.exit("codeIndented"),r(h)}}function Jv(n,r,s){const o=this;return u;function u(f){return o.parser.lazy[o.now().line]?s(f):ye(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):Oe(n,d,"linePrefix",5)(f)}function d(f){const x=o.events[o.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?r(f):ye(f)?u(f):s(f)}}const Pv={name:"codeText",previous:e2,resolve:Wv,tokenize:t2};function Wv(n){let r=n.length-4,s=3,o,u;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)u===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(u=o):(o===r||n[o][1].type==="lineEnding")&&(n[u][1].type="codeTextData",o!==u+2&&(n[u][1].end=n[o-1][1].end,n.splice(u+2,o-u-2),r-=o-u-2,o=u+2),u=void 0);return n}function e2(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function t2(n,r,s){let o=0,u,d;return f;function f(g){return n.enter("codeText"),n.enter("codeTextSequence"),x(g)}function x(g){return g===96?(n.consume(g),o++,x):(n.exit("codeTextSequence"),p(g))}function p(g){return g===null?s(g):g===32?(n.enter("space"),n.consume(g),n.exit("space"),p):g===96?(d=n.enter("codeTextSequence"),u=0,y(g)):ye(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),p):(n.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||ye(g)?(n.exit("codeTextData"),p(g)):(n.consume(g),h)}function y(g){return g===96?(n.consume(g),u++,y):u===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(g)):(d.type="codeTextData",h(g))}}class n2{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const u=s||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return o&&Ir(this.left,o),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Ir(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ir(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Ir(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ir(this.left,s.reverse())}}}function Ir(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function Hp(n){const r={};let s=-1,o,u,d,f,x,p,h;const y=new n2(n);for(;++s<y.length;){for(;s in r;)s=r[s];if(o=y.get(s),s&&o[1].type==="chunkFlow"&&y.get(s-1)[1].type==="listItemPrefix"&&(p=o[1]._tokenizer.events,d=0,d<p.length&&p[d][1].type==="lineEndingBlank"&&(d+=2),d<p.length&&p[d][1].type==="content"))for(;++d<p.length&&p[d][1].type!=="content";)p[d][1].type==="chunkText"&&(p[d][1]._isInFirstContentOfListItem=!0,d++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,l2(y,s)),s=r[s],h=!0);else if(o[1]._container){for(d=s,u=void 0;d--;)if(f=y.get(d),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),f[1].type="lineEnding",u=d);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;u&&(o[1].end={...y.get(u)[1].start},x=y.slice(u,s),x.unshift(o),y.splice(u,s-u+1,x))}}return Qt(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function l2(n,r){const s=n.get(r)[1],o=n.get(r)[2];let u=r-1;const d=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const x=f.events,p=[],h={};let y,g,v=-1,j=s,w=0,S=0;const D=[S];for(;j;){for(;n.get(++u)[1]!==j;);d.push(u),j._tokenizer||(y=o.sliceStream(j),j.next||y.push(null),g&&f.defineSkip(j.start),j._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),j._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=j,j=j.next}for(j=s;++v<x.length;)x[v][0]==="exit"&&x[v-1][0]==="enter"&&x[v][1].type===x[v-1][1].type&&x[v][1].start.line!==x[v][1].end.line&&(S=v+1,D.push(S),j._tokenizer=void 0,j.previous=void 0,j=j.next);for(f.events=[],j?(j._tokenizer=void 0,j.previous=void 0):D.pop(),v=D.length;v--;){const E=x.slice(D[v],D[v+1]),q=d.pop();p.push([q,q+E.length-1]),n.splice(q,2,E)}for(p.reverse(),v=-1;++v<p.length;)h[w+p[v][0]]=w+p[v][1],w+=p[v][1]-p[v][0]-1;return h}const a2={resolve:s2,tokenize:i2},r2={partial:!0,tokenize:o2};function s2(n){return Hp(n),n}function i2(n,r){let s;return o;function o(x){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),u(x)}function u(x){return x===null?d(x):ye(x)?n.check(r2,f,d)(x):(n.consume(x),u)}function d(x){return n.exit("chunkContent"),n.exit("content"),r(x)}function f(x){return n.consume(x),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,u}}function o2(n,r,s){const o=this;return u;function u(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Oe(n,d,"linePrefix")}function d(f){if(f===null||ye(f))return s(f);const x=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function Bp(n,r,s,o,u,d,f,x,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(n.enter(o),n.enter(u),n.enter(d),n.consume(E),n.exit(d),v):E===null||E===32||E===41||$i(E)?s(E):(n.enter(o),n.enter(f),n.enter(x),n.enter("chunkString",{contentType:"string"}),S(E))}function v(E){return E===62?(n.enter(d),n.consume(E),n.exit(d),n.exit(u),n.exit(o),r):(n.enter(x),n.enter("chunkString",{contentType:"string"}),j(E))}function j(E){return E===62?(n.exit("chunkString"),n.exit(x),v(E)):E===null||E===60||ye(E)?s(E):(n.consume(E),E===92?w:j)}function w(E){return E===60||E===62||E===92?(n.consume(E),j):j(E)}function S(E){return!y&&(E===null||E===41||Fe(E))?(n.exit("chunkString"),n.exit(x),n.exit(f),n.exit(o),r(E)):y<h&&E===40?(n.consume(E),y++,S):E===41?(n.consume(E),y--,S):E===null||E===32||E===40||$i(E)?s(E):(n.consume(E),E===92?D:S)}function D(E){return E===40||E===41||E===92?(n.consume(E),S):S(E)}}function qp(n,r,s,o,u,d){const f=this;let x=0,p;return h;function h(j){return n.enter(o),n.enter(u),n.consume(j),n.exit(u),n.enter(d),y}function y(j){return x>999||j===null||j===91||j===93&&!p||j===94&&!x&&"_hiddenFootnoteSupport"in f.parser.constructs?s(j):j===93?(n.exit(d),n.enter(u),n.consume(j),n.exit(u),n.exit(o),r):ye(j)?(n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||j===91||j===93||ye(j)||x++>999?(n.exit("chunkString"),y(j)):(n.consume(j),p||(p=!Te(j)),j===92?v:g)}function v(j){return j===91||j===92||j===93?(n.consume(j),x++,g):g(j)}}function Yp(n,r,s,o,u,d){let f;return x;function x(v){return v===34||v===39||v===40?(n.enter(o),n.enter(u),n.consume(v),n.exit(u),f=v===40?41:v,p):s(v)}function p(v){return v===f?(n.enter(u),n.consume(v),n.exit(u),n.exit(o),r):(n.enter(d),h(v))}function h(v){return v===f?(n.exit(d),p(f)):v===null?s(v):ye(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),Oe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===f||v===null||ye(v)?(n.exit("chunkString"),h(v)):(n.consume(v),v===92?g:y)}function g(v){return v===f||v===92?(n.consume(v),y):y(v)}}function ls(n,r){let s;return o;function o(u){return ye(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),s=!0,o):Te(u)?Oe(n,o,s?"linePrefix":"lineSuffix")(u):r(u)}}const c2={name:"definition",tokenize:d2},u2={partial:!0,tokenize:f2};function d2(n,r,s){const o=this;let u;return d;function d(j){return n.enter("definition"),f(j)}function f(j){return qp.call(o,n,x,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(j)}function x(j){return u=dn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),j===58?(n.enter("definitionMarker"),n.consume(j),n.exit("definitionMarker"),p):s(j)}function p(j){return Fe(j)?ls(n,h)(j):h(j)}function h(j){return Bp(n,y,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(j)}function y(j){return n.attempt(u2,g,g)(j)}function g(j){return Te(j)?Oe(n,v,"whitespace")(j):v(j)}function v(j){return j===null||ye(j)?(n.exit("definition"),o.parser.defined.push(u),r(j)):s(j)}}function f2(n,r,s){return o;function o(x){return Fe(x)?ls(n,u)(x):s(x)}function u(x){return Yp(n,d,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(x)}function d(x){return Te(x)?Oe(n,f,"whitespace")(x):f(x)}function f(x){return x===null||ye(x)?r(x):s(x)}}const m2={name:"hardBreakEscape",tokenize:h2};function h2(n,r,s){return o;function o(d){return n.enter("hardBreakEscape"),n.consume(d),u}function u(d){return ye(d)?(n.exit("hardBreakEscape"),r(d)):s(d)}}const x2={name:"headingAtx",resolve:p2,tokenize:g2};function p2(n,r){let s=n.length-2,o=3,u,d;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(u={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},d={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},Qt(n,o,s-o+1,[["enter",u,r],["enter",d,r],["exit",d,r],["exit",u,r]])),n}function g2(n,r,s){let o=0;return u;function u(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&o++<6?(n.consume(y),f):y===null||Fe(y)?(n.exit("atxHeadingSequence"),x(y)):s(y)}function x(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||ye(y)?(n.exit("atxHeading"),r(y)):Te(y)?Oe(n,x,"whitespace")(y):(n.enter("atxHeadingText"),h(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),x(y))}function h(y){return y===null||y===35||Fe(y)?(n.exit("atxHeadingText"),x(y)):(n.consume(y),h)}}const y2=["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"],ux=["pre","script","style","textarea"],b2={concrete:!0,name:"htmlFlow",resolveTo:N2,tokenize:w2},v2={partial:!0,tokenize:S2},j2={partial:!0,tokenize:k2};function N2(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function w2(n,r,s){const o=this;let u,d,f,x,p;return h;function h(k){return y(k)}function y(k){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(k),g}function g(k){return k===33?(n.consume(k),v):k===47?(n.consume(k),d=!0,S):k===63?(n.consume(k),u=3,o.interrupt?r:C):kt(k)?(n.consume(k),f=String.fromCharCode(k),D):s(k)}function v(k){return k===45?(n.consume(k),u=2,j):k===91?(n.consume(k),u=5,x=0,w):kt(k)?(n.consume(k),u=4,o.interrupt?r:C):s(k)}function j(k){return k===45?(n.consume(k),o.interrupt?r:C):s(k)}function w(k){const Z="CDATA[";return k===Z.charCodeAt(x++)?(n.consume(k),x===Z.length?o.interrupt?r:ne:w):s(k)}function S(k){return kt(k)?(n.consume(k),f=String.fromCharCode(k),D):s(k)}function D(k){if(k===null||k===47||k===62||Fe(k)){const Z=k===47,pe=f.toLowerCase();return!Z&&!d&&ux.includes(pe)?(u=1,o.interrupt?r(k):ne(k)):y2.includes(f.toLowerCase())?(u=6,Z?(n.consume(k),E):o.interrupt?r(k):ne(k)):(u=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(k):d?q(k):H(k))}return k===45||bt(k)?(n.consume(k),f+=String.fromCharCode(k),D):s(k)}function E(k){return k===62?(n.consume(k),o.interrupt?r:ne):s(k)}function q(k){return Te(k)?(n.consume(k),q):A(k)}function H(k){return k===47?(n.consume(k),A):k===58||k===95||kt(k)?(n.consume(k),K):Te(k)?(n.consume(k),H):A(k)}function K(k){return k===45||k===46||k===58||k===95||bt(k)?(n.consume(k),K):U(k)}function U(k){return k===61?(n.consume(k),L):Te(k)?(n.consume(k),U):H(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?s(k):k===34||k===39?(n.consume(k),p=k,$):Te(k)?(n.consume(k),L):ue(k)}function $(k){return k===p?(n.consume(k),p=null,P):k===null||ye(k)?s(k):(n.consume(k),$)}function ue(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Fe(k)?U(k):(n.consume(k),ue)}function P(k){return k===47||k===62||Te(k)?H(k):s(k)}function A(k){return k===62?(n.consume(k),ae):s(k)}function ae(k){return k===null||ye(k)?ne(k):Te(k)?(n.consume(k),ae):s(k)}function ne(k){return k===45&&u===2?(n.consume(k),M):k===60&&u===1?(n.consume(k),z):k===62&&u===4?(n.consume(k),_):k===63&&u===3?(n.consume(k),C):k===93&&u===5?(n.consume(k),oe):ye(k)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(v2,F,X)(k)):k===null||ye(k)?(n.exit("htmlFlowData"),X(k)):(n.consume(k),ne)}function X(k){return n.check(j2,W,F)(k)}function W(k){return n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),te}function te(k){return k===null||ye(k)?X(k):(n.enter("htmlFlowData"),ne(k))}function M(k){return k===45?(n.consume(k),C):ne(k)}function z(k){return k===47?(n.consume(k),f="",re):ne(k)}function re(k){if(k===62){const Z=f.toLowerCase();return ux.includes(Z)?(n.consume(k),_):ne(k)}return kt(k)&&f.length<8?(n.consume(k),f+=String.fromCharCode(k),re):ne(k)}function oe(k){return k===93?(n.consume(k),C):ne(k)}function C(k){return k===62?(n.consume(k),_):k===45&&u===2?(n.consume(k),C):ne(k)}function _(k){return k===null||ye(k)?(n.exit("htmlFlowData"),F(k)):(n.consume(k),_)}function F(k){return n.exit("htmlFlow"),r(k)}}function k2(n,r,s){const o=this;return u;function u(f){return ye(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):s(f)}function d(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function S2(n,r,s){return o;function o(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(us,r,s)}}const C2={name:"htmlText",tokenize:_2};function _2(n,r,s){const o=this;let u,d,f;return x;function x(C){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(C),p}function p(C){return C===33?(n.consume(C),h):C===47?(n.consume(C),U):C===63?(n.consume(C),H):kt(C)?(n.consume(C),ue):s(C)}function h(C){return C===45?(n.consume(C),y):C===91?(n.consume(C),d=0,w):kt(C)?(n.consume(C),q):s(C)}function y(C){return C===45?(n.consume(C),j):s(C)}function g(C){return C===null?s(C):C===45?(n.consume(C),v):ye(C)?(f=g,z(C)):(n.consume(C),g)}function v(C){return C===45?(n.consume(C),j):g(C)}function j(C){return C===62?M(C):C===45?v(C):g(C)}function w(C){const _="CDATA[";return C===_.charCodeAt(d++)?(n.consume(C),d===_.length?S:w):s(C)}function S(C){return C===null?s(C):C===93?(n.consume(C),D):ye(C)?(f=S,z(C)):(n.consume(C),S)}function D(C){return C===93?(n.consume(C),E):S(C)}function E(C){return C===62?M(C):C===93?(n.consume(C),E):S(C)}function q(C){return C===null||C===62?M(C):ye(C)?(f=q,z(C)):(n.consume(C),q)}function H(C){return C===null?s(C):C===63?(n.consume(C),K):ye(C)?(f=H,z(C)):(n.consume(C),H)}function K(C){return C===62?M(C):H(C)}function U(C){return kt(C)?(n.consume(C),L):s(C)}function L(C){return C===45||bt(C)?(n.consume(C),L):$(C)}function $(C){return ye(C)?(f=$,z(C)):Te(C)?(n.consume(C),$):M(C)}function ue(C){return C===45||bt(C)?(n.consume(C),ue):C===47||C===62||Fe(C)?P(C):s(C)}function P(C){return C===47?(n.consume(C),M):C===58||C===95||kt(C)?(n.consume(C),A):ye(C)?(f=P,z(C)):Te(C)?(n.consume(C),P):M(C)}function A(C){return C===45||C===46||C===58||C===95||bt(C)?(n.consume(C),A):ae(C)}function ae(C){return C===61?(n.consume(C),ne):ye(C)?(f=ae,z(C)):Te(C)?(n.consume(C),ae):P(C)}function ne(C){return C===null||C===60||C===61||C===62||C===96?s(C):C===34||C===39?(n.consume(C),u=C,X):ye(C)?(f=ne,z(C)):Te(C)?(n.consume(C),ne):(n.consume(C),W)}function X(C){return C===u?(n.consume(C),u=void 0,te):C===null?s(C):ye(C)?(f=X,z(C)):(n.consume(C),X)}function W(C){return C===null||C===34||C===39||C===60||C===61||C===96?s(C):C===47||C===62||Fe(C)?P(C):(n.consume(C),W)}function te(C){return C===47||C===62||Fe(C)?P(C):s(C)}function M(C){return C===62?(n.consume(C),n.exit("htmlTextData"),n.exit("htmlText"),r):s(C)}function z(C){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),re}function re(C){return Te(C)?Oe(n,oe,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):oe(C)}function oe(C){return n.enter("htmlTextData"),f(C)}}const bd={name:"labelEnd",resolveAll:M2,resolveTo:z2,tokenize:O2},T2={tokenize:D2},E2={tokenize:R2},A2={tokenize:L2};function M2(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const u=o.type==="labelImage"?4:2;o.type="data",r+=u}}return n.length!==s.length&&Qt(n,0,n.length,s),n}function z2(n,r){let s=n.length,o=0,u,d,f,x;for(;s--;)if(u=n[s][1],d){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[s][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(d=s,u.type!=="labelLink")){o=2;break}}else u.type==="labelEnd"&&(f=s);const p={type:n[d][1].type==="labelLink"?"link":"image",start:{...n[d][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[d][1].start},end:{...n[f][1].end}},y={type:"labelText",start:{...n[d+o+2][1].end},end:{...n[f-2][1].start}};return x=[["enter",p,r],["enter",h,r]],x=ln(x,n.slice(d+1,d+o+3)),x=ln(x,[["enter",y,r]]),x=ln(x,eo(r.parser.constructs.insideSpan.null,n.slice(d+o+4,f-3),r)),x=ln(x,[["exit",y,r],n[f-2],n[f-1],["exit",h,r]]),x=ln(x,n.slice(f+1)),x=ln(x,[["exit",p,r]]),Qt(n,d,n.length,x),n}function O2(n,r,s){const o=this;let u=o.events.length,d,f;for(;u--;)if((o.events[u][1].type==="labelImage"||o.events[u][1].type==="labelLink")&&!o.events[u][1]._balanced){d=o.events[u][1];break}return x;function x(v){return d?d._inactive?g(v):(f=o.parser.defined.includes(dn(o.sliceSerialize({start:d.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(v),n.exit("labelMarker"),n.exit("labelEnd"),p):s(v)}function p(v){return v===40?n.attempt(T2,y,f?y:g)(v):v===91?n.attempt(E2,y,f?h:g)(v):f?y(v):g(v)}function h(v){return n.attempt(A2,y,g)(v)}function y(v){return r(v)}function g(v){return d._balanced=!0,s(v)}}function D2(n,r,s){return o;function o(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),u}function u(g){return Fe(g)?ls(n,d)(g):d(g)}function d(g){return g===41?y(g):Bp(n,f,x,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return Fe(g)?ls(n,p)(g):y(g)}function x(g){return s(g)}function p(g){return g===34||g===39||g===40?Yp(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return Fe(g)?ls(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):s(g)}}function R2(n,r,s){const o=this;return u;function u(x){return qp.call(o,n,d,f,"reference","referenceMarker","referenceString")(x)}function d(x){return o.parser.defined.includes(dn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(x):s(x)}function f(x){return s(x)}}function L2(n,r,s){return o;function o(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),u}function u(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):s(d)}}const U2={name:"labelStartImage",resolveAll:bd.resolveAll,tokenize:H2};function H2(n,r,s){const o=this;return u;function u(x){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(x),n.exit("labelImageMarker"),d}function d(x){return x===91?(n.enter("labelMarker"),n.consume(x),n.exit("labelMarker"),n.exit("labelImage"),f):s(x)}function f(x){return x===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(x):r(x)}}const B2={name:"labelStartLink",resolveAll:bd.resolveAll,tokenize:q2};function q2(n,r,s){const o=this;return u;function u(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),d}function d(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Mu={name:"lineEnding",tokenize:Y2};function Y2(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Oe(n,r,"linePrefix")}}const Yi={name:"thematicBreak",tokenize:V2};function V2(n,r,s){let o=0,u;return d;function d(h){return n.enter("thematicBreak"),f(h)}function f(h){return u=h,x(h)}function x(h){return h===u?(n.enter("thematicBreakSequence"),p(h)):o>=3&&(h===null||ye(h))?(n.exit("thematicBreak"),r(h)):s(h)}function p(h){return h===u?(n.consume(h),o++,p):(n.exit("thematicBreakSequence"),Te(h)?Oe(n,x,"whitespace")(h):x(h))}}const Ot={continuation:{tokenize:X2},exit:Z2,name:"list",tokenize:Q2},G2={partial:!0,tokenize:I2},$2={partial:!0,tokenize:F2};function Q2(n,r,s){const o=this,u=o.events[o.events.length-1];let d=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,f=0;return x;function x(j){const w=o.containerState.type||(j===42||j===43||j===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!o.containerState.marker||j===o.containerState.marker:Ju(j)){if(o.containerState.type||(o.containerState.type=w,n.enter(w,{_container:!0})),w==="listUnordered")return n.enter("listItemPrefix"),j===42||j===45?n.check(Yi,s,h)(j):h(j);if(!o.interrupt||j===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(j)}return s(j)}function p(j){return Ju(j)&&++f<10?(n.consume(j),p):(!o.interrupt||f<2)&&(o.containerState.marker?j===o.containerState.marker:j===41||j===46)?(n.exit("listItemValue"),h(j)):s(j)}function h(j){return n.enter("listItemMarker"),n.consume(j),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||j,n.check(us,o.interrupt?s:y,n.attempt(G2,v,g))}function y(j){return o.containerState.initialBlankLine=!0,d++,v(j)}function g(j){return Te(j)?(n.enter("listItemPrefixWhitespace"),n.consume(j),n.exit("listItemPrefixWhitespace"),v):s(j)}function v(j){return o.containerState.size=d+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(j)}}function X2(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(us,u,d);function u(x){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Oe(n,r,"listItemIndent",o.containerState.size+1)(x)}function d(x){return o.containerState.furtherBlankLines||!Te(x)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(x)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt($2,r,f)(x))}function f(x){return o.containerState._closeFlow=!0,o.interrupt=void 0,Oe(n,n.attempt(Ot,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x)}}function F2(n,r,s){const o=this;return Oe(n,u,"listItemIndent",o.containerState.size+1);function u(d){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(d):s(d)}}function Z2(n){n.exit(this.containerState.type)}function I2(n,r,s){const o=this;return Oe(n,u,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(d){const f=o.events[o.events.length-1];return!Te(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):s(d)}}const dx={name:"setextUnderline",resolveTo:K2,tokenize:J2};function K2(n,r){let s=n.length,o,u,d;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(u=s)}else n[s][1].type==="content"&&n.splice(s,1),!d&&n[s][1].type==="definition"&&(d=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",d?(n.splice(u,0,["enter",f,r]),n.splice(d+1,0,["exit",n[o][1],r]),n[o][1].end={...n[d][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function J2(n,r,s){const o=this;let u;return d;function d(h){let y=o.events.length,g;for(;y--;)if(o.events[y][1].type!=="lineEnding"&&o.events[y][1].type!=="linePrefix"&&o.events[y][1].type!=="content"){g=o.events[y][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||g)?(n.enter("setextHeadingLine"),u=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),x(h)}function x(h){return h===u?(n.consume(h),x):(n.exit("setextHeadingLineSequence"),Te(h)?Oe(n,p,"lineSuffix")(h):p(h))}function p(h){return h===null||ye(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const P2={tokenize:W2};function W2(n){const r=this,s=n.attempt(us,o,n.attempt(this.parser.constructs.flowInitial,u,Oe(n,n.attempt(this.parser.constructs.flow,u,n.attempt(a2,u)),"linePrefix")));return s;function o(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function u(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const e5={resolveAll:Gp()},t5=Vp("string"),n5=Vp("text");function Vp(n){return{resolveAll:Gp(n==="text"?l5:void 0),tokenize:r};function r(s){const o=this,u=this.parser.constructs[n],d=s.attempt(u,f,x);return f;function f(y){return h(y)?d(y):x(y)}function x(y){if(y===null){s.consume(y);return}return s.enter("data"),s.consume(y),p}function p(y){return h(y)?(s.exit("data"),d(y)):(s.consume(y),p)}function h(y){if(y===null)return!0;const g=u[y];let v=-1;if(g)for(;++v<g.length;){const j=g[v];if(!j.previous||j.previous.call(o,o.previous))return!0}return!1}}}function Gp(n){return r;function r(s,o){let u=-1,d;for(;++u<=s.length;)d===void 0?s[u]&&s[u][1].type==="data"&&(d=u,u++):(!s[u]||s[u][1].type!=="data")&&(u!==d+2&&(s[d][1].end=s[u-1][1].end,s.splice(d+2,u-d-2),u=d+2),d=void 0);return n?n(s,o):s}}function l5(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],u=r.sliceStream(o);let d=u.length,f=-1,x=0,p;for(;d--;){const h=u[d];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)x++,f--;if(f)break;f=-1}else if(h===-2)p=!0,x++;else if(h!==-1){d++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(x=0),x){const h={type:s===n.length||p||x<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?f:o.start._bufferIndex+f,_index:o.start._index+d,line:o.end.line,column:o.end.column-x,offset:o.end.offset-x},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const a5={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:Rp},r5={91:c2},s5={[-2]:Au,[-1]:Au,32:Au},i5={35:x2,42:Yi,45:[dx,Yi],60:b2,61:dx,95:Yi,96:cx,126:cx},o5={38:Up,92:Lp},c5={[-5]:Mu,[-4]:Mu,[-3]:Mu,33:U2,38:Up,42:Pu,60:[Bv,C2],91:B2,92:[m2,Lp],93:bd,95:Pu,96:Pv},u5={null:[Pu,e5]},d5={null:[42,95]},f5={null:[]},m5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:d5,contentInitial:r5,disable:f5,document:a5,flow:i5,flowInitial:s5,insideSpan:u5,string:o5,text:c5},Symbol.toStringTag,{value:"Module"}));function h5(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const u={},d=[];let f=[],x=[];const p={attempt:$(U),check:$(L),consume:q,enter:H,exit:K,interrupt:$(L,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:n,previous:null,sliceSerialize:v,sliceStream:j,write:g};let y=r.tokenize.call(h,p);return r.resolveAll&&d.push(r),h;function g(ae){return f=ln(f,ae),D(),f[f.length-1]!==null?[]:(ue(r,0),h.events=eo(d,h.events,h),h.events)}function v(ae,ne){return p5(j(ae),ne)}function j(ae){return x5(f,ae)}function w(){const{_bufferIndex:ae,_index:ne,line:X,column:W,offset:te}=o;return{_bufferIndex:ae,_index:ne,line:X,column:W,offset:te}}function S(ae){u[ae.line]=ae.column,A()}function D(){let ae;for(;o._index<f.length;){const ne=f[o._index];if(typeof ne=="string")for(ae=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===ae&&o._bufferIndex<ne.length;)E(ne.charCodeAt(o._bufferIndex));else E(ne)}}function E(ae){y=y(ae)}function q(ae){ye(ae)?(o.line++,o.column=1,o.offset+=ae===-3?2:1,A()):ae!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=ae}function H(ae,ne){const X=ne||{};return X.type=ae,X.start=w(),h.events.push(["enter",X,h]),x.push(X),X}function K(ae){const ne=x.pop();return ne.end=w(),h.events.push(["exit",ne,h]),ne}function U(ae,ne){ue(ae,ne.from)}function L(ae,ne){ne.restore()}function $(ae,ne){return X;function X(W,te,M){let z,re,oe,C;return Array.isArray(W)?F(W):"tokenize"in W?F([W]):_(W);function _(he){return Ee;function Ee(Pe){const Ye=Pe!==null&&he[Pe],Xt=Pe!==null&&he.null,Nn=[...Array.isArray(Ye)?Ye:Ye?[Ye]:[],...Array.isArray(Xt)?Xt:Xt?[Xt]:[]];return F(Nn)(Pe)}}function F(he){return z=he,re=0,he.length===0?M:k(he[re])}function k(he){return Ee;function Ee(Pe){return C=P(),oe=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(ne?Object.assign(Object.create(h),ne):h,p,Z,pe)(Pe)}}function Z(he){return ae(oe,C),te}function pe(he){return C.restore(),++re<z.length?k(z[re]):M}}}function ue(ae,ne){ae.resolveAll&&!d.includes(ae)&&d.push(ae),ae.resolve&&Qt(h.events,ne,h.events.length-ne,ae.resolve(h.events.slice(ne),h)),ae.resolveTo&&(h.events=ae.resolveTo(h.events,h))}function P(){const ae=w(),ne=h.previous,X=h.currentConstruct,W=h.events.length,te=Array.from(x);return{from:W,restore:M};function M(){o=ae,h.previous=ne,h.currentConstruct=X,h.events.length=W,x=te,A()}}function A(){o.line in u&&o.column<2&&(o.column=u[o.line],o.offset+=u[o.line]-1)}}function x5(n,r){const s=r.start._index,o=r.start._bufferIndex,u=r.end._index,d=r.end._bufferIndex;let f;if(s===u)f=[n[s].slice(o,d)];else{if(f=n.slice(s,u),o>-1){const x=f[0];typeof x=="string"?f[0]=x.slice(o):f.shift()}d>0&&f.push(n[u].slice(0,d))}return f}function p5(n,r){let s=-1;const o=[];let u;for(;++s<n.length;){const d=n[s];let f;if(typeof d=="string")f=d;else switch(d){case-5:{f="\r";break}case-4:{f=`
`;break}case-3:{f=`\r
`;break}case-2:{f=r?" ":"	";break}case-1:{if(!r&&u)continue;f=" ";break}default:f=String.fromCharCode(d)}u=d===-2,o.push(f)}return o.join("")}function g5(n){const o={constructs:Op([m5,...(n||{}).extensions||[]]),content:u(zv),defined:[],document:u(Dv),flow:u(P2),lazy:{},string:u(t5),text:u(n5)};return o;function u(d){return f;function f(x){return h5(o,d,x)}}}function y5(n){for(;!Hp(n););return n}const fx=/[\0\t\n\r]/g;function b5(){let n=1,r="",s=!0,o;return u;function u(d,f,x){const p=[];let h,y,g,v,j;for(d=r+(typeof d=="string"?d.toString():new TextDecoder(f||void 0).decode(d)),g=0,r="",s&&(d.charCodeAt(0)===65279&&g++,s=void 0);g<d.length;){if(fx.lastIndex=g,h=fx.exec(d),v=h&&h.index!==void 0?h.index:d.length,j=d.charCodeAt(v),!h){r=d.slice(g);break}if(j===10&&g===v&&o)p.push(-3),o=void 0;else switch(o&&(p.push(-5),o=void 0),g<v&&(p.push(d.slice(g,v)),n+=v-g),j){case 0:{p.push(65533),n++;break}case 9:{for(y=Math.ceil(n/4)*4,p.push(-2);n++<y;)p.push(-1);break}case 10:{p.push(-4),n=1;break}default:o=!0,n=1}g=v+1}return x&&(o&&p.push(-5),r&&p.push(r),p.push(null)),p}}const v5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function j5(n){return n.replace(v5,N5)}function N5(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const u=s.charCodeAt(1),d=u===120||u===88;return Dp(s.slice(d?2:1),d?16:10)}return yd(s)||n}const $p={}.hasOwnProperty;function w5(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),k5(s)(y5(g5(s).document().write(b5()(n,r,!0))))}function k5(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(Zl),autolinkProtocol:P,autolinkEmail:P,atxHeading:d(Xl),blockQuote:d(Xt),characterEscape:P,characterReference:P,codeFenced:d(Nn),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:d(Nn,f),codeText:d(Pa,f),codeTextData:P,data:P,codeFlowValue:P,definition:d(ms),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:d(wn),hardBreakEscape:d(Fl),hardBreakTrailing:d(Fl),htmlFlow:d(hs,f),htmlFlowData:P,htmlText:d(hs,f),htmlTextData:P,image:d(xs),label:f,link:d(Zl),listItem:d(Wa),listItemValue:v,listOrdered:d(Il,g),listUnordered:d(Il),paragraph:d(ao),reference:k,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:d(Xl),strong:d(ro),thematicBreak:d(so)},exit:{atxHeading:p(),atxHeadingSequence:U,autolink:p(),autolinkEmail:Ye,autolinkProtocol:Pe,blockQuote:p(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:Ee,codeFenced:p(D),codeFencedFence:S,codeFencedFenceInfo:j,codeFencedFenceMeta:w,codeFlowValue:A,codeIndented:p(E),codeText:p(te),codeTextData:A,data:A,definition:p(),definitionDestinationString:K,definitionLabelString:q,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(ne),hardBreakTrailing:p(ne),htmlFlow:p(X),htmlFlowData:A,htmlText:p(W),htmlTextData:A,image:p(z),label:oe,labelText:re,lineEnding:ae,link:p(M),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:Z,resourceDestinationString:C,resourceTitleString:_,resource:F,setextHeading:p(ue),setextHeadingLineSequence:$,setextHeadingText:L,strong:p(),thematicBreak:p()}};Qp(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(J){let ce={type:"root",children:[]};const ve={stack:[ce],tokenStack:[],config:r,enter:x,exit:h,buffer:f,resume:y,data:s},Se=[];let Ue=-1;for(;++Ue<J.length;)if(J[Ue][1].type==="listOrdered"||J[Ue][1].type==="listUnordered")if(J[Ue][0]==="enter")Se.push(Ue);else{const Rt=Se.pop();Ue=u(J,Rt,Ue)}for(Ue=-1;++Ue<J.length;){const Rt=r[J[Ue][0]];$p.call(Rt,J[Ue][1].type)&&Rt[J[Ue][1].type].call(Object.assign({sliceSerialize:J[Ue][2].sliceSerialize},ve),J[Ue][1])}if(ve.tokenStack.length>0){const Rt=ve.tokenStack[ve.tokenStack.length-1];(Rt[1]||mx).call(ve,void 0,Rt[0])}for(ce.position={start:pl(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:pl(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<r.transforms.length;)ce=r.transforms[Ue](ce)||ce;return ce}function u(J,ce,ve){let Se=ce-1,Ue=-1,Rt=!1,kn,Nt,ct,St;for(;++Se<=ve;){const Qe=J[Se];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ue++:Ue--,St=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(kn&&!St&&!Ue&&!ct&&(ct=Se),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!Ue&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ue===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(kn){let Qn=Se;for(Nt=void 0;Qn--;){const sn=J[Qn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;Nt&&(J[Nt][1].type="lineEndingBlank",Rt=!0),sn[1].type="lineEnding",Nt=Qn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}ct&&(!Nt||ct<Nt)&&(kn._spread=!0),kn.end=Object.assign({},Nt?J[Nt][1].start:Qe[1].end),J.splice(Nt||Se,0,["exit",kn,Qe[2]]),Se++,ve++}if(Qe[1].type==="listItemPrefix"){const Qn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};kn=Qn,J.splice(Se,0,["enter",Qn,Qe[2]]),Se++,ve++,ct=void 0,St=!0}}}return J[ce][1]._spread=Rt,ve}function d(J,ce){return ve;function ve(Se){x.call(this,J(Se),Se),ce&&ce.call(this,Se)}}function f(){this.stack.push({type:"fragment",children:[]})}function x(J,ce,ve){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([ce,ve||void 0]),J.position={start:pl(ce.start),end:void 0}}function p(J){return ce;function ce(ve){J&&J.call(this,ve),h.call(this,ve)}}function h(J,ce){const ve=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==J.type&&(ce?ce.call(this,J,Se[0]):(Se[1]||mx).call(this,J,Se[0]));else throw new Error("Cannot close `"+J.type+"` ("+ns({start:J.start,end:J.end})+"): it’s not open");ve.position.end=pl(J.end)}function y(){return gd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(J){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function j(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=J}function w(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=J}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function D(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J.replace(/(\r?\n|\r)$/g,"")}function q(J){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=dn(this.sliceSerialize(J)).toLowerCase()}function H(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function K(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function U(J){const ce=this.stack[this.stack.length-1];if(!ce.depth){const ve=this.sliceSerialize(J).length;ce.depth=ve}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function $(J){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function ue(){this.data.setextHeadingSlurpLineEnding=void 0}function P(J){const ve=this.stack[this.stack.length-1].children;let Se=ve[ve.length-1];(!Se||Se.type!=="text")&&(Se=jt(),Se.position={start:pl(J.start),end:void 0},ve.push(Se)),this.stack.push(Se)}function A(J){const ce=this.stack.pop();ce.value+=this.sliceSerialize(J),ce.position.end=pl(J.end)}function ae(J){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=ce.children[ce.children.length-1];ve.position.end=pl(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ce.type)&&(P.call(this,J),A.call(this,J))}function ne(){this.data.atHardBreak=!0}function X(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function W(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function te(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.value=J}function M(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function z(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=ce,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function re(J){const ce=this.sliceSerialize(J),ve=this.stack[this.stack.length-2];ve.label=j5(ce),ve.identifier=dn(ce).toLowerCase()}function oe(){const J=this.stack[this.stack.length-1],ce=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Se=J.children;ve.children=Se}else ve.alt=ce}function C(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.url=J}function _(){const J=this.resume(),ce=this.stack[this.stack.length-1];ce.title=J}function F(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function Z(J){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=dn(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function pe(J){this.data.characterReferenceType=J.type}function he(J){const ce=this.sliceSerialize(J),ve=this.data.characterReferenceType;let Se;ve?(Se=Dp(ce,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=yd(ce);const Ue=this.stack[this.stack.length-1];Ue.value+=Se}function Ee(J){const ce=this.stack.pop();ce.position.end=pl(J.end)}function Pe(J){A.call(this,J);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(J)}function Ye(J){A.call(this,J);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(J)}function Xt(){return{type:"blockquote",children:[]}}function Nn(){return{type:"code",lang:null,meta:null,value:""}}function Pa(){return{type:"inlineCode",value:""}}function ms(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wn(){return{type:"emphasis",children:[]}}function Xl(){return{type:"heading",depth:0,children:[]}}function Fl(){return{type:"break"}}function hs(){return{type:"html",value:""}}function xs(){return{type:"image",title:null,url:"",alt:null}}function Zl(){return{type:"link",title:null,url:"",children:[]}}function Il(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Wa(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function ao(){return{type:"paragraph",children:[]}}function ro(){return{type:"strong",children:[]}}function jt(){return{type:"text",value:""}}function so(){return{type:"thematicBreak"}}}function pl(n){return{line:n.line,column:n.column,offset:n.offset}}function Qp(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?Qp(n,o):S5(n,o)}}function S5(n,r){let s;for(s in r)if($p.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function mx(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+ns({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+ns({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ns({start:r.start,end:r.end})+") is still open")}function C5(n){const r=this;r.parser=s;function s(o){return w5(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function _5(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function T5(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
`}]}function E5(n,r){const s=r.value?r.value+`
`:"",o={},u=r.lang?r.lang.split(/\s+/):[];u.length>0&&(o.className=["language-"+u[0]]);let d={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function A5(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function M5(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function z5(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),u=Ja(o.toLowerCase()),d=n.footnoteOrder.indexOf(o);let f,x=n.footnoteCounts.get(o);x===void 0?(x=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=d+1,x+=1,n.footnoteCounts.set(o,x);const p={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+u,id:s+"fnref-"+u+(x>1?"-"+x:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,h),n.applyData(r,h)}function O5(n,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function D5(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function Xp(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const u=n.all(r),d=u[0];d&&d.type==="text"?d.value="["+d.value:u.unshift({type:"text",value:"["});const f=u[u.length-1];return f&&f.type==="text"?f.value+=o:u.push({type:"text",value:o}),u}function R5(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return Xp(n,r);const u={src:Ja(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(u.title=o.title);const d={type:"element",tagName:"img",properties:u,children:[]};return n.patch(r,d),n.applyData(r,d)}function L5(n,r){const s={src:Ja(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function U5(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function H5(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return Xp(n,r);const u={href:Ja(o.url||"")};o.title!==null&&o.title!==void 0&&(u.title=o.title);const d={type:"element",tagName:"a",properties:u,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function B5(n,r){const s={href:Ja(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function q5(n,r,s){const o=n.all(r),u=s?Y5(s):Fp(r),d={},f=[];if(typeof r.checked=="boolean"){const y=o[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},o.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let x=-1;for(;++x<o.length;){const y=o[x];(u||x!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
`}),y.type==="element"&&y.tagName==="p"&&!u?f.push(...y.children):f.push(y)}const p=o[o.length-1];p&&(u||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
`});const h={type:"element",tagName:"li",properties:d,children:f};return n.patch(r,h),n.applyData(r,h)}function Y5(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=Fp(s[o])}return r}function Fp(n){const r=n.spread;return r??n.children.length>1}function V5(n,r){const s={},o=n.all(r);let u=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++u<o.length;){const f=o[u];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const d={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,d),n.applyData(r,d)}function G5(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function $5(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function Q5(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function X5(n,r){const s=n.all(r),o=s.shift(),u=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),u.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},x=md(r.children[1]),p=Cp(r.children[r.children.length-1]);x&&p&&(f.position={start:x,end:p}),u.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(u,!0)};return n.patch(r,d),n.applyData(r,d)}function F5(n,r,s){const o=s?s.children:void 0,d=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,x=f?f.length:r.children.length;let p=-1;const h=[];for(;++p<x;){const g=r.children[p],v={},j=f?f[p]:void 0;j&&(v.align=j);let w={type:"element",tagName:d,properties:v,children:[]};g&&(w.children=n.all(g),n.patch(g,w),w=n.applyData(g,w)),h.push(w)}const y={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,y),n.applyData(r,y)}function Z5(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const hx=9,xx=32;function I5(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),u=0;const d=[];for(;o;)d.push(px(r.slice(u,o.index),u>0,!0),o[0]),u=o.index+o[0].length,o=s.exec(r);return d.push(px(r.slice(u),u>0,!1)),d.join("")}function px(n,r,s){let o=0,u=n.length;if(r){let d=n.codePointAt(o);for(;d===hx||d===xx;)o++,d=n.codePointAt(o)}if(s){let d=n.codePointAt(u-1);for(;d===hx||d===xx;)u--,d=n.codePointAt(u-1)}return u>o?n.slice(o,u):""}function K5(n,r){const s={type:"text",value:I5(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function J5(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const P5={blockquote:_5,break:T5,code:E5,delete:A5,emphasis:M5,footnoteReference:z5,heading:O5,html:D5,imageReference:R5,image:L5,inlineCode:U5,linkReference:H5,link:B5,listItem:q5,list:V5,paragraph:G5,root:$5,strong:Q5,table:X5,tableCell:Z5,tableRow:F5,text:K5,thematicBreak:J5,toml:zi,yaml:zi,definition:zi,footnoteDefinition:zi};function zi(){}const Zp=-1,to=0,as=1,Qi=2,vd=3,jd=4,Nd=5,wd=6,Ip=7,Kp=8,gx=typeof self=="object"?self:globalThis,W5=(n,r)=>{const s=(u,d)=>(n.set(d,u),u),o=u=>{if(n.has(u))return n.get(u);const[d,f]=r[u];switch(d){case to:case Zp:return s(f,u);case as:{const x=s([],u);for(const p of f)x.push(o(p));return x}case Qi:{const x=s({},u);for(const[p,h]of f)x[o(p)]=o(h);return x}case vd:return s(new Date(f),u);case jd:{const{source:x,flags:p}=f;return s(new RegExp(x,p),u)}case Nd:{const x=s(new Map,u);for(const[p,h]of f)x.set(o(p),o(h));return x}case wd:{const x=s(new Set,u);for(const p of f)x.add(o(p));return x}case Ip:{const{name:x,message:p}=f;return s(new gx[x](p),u)}case Kp:return s(BigInt(f),u);case"BigInt":return s(Object(BigInt(f)),u);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:x}=new Uint8Array(f);return s(new DataView(x),f)}}return s(new gx[d](f),u)};return o},yx=n=>W5(new Map,n)(0),Ra="",{toString:ej}={},{keys:tj}=Object,Kr=n=>{const r=typeof n;if(r!=="object"||!n)return[to,r];const s=ej.call(n).slice(8,-1);switch(s){case"Array":return[as,Ra];case"Object":return[Qi,Ra];case"Date":return[vd,Ra];case"RegExp":return[jd,Ra];case"Map":return[Nd,Ra];case"Set":return[wd,Ra];case"DataView":return[as,s]}return s.includes("Array")?[as,s]:s.includes("Error")?[Ip,s]:[Qi,s]},Oi=([n,r])=>n===to&&(r==="function"||r==="symbol"),nj=(n,r,s,o)=>{const u=(f,x)=>{const p=o.push(f)-1;return s.set(x,p),p},d=f=>{if(s.has(f))return s.get(f);let[x,p]=Kr(f);switch(x){case to:{let y=f;switch(p){case"bigint":x=Kp,y=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return u([Zp],f)}return u([x,y],f)}case as:{if(p){let v=f;return p==="DataView"?v=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(f)),u([p,[...v]],f)}const y=[],g=u([x,y],f);for(const v of f)y.push(d(v));return g}case Qi:{if(p)switch(p){case"BigInt":return u([p,f.toString()],f);case"Boolean":case"Number":case"String":return u([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=u([x,y],f);for(const v of tj(f))(n||!Oi(Kr(f[v])))&&y.push([d(v),d(f[v])]);return g}case vd:return u([x,f.toISOString()],f);case jd:{const{source:y,flags:g}=f;return u([x,{source:y,flags:g}],f)}case Nd:{const y=[],g=u([x,y],f);for(const[v,j]of f)(n||!(Oi(Kr(v))||Oi(Kr(j))))&&y.push([d(v),d(j)]);return g}case wd:{const y=[],g=u([x,y],f);for(const v of f)(n||!Oi(Kr(v)))&&y.push(d(v));return g}}const{message:h}=f;return u([x,{name:p,message:h}],f)};return d},bx=(n,{json:r,lossy:s}={})=>{const o=[];return nj(!(r||s),!!r,new Map,o)(n),o},Xi=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?yx(bx(n,r)):structuredClone(n):(n,r)=>yx(bx(n,r));function lj(n,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function aj(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function rj(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||lj,o=n.options.footnoteBackLabel||aj,u=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},x=[];let p=-1;for(;++p<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[p]);if(!h)continue;const y=n.all(h),g=String(h.identifier).toUpperCase(),v=Ja(g.toLowerCase());let j=0;const w=[],S=n.footnoteCounts.get(g);for(;S!==void 0&&++j<=S;){w.length>0&&w.push({type:"text",value:" "});let q=typeof s=="string"?s:s(p,j);typeof q=="string"&&(q={type:"text",value:q}),w.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(j>1?"-"+j:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(p,j),className:["data-footnote-backref"]},children:Array.isArray(q)?q:[q]})}const D=y[y.length-1];if(D&&D.type==="element"&&D.tagName==="p"){const q=D.children[D.children.length-1];q&&q.type==="text"?q.value+=" ":D.children.push({type:"text",value:" "}),D.children.push(...w)}else y.push(...w);const E={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:n.wrap(y,!0)};n.patch(h,E),x.push(E)}if(x.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...Xi(f),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(x,!0)},{type:"text",value:`
`}]}}const no=(function(n){if(n==null)return cj;if(typeof n=="function")return lo(n);if(typeof n=="object")return Array.isArray(n)?sj(n):ij(n);if(typeof n=="string")return oj(n);throw new Error("Expected function, string, or object as test")});function sj(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=no(n[s]);return lo(o);function o(...u){let d=-1;for(;++d<r.length;)if(r[d].apply(this,u))return!0;return!1}}function ij(n){const r=n;return lo(s);function s(o){const u=o;let d;for(d in n)if(u[d]!==r[d])return!1;return!0}}function oj(n){return lo(r);function r(s){return s&&s.type===n}}function lo(n){return r;function r(s,o,u){return!!(uj(s)&&n.call(this,s,typeof o=="number"?o:void 0,u||void 0))}}function cj(){return!0}function uj(n){return n!==null&&typeof n=="object"&&"type"in n}const Jp=[],dj=!0,Wu=!1,fj="skip";function Pp(n,r,s,o){let u;typeof r=="function"&&typeof s!="function"?(o=s,s=r):u=r;const d=no(u),f=o?-1:1;x(n,void 0,[])();function x(p,h,y){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const j=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(j?"<"+j+">":""))+")"})}return v;function v(){let j=Jp,w,S,D;if((!r||d(p,h,y[y.length-1]||void 0))&&(j=mj(s(p,y)),j[0]===Wu))return j;if("children"in p&&p.children){const E=p;if(E.children&&j[0]!==fj)for(S=(o?E.children.length:-1)+f,D=y.concat(E);S>-1&&S<E.children.length;){const q=E.children[S];if(w=x(q,S,D)(),w[0]===Wu)return w;S=typeof w[1]=="number"?w[1]:S+f}}return j}}}function mj(n){return Array.isArray(n)?n:typeof n=="number"?[dj,n]:n==null?Jp:[n]}function kd(n,r,s,o){let u,d,f;typeof r=="function"&&typeof s!="function"?(d=void 0,f=r,u=s):(d=r,f=s,u=o),Pp(n,d,x,u);function x(p,h){const y=h[h.length-1],g=y?y.children.indexOf(p):void 0;return f(p,g,y)}}const ed={}.hasOwnProperty,hj={};function xj(n,r){const s=r||hj,o=new Map,u=new Map,d=new Map,f={...P5,...s.handlers},x={all:h,applyData:gj,definitionById:o,footnoteById:u,footnoteCounts:d,footnoteOrder:[],handlers:f,one:p,options:s,patch:pj,wrap:bj};return kd(n,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?o:u,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),x;function p(y,g){const v=y.type,j=x.handlers[v];if(ed.call(x.handlers,v)&&j)return j(x,y,g);if(x.options.passThrough&&x.options.passThrough.includes(v)){if("children"in y){const{children:S,...D}=y,E=Xi(D);return E.children=x.all(y),E}return Xi(y)}return(x.options.unknownHandler||yj)(x,y,g)}function h(y){const g=[];if("children"in y){const v=y.children;let j=-1;for(;++j<v.length;){const w=x.one(v[j],y);if(w){if(j&&v[j-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=vx(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=vx(S.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function pj(n,r){n.position&&(r.position=av(n))}function gj(n,r){let s=r;if(n&&n.data){const o=n.data.hName,u=n.data.hChildren,d=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&d&&Object.assign(s.properties,Xi(d)),"children"in s&&s.children&&u!==null&&u!==void 0&&(s.children=u)}return s}function yj(n,r){const s=r.data||{},o="value"in r&&!(ed.call(s,"hProperties")||ed.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function bj(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
`});++o<n.length;)o&&s.push({type:"text",value:`
`}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
`}),s}function vx(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function jx(n,r){const s=xj(n,r),o=s.one(n,void 0),u=rj(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return u&&d.children.push({type:"text",value:`
`},u),d}function vj(n,r){return n&&"run"in n?async function(s,o){const u=jx(s,{file:o,...r});await n.run(u,o)}:function(s,o){return jx(s,{file:o,...n||r})}}function Nx(n){if(n)throw n}var zu,wx;function jj(){if(wx)return zu;wx=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},d=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var y=n.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var v;for(v in h);return typeof v>"u"||n.call(h,v)},f=function(h,y){s&&y.name==="__proto__"?s(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},x=function(h,y){if(y==="__proto__")if(n.call(h,y)){if(o)return o(h,y).value}else return;return h[y]};return zu=function p(){var h,y,g,v,j,w,S=arguments[0],D=1,E=arguments.length,q=!1;for(typeof S=="boolean"&&(q=S,S=arguments[1]||{},D=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});D<E;++D)if(h=arguments[D],h!=null)for(y in h)g=x(S,y),v=x(h,y),S!==v&&(q&&v&&(d(v)||(j=u(v)))?(j?(j=!1,w=g&&u(g)?g:[]):w=g&&d(g)?g:{},f(S,{name:y,newValue:p(q,w,v)})):typeof v<"u"&&f(S,{name:y,newValue:v}));return S},zu}var Nj=jj();const Ou=Zi(Nj);function td(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function wj(){const n=[],r={run:s,use:o};return r;function s(...u){let d=-1;const f=u.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);x(null,...u);function x(p,...h){const y=n[++d];let g=-1;if(p){f(p);return}for(;++g<u.length;)(h[g]===null||h[g]===void 0)&&(h[g]=u[g]);u=h,y?kj(y,x)(...h):f(null,...h)}}function o(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),r}}function kj(n,r){let s;return o;function o(...f){const x=n.length>f.length;let p;x&&f.push(u);try{p=n.apply(this,f)}catch(h){const y=h;if(x&&s)throw y;return u(y)}x||(p&&p.then&&typeof p.then=="function"?p.then(d,u):p instanceof Error?u(p):d(p))}function u(f,...x){s||(s=!0,r(f,...x))}function d(f){u(null,f)}}const pn={basename:Sj,dirname:Cj,extname:_j,join:Tj,sep:"/"};function Sj(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ds(n);let s=0,o=-1,u=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(d){s=u+1;break}}else o<0&&(d=!0,o=u+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,x=r.length-1;for(;u--;)if(n.codePointAt(u)===47){if(d){s=u+1;break}}else f<0&&(d=!0,f=u+1),x>-1&&(n.codePointAt(u)===r.codePointAt(x--)?x<0&&(o=u):(x=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function Cj(n){if(ds(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function _j(n){ds(n);let r=n.length,s=-1,o=0,u=-1,d=0,f;for(;r--;){const x=n.codePointAt(r);if(x===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),x===46?u<0?u=r:d!==1&&(d=1):u>-1&&(d=-1)}return u<0||s<0||d===0||d===1&&u===s-1&&u===o+1?"":n.slice(u,s)}function Tj(...n){let r=-1,s;for(;++r<n.length;)ds(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":Ej(s)}function Ej(n){ds(n);const r=n.codePointAt(0)===47;let s=Aj(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Aj(n,r){let s="",o=0,u=-1,d=0,f=-1,x,p;for(;++f<=n.length;){if(f<n.length)x=n.codePointAt(f);else{if(x===47)break;x=47}if(x===47){if(!(u===f-1||d===1))if(u!==f-1&&d===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(p=s.lastIndexOf("/"),p!==s.length-1){p<0?(s="",o=0):(s=s.slice(0,p),o=s.length-1-s.lastIndexOf("/")),u=f,d=0;continue}}else if(s.length>0){s="",o=0,u=f,d=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(u+1,f):s=n.slice(u+1,f),o=f-u-1;u=f,d=0}else x===46&&d>-1?d++:d=-1}return s}function ds(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Mj={cwd:zj};function zj(){return"/"}function nd(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Oj(n){if(typeof n=="string")n=new URL(n);else if(!nd(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Dj(n)}function Dj(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(r)}const Du=["history","path","basename","stem","extname","dirname"];class Wp{constructor(r){let s;r?nd(r)?s={path:r}:typeof r=="string"||Rj(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Mj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<Du.length;){const d=Du[o];d in s&&s[d]!==void 0&&s[d]!==null&&(this[d]=d==="history"?[...s[d]]:s[d])}let u;for(u in s)Du.includes(u)||(this[u]=s[u])}get basename(){return typeof this.path=="string"?pn.basename(this.path):void 0}set basename(r){Lu(r,"basename"),Ru(r,"basename"),this.path=pn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?pn.dirname(this.path):void 0}set dirname(r){kx(this.basename,"dirname"),this.path=pn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?pn.extname(this.path):void 0}set extname(r){if(Ru(r,"extname"),kx(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){nd(r)&&(r=Oj(r)),Lu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?pn.basename(this.path,this.extname):void 0}set stem(r){Lu(r,"stem"),Ru(r,"stem"),this.path=pn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const u=this.message(r,s,o);throw u.fatal=!0,u}info(r,s,o){const u=this.message(r,s,o);return u.fatal=void 0,u}message(r,s,o){const u=new vt(r,s,o);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Ru(n,r){if(n&&n.includes(pn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+pn.sep+"`")}function Lu(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function kx(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Rj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Lj=(function(n){const o=this.constructor.prototype,u=o[n],d=function(){return u.apply(d,arguments)};return Object.setPrototypeOf(d,o),d}),Uj={}.hasOwnProperty;class Sd extends Lj{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=wj()}copy(){const r=new Sd;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Ou(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(Bu("data",this.frozen),this.namespace[r]=s,this):Uj.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Bu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const u=s.call(r,...o);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Di(r),o=this.parser||this.Parser;return Uu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),Uu("process",this.parser||this.Parser),Hu("process",this.compiler||this.Compiler),s?u(void 0,s):new Promise(u);function u(d,f){const x=Di(r),p=o.parse(x);o.run(p,x,function(y,g,v){if(y||!g||!v)return h(y);const j=g,w=o.stringify(j,v);qj(w)?v.value=w:v.result=w,h(y,v)});function h(y,g){y||!g?f(y):d?d(g):s(void 0,g)}}}processSync(r){let s=!1,o;return this.freeze(),Uu("processSync",this.parser||this.Parser),Hu("processSync",this.compiler||this.Compiler),this.process(r,u),Cx("processSync","process",s),o;function u(d,f){s=!0,Nx(d),o=f}}run(r,s,o){Sx(r),this.freeze();const u=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?d(void 0,o):new Promise(d);function d(f,x){const p=Di(s);u.run(r,p,h);function h(y,g,v){const j=g||r;y?x(y):f?f(j):o(void 0,j,v)}}}runSync(r,s){let o=!1,u;return this.run(r,s,d),Cx("runSync","run",o),u;function d(f,x){Nx(f),u=x,o=!0}}stringify(r,s){this.freeze();const o=Di(s),u=this.compiler||this.Compiler;return Hu("stringify",u),Sx(r),u(r,o)}use(r,...s){const o=this.attachers,u=this.namespace;if(Bu("use",this.frozen),r!=null)if(typeof r=="function")p(r,s);else if(typeof r=="object")Array.isArray(r)?x(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function d(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;p(y,g)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))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");x(h.plugins),h.settings&&(u.settings=Ou(!0,u.settings,h.settings))}function x(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];d(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let g=-1,v=-1;for(;++g<o.length;)if(o[g][0]===h){v=g;break}if(v===-1)o.push([h,...y]);else if(y.length>0){let[j,...w]=y;const S=o[v][1];td(S)&&td(j)&&(j=Ou(!0,S,j)),o[v]=[h,j,...w]}}}}const Hj=new Sd().freeze();function Uu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Hu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Bu(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sx(n){if(!td(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Cx(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Di(n){return Bj(n)?n:new Wp(n)}function Bj(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function qj(n){return typeof n=="string"||Yj(n)}function Yj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Vj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_x=[],Tx={allowDangerousHtml:!0},Gj=/^(https?|ircs?|mailto|xmpp)$/i,$j=[{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 Qj(n){const r=Xj(n),s=Fj(n);return Zj(r.runSync(r.parse(s),s),n)}function Xj(n){const r=n.rehypePlugins||_x,s=n.remarkPlugins||_x,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Tx}:Tx;return Hj().use(C5).use(s).use(vj,o).use(r)}function Fj(n){const r=n.children||"",s=new Wp;return typeof r=="string"&&(s.value=r),s}function Zj(n,r){const s=r.allowedElements,o=r.allowElement,u=r.components,d=r.disallowedElements,f=r.skipHtml,x=r.unwrapDisallowed,p=r.urlTransform||Ij;for(const y of $j)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Vj+y.id,void 0);return kd(n,h),cv(n,{Fragment:a.Fragment,components:u,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function h(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return f?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let j;for(j in Eu)if(Object.hasOwn(Eu,j)&&Object.hasOwn(y.properties,j)){const w=y.properties[j],S=Eu[j];(S===null||S.includes(y.tagName))&&(y.properties[j]=p(String(w||""),j,y))}}if(y.type==="element"){let j=s?!s.includes(y.tagName):d?d.includes(y.tagName):!1;if(!j&&o&&typeof g=="number"&&(j=!o(y,g,v)),j&&v&&typeof g=="number")return x&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function Ij(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),u=n.indexOf("/");return r===-1||u!==-1&&r>u||s!==-1&&r>s||o!==-1&&r>o||Gj.test(n.slice(0,r))?n:""}function Ex(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,u=s.indexOf(r);for(;u!==-1;)o++,u=s.indexOf(r,u+r.length);return o}function Kj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Jj(n,r,s){const u=no((s||{}).ignore||[]),d=Pj(r);let f=-1;for(;++f<d.length;)Pp(n,"text",x);function x(h,y){let g=-1,v;for(;++g<y.length;){const j=y[g],w=v?v.children:void 0;if(u(j,w?w.indexOf(j):void 0,v))return;v=j}if(v)return p(h,y)}function p(h,y){const g=y[y.length-1],v=d[f][0],j=d[f][1];let w=0;const D=g.children.indexOf(h);let E=!1,q=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const K=H.index,U={index:H.index,input:H.input,stack:[...y,h]};let L=j(...H,U);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?v.lastIndex=K+1:(w!==K&&q.push({type:"text",value:h.value.slice(w,K)}),Array.isArray(L)?q.push(...L):L&&q.push(L),w=K+H[0].length,E=!0),!v.global)break;H=v.exec(h.value)}return E?(w<h.value.length&&q.push({type:"text",value:h.value.slice(w)}),g.children.splice(D,1,...q)):q=[h],D+q.length}}function Pj(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const u=s[o];r.push([Wj(u[0]),eN(u[1])])}return r}function Wj(n){return typeof n=="string"?new RegExp(Kj(n),"g"):n}function eN(n){return typeof n=="function"?n:function(){return n}}const qu="phrasing",Yu=["autolink","link","image","label"];function tN(){return{transforms:[oN],enter:{literalAutolink:lN,literalAutolinkEmail:Vu,literalAutolinkHttp:Vu,literalAutolinkWww:Vu},exit:{literalAutolink:iN,literalAutolinkEmail:sN,literalAutolinkHttp:aN,literalAutolinkWww:rN}}}function nN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qu,notInConstruct:Yu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qu,notInConstruct:Yu},{character:":",before:"[ps]",after:"\\/",inConstruct:qu,notInConstruct:Yu}]}}function lN(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function Vu(n){this.config.enter.autolinkProtocol.call(this,n)}function aN(n){this.config.exit.autolinkProtocol.call(this,n)}function rN(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function sN(n){this.config.exit.autolinkEmail.call(this,n)}function iN(n){this.exit(n)}function oN(n){Jj(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uN]],{ignore:["link","linkReference"]})}function cN(n,r,s,o,u){let d="";if(!eg(u)||(/^w/i.test(r)&&(s=r+s,r="",d="http://"),!dN(s)))return!1;const f=fN(s+o);if(!f[0])return!1;const x={type:"link",title:null,url:d+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[x,{type:"text",value:f[1]}]:x}function uN(n,r,s,o){return!eg(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function dN(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function fN(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const u=Ex(n,"(");let d=Ex(n,")");for(;o!==-1&&u>d;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),d++;return[n,s]}function eg(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Vl(s)||Wi(s))&&(!r||s!==47)}tg.peek=jN;function mN(){this.buffer()}function hN(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function xN(){this.buffer()}function pN(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function gN(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=dn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function yN(n){this.exit(n)}function bN(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=dn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function vN(n){this.exit(n)}function jN(){return"["}function tg(n,r,s,o){const u=s.createTracker(o);let d=u.move("[^");const f=s.enter("footnoteReference"),x=s.enter("reference");return d+=u.move(s.safe(s.associationId(n),{after:"]",before:d})),x(),f(),d+=u.move("]"),d}function NN(){return{enter:{gfmFootnoteCallString:mN,gfmFootnoteCall:hN,gfmFootnoteDefinitionLabelString:xN,gfmFootnoteDefinition:pN},exit:{gfmFootnoteCallString:gN,gfmFootnoteCall:yN,gfmFootnoteDefinitionLabelString:bN,gfmFootnoteDefinition:vN}}}function wN(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:tg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,u,d,f){const x=d.createTracker(f);let p=x.move("[^");const h=d.enter("footnoteDefinition"),y=d.enter("label");return p+=x.move(d.safe(d.associationId(o),{before:p,after:"]"})),y(),p+=x.move("]:"),o.children&&o.children.length>0&&(x.shift(4),p+=x.move((r?`
`:" ")+d.indentLines(d.containerFlow(o,x.current()),r?ng:kN))),h(),p}}function kN(n,r,s){return r===0?n:ng(n,r,s)}function ng(n,r,s){return(s?"":"    ")+n}const SN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lg.peek=AN;function CN(){return{canContainEols:["delete"],enter:{strikethrough:TN},exit:{strikethrough:EN}}}function _N(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:SN}],handlers:{delete:lg}}}function TN(n){this.enter({type:"delete",children:[]},n)}function EN(n){this.exit(n)}function lg(n,r,s,o){const u=s.createTracker(o),d=s.enter("strikethrough");let f=u.move("~~");return f+=s.containerPhrasing(n,{...u.current(),before:f,after:"~"}),f+=u.move("~~"),d(),f}function AN(){return"~"}function MN(n){return n.length}function zN(n,r){const s=r||{},o=(s.align||[]).concat(),u=s.stringLength||MN,d=[],f=[],x=[],p=[];let h=0,y=-1;for(;++y<n.length;){const S=[],D=[];let E=-1;for(n[y].length>h&&(h=n[y].length);++E<n[y].length;){const q=ON(n[y][E]);if(s.alignDelimiters!==!1){const H=u(q);D[E]=H,(p[E]===void 0||H>p[E])&&(p[E]=H)}S.push(q)}f[y]=S,x[y]=D}let g=-1;if(typeof o=="object"&&"length"in o)for(;++g<h;)d[g]=Ax(o[g]);else{const S=Ax(o);for(;++g<h;)d[g]=S}g=-1;const v=[],j=[];for(;++g<h;){const S=d[g];let D="",E="";S===99?(D=":",E=":"):S===108?D=":":S===114&&(E=":");let q=s.alignDelimiters===!1?1:Math.max(1,p[g]-D.length-E.length);const H=D+"-".repeat(q)+E;s.alignDelimiters!==!1&&(q=D.length+q+E.length,q>p[g]&&(p[g]=q),j[g]=q),v[g]=H}f.splice(1,0,v),x.splice(1,0,j),y=-1;const w=[];for(;++y<f.length;){const S=f[y],D=x[y];g=-1;const E=[];for(;++g<h;){const q=S[g]||"";let H="",K="";if(s.alignDelimiters!==!1){const U=p[g]-(D[g]||0),L=d[g];L===114?H=" ".repeat(U):L===99?U%2?(H=" ".repeat(U/2+.5),K=" ".repeat(U/2-.5)):(H=" ".repeat(U/2),K=H):K=" ".repeat(U)}s.delimiterStart!==!1&&!g&&E.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&q==="")&&(s.delimiterStart!==!1||g)&&E.push(" "),s.alignDelimiters!==!1&&E.push(H),E.push(q),s.alignDelimiters!==!1&&E.push(K),s.padding!==!1&&E.push(" "),(s.delimiterEnd!==!1||g!==h-1)&&E.push("|")}w.push(s.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return w.join(`
`)}function ON(n){return n==null?"":String(n)}function Ax(n){const r=typeof n=="string"?n.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function DN(n,r,s,o){const u=s.enter("blockquote"),d=s.createTracker(o);d.move("> "),d.shift(2);const f=s.indentLines(s.containerFlow(n,d.current()),RN);return u(),f}function RN(n,r,s){return">"+(s?"":" ")+n}function LN(n,r){return Mx(n,r.inConstruct,!0)&&!Mx(n,r.notInConstruct,!1)}function Mx(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function zx(n,r,s,o){let u=-1;for(;++u<s.unsafe.length;)if(s.unsafe[u].character===`
`&&LN(s.stack,s.unsafe[u]))return/[ \t]/.test(o.before)?"":" ";return`\\
`}function UN(n,r){const s=String(n);let o=s.indexOf(r),u=o,d=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===u?++d>f&&(f=d):d=1,u=o+r.length,o=s.indexOf(r,u);return f}function HN(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function BN(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function qN(n,r,s,o){const u=BN(s),d=n.value||"",f=u==="`"?"GraveAccent":"Tilde";if(HN(n,s)){const g=s.enter("codeIndented"),v=s.indentLines(d,YN);return g(),v}const x=s.createTracker(o),p=u.repeat(Math.max(UN(d,u)+1,3)),h=s.enter("codeFenced");let y=x.move(p);if(n.lang){const g=s.enter(`codeFencedLang${f}`);y+=x.move(s.safe(n.lang,{before:y,after:" ",encode:["`"],...x.current()})),g()}if(n.lang&&n.meta){const g=s.enter(`codeFencedMeta${f}`);y+=x.move(" "),y+=x.move(s.safe(n.meta,{before:y,after:`
`,encode:["`"],...x.current()})),g()}return y+=x.move(`
`),d&&(y+=x.move(d+`
`)),y+=x.move(p),h(),y}function YN(n,r,s){return(s?"":"    ")+n}function Cd(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function VN(n,r,s,o){const u=Cd(s),d=u==='"'?"Quote":"Apostrophe",f=s.enter("definition");let x=s.enter("label");const p=s.createTracker(o);let h=p.move("[");return h+=p.move(s.safe(s.associationId(n),{before:h,after:"]",...p.current()})),h+=p.move("]: "),x(),!n.url||/[\0- \u007F]/.test(n.url)?(x=s.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(s.safe(n.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(x=s.enter("destinationRaw"),h+=p.move(s.safe(n.url,{before:h,after:n.title?" ":`
`,...p.current()}))),x(),n.title&&(x=s.enter(`title${d}`),h+=p.move(" "+u),h+=p.move(s.safe(n.title,{before:h,after:u,...p.current()})),h+=p.move(u),x()),f(),h}function GN(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Fi(n,r,s){const o=Xa(n),u=Xa(r);return o===void 0?u===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ag.peek=$N;function ag(n,r,s,o){const u=GN(s),d=s.enter("emphasis"),f=s.createTracker(o),x=f.move(u);let p=f.move(s.containerPhrasing(n,{after:u,before:x,...f.current()}));const h=p.charCodeAt(0),y=Fi(o.before.charCodeAt(o.before.length-1),h,u);y.inside&&(p=os(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Fi(o.after.charCodeAt(0),g,u);v.inside&&(p=p.slice(0,-1)+os(g));const j=f.move(u);return d(),s.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},x+p+j}function $N(n,r,s){return s.options.emphasis||"*"}function QN(n,r){let s=!1;return kd(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,Wu}),!!((!n.depth||n.depth<3)&&gd(n)&&(r.options.setext||s))}function XN(n,r,s,o){const u=Math.max(Math.min(6,n.depth||1),1),d=s.createTracker(o);if(QN(n,s)){const y=s.enter("headingSetext"),g=s.enter("phrasing"),v=s.containerPhrasing(n,{...d.current(),before:`
`,after:`
`});return g(),y(),v+`
`+(u===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
`))+1))}const f="#".repeat(u),x=s.enter("headingAtx"),p=s.enter("phrasing");d.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
`,...d.current()});return/^[\t ]/.test(h)&&(h=os(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),p(),x(),h}rg.peek=FN;function rg(n){return n.value||""}function FN(){return"<"}sg.peek=ZN;function sg(n,r,s,o){const u=Cd(s),d=u==='"'?"Quote":"Apostrophe",f=s.enter("image");let x=s.enter("label");const p=s.createTracker(o);let h=p.move("![");return h+=p.move(s.safe(n.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),x(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(x=s.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(s.safe(n.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(x=s.enter("destinationRaw"),h+=p.move(s.safe(n.url,{before:h,after:n.title?" ":")",...p.current()}))),x(),n.title&&(x=s.enter(`title${d}`),h+=p.move(" "+u),h+=p.move(s.safe(n.title,{before:h,after:u,...p.current()})),h+=p.move(u),x()),h+=p.move(")"),f(),h}function ZN(){return"!"}ig.peek=IN;function ig(n,r,s,o){const u=n.referenceType,d=s.enter("imageReference");let f=s.enter("label");const x=s.createTracker(o);let p=x.move("![");const h=s.safe(n.alt,{before:p,after:"]",...x.current()});p+=x.move(h+"]["),f();const y=s.stack;s.stack=[],f=s.enter("reference");const g=s.safe(s.associationId(n),{before:p,after:"]",...x.current()});return f(),s.stack=y,d(),u==="full"||!h||h!==g?p+=x.move(g+"]"):u==="shortcut"?p=p.slice(0,-1):p+=x.move("]"),p}function IN(){return"!"}og.peek=KN;function og(n,r,s){let o=n.value||"",u="`",d=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(o);)u+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++d<s.unsafe.length;){const f=s.unsafe[d],x=s.compilePattern(f);let p;if(f.atBreak)for(;p=x.exec(o);){let h=p.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(p.index+1)}}return u+o+u}function KN(){return"`"}function cg(n,r){const s=gd(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(s===n.url||"mailto:"+s===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}ug.peek=JN;function ug(n,r,s,o){const u=Cd(s),d=u==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let x,p;if(cg(n,s)){const y=s.stack;s.stack=[],x=s.enter("autolink");let g=f.move("<");return g+=f.move(s.containerPhrasing(n,{before:g,after:">",...f.current()})),g+=f.move(">"),x(),s.stack=y,g}x=s.enter("link"),p=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),p(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(p=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(p=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),p(),n.title&&(p=s.enter(`title${d}`),h+=f.move(" "+u),h+=f.move(s.safe(n.title,{before:h,after:u,...f.current()})),h+=f.move(u),p()),h+=f.move(")"),x(),h}function JN(n,r,s){return cg(n,s)?"<":"["}dg.peek=PN;function dg(n,r,s,o){const u=n.referenceType,d=s.enter("linkReference");let f=s.enter("label");const x=s.createTracker(o);let p=x.move("[");const h=s.containerPhrasing(n,{before:p,after:"]",...x.current()});p+=x.move(h+"]["),f();const y=s.stack;s.stack=[],f=s.enter("reference");const g=s.safe(s.associationId(n),{before:p,after:"]",...x.current()});return f(),s.stack=y,d(),u==="full"||!h||h!==g?p+=x.move(g+"]"):u==="shortcut"?p=p.slice(0,-1):p+=x.move("]"),p}function PN(){return"["}function _d(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function WN(n){const r=_d(n),s=n.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function e4(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function fg(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function t4(n,r,s,o){const u=s.enter("list"),d=s.bulletCurrent;let f=n.ordered?e4(s):_d(s);const x=n.ordered?f==="."?")":".":WN(s);let p=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(p=!0),fg(s)===f&&y){let g=-1;for(;++g<n.children.length;){const v=n.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=x),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=d,u(),h}function n4(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function l4(n,r,s,o){const u=n4(s);let d=s.bulletCurrent||_d(s);r&&r.type==="list"&&r.ordered&&(d=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(u==="tab"||u==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const x=s.createTracker(o);x.move(d+" ".repeat(f-d.length)),x.shift(f);const p=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,x.current()),y);return p(),h;function y(g,v,j){return v?(j?"":" ".repeat(f))+g:(j?d:d+" ".repeat(f-d.length))+g}}function a4(n,r,s,o){const u=s.enter("paragraph"),d=s.enter("phrasing"),f=s.containerPhrasing(n,o);return d(),u(),f}const r4=no(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function s4(n,r,s,o){return(n.children.some(function(f){return r4(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function i4(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}mg.peek=o4;function mg(n,r,s,o){const u=i4(s),d=s.enter("strong"),f=s.createTracker(o),x=f.move(u+u);let p=f.move(s.containerPhrasing(n,{after:u,before:x,...f.current()}));const h=p.charCodeAt(0),y=Fi(o.before.charCodeAt(o.before.length-1),h,u);y.inside&&(p=os(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Fi(o.after.charCodeAt(0),g,u);v.inside&&(p=p.slice(0,-1)+os(g));const j=f.move(u+u);return d(),s.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},x+p+j}function o4(n,r,s){return s.options.strong||"*"}function c4(n,r,s,o){return s.safe(n.value,o)}function u4(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function d4(n,r,s){const o=(fg(s)+(s.options.ruleSpaces?" ":"")).repeat(u4(s));return s.options.ruleSpaces?o.slice(0,-1):o}const hg={blockquote:DN,break:zx,code:qN,definition:VN,emphasis:ag,hardBreak:zx,heading:XN,html:rg,image:sg,imageReference:ig,inlineCode:og,link:ug,linkReference:dg,list:t4,listItem:l4,paragraph:a4,root:s4,strong:mg,text:c4,thematicBreak:d4};function f4(){return{enter:{table:m4,tableData:Ox,tableHeader:Ox,tableRow:x4},exit:{codeText:p4,table:h4,tableData:Gu,tableHeader:Gu,tableRow:Gu}}}function m4(n){const r=n._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},n),this.data.inTable=!0}function h4(n){this.exit(n),this.data.inTable=void 0}function x4(n){this.enter({type:"tableRow",children:[]},n)}function Gu(n){this.exit(n)}function Ox(n){this.enter({type:"tableCell",children:[]},n)}function p4(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,g4));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function g4(n,r){return r==="|"?r:n}function y4(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,u=r.stringLength,d=s?" ":"|";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:v,table:f,tableCell:p,tableRow:x}};function f(j,w,S,D){return h(y(j,S,D),j.align)}function x(j,w,S,D){const E=g(j,S,D),q=h([E]);return q.slice(0,q.indexOf(`
`))}function p(j,w,S,D){const E=S.enter("tableCell"),q=S.enter("phrasing"),H=S.containerPhrasing(j,{...D,before:d,after:d});return q(),E(),H}function h(j,w){return zN(j,{align:w,alignDelimiters:o,padding:s,stringLength:u})}function y(j,w,S){const D=j.children;let E=-1;const q=[],H=w.enter("table");for(;++E<D.length;)q[E]=g(D[E],w,S);return H(),q}function g(j,w,S){const D=j.children;let E=-1;const q=[],H=w.enter("tableRow");for(;++E<D.length;)q[E]=p(D[E],j,w,S);return H(),q}function v(j,w,S){let D=hg.inlineCode(j,w,S);return S.stack.includes("tableCell")&&(D=D.replace(/\|/g,"\\$&")),D}}function b4(){return{exit:{taskListCheckValueChecked:Dx,taskListCheckValueUnchecked:Dx,paragraph:j4}}}function v4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:N4}}}function Dx(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function j4(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const u=r.children;let d=-1,f;for(;++d<u.length;){const x=u[d];if(x.type==="paragraph"){f=x;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function N4(n,r,s,o){const u=n.children[0],d=typeof n.checked=="boolean"&&u&&u.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",x=s.createTracker(o);d&&x.move(f);let p=hg.listItem(n,r,s,{...o,...x.current()});return d&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+f}}function w4(){return[tN(),NN(),CN(),f4(),b4()]}function k4(n){return{extensions:[nN(),wN(n),_N(),y4(n),v4()]}}const S4={tokenize:M4,partial:!0},xg={tokenize:z4,partial:!0},pg={tokenize:O4,partial:!0},gg={tokenize:D4,partial:!0},C4={tokenize:R4,partial:!0},yg={name:"wwwAutolink",tokenize:E4,previous:vg},bg={name:"protocolAutolink",tokenize:A4,previous:jg},$n={name:"emailAutolink",tokenize:T4,previous:Ng},jn={};function _4(){return{text:jn}}let Bl=48;for(;Bl<123;)jn[Bl]=$n,Bl++,Bl===58?Bl=65:Bl===91&&(Bl=97);jn[43]=$n;jn[45]=$n;jn[46]=$n;jn[95]=$n;jn[72]=[$n,bg];jn[104]=[$n,bg];jn[87]=[$n,yg];jn[119]=[$n,yg];function T4(n,r,s){const o=this;let u,d;return f;function f(g){return!ld(g)||!Ng.call(o,o.previous)||Td(o.events)?s(g):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),x(g))}function x(g){return ld(g)?(n.consume(g),x):g===64?(n.consume(g),p):s(g)}function p(g){return g===46?n.check(C4,y,h)(g):g===45||g===95||bt(g)?(d=!0,n.consume(g),p):y(g)}function h(g){return n.consume(g),u=!0,p}function y(g){return d&&u&&kt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(g)):s(g)}}function E4(n,r,s){const o=this;return u;function u(f){return f!==87&&f!==119||!vg.call(o,o.previous)||Td(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(S4,n.attempt(xg,n.attempt(pg,d),s),s)(f))}function d(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function A4(n,r,s){const o=this;let u="",d=!1;return f;function f(g){return(g===72||g===104)&&jg.call(o,o.previous)&&!Td(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),u+=String.fromCodePoint(g),n.consume(g),x):s(g)}function x(g){if(kt(g)&&u.length<5)return u+=String.fromCodePoint(g),n.consume(g),x;if(g===58){const v=u.toLowerCase();if(v==="http"||v==="https")return n.consume(g),p}return s(g)}function p(g){return g===47?(n.consume(g),d?h:(d=!0,p)):s(g)}function h(g){return g===null||$i(g)||Fe(g)||Vl(g)||Wi(g)?s(g):n.attempt(xg,n.attempt(pg,y),s)(g)}function y(g){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(g)}}function M4(n,r,s){let o=0;return u;function u(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),u):f===46&&o===3?(n.consume(f),d):s(f)}function d(f){return f===null?s(f):r(f)}}function z4(n,r,s){let o,u,d;return f;function f(h){return h===46||h===95?n.check(gg,p,x)(h):h===null||Fe(h)||Vl(h)||h!==45&&Wi(h)?p(h):(d=!0,n.consume(h),f)}function x(h){return h===95?o=!0:(u=o,o=void 0),n.consume(h),f}function p(h){return u||o||!d?s(h):r(h)}}function O4(n,r){let s=0,o=0;return u;function u(f){return f===40?(s++,n.consume(f),u):f===41&&o<s?d(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(gg,r,d)(f):f===null||Fe(f)||Vl(f)?r(f):(n.consume(f),u)}function d(f){return f===41&&o++,n.consume(f),u}}function D4(n,r,s){return o;function o(x){return x===33||x===34||x===39||x===41||x===42||x===44||x===46||x===58||x===59||x===63||x===95||x===126?(n.consume(x),o):x===38?(n.consume(x),d):x===93?(n.consume(x),u):x===60||x===null||Fe(x)||Vl(x)?r(x):s(x)}function u(x){return x===null||x===40||x===91||Fe(x)||Vl(x)?r(x):o(x)}function d(x){return kt(x)?f(x):s(x)}function f(x){return x===59?(n.consume(x),o):kt(x)?(n.consume(x),f):s(x)}}function R4(n,r,s){return o;function o(d){return n.consume(d),u}function u(d){return bt(d)?s(d):r(d)}}function vg(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||Fe(n)}function jg(n){return!kt(n)}function Ng(n){return!(n===47||ld(n))}function ld(n){return n===43||n===45||n===46||n===95||bt(n)}function Td(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const L4={tokenize:$4,partial:!0};function U4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Y4,continuation:{tokenize:V4},exit:G4}},text:{91:{name:"gfmFootnoteCall",tokenize:q4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:H4,resolveTo:B4}}}}function H4(n,r,s){const o=this;let u=o.events.length;const d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;u--;){const p=o.events[u][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return x;function x(p){if(!f||!f._balanced)return s(p);const h=dn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!d.includes(h.slice(1))?s(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function B4(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},x=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",u,r],["exit",u,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...x),n}function q4(n,r,s){const o=this,u=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let d=0,f;return x;function x(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?s(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(g){if(d>999||g===93&&!f||g===null||g===91||Fe(g))return s(g);if(g===93){n.exit("chunkString");const v=n.exit("gfmFootnoteCallString");return u.includes(dn(o.sliceSerialize(v)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(g)}return Fe(g)||(f=!0),d++,n.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,h):h(g)}}function Y4(n,r,s){const o=this,u=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let d,f=0,x;return p;function p(w){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(w),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(w){return w===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(w),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):s(w)}function y(w){if(f>999||w===93&&!x||w===null||w===91||Fe(w))return s(w);if(w===93){n.exit("chunkString");const S=n.exit("gfmFootnoteDefinitionLabelString");return d=dn(o.sliceSerialize(S)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(w),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),v}return Fe(w)||(x=!0),f++,n.consume(w),w===92?g:y}function g(w){return w===91||w===92||w===93?(n.consume(w),f++,y):y(w)}function v(w){return w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),u.includes(d)||u.push(d),Oe(n,j,"gfmFootnoteDefinitionWhitespace")):s(w)}function j(w){return r(w)}}function V4(n,r,s){return n.check(us,r,n.attempt(L4,r,s))}function G4(n){n.exit("gfmFootnoteDefinition")}function $4(n,r,s){const o=this;return Oe(n,u,"gfmFootnoteDefinitionIndent",5);function u(d){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):s(d)}}function Q4(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:d,resolveAll:u};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function u(f,x){let p=-1;for(;++p<f.length;)if(f[p][0]==="enter"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._close){let h=p;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[p][1].end.offset-f[p][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[p][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[p][1].end)},g={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[p][1].start)},v=[["enter",y,x],["enter",f[h][1],x],["exit",f[h][1],x],["enter",g,x]],j=x.parser.constructs.insideSpan.null;j&&Qt(v,v.length,0,eo(j,f.slice(h+1,p),x)),Qt(v,v.length,0,[["exit",g,x],["enter",f[p][1],x],["exit",f[p][1],x],["exit",y,x]]),Qt(f,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function d(f,x,p){const h=this.previous,y=this.events;let g=0;return v;function v(w){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(w):(f.enter("strikethroughSequenceTemporary"),j(w))}function j(w){const S=Xa(h);if(w===126)return g>1?p(w):(f.consume(w),g++,j);if(g<2&&!s)return p(w);const D=f.exit("strikethroughSequenceTemporary"),E=Xa(w);return D._open=!E||E===2&&!!S,D._close=!S||S===2&&!!E,x(w)}}}class X4{constructor(){this.map=[]}add(r,s,o){F4(this,r,s,o)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let u=o.pop();for(;u;){for(const d of u)r.push(d);u=o.pop()}this.map.length=0}}function F4(n,r,s,o){let u=0;if(!(s===0&&o.length===0)){for(;u<n.map.length;){if(n.map[u][0]===r){n.map[u][1]+=s,n.map[u][2].push(...o);return}u+=1}n.map.push([r,s,o])}}function Z4(n,r){let s=!1;const o=[];for(;r<n.length;){const u=n[r];if(s){if(u[0]==="enter")u[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const d=o.length-1;o[d]=o[d]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function I4(){return{flow:{null:{name:"table",tokenize:K4,resolveAll:J4}}}}function K4(n,r,s){const o=this;let u=0,d=0,f;return x;function x(A){let ae=o.events.length-1;for(;ae>-1;){const W=o.events[ae][1].type;if(W==="lineEnding"||W==="linePrefix")ae--;else break}const ne=ae>-1?o.events[ae][1].type:null,X=ne==="tableHead"||ne==="tableRow"?L:p;return X===L&&o.parser.lazy[o.now().line]?s(A):X(A)}function p(A){return n.enter("tableHead"),n.enter("tableRow"),h(A)}function h(A){return A===124||(f=!0,d+=1),y(A)}function y(A){return A===null?s(A):ye(A)?d>1?(d=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(A),n.exit("lineEnding"),j):s(A):Te(A)?Oe(n,y,"whitespace")(A):(d+=1,f&&(f=!1,u+=1),A===124?(n.enter("tableCellDivider"),n.consume(A),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(A)))}function g(A){return A===null||A===124||Fe(A)?(n.exit("data"),y(A)):(n.consume(A),A===92?v:g)}function v(A){return A===92||A===124?(n.consume(A),g):g(A)}function j(A){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(A):(n.enter("tableDelimiterRow"),f=!1,Te(A)?Oe(n,w,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):w(A))}function w(A){return A===45||A===58?D(A):A===124?(f=!0,n.enter("tableCellDivider"),n.consume(A),n.exit("tableCellDivider"),S):U(A)}function S(A){return Te(A)?Oe(n,D,"whitespace")(A):D(A)}function D(A){return A===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(A),n.exit("tableDelimiterMarker"),E):A===45?(d+=1,E(A)):A===null||ye(A)?K(A):U(A)}function E(A){return A===45?(n.enter("tableDelimiterFiller"),q(A)):U(A)}function q(A){return A===45?(n.consume(A),q):A===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(A),n.exit("tableDelimiterMarker"),H):(n.exit("tableDelimiterFiller"),H(A))}function H(A){return Te(A)?Oe(n,K,"whitespace")(A):K(A)}function K(A){return A===124?w(A):A===null||ye(A)?!f||u!==d?U(A):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(A)):U(A)}function U(A){return s(A)}function L(A){return n.enter("tableRow"),$(A)}function $(A){return A===124?(n.enter("tableCellDivider"),n.consume(A),n.exit("tableCellDivider"),$):A===null||ye(A)?(n.exit("tableRow"),r(A)):Te(A)?Oe(n,$,"whitespace")(A):(n.enter("data"),ue(A))}function ue(A){return A===null||A===124||Fe(A)?(n.exit("data"),$(A)):(n.consume(A),A===92?P:ue)}function P(A){return A===92||A===124?(n.consume(A),ue):ue(A)}}function J4(n,r){let s=-1,o=!0,u=0,d=[0,0,0,0],f=[0,0,0,0],x=!1,p=0,h,y,g;const v=new X4;for(;++s<n.length;){const j=n[s],w=j[1];j[0]==="enter"?w.type==="tableHead"?(x=!1,p!==0&&(Rx(v,r,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(s,0,[["enter",h,r]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(o=!0,g=void 0,d=[0,0,0,0],f=[0,s+1,0,0],x&&(x=!1,y={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(s,0,[["enter",y,r]])),u=w.type==="tableDelimiterRow"?2:y?3:1):u&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(d[1]!==0&&(f[0]=f[1],g=Ri(v,r,d,u,void 0,g),d=[0,0,0,0]),f[2]=s)):w.type==="tableCellDivider"&&(o?o=!1:(d[1]!==0&&(f[0]=f[1],g=Ri(v,r,d,u,void 0,g)),d=f,f=[d[1],s,0,0])):w.type==="tableHead"?(x=!0,p=s):w.type==="tableRow"||w.type==="tableDelimiterRow"?(p=s,d[1]!==0?(f[0]=f[1],g=Ri(v,r,d,u,s,g)):f[1]!==0&&(g=Ri(v,r,f,u,s,g)),u=0):u&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(f[3]=s)}for(p!==0&&Rx(v,r,p,h,y),v.consume(r.events),s=-1;++s<r.events.length;){const j=r.events[s];j[0]==="enter"&&j[1].type==="table"&&(j[1]._align=Z4(r.events,s))}return n}function Ri(n,r,s,o,u,d){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",x="tableContent";s[0]!==0&&(d.end=Object.assign({},Ha(r.events,s[0])),n.add(s[0],0,[["exit",d,r]]));const p=Ha(r.events,s[1]);if(d={type:f,start:Object.assign({},p),end:Object.assign({},p)},n.add(s[1],0,[["enter",d,r]]),s[2]!==0){const h=Ha(r.events,s[2]),y=Ha(r.events,s[3]),g={type:x,start:Object.assign({},h),end:Object.assign({},y)};if(n.add(s[2],0,[["enter",g,r]]),o!==2){const v=r.events[s[2]],j=r.events[s[3]];if(v[1].end=Object.assign({},j[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){const w=s[2]+1,S=s[3]-s[2]-1;n.add(w,S,[])}}n.add(s[3]+1,0,[["exit",g,r]])}return u!==void 0&&(d.end=Object.assign({},Ha(r.events,u)),n.add(u,0,[["exit",d,r]]),d=void 0),d}function Rx(n,r,s,o,u){const d=[],f=Ha(r.events,s);u&&(u.end=Object.assign({},f),d.push(["exit",u,r])),o.end=Object.assign({},f),d.push(["exit",o,r]),n.add(s+1,0,d)}function Ha(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const P4={name:"tasklistCheck",tokenize:ew};function W4(){return{text:{91:P4}}}function ew(n,r,s){const o=this;return u;function u(p){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return Fe(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):s(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),x):s(p)}function x(p){return ye(p)?r(p):Te(p)?n.check({tokenize:tw},r,s)(p):s(p)}}function tw(n,r,s){return Oe(n,o,"whitespace");function o(u){return u===null?s(u):r(u)}}function nw(n){return Op([_4(),U4(),Q4(n),I4(),W4()])}const lw={};function aw(n){const r=this,s=n||lw,o=r.data(),u=o.micromarkExtensions||(o.micromarkExtensions=[]),d=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);u.push(nw(s)),d.push(w4()),f.push(k4(s))}function rw({className:n,children:r}){const[s,o]=O.useState(!1),u=/language-(\w+)/.exec(n||""),d=u?u[1]:"",f=String(r).replace(/\n$/,""),x=()=>{navigator.clipboard.writeText(f),o(!0),setTimeout(()=>o(!1),2e3)};return a.jsxs("div",{className:"my-3 bg-gray-950 rounded-xl overflow-hidden border border-gray-800/80",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsx("span",{className:"text-[11px] text-gray-500 font-mono",children:d||"code"}),a.jsx("button",{onClick:x,className:"text-gray-500 hover:text-gray-300 transition-colors",title:"Copy code",children:s?a.jsx(ql,{className:"w-3.5 h-3.5 text-emerald-400"}):a.jsx(qa,{className:"w-3.5 h-3.5"})})]}),a.jsx("pre",{className:"px-4 py-3 text-[13px] font-mono text-gray-300 overflow-x-auto leading-relaxed",children:a.jsx("code",{children:f})})]})}const sw={h1:({children:n})=>a.jsx("h1",{className:"text-xl font-semibold text-gray-100 mt-5 mb-2 pb-1.5 border-b border-gray-800/50",children:n}),h2:({children:n})=>a.jsx("h2",{className:"text-lg font-semibold text-gray-100 mt-4 mb-2 pb-1 border-b border-gray-800/40",children:n}),h3:({children:n})=>a.jsx("h3",{className:"text-base font-semibold text-gray-100 mt-3 mb-1",children:n}),h4:({children:n})=>a.jsx("h4",{className:"text-sm font-semibold text-gray-200 mt-2.5 mb-1",children:n}),h5:({children:n})=>a.jsx("h5",{className:"text-sm font-medium text-gray-200 mt-2 mb-1",children:n}),h6:({children:n})=>a.jsx("h6",{className:"text-xs font-medium text-gray-300 mt-2 mb-1 uppercase tracking-wide",children:n}),p:({children:n})=>a.jsx("p",{className:"mb-2.5 last:mb-0 leading-relaxed",children:n}),strong:({children:n})=>a.jsx("strong",{className:"font-semibold text-gray-100",children:n}),em:({children:n})=>a.jsx("em",{className:"italic text-gray-300",children:n}),a:({href:n,children:r})=>a.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 underline underline-offset-2 decoration-plutus-400/30 hover:decoration-plutus-300/50 transition-colors",children:r}),ul:({children:n})=>a.jsx("ul",{className:"list-disc list-outside ml-5 mb-3 space-y-1",children:n}),ol:({children:n})=>a.jsx("ol",{className:"list-decimal list-outside ml-5 mb-3 space-y-1",children:n}),li:({children:n})=>a.jsx("li",{className:"text-gray-200 leading-relaxed pl-1",children:n}),code:({className:n,children:r,...s})=>(n==null?void 0:n.includes("language-"))||String(r).includes(`
`)?a.jsx(rw,{className:n,children:r}):a.jsx("code",{className:"px-1.5 py-0.5 bg-gray-800/80 border border-gray-700/40 rounded-md text-plutus-300 text-[13px] font-mono",children:r}),pre:({children:n})=>a.jsx(a.Fragment,{children:n}),blockquote:({children:n})=>a.jsx("blockquote",{className:"border-l-2 border-plutus-500/30 pl-4 my-3 text-gray-400 italic",children:n}),hr:()=>a.jsx("hr",{className:"my-4 border-gray-800/50"}),table:({children:n})=>a.jsx("div",{className:"my-3 overflow-x-auto rounded-xl border border-gray-800",children:a.jsx("table",{className:"w-full text-xs",children:n})}),thead:({children:n})=>a.jsx("thead",{className:"bg-gray-900/60",children:n}),tbody:({children:n})=>a.jsx("tbody",{children:n}),tr:({children:n})=>a.jsx("tr",{className:"border-b border-gray-800/50 last:border-0",children:n}),th:({children:n})=>a.jsx("th",{className:"px-3 py-2 text-left font-semibold text-gray-300",children:n}),td:({children:n})=>a.jsx("td",{className:"px-3 py-2 text-gray-400",children:n}),img:({src:n,alt:r})=>a.jsx("img",{src:n,alt:r||"",className:"max-w-full rounded-xl my-3 border border-gray-800"}),input:({checked:n,...r})=>a.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"mr-1.5 accent-plutus-500 rounded",...r}),del:({children:n})=>a.jsx("del",{className:"text-gray-500 line-through",children:n})};function Lx({content:n}){return a.jsx("div",{className:"markdown-content",children:a.jsx(Qj,{remarkPlugins:[aw],components:sw,children:n})})}const iw={code_editor:d1,code_analysis:op,subprocess:$t,tool_creator:vn,shell:rn,filesystem:od,browser:ss,pc:Fa,connector:cd},ow={code_editor:"text-emerald-400 bg-emerald-500/8 border-emerald-500/15",code_analysis:"text-blue-400 bg-blue-500/8 border-blue-500/15",subprocess:"text-violet-400 bg-violet-500/8 border-violet-500/15",tool_creator:"text-pink-400 bg-pink-500/8 border-pink-500/15",shell:"text-amber-400 bg-amber-500/8 border-amber-500/15",filesystem:"text-cyan-400 bg-cyan-500/8 border-cyan-500/15",pc:"text-blue-400 bg-blue-500/8 border-blue-500/15",connector:"text-violet-400 bg-violet-500/8 border-violet-500/15"},Ux={read:"Reading file",write:"Writing file",edit:"Editing file",append:"Appending to file",delete:"Deleting file",move:"Moving file",copy:"Copying file",find:"Finding files",grep:"Searching in files",diff:"Comparing files",list:"Listing directory",mkdir:"Creating directory",analyze:"Analyzing code",find_functions:"Finding functions",find_classes:"Finding classes",find_imports:"Finding imports",complexity:"Checking complexity",summarize:"Summarizing code",call_graph:"Building call graph",find_todos:"Finding TODOs",symbols:"Listing symbols",spawn:"Running subprocess",spawn_many:"Running parallel tasks",create:"Creating tool",validate:"Validating tool",run:"Running tool",open_app:"Opening app",close_app:"Closing app",open_url:"Opening URL",shell_exec:"Running command",list_processes:"Listing processes",system_info:"Getting system info",snapshot:"Reading page elements",click_ref:"Clicking element",type_ref:"Typing into element",select_ref:"Selecting option",check_ref:"Toggling checkbox",hover_ref:"Hovering element",navigate:"Navigating to URL",browser_back:"Going back",browser_forward:"Going forward",browser_refresh:"Refreshing page",new_tab:"Opening new tab",close_tab:"Closing tab",switch_tab:"Switching tab",list_tabs:"Listing tabs",page_content:"Reading page content",scroll_page:"Scrolling page",keyboard_type:"Typing text",keyboard_press:"Pressing key",keyboard_shortcut:"Using shortcut",mouse_click:"Clicking",mouse_move:"Moving mouse",take_screenshot:"Taking screenshot",send:"Sending message",send_file:"Sending file",run_skill:"Running skill",list_skills:"Listing skills",create_skill:"Creating skill",update_skill:"Updating skill",delete_skill:"Deleting skill"};function cw({name:n,args:r}){const[s,o]=O.useState(!1),u=iw[n]||rn,d=ow[n]||"text-gray-400 bg-gray-500/8 border-gray-500/15",[f,x,p]=d.split(" "),h=r.operation,y=r.action,g=h?Ux[h]||h.replace(/_/g," "):y?Ux[y]||y.replace(/_/g," "):n.replace(/_/g," "),v=r.path||r.file_path||r.directory||"",j=r.command||"",w=r.text||r.value||"",S=r.ref,D=r.url||"",E=r.app_name||"",q=r.skill_name||"";let H="";return S!==void 0?(H=`[ref=${S}]`,w&&(H+=` "${w.slice(0,30)}${w.length>30?"...":""}"`)):D?H=D.length>50?D.slice(0,47)+"...":D:E?H=E:q?H=q:v?H=v.length>50?"..."+v.slice(-47):v:j?H=`$ ${j.slice(0,50)}`:w&&(H=w.length>40?`"${w.slice(0,37)}..."`:`"${w}"`),a.jsxs("div",{className:`border rounded-xl overflow-hidden transition-all ${p}`,children:[a.jsxs("button",{onClick:()=>o(!s),className:`w-full flex items-center gap-3 px-3.5 py-2.5 ${x} hover:brightness-110 transition-all`,children:[a.jsx(u,{className:`w-4 h-4 ${f} flex-shrink-0`}),a.jsxs("div",{className:"flex-1 text-left min-w-0",children:[a.jsx("span",{className:`text-xs font-medium ${f}`,children:g}),H&&a.jsx("span",{className:"text-[11px] text-gray-500 ml-2 font-mono truncate",children:H})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Gn,{className:"w-3 h-3 text-gray-600 animate-pulse"}),s?a.jsx(lp,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx(Gl,{className:"w-3.5 h-3.5 text-gray-500"})]})]}),s&&a.jsxs("div",{className:"px-3.5 py-3 bg-gray-950/60 border-t border-gray-800/50 animate-fade-in",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Parameters"}),a.jsx("div",{className:"space-y-1.5",children:Object.entries(r).map(([K,U])=>a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[11px] text-gray-500 font-mono w-20 flex-shrink-0",children:K}),a.jsx("span",{className:"text-[11px] text-gray-300 font-mono break-all",children:typeof U=="string"?U.length>200?U.slice(0,200)+"...":U:JSON.stringify(U,null,2).slice(0,200)})]},K))})]})]})}function uw({base64:n}){const[r,s]=O.useState(!1);return a.jsxs("div",{className:"bg-gray-950 border border-blue-500/15 rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>s(!r),className:"w-full flex items-center justify-between px-3.5 py-2 bg-blue-500/8 hover:bg-blue-500/12 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(tp,{className:"w-3.5 h-3.5 text-blue-400"}),a.jsx("span",{className:"text-xs font-medium text-blue-400",children:"Screenshot"})]}),r?a.jsx(mp,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx(dp,{className:"w-3.5 h-3.5 text-gray-500"})]}),a.jsx("div",{className:`transition-all duration-300 ${r?"max-h-[600px]":"max-h-48"} overflow-hidden`,children:a.jsx("img",{src:`data:image/png;base64,${n}`,alt:"Screenshot",className:"w-full h-auto cursor-pointer",onClick:()=>s(!r)})})]})}function dw({base64:n,fileName:r,caption:s}){var x;const[o,u]=O.useState(!1),d=((x=r.split(".").pop())==null?void 0:x.toLowerCase())||"png",f=d==="jpg"||d==="jpeg"?"image/jpeg":d==="gif"?"image/gif":d==="webp"?"image/webp":"image/png";return a.jsxs("div",{className:"bg-gray-950 border border-violet-500/15 rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>u(!o),className:"w-full flex items-center justify-between px-3.5 py-2 bg-violet-500/8 hover:bg-violet-500/12 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(tp,{className:"w-3.5 h-3.5 text-violet-400"}),a.jsx("span",{className:"text-xs font-medium text-violet-400",children:s||r})]}),o?a.jsx(mp,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx(dp,{className:"w-3.5 h-3.5 text-gray-500"})]}),a.jsx("div",{className:`transition-all duration-300 ${o?"max-h-[600px]":"max-h-48"} overflow-hidden`,children:a.jsx("img",{src:`data:${f};base64,${n}`,alt:s||r,className:"w-full h-auto cursor-pointer",onClick:()=>u(!o)})})]})}function fw({fileName:n,sizeKB:r,filePath:s,caption:o}){const u=parseInt(r)>=1024?`${(parseInt(r)/1024).toFixed(1)} MB`:`${r} KB`,d=`/api/files?path=${encodeURIComponent(s)}`;return a.jsx("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-gray-900 border border-gray-800 flex items-center justify-center flex-shrink-0",children:a.jsx(Yh,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-200 truncate",children:n}),a.jsxs("p",{className:"text-xs text-gray-500",children:[u,o?` — ${o}`:""]})]}),a.jsxs("a",{href:d,download:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 text-xs font-medium transition-colors border border-gray-700/50",children:[a.jsx(Yh,{className:"w-3.5 h-3.5"})," Download"]})]})})}function mw({content:n}){const[r,s]=O.useState(!1),[o,u]=O.useState(!1),d=n.split(`
`),f=d.slice(0,15),x=d.length>15,p=y=>{y.stopPropagation(),navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),2e3)},h=(y,g)=>{var S,D;const v=y.match(/\[ref=(\d+)\]/),j=((D=(S=y.match(/^(\s*)/))==null?void 0:S[1])==null?void 0:D.length)||0;let w="text-gray-400";if(y.includes("button")?w="text-violet-400":y.includes("link")?w="text-blue-400":y.includes("textbox")||y.includes("input")||y.includes("textarea")?w="text-emerald-400":y.includes("heading")?w="text-amber-400":y.includes("img")||y.includes("image")?w="text-pink-400":y.includes("checkbox")||y.includes("radio")?w="text-cyan-400":(y.includes("select")||y.includes("combobox"))&&(w="text-orange-400"),v){const E=v[1],q=y.slice(0,y.indexOf("[ref=")),H=y.slice(y.indexOf("]")+1);return a.jsxs("div",{className:`${w} whitespace-pre hover:bg-white/5 px-1 rounded`,style:{paddingLeft:`${j*8+4}px`},children:[q.trim(),a.jsxs("span",{className:"bg-blue-500/15 text-blue-300 px-1 rounded font-bold text-[10px] mx-1",children:["ref=",E]}),H]},g)}return a.jsx("div",{className:`${w} whitespace-pre px-1`,style:{paddingLeft:`${j*8+4}px`},children:y.trim()},g)};return a.jsxs("div",{className:"bg-gray-950 border border-blue-500/15 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-blue-500/8 border-b border-blue-500/10",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-medium text-blue-400",children:"Accessibility Tree"}),a.jsxs("span",{className:"text-[10px] text-gray-500",children:[d.length," elements"]})]}),a.jsx("button",{onClick:p,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(qa,{className:"w-3 h-3"})})]}),a.jsx("div",{className:"py-2 text-xs font-mono overflow-x-auto max-h-80 overflow-y-auto",children:(r?d:f).map((y,g)=>h(y,g))}),x&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-blue-400 hover:text-blue-300 bg-blue-500/5 border-t border-blue-500/10 transition-colors",children:r?"Show less":`Show all ${d.length} elements`})]})}function hw({content:n}){const[r,s]=O.useState(!1),[o,u]=O.useState(!1);if(n.startsWith("__SCREENSHOT__:"))return a.jsx(uw,{base64:n.replace("__SCREENSHOT__:","")});if(n.startsWith("__ATTACHMENT_IMAGE__:")){const v=n.replace("__ATTACHMENT_IMAGE__:",""),j=v.indexOf(":"),w=v.slice(0,j),S=v.slice(j+1),D=S.indexOf(`
`),E=D>=0?S.slice(0,D):S,q=D>=0?S.slice(D+1):"";return a.jsx(dw,{base64:E,fileName:w,caption:q})}if(n.startsWith("__ATTACHMENT_FILE__:")){const j=n.replace("__ATTACHMENT_FILE__:","").split(":"),w=j[0]||"file",S=j[1]||"0",D=j.slice(2).join(":"),E=D.indexOf(" — "),q=E>=0?D.slice(0,E):D,H=E>=0?D.slice(E+3):"";return a.jsx(fw,{fileName:w,sizeKB:S,filePath:q,caption:H})}if(n.includes("[ref=")&&(n.includes("button")||n.includes("link")||n.includes("textbox")||n.includes("heading")))return a.jsx(mw,{content:n});const f=n.length>300,x=n.includes("@@")||n.includes("--- ")||n.includes("+++ "),p=n.trim().startsWith("{")||n.trim().startsWith("["),h=n.startsWith("[ERROR]")||n.toLowerCase().includes("error:"),y=v=>{v.stopPropagation(),navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),2e3)};if(x)return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ii,{className:"w-3.5 h-3.5 text-gray-500"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"File Changes"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(qa,{className:"w-3 h-3"})})]}),a.jsx("pre",{className:"px-3.5 py-2.5 text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto",children:n.split(`
`).map((v,j)=>{let w="text-gray-400";return v.startsWith("+")&&!v.startsWith("+++")?w="text-emerald-400 bg-emerald-500/5":v.startsWith("-")&&!v.startsWith("---")?w="text-red-400 bg-red-500/5":v.startsWith("@@")?w="text-blue-400":(v.startsWith("---")||v.startsWith("+++"))&&(w="text-gray-500 font-bold"),a.jsx("div",{className:`${w} px-1 whitespace-pre-wrap`,children:v},j)})})]});if(h)return a.jsx("div",{className:"bg-red-500/5 border border-red-500/15 rounded-xl px-4 py-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(yn,{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5"}),a.jsx("pre",{className:"text-xs text-red-300 font-mono whitespace-pre-wrap",children:n})]})});if(p){let v;try{v=JSON.parse(n)}catch{v=null}if(v){const j=JSON.stringify(v,null,2),w=r?j:j.slice(0,300);return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-3.5 h-3.5 text-emerald-400"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"Result"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(qa,{className:"w-3 h-3"})})]}),a.jsxs("pre",{className:"px-3.5 py-2.5 text-xs font-mono text-gray-300 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:[w,!r&&j.length>300&&"..."]}),j.length>300&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-gray-500 hover:text-gray-300 bg-gray-900/50 border-t border-gray-800/50 transition-colors",children:r?"Show less":"Show more"})]})}}const g=r?n:n.slice(0,300);return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Za,{className:"w-3.5 h-3.5 text-gray-500"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"Output"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(qa,{className:"w-3 h-3"})})]}),a.jsxs("pre",{className:"px-3.5 py-2.5 text-xs font-mono text-gray-300 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:[g,!r&&f&&"..."]}),f&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-gray-500 hover:text-gray-300 bg-gray-900/50 border-t border-gray-800/50 transition-colors",children:r?"Show less":`Show more (${n.length} chars)`})]})}function xw({message:n,send:r}){const{role:s,content:o,tool_calls:u}=n;if(s==="user")return a.jsx("div",{className:"flex justify-end py-2 animate-slide-up",children:a.jsx("div",{className:"max-w-xl",children:a.jsx("div",{className:"bg-plutus-600 text-white px-4 py-3 rounded-2xl rounded-br-lg text-sm leading-relaxed",children:o})})});if(s==="assistant"){const d=typeof o=="string"?o:String(o||"");if(d.startsWith("__WORKER_RESULT__:")){const f=d.replace("__WORKER_RESULT__:",""),x=f.indexOf(":"),p=x>=0?f.slice(0,x):"Worker",h=x>=0?f.slice(x+1):f,y=h.indexOf(":"),g=y>=0?h.slice(0,y):"",v=y>=0?h.slice(y+1):h;return a.jsx("div",{className:"py-2 animate-slide-up",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(bl,{className:"w-3.5 h-3.5 text-amber-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-amber-300",children:p}),g&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-md bg-amber-500/10 text-amber-400/70 font-mono",children:g})]}),a.jsx("div",{className:"text-sm leading-relaxed text-gray-200",children:a.jsx(Lx,{content:v})})]})]})})}return a.jsx("div",{className:"py-2 animate-slide-up",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg bg-plutus-600/10 border border-plutus-500/15 flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(ep,{className:"w-3.5 h-3.5 text-plutus-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[o&&a.jsx("div",{className:"text-sm leading-relaxed text-gray-200",children:a.jsx(Lx,{content:typeof o=="string"?o:String(o)})}),u&&u.length>0&&a.jsx("div",{className:`${o?"mt-3":""} space-y-2`,children:u.map(f=>a.jsx(cw,{name:f.name,args:f.arguments,id:f.id},f.id))})]})]})})}if(s==="tool")return a.jsx("div",{className:"py-1 pl-10 animate-fade-in",children:a.jsx(hw,{content:o||""})});if(s==="system"){if(o!=null&&o.startsWith("Approval needed"))return a.jsx(D1,{message:o,send:r,approvalId:n.approval_id??void 0});if(o!=null&&o.includes("Computer Use mode")||o!=null&&o.includes("Standard mode")){const d=o.includes("Computer Use mode");return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:`px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 ${d?"bg-blue-500/8 text-blue-400 border border-blue-500/15":"bg-emerald-500/8 text-emerald-400 border border-emerald-500/15"}`,children:[d?a.jsx(Fa,{className:"w-3 h-3"}):a.jsx(rn,{className:"w-3 h-3"}),o]})})}if(typeof o=="string"&&o.startsWith("__WORKER_STARTED__:")){const d=o.replace("__WORKER_STARTED__:",""),f=d.indexOf(":"),x=f>=0?d.slice(0,f):d,p=f>=0?d.slice(f+1):"";return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-2 bg-amber-500/8 text-amber-400/80 border border-amber-500/12",children:[a.jsx(bl,{className:"w-3 h-3"}),a.jsxs("span",{children:["Worker ",a.jsx("strong",{children:x})," dispatched"]}),a.jsx("span",{className:"text-[10px] font-mono text-amber-400/50",children:p})]})})}if(typeof o=="string"&&o.startsWith("[HEARTBEAT]"))return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-rose-500/8 text-rose-400/80 border border-rose-500/12",children:[a.jsx(Ji,{className:"w-3 h-3"}),a.jsx("span",{children:"Heartbeat"})]})});if(typeof o=="string"&&o.startsWith("[SYSTEM NOTIFICATION]")){const d=o.replace(`[SYSTEM NOTIFICATION]
`,"").replace("[SYSTEM NOTIFICATION]","").trim();return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-blue-500/8 text-blue-400/80 border border-blue-500/12 max-w-lg truncate",children:[a.jsx($a,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d||"System notification"})]})})}if(typeof o=="string"&&o.startsWith("[SYSTEM]")){const d=o.replace("[SYSTEM]","").trim();return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-gray-500/8 text-gray-400 border border-gray-500/12 max-w-lg",children:[a.jsx($a,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d})]})})}return o!=null&&o.startsWith("Step ")?a.jsx("div",{className:"flex items-center justify-center py-1 animate-fade-in",children:a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:o})}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 animate-fade-in",children:[a.jsx(Yl,{className:"w-3.5 h-3.5 text-amber-400"}),a.jsx("span",{className:"text-xs text-gray-500",children:o})]})}return null}const pw=[{id:"anthropic",label:"Anthropic",icon:"A",color:"from-orange-500 to-amber-600"},{id:"openai",label:"OpenAI",icon:"O",color:"from-emerald-500 to-teal-600"},{id:"ollama",label:"Ollama",icon:"L",color:"from-blue-500 to-indigo-600"}],Hx={anthropic:[{id:"claude-opus-4-6",label:"Opus 4-6"},{id:"claude-sonnet-4-6",label:"Sonnet 4-6"},{id:"claude-haiku-4-5",label:"Haiku 4-5"}],openai:[{id:"gpt-5.2",label:"GPT-5.2"},{id:"gpt-5",label:"GPT-5"},{id:"gpt-4.1",label:"GPT-4.1"},{id:"gpt-4.1-mini",label:"GPT-4.1 Mini"},{id:"o3",label:"o3"},{id:"o4-mini",label:"o4-mini"}],ollama:[{id:"llama3.2",label:"Llama 3.2"},{id:"mistral",label:"Mistral"}]},gw=[{id:"observer",label:"Observer",color:"text-gray-400 bg-gray-500/10 border-gray-500/30"},{id:"assistant",label:"Assistant",color:"text-blue-400 bg-blue-500/10 border-blue-500/30"},{id:"operator",label:"Operator",color:"text-amber-400 bg-amber-500/10 border-amber-500/30"},{id:"autonomous",label:"Autonomous",color:"text-red-400 bg-red-500/10 border-red-500/30"}];function yw(){var L,$,ue,P;const[n,r]=O.useState(!1),[s,o]=O.useState(null),[u,d]=O.useState(null),[f,x]=O.useState(!1),[p,h]=O.useState(!1),y=O.useRef(null),{currentTier:g,setCurrentTier:v}=Ie(),j=O.useCallback(()=>{fe.getConfig().then(o).catch(()=>{}),fe.getHeartbeatStatus().then(A=>d(A)).catch(()=>{})},[]);O.useEffect(()=>{if(n){j();const A=window.setInterval(()=>{fe.getHeartbeatStatus().then(ae=>d(ae)).catch(()=>{})},5e3);return()=>window.clearInterval(A)}},[n,j]),O.useEffect(()=>{if(!n)return;const A=ae=>{y.current&&!y.current.contains(ae.target)&&r(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[n]),O.useEffect(()=>{if(!n)return;const A=ae=>{ae.key==="Escape"&&r(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[n]);const w=async A=>{x(!0),h(!1);try{await fe.updateConfig(A),h(!0);const ae=await fe.getConfig();o(ae),setTimeout(()=>h(!1),2e3)}catch(ae){console.error("Failed to save:",ae)}finally{x(!1)}},S=async A=>{try{await fe.setTier(A),v(A)}catch(ae){console.error("Failed to set tier:",ae)}},D=async()=>{try{if(u!=null&&u.running){const A=await fe.stopHeartbeat();d(A)}else{const A=await fe.startHeartbeat();d(A)}}catch(A){console.error("Failed to toggle heartbeat:",A)}},E=((L=s==null?void 0:s.model)==null?void 0:L.provider)||"anthropic",q=(($=s==null?void 0:s.model)==null?void 0:$.model)||"",H=((ue=s==null?void 0:s.model)==null?void 0:ue.temperature)??.7,K=((P=s==null?void 0:s.agent)==null?void 0:P.max_tool_rounds)||25,U=Hx[E]||[];return a.jsxs("div",{className:"relative",ref:y,children:[a.jsx("button",{onClick:()=>r(!n),className:`flex-shrink-0 w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${n?"bg-plutus-600 text-white":"bg-gray-700/50 hover:bg-gray-700 text-gray-400 hover:text-gray-200"}`,title:"Command Center",children:a.jsx(yp,{className:"w-4 h-4"})}),n&&s&&a.jsxs("div",{className:"absolute bottom-12 left-0 w-[380px] bg-[#12122a] border border-gray-800/80 rounded-2xl shadow-2xl shadow-black/40 overflow-hidden z-50 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-800/60",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Qh,{className:"w-4 h-4 text-plutus-400"}),a.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Command Center"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[p&&a.jsxs("span",{className:"text-xs text-emerald-400 flex items-center gap-1",children:[a.jsx(qe,{className:"w-3 h-3"}),"Saved"]}),a.jsx("button",{onClick:()=>r(!1),className:"text-gray-500 hover:text-gray-300 p-0.5 rounded transition-colors",children:a.jsx(Qa,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"max-h-[480px] overflow-y-auto p-4 space-y-4",children:[a.jsxs(Li,{icon:an,iconColor:"text-plutus-400 bg-plutus-500/10",title:"Model",children:[a.jsx("div",{className:"flex gap-1.5 mb-3",children:pw.map(A=>a.jsxs("button",{onClick:()=>{var X;const ae=Hx[A.id],ne=((X=ae==null?void 0:ae[0])==null?void 0:X.id)||q;w({model:{provider:A.id,model:ne}})},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${E===A.id?"bg-plutus-500/15 text-plutus-300 border border-plutus-500/30":"bg-gray-800/40 text-gray-400 border border-gray-800/40 hover:border-gray-700/60 hover:text-gray-300"}`,children:[a.jsx("span",{className:`w-4 h-4 rounded text-[9px] font-bold bg-gradient-to-br ${A.color} text-white flex items-center justify-center`,children:A.icon}),A.label]},A.id))}),a.jsxs("div",{className:"relative mb-3",children:[a.jsx("select",{value:q,onChange:A=>w({model:{model:A.target.value}}),className:"w-full appearance-none bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 pr-8 text-sm text-gray-200 focus:outline-none focus:border-plutus-500/50 cursor-pointer",children:U.map(A=>a.jsx("option",{value:A.id,children:A.label},A.id))}),a.jsx(Gl,{className:"w-3.5 h-3.5 text-gray-500 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("span",{className:"text-xs text-gray-500",children:"Temperature"}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded",children:H})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:H,onChange:A=>w({model:{temperature:parseFloat(A.target.value)}}),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"Precise"}),a.jsx("span",{children:"Creative"})]})]})]}),a.jsx(Li,{icon:bn,iconColor:"text-amber-400 bg-amber-500/10",title:"Guardrails",children:a.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:gw.map(A=>a.jsx("button",{onClick:()=>S(A.id),className:`px-2 py-1.5 rounded-lg text-xs font-medium border transition-all ${g===A.id?A.color:"text-gray-500 bg-gray-800/30 border-gray-800/40 hover:border-gray-700/50 hover:text-gray-400"}`,children:A.label},A.id))})}),a.jsx(Li,{icon:Ji,iconColor:"text-rose-400 bg-rose-500/10",title:"Heartbeat",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.running)&&!(u!=null&&u.paused)&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active",a.jsxs("span",{className:"text-gray-500 ml-1",children:[u.consecutive_beats,"/",u.max_consecutive]})]}),(u==null?void 0:u.paused)&&a.jsx("span",{className:"text-xs text-amber-400",children:"Paused"}),u&&!u.running&&!u.paused&&a.jsx("span",{className:"text-xs text-gray-500",children:"Off"})]}),a.jsx("button",{onClick:D,className:`flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border transition-colors ${u!=null&&u.running?"border-red-500/30 bg-red-500/10 text-red-400 hover:bg-red-500/20":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"}`,children:u!=null&&u.running?a.jsxs(a.Fragment,{children:[a.jsx(Pi,{className:"w-3 h-3"})," Stop"]}):a.jsxs(a.Fragment,{children:[a.jsx(Za,{className:"w-3 h-3"})," Start"]})})]})}),a.jsx(Li,{icon:Qh,iconColor:"text-blue-400 bg-blue-500/10",title:"Agent",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("span",{className:"text-xs text-gray-300",children:"Max Tool Rounds"}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded",children:K})]}),a.jsx("input",{type:"range",min:"5",max:"100",step:"5",value:K,onChange:A=>w({agent:{max_tool_rounds:parseInt(A.target.value)||25}}),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"5"}),a.jsx("span",{children:"50"}),a.jsx("span",{children:"100"})]})]})})]}),a.jsxs("div",{className:"px-4 py-2.5 border-t border-gray-800/60 flex items-center justify-between",children:[a.jsx("button",{onClick:()=>{r(!1),Ie.getState().setView("settings")},className:"text-xs text-gray-500 hover:text-plutus-400 transition-colors",children:"Open full settings"}),f&&a.jsx("span",{className:"text-xs text-gray-500",children:"Saving..."})]})]})]})}function Li({icon:n,iconColor:r,title:s,children:o}){const[u,d]=r.split(" ").length>=2?[r.split(" ")[1],r.split(" ")[0]]:["bg-gray-500/10","text-gray-400"];return a.jsxs("div",{className:"bg-gray-800/20 rounded-xl border border-gray-800/40 p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("div",{className:`w-6 h-6 rounded-md ${u} flex items-center justify-center`,children:a.jsx(n,{className:`w-3.5 h-3.5 ${d}`})}),a.jsx("span",{className:"text-xs font-semibold text-gray-300",children:s})]}),o]})}function bw({onSend:n,onStop:r,disabled:s}){const[o,u]=O.useState(""),d=O.useRef(null),{isProcessing:f}=Ie();O.useEffect(()=>{const g=d.current;if(!g)return;g.style.height="24px";const v=g.scrollHeight;g.style.height=Math.min(v,160)+"px"},[o]),O.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]);const x=()=>{const g=o.trim();!g||s||(n(g),u(""),d.current&&(d.current.style.height="24px"))},p=g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),x())},h=()=>{r&&r()},y=o.trim().length>0;return a.jsx("div",{className:"bg-gray-950/80 backdrop-blur-md px-4 pt-2 pb-4",children:a.jsx("div",{className:"max-w-3xl mx-auto",children:a.jsxs("div",{className:"relative bg-gray-900 border border-gray-800 rounded-2xl shadow-lg shadow-black/20 transition-all focus-within:border-gray-700 focus-within:shadow-xl focus-within:shadow-black/30",children:[a.jsx("textarea",{ref:d,value:o,onChange:g=>u(g.target.value),onKeyDown:p,placeholder:f?"Plutus is working...":"Message Plutus...",disabled:s,rows:1,className:"w-full bg-transparent border-none outline-none text-sm text-gray-100 placeholder-gray-600 resize-none leading-6 px-4 pt-3.5 pb-12",style:{height:"24px",minHeight:"24px",maxHeight:"160px"}}),a.jsxs("div",{className:"absolute bottom-0 left-0 right-0 flex items-center justify-between px-3 pb-2.5",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(yw,{}),a.jsx("span",{className:"text-[11px] text-gray-600 ml-1 select-none",children:f?"Working on your task":"Enter to send"})]}),f?a.jsx("button",{onClick:h,className:"w-7 h-7 rounded-lg bg-red-500/90 hover:bg-red-500 flex items-center justify-center transition-colors",title:"Stop current task",children:a.jsx(Pi,{className:"w-3 h-3 text-white fill-white"})}):a.jsx("button",{onClick:x,disabled:s||!y,className:`w-7 h-7 rounded-lg flex items-center justify-center transition-all ${y?"bg-plutus-600 hover:bg-plutus-500 text-white shadow-sm shadow-plutus-600/30":"bg-gray-800 text-gray-600 cursor-not-allowed"}`,children:a.jsx(r1,{className:"w-4 h-4",strokeWidth:2.5})})]})]})})})}function vw({send:n}){const{messages:r,isProcessing:s,keyConfigured:o}=Ie(),u=O.useRef(null);O.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[r]);const d=x=>{Ie.getState().addMessage({role:"user",content:x}),n({type:"chat",content:x})},f=()=>{n({type:"stop_task"})};return a.jsxs("div",{className:"flex h-full flex-col flex-1 min-h-0",children:[a.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-6 space-y-1",children:[r.length===0?o?a.jsx(Nw,{onSend:d}):a.jsx(jw,{}):r.map((x,p)=>a.jsx(xw,{message:x,send:n},p)),s&&a.jsxs("div",{className:"flex items-center gap-3 py-4 px-1 animate-fade-in",children:[a.jsx("div",{className:"w-7 h-7 rounded-full bg-plutus-600/15 flex items-center justify-center flex-shrink-0",children:a.jsxs("div",{className:"dot-pulse flex items-center gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"})]})}),a.jsx("span",{className:"text-sm text-gray-500",children:"Thinking..."})]})]})}),a.jsx(bw,{onSend:d,onStop:f,disabled:s||!o})]})}function jw(){return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center mb-5",children:a.jsx(f1,{className:"w-7 h-7 text-amber-400"})}),a.jsx("h3",{className:"text-xl font-semibold text-gray-100 mb-2",children:"API Key Required"}),a.jsx("p",{className:"text-gray-400 max-w-sm text-sm leading-relaxed mb-2",children:"Configure your API key in Settings to get started."}),a.jsx("p",{className:"text-gray-600 max-w-sm text-xs leading-relaxed mb-6",children:"Your key is stored locally and never leaves your machine."}),a.jsx("button",{onClick:()=>Ie.getState().setView("settings"),className:"px-5 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium transition-colors",children:"Go to Settings"})]})}function Nw({onSend:n}){const r=[{icon:Ki,color:"text-blue-400",bg:"bg-blue-500/8 border-blue-500/10",label:"Browse the Web",description:"Navigate sites, read content, fill forms"},{icon:g1,color:"text-violet-400",bg:"bg-violet-500/8 border-violet-500/10",label:"Control Your PC",description:"Click, type, open apps, manage files"},{icon:an,color:"text-emerald-400",bg:"bg-emerald-500/8 border-emerald-500/10",label:"Learn & Improve",description:"Creates reusable skills over time"},{icon:Px,color:"text-amber-400",bg:"bg-amber-500/8 border-amber-500/10",label:"Automate Anything",description:"Chain actions, schedule tasks"}],s=["Open Chrome and search for the latest AI news","Send a message on Telegram","Open Notepad and write a quick to-do list","Find and organize my Downloads folder","Check my email for anything important","Help me research a topic and summarize it"];return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-16",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-plutus-500/20 to-violet-500/20 border border-plutus-500/10 flex items-center justify-center mb-6",children:a.jsx($t,{className:"w-6 h-6 text-plutus-400"})}),a.jsx("h2",{className:"text-2xl font-semibold text-gray-100 mb-2 tracking-tight",children:"What can I help you with?"}),a.jsx("p",{className:"text-gray-500 max-w-md text-sm leading-relaxed mb-10",children:"Describe what you need in plain English. I can browse the web, control apps, manage files, and automate tasks."}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 max-w-2xl w-full mb-10",children:r.map(o=>{const u=o.icon;return a.jsxs("div",{className:`flex flex-col items-center gap-2.5 p-4 rounded-xl border ${o.bg} transition-colors hover:bg-gray-800/40`,children:[a.jsx(u,{className:`w-5 h-5 ${o.color}`}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-medium text-gray-200 block",children:o.label}),a.jsx("span",{className:"text-[11px] text-gray-500 leading-snug mt-0.5 block",children:o.description})]})]},o.label)})}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 max-w-2xl w-full",children:s.map(o=>a.jsxs("button",{onClick:()=>n(o),className:"group text-left px-4 py-3 rounded-xl border border-gray-800/60 bg-gray-900/40 hover:bg-gray-800/50 hover:border-gray-700/60 text-sm text-gray-400 hover:text-gray-200 transition-all flex items-center gap-3",children:[a.jsx("span",{className:"flex-1",children:o}),a.jsx(Wx,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400 transition-colors flex-shrink-0 opacity-0 group-hover:opacity-100"})]},o))})]})}const Bx={emerald:{icon:"bg-emerald-500/10 text-emerald-400",glow:"shadow-emerald-500/5"},red:{icon:"bg-red-500/10 text-red-400",glow:"shadow-red-500/5"},plutus:{icon:"bg-plutus-500/10 text-plutus-400",glow:"shadow-plutus-500/5"},blue:{icon:"bg-blue-500/10 text-blue-400",glow:"shadow-blue-500/5"},gray:{icon:"bg-gray-500/10 text-gray-400",glow:""},amber:{icon:"bg-amber-500/10 text-amber-400",glow:"shadow-amber-500/5"},purple:{icon:"bg-purple-500/10 text-purple-400",glow:"shadow-purple-500/5"},rose:{icon:"bg-rose-500/10 text-rose-400",glow:"shadow-rose-500/5"}};function Ui({icon:n,label:r,value:s,sublabel:o,color:u,capitalize:d}){const f=Bx[u]||Bx.gray;return a.jsxs("div",{className:`bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-4 ${f.glow}`,children:[a.jsx("div",{className:"flex items-center justify-between mb-3",children:a.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${f.icon}`,children:a.jsx(n,{className:"w-4.5 h-4.5"})})}),a.jsx("p",{className:`text-2xl font-bold text-gray-100 tracking-tight ${d?"capitalize":""}`,children:s}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:r}),o&&a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:o})]})}const qx={allowed:{icon:qe,color:"text-emerald-400",bg:"bg-emerald-500/10",label:"Allowed"},denied:{icon:yn,color:"text-red-400",bg:"bg-red-500/10",label:"Denied"},pending_approval:{icon:Gn,color:"text-amber-400",bg:"bg-amber-500/10",label:"Pending"},approved:{icon:qe,color:"text-blue-400",bg:"bg-blue-500/10",label:"Approved"},rejected:{icon:bn,color:"text-red-400",bg:"bg-red-500/10",label:"Rejected"}};function ww(n){const s=Date.now()/1e3-n;return s<60?"just now":s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:new Date(n*1e3).toLocaleDateString()}function kw({entries:n}){const r=Array.isArray(n)?n:[];return r.length===0?a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-500/10 flex items-center justify-center",children:a.jsx($t,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Recent Activity"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Tool calls and system events"})]})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800/50 flex items-center justify-center mb-3",children:a.jsx($t,{className:"w-6 h-6 text-gray-600"})}),a.jsx("p",{className:"text-sm text-gray-500",children:"No activity yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Start a conversation to see actions here"})]})]}):a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-500/10 flex items-center justify-center",children:a.jsx($t,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Recent Activity"}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Last ",Math.min(r.length,10)," tool calls"]})]}),a.jsxs("span",{className:"text-xs text-gray-600 bg-gray-800/50 px-2.5 py-1 rounded-full",children:[r.length," total"]})]}),a.jsx("div",{className:"space-y-1",children:r.slice(0,10).map((s,o)=>{const u=qx[s.decision]||qx.allowed,d=u.icon;return a.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-gray-800/30 transition-colors group",children:[a.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center shrink-0 ${u.bg}`,children:a.jsx(d,{className:`w-3.5 h-3.5 ${u.color}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-300",children:s.tool_name}),s.operation&&a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:[".",s.operation]})]}),s.reason&&a.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:s.reason})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${u.bg} ${u.color}`,children:u.label}),a.jsx("span",{className:"text-[10px] text-gray-600",children:ww(s.timestamp)})]})]},s.id||o)})})]})}function Sw(){var P,A,ae,ne;const{currentTier:n,connected:r}=Ie(),[s,o]=O.useState(null),[u,d]=O.useState(null),[f,x]=O.useState([]),[p,h]=O.useState(null),[y,g]=O.useState(null),[v,j]=O.useState(null),w=O.useCallback(()=>{fe.getStatus().then(o).catch(()=>{}),fe.getAudit(20).then(X=>{X&&!Array.isArray(X.entries)&&(X.entries=[]),d(X)}).catch(()=>{}),fe.getConversations(5).then(x).catch(()=>{}),fe.getConnectors().then(h).catch(()=>{}),fe.getSkills().then(g).catch(()=>{}),fe.getMemoryStats().then(j).catch(()=>{})},[]);O.useEffect(()=>{w();const X=setInterval(w,15e3);return()=>clearInterval(X)},[w]);const S=(P=s==null?void 0:s.guardrails)==null?void 0:P.audit_summary,D=s==null?void 0:s.worker_pool,E=s==null?void 0:s.scheduler,q=s==null?void 0:s.heartbeat,H=((A=s==null?void 0:s.tools)==null?void 0:A.length)??0,K=(S==null?void 0:S.total_entries)??0,U=p?Object.values(p):[],L=U.filter(X=>(X==null?void 0:X.connected)||(X==null?void 0:X.running)).length,$=((ae=y==null?void 0:y.skills)==null?void 0:ae.length)??(Array.isArray(y)?y.length:0),ue=(v==null?void 0:v.total_facts)??(v==null?void 0:v.facts)??0;return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-5xl mx-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100",children:"Dashboard"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"System overview and real-time metrics"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium ${r?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[r?a.jsx(Xh,{className:"w-3.5 h-3.5"}):a.jsx(S1,{className:"w-3.5 h-3.5"}),r?"Connected":"Disconnected"]}),a.jsxs("span",{className:"text-xs text-gray-600 font-mono bg-gray-800/50 px-2.5 py-1.5 rounded-lg",children:["v",(s==null?void 0:s.version)||"0.3.2"]})]})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsx(Ui,{icon:Pr,label:"System Status",value:r?"Online":"Offline",color:r?"emerald":"red"}),a.jsx(Ui,{icon:bn,label:"Guardrail Tier",value:n,color:"plutus",capitalize:!0}),a.jsx(Ui,{icon:rn,label:"Tools Available",value:String(H),sublabel:`${K} total actions`,color:"blue"}),a.jsx(Ui,{icon:k1,label:"Active Workers",value:String((D==null?void 0:D.active)??0),sublabel:`of ${(D==null?void 0:D.max_workers)??5} max`,color:"purple"})]}),a.jsx("div",{className:"grid grid-cols-5 gap-3",children:[{icon:fp,label:"Conversations",value:String((f==null?void 0:f.length)??0),color:"text-blue-400",bg:"bg-blue-500/10"},{icon:Ba,label:"Scheduled Jobs",value:String((E==null?void 0:E.total_jobs)??(E==null?void 0:E.jobs)??0),color:"text-amber-400",bg:"bg-amber-500/10"},{icon:up,label:"Skills",value:String($),color:"text-emerald-400",bg:"bg-emerald-500/10"},{icon:Xh,label:"Connectors",value:`${L}/${U.length}`,color:"text-purple-400",bg:"bg-purple-500/10"},{icon:an,label:"Memory Facts",value:String(ue),color:"text-rose-400",bg:"bg-rose-500/10"}].map(({icon:X,label:W,value:te,color:M,bg:z})=>a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-3.5 flex items-center gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${z}`,children:a.jsx(X,{className:`w-4 h-4 ${M}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-bold text-gray-200 leading-none",children:te}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:W})]})]},W))}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"col-span-2 bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center",children:a.jsx(np,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Action Decisions"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Guardrail outcomes for tool calls"})]})]}),S!=null&&S.by_decision?a.jsx("div",{className:"space-y-3",children:[{key:"allowed",label:"Allowed",icon:qe,color:"emerald"},{key:"denied",label:"Denied",icon:yn,color:"red"},{key:"approved",label:"Approved",icon:qe,color:"blue"},{key:"rejected",label:"Rejected",icon:Yl,color:"amber"}].map(({key:X,label:W,icon:te,color:M})=>{const z=S.by_decision[X]??0,oe=Math.round(z/(K||1)*100);return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(te,{className:`w-4 h-4 text-${M}-400 shrink-0`}),a.jsx("span",{className:"text-sm text-gray-400 w-20",children:W}),a.jsx("div",{className:"flex-1 bg-gray-800/50 rounded-full h-2 overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full bg-${M}-500/60 transition-all`,style:{width:`${Math.max(oe,z>0?2:0)}%`}})}),a.jsx("span",{className:"text-sm font-mono text-gray-300 w-10 text-right",children:z})]},X)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[a.jsx("p",{className:"text-sm text-gray-500",children:"No action data yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Tool calls will appear here as you use Plutus"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-rose-500/10 flex items-center justify-center",children:a.jsx(Ji,{className:"w-4 h-4 text-rose-400"})}),a.jsx("div",{className:"flex-1",children:a.jsx("h3",{className:"text-xs font-semibold text-gray-300",children:"Heartbeat"})}),q!=null&&q.running?a.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded-full",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active"]}):a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-500/10 px-2 py-0.5 rounded-full",children:"Off"})]}),(q==null?void 0:q.running)&&a.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Beats"}),a.jsxs("span",{className:"text-gray-300",children:[q.consecutive_beats,"/",q.max_consecutive]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Interval"}),a.jsx("span",{className:"text-gray-300",children:q.interval_seconds<60?`${q.interval_seconds}s`:`${Math.floor(q.interval_seconds/60)}m`})]})]}),!(q!=null&&q.running)&&a.jsx("p",{className:"text-xs text-gray-600",children:"Configure in Settings to enable autonomous operation"})]}),a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(an,{className:"w-4 h-4 text-plutus-400"})}),a.jsx("h3",{className:"text-xs font-semibold text-gray-300",children:"Coordinator"})]}),a.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Model"}),a.jsx("span",{className:"text-gray-300 font-mono text-[10px]",children:((ne=s==null?void 0:s.model_routing)==null?void 0:ne.default_worker_model)||"claude-sonnet-4-6"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Planner"}),a.jsx("span",{className:`${s!=null&&s.planner_enabled?"text-emerald-400":"text-gray-500"}`,children:s!=null&&s.planner_enabled?"Enabled":"Disabled"})]})]})]})]})]}),(S==null?void 0:S.by_tool)&&Object.keys(S.by_tool).length>0&&a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-emerald-500/10 flex items-center justify-center",children:a.jsx(rn,{className:"w-5 h-5 text-emerald-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Tool Usage"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Distribution of tool calls"})]}),a.jsxs("span",{className:"text-xs text-gray-600 bg-gray-800/50 px-2.5 py-1 rounded-full",children:[Object.keys(S.by_tool).length," tools used"]})]}),a.jsx("div",{className:"space-y-2.5",children:Object.entries(S.by_tool).sort(([,X],[,W])=>W-X).slice(0,10).map(([X,W])=>{const te=Math.max(...Object.values(S.by_tool)),M=W/te*100;return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-gray-400 w-28 truncate font-mono text-xs",children:X}),a.jsx("div",{className:"flex-1 bg-gray-800/50 rounded-full h-2 overflow-hidden",children:a.jsx("div",{className:"bg-gradient-to-r from-plutus-500/80 to-plutus-400/60 rounded-full h-2 transition-all",style:{width:`${M}%`}})}),a.jsx("span",{className:"text-xs text-gray-400 font-mono w-10 text-right",children:W})]},X)})})]}),a.jsx(kw,{entries:(u==null?void 0:u.entries)??[]})]})})}const Cw={observer:$l,assistant:w1,operator:o1,autonomous:$t},Yx={observer:{ring:"ring-gray-500",bg:"bg-gray-500/10",text:"text-gray-400"},assistant:{ring:"ring-blue-500",bg:"bg-blue-500/10",text:"text-blue-400"},operator:{ring:"ring-plutus-500",bg:"bg-plutus-500/10",text:"text-plutus-400"},autonomous:{ring:"ring-amber-500",bg:"bg-amber-500/10",text:"text-amber-400"}};function _w({tiers:n,currentTier:r,onSelect:s}){return a.jsx("div",{className:"grid grid-cols-4 gap-3",children:n.map(o=>{const u=Cw[o.id]||$l,d=Yx[o.id]||Yx.observer,f=o.id===r;return a.jsxs("button",{onClick:()=>s(o.id),className:`relative flex flex-col items-center gap-3 p-4 rounded-xl border-2 transition-all ${f?`border-transparent ring-2 ${d.ring} ${d.bg}`:"border-gray-800 hover:border-gray-700 bg-gray-900"}`,children:[f&&a.jsx("div",{className:"absolute top-2 right-2 w-2 h-2 rounded-full bg-emerald-400"}),a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${d.bg}`,children:a.jsx(u,{className:`w-5 h-5 ${d.text}`})}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:`text-sm font-semibold ${f?d.text:"text-gray-300"}`,children:o.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:o.description})]}),a.jsx("div",{className:"flex gap-1",children:[0,1,2,3].map(x=>a.jsx("div",{className:`w-6 h-1.5 rounded-full ${x<=o.level?d.bg.replace("/10","/40"):"bg-gray-800"}`},x))})]},o.id)})})}const Tw={shell:rn,filesystem:cp,browser:Ki,process:bl,system_info:Fa,clipboard:rp},Vx={allowed:{label:"Allowed",color:"text-emerald-400"},requires_approval:{label:"Needs Approval",color:"text-amber-400"},denied:{label:"Denied",color:"text-red-400"}};function Ew({toolName:n,description:r,defaultPermission:s,override:o,onOverride:u}){const d=Tw[n]||rn,f=o?o.enabled:s!=="denied",x=o?o.require_approval:s==="requires_approval",h=Vx[f?x?"requires_approval":"allowed":"denied"]||Vx.denied;return a.jsxs("div",{className:"flex items-center gap-4 p-3 bg-gray-800/50 rounded-lg border border-gray-800",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-800 flex items-center justify-center flex-shrink-0",children:a.jsx(d,{className:"w-4.5 h-4.5 text-gray-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200",children:n}),a.jsx("span",{className:`text-xs ${h.color}`,children:h.label})]}),a.jsx("p",{className:"text-xs text-gray-500 truncate",children:r})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f&&a.jsx("button",{onClick:()=>u(!0,!x),className:`text-xs px-2.5 py-1 rounded-md border transition-colors ${x?"border-amber-500/30 bg-amber-500/10 text-amber-400":"border-gray-700 bg-gray-800 text-gray-500 hover:text-gray-300"}`,children:x?"Approval ON":"Approval OFF"}),a.jsx("button",{onClick:()=>u(!f,x),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${f?"bg-plutus-600":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${f?"translate-x-6":"translate-x-1"}`})})]})]})}function Aw(){const{currentTier:n,setCurrentTier:r}=Ie(),[s,o]=O.useState([]),[u,d]=O.useState([]),[f,x]=O.useState({});O.useEffect(()=>{fe.getGuardrails().then(g=>{o(g.tier_info||[]),x(g.overrides||{}),g.current_tier&&r(g.current_tier)}).catch(()=>{}),fe.getTools().then(g=>d(g||[])).catch(()=>{})},[r]);const p=async g=>{try{await fe.setTier(g),r(g)}catch(v){console.error("Failed to set tier:",v)}},h=async(g,v,j)=>{try{await fe.setToolOverride(g,v,j),x(w=>({...w,[g]:{enabled:v,require_approval:j}}))}catch(w){console.error("Failed to set override:",w)}},y=s.find(g=>g.id===n);return a.jsxs("div",{className:"h-full overflow-y-auto p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-1",children:"Guardrails"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Control how much access Plutus has to your system"})]}),a.jsxs("div",{className:"flex items-start gap-3 p-4 bg-plutus-600/10 border border-plutus-500/20 rounded-xl",children:[a.jsx($a,{className:"w-5 h-5 text-plutus-400 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-plutus-200",children:[a.jsx("p",{className:"font-medium mb-1",children:"How guardrails work"}),a.jsx("p",{className:"text-plutus-300/80",children:"Choose a tier to set the baseline permissions, then fine-tune individual tools below. Higher tiers give the AI more autonomy. Every action is logged to the audit trail regardless of tier."})]})]}),a.jsxs("div",{className:"card",children:[a.jsxs("h3",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:[a.jsx(bn,{className:"w-4 h-4 text-plutus-400"}),"Access Tier"]}),a.jsx(_w,{tiers:s,currentTier:n,onSelect:p})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Tool Permissions"}),a.jsxs("p",{className:"text-xs text-gray-500 mb-4",children:["Override the default permissions for the ",a.jsx("strong",{className:"text-gray-400 capitalize",children:n})," tier. These overrides take priority over tier defaults."]}),a.jsx("div",{className:"space-y-3",children:u.map(g=>{const v=y==null?void 0:y.tools[g.name],j=f[g.name];return a.jsx(Ew,{toolName:g.name,description:g.description,defaultPermission:(v==null?void 0:v.permission)||"denied",override:j,onOverride:(w,S)=>h(g.name,w,S)},g.name)})})]})]})}const Gx=[{id:"anthropic",label:"Anthropic",sublabel:"Claude",icon:"A",color:"from-orange-500 to-amber-600"},{id:"openai",label:"OpenAI",sublabel:"GPT",icon:"O",color:"from-emerald-500 to-teal-600"},{id:"ollama",label:"Ollama",sublabel:"Local",icon:"L",color:"from-blue-500 to-indigo-600"},{id:"custom",label:"Custom",sublabel:"Endpoint",icon:"C",color:"from-gray-500 to-gray-600"}],Mw={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",ollama:"",custom:"API_KEY"},$x={anthropic:[{id:"claude-opus-4-6",label:"Claude Opus 4-6",desc:"Most capable — complex reasoning & analysis"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4-6",desc:"Balanced — great for most tasks"},{id:"claude-haiku-4-5",label:"Claude Haiku 4-5",desc:"Fast & efficient — simple tasks"}],openai:[{id:"gpt-5.2",label:"GPT-5.2",desc:"Latest flagship model"},{id:"gpt-5",label:"GPT-5",desc:"Previous generation flagship"},{id:"gpt-4.1",label:"GPT-4.1",desc:"Reliable general purpose"},{id:"gpt-4.1-mini",label:"GPT-4.1 Mini",desc:"Fast & affordable"},{id:"o3",label:"o3",desc:"Advanced reasoning"},{id:"o4-mini",label:"o4-mini",desc:"Fast reasoning"}],ollama:[{id:"llama3.2",label:"Llama 3.2",desc:"Meta's open model"},{id:"mistral",label:"Mistral",desc:"Efficient open model"},{id:"codellama",label:"Code Llama",desc:"Optimized for code"},{id:"phi3",label:"Phi-3",desc:"Microsoft's compact model"}]};function zw({config:n,onSave:r,saving:s,keyStatus:o,onKeyStatusChange:u}){var te;const[d,f]=O.useState(n.provider||"anthropic"),[x,p]=O.useState(n.model||""),[h,y]=O.useState(n.base_url||""),[g,v]=O.useState(n.temperature??.7),[j,w]=O.useState(n.max_tokens??4096),[S,D]=O.useState(""),[E,q]=O.useState(""),[H,K]=O.useState(!1),[U,L]=O.useState(!1),[$,ue]=O.useState(!1),P=o[d]??!1,A=d!=="ollama",ae=$x[d]||[];ae.find(M=>M.id===x);const ne=()=>{const M=Mw[d]||"API_KEY";r({provider:d,model:x||S,api_key_env:M,base_url:h||null,temperature:g,max_tokens:j})},X=async()=>{if(E.trim()){L(!0),ue(!1);try{const M=await fe.setKey(d,E.trim());ue(!0),q(""),K(!1),u(),M.key_configured&&Ie.getState().setKeyConfigured(!0),setTimeout(()=>ue(!1),3e3)}catch(M){console.error("Failed to save key:",M)}finally{L(!1)}}},W=async()=>{try{await fe.deleteKey(d),u()}catch(M){console.error("Failed to delete key:",M)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(an,{className:"w-5 h-5 text-plutus-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Coordinator Model"}),a.jsx("p",{className:"text-xs text-gray-500",children:"The main AI brain that talks to you and orchestrates workers"})]}),P&&A&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400 bg-emerald-500/10 px-2.5 py-1 rounded-full",children:[a.jsx(qe,{className:"w-3 h-3"}),"Connected"]}),!P&&A&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-amber-400 bg-amber-500/10 px-2.5 py-1 rounded-full",children:[a.jsx(Yl,{className:"w-3 h-3"}),"Key needed"]})]}),a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-2 block",children:"Provider"}),a.jsx("div",{className:"grid grid-cols-4 gap-2",children:Gx.map(M=>a.jsxs("button",{onClick:()=>{f(M.id);const z=$x[M.id];z!=null&&z.length&&p(z[0].id),q(""),ue(!1)},className:`relative flex flex-col items-center gap-1.5 p-3 rounded-xl border transition-all ${d===M.id?"border-plutus-500/50 bg-plutus-500/5 shadow-sm shadow-plutus-500/10":"border-gray-800/60 bg-gray-800/20 hover:border-gray-700/60 hover:bg-gray-800/40"}`,children:[a.jsx("div",{className:`w-8 h-8 rounded-lg bg-gradient-to-br ${M.color} flex items-center justify-center text-white text-xs font-bold shadow-sm`,children:M.icon}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:M.label}),a.jsx("span",{className:"text-[10px] text-gray-500",children:M.sublabel}),d===M.id&&a.jsx("div",{className:"absolute -top-px -right-px w-3 h-3 bg-plutus-500 rounded-full rounded-tl-none border-2 border-[#1a1a2e]"})]},M.id))})]}),a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-2 block",children:"Model"}),ae.length>0?a.jsxs("div",{className:"space-y-1.5",children:[ae.map(M=>a.jsxs("button",{onClick:()=>{p(M.id),D("")},className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-all text-left ${x===M.id?"border-plutus-500/40 bg-plutus-500/5":"border-gray-800/40 bg-gray-800/20 hover:border-gray-700/40"}`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${x===M.id?"bg-plutus-400":"bg-gray-600"}`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200",children:M.label}),a.jsx("span",{className:"text-xs text-gray-500 ml-2",children:M.desc})]}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono shrink-0",children:M.id})]},M.id)),a.jsxs("button",{onClick:()=>{p("")},className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-all text-left ${x===""?"border-plutus-500/40 bg-plutus-500/5":"border-gray-800/40 bg-gray-800/20 hover:border-gray-700/40"}`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${x===""?"bg-plutus-400":"bg-gray-600"}`}),a.jsx("span",{className:"text-sm text-gray-400",children:"Custom model..."})]}),x===""&&a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 ml-5",value:S,onChange:M=>D(M.target.value),placeholder:"Enter custom model name"})]}):a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:x||S,onChange:M=>{p(M.target.value),D(M.target.value)},placeholder:"Enter model name"})]}),(d==="custom"||d==="ollama")&&a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Base URL"}),a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:h,onChange:M=>y(M.target.value),placeholder:d==="ollama"?"http://localhost:11434":"https://your-api-endpoint.com/v1"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Temperature"}),a.jsx("span",{className:"text-xs font-mono text-gray-400",children:g})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:g,onChange:M=>v(parseFloat(M.target.value)),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"Precise"}),a.jsx("span",{children:"Creative"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Max Tokens"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:j,onChange:M=>w(parseInt(M.target.value)||4096)})]})]}),a.jsxs("button",{onClick:ne,disabled:s,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-sm font-medium transition-colors",children:[a.jsx(pp,{className:"w-4 h-4"}),s?"Saving...":"Save Model Settings"]})]}),A&&a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center",children:a.jsx(rs,{className:"w-5 h-5 text-amber-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"API Key"}),a.jsx("p",{className:"text-xs text-gray-500",children:P?"Your key is securely stored":`Required for ${(te=Gx.find(M=>M.id===d))==null?void 0:te.label}`})]}),P&&a.jsxs("button",{onClick:W,className:"flex items-center gap-1.5 text-xs text-red-400 hover:text-red-300 bg-red-500/10 hover:bg-red-500/15 px-2.5 py-1.5 rounded-lg transition-colors",children:[a.jsx(Ia,{className:"w-3 h-3"}),"Remove"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx("input",{type:H?"text":"password",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2.5 pr-10 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:E,onChange:M=>q(M.target.value),placeholder:P?"Enter new key to update...":"sk-...",onKeyDown:M=>{M.key==="Enter"&&X()}}),a.jsx("button",{onClick:()=>K(!H),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 p-0.5",children:H?a.jsx(id,{className:"w-4 h-4"}):a.jsx($l,{className:"w-4 h-4"})})]}),a.jsxs("button",{onClick:X,disabled:U||!E.trim(),className:"flex items-center gap-1.5 px-4 py-2.5 rounded-lg bg-amber-600 hover:bg-amber-500 disabled:opacity-50 disabled:hover:bg-amber-600 text-white text-sm font-medium transition-colors whitespace-nowrap",children:[a.jsx(rs,{className:"w-4 h-4"}),U?"...":"Save"]})]}),$&&a.jsxs("p",{className:"text-xs text-emerald-400 mt-2 flex items-center gap-1.5",children:[a.jsx(qe,{className:"w-3.5 h-3.5"}),"API key saved securely"]}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-3",children:"Stored locally at ~/.plutus/.secrets.json — never leaves your machine."})]})]})}function Ow({config:n,onSave:r,saving:s}){const[o,u]=O.useState(null),[d,f]=O.useState(n.enabled??!1),[x,p]=O.useState(n.interval_seconds??300),[h,y]=O.useState(n.max_consecutive??50),[g,v]=O.useState(n.quiet_hours_start??""),[j,w]=O.useState(n.quiet_hours_end??""),[S,D]=O.useState(n.prompt??""),[E,q]=O.useState(!1),H=()=>{fe.getHeartbeatStatus().then($=>u($)).catch(()=>{})};O.useEffect(()=>{H();const $=window.setInterval(H,5e3);return()=>window.clearInterval($)},[]);const K=async()=>{try{if(o!=null&&o.running){const $=await fe.stopHeartbeat();u($),f(!1)}else{const $=await fe.startHeartbeat();u($),f(!0)}}catch($){console.error("Failed to toggle heartbeat:",$)}},U=()=>{r({heartbeat:{enabled:d,interval_seconds:x,max_consecutive:h,quiet_hours_start:g||null,quiet_hours_end:j||null,prompt:S||""}}),fe.updateHeartbeat({enabled:d,interval_seconds:x,max_consecutive:h,quiet_hours_start:g||null,quiet_hours_end:j||null,prompt:S||""}).then($=>u($)).catch(()=>{})},L=$=>$<60?`${$}s`:$<3600?`${Math.floor($/60)}m`:`${Math.floor($/3600)}h ${Math.floor($%3600/60)}m`;return a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-rose-500/10 flex items-center justify-center",children:a.jsx(Ji,{className:"w-5 h-5 text-rose-400"})}),a.jsxs("div",{children:[a.jsxs("h3",{className:"text-sm font-semibold text-gray-200 flex items-center gap-2",children:["Heartbeat",(o==null?void 0:o.running)&&!(o!=null&&o.paused)&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400 font-normal bg-emerald-500/10 px-2 py-0.5 rounded-full",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active"]}),(o==null?void 0:o.paused)&&a.jsx("span",{className:"text-xs text-amber-400 font-normal bg-amber-500/10 px-2 py-0.5 rounded-full",children:"Paused"}),o&&!o.running&&!o.paused&&a.jsx("span",{className:"text-xs text-gray-500 font-normal bg-gray-500/10 px-2 py-0.5 rounded-full",children:"Off"})]}),a.jsx("p",{className:"text-xs text-gray-500",children:"Autonomous wake-up for continuous task execution"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>q(!E),className:"text-xs text-gray-500 hover:text-gray-300 px-2 py-1 rounded transition-colors",children:E?"Collapse":"Configure"}),a.jsx("button",{onClick:K,className:`flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border transition-colors ${o!=null&&o.running?"border-red-500/30 bg-red-500/10 text-red-400 hover:bg-red-500/20":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"}`,children:o!=null&&o.running?a.jsxs(a.Fragment,{children:[a.jsx(Pi,{className:"w-3 h-3"})," Stop"]}):a.jsxs(a.Fragment,{children:[a.jsx(Za,{className:"w-3 h-3"})," Start"]})})]})]}),(o==null?void 0:o.running)&&a.jsxs("div",{className:"mt-4 bg-gray-800/40 rounded-lg p-3 flex items-center gap-5 text-xs text-gray-400",children:[a.jsxs("span",{children:["Beats: ",a.jsx("span",{className:"text-gray-200 font-medium",children:o.consecutive_beats}),a.jsxs("span",{className:"text-gray-600",children:["/",o.max_consecutive]})]}),a.jsxs("span",{children:["Interval: ",a.jsx("span",{className:"text-gray-200 font-medium",children:L(o.interval_seconds)})]}),o.quiet_hours_start&&o.quiet_hours_end&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Gh,{className:"w-3 h-3"}),"Quiet: ",o.quiet_hours_start," – ",o.quiet_hours_end]})]}),E&&a.jsxs("div",{className:"mt-5 pt-5 border-t border-gray-800/40 space-y-5",children:[a.jsxs("div",{className:"bg-gray-800/30 rounded-lg p-3 flex gap-2.5",children:[a.jsx($a,{className:"w-4 h-4 text-gray-500 shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:"The heartbeat periodically wakes Plutus so it can continue working on tasks autonomously. Each beat sends a check-in that lets the agent review its plan and pick up where it left off."})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("label",{className:"text-xs text-gray-500 flex items-center gap-1.5",children:[a.jsx(Gn,{className:"w-3 h-3"}),"Wake-up interval"]}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded-md",children:L(x)})]}),a.jsx("input",{type:"range",min:"30",max:"3600",step:"30",value:x,onChange:$=>p(parseInt($.target.value)),className:"w-full accent-plutus-500 h-2 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"30s"}),a.jsx("span",{children:"5m"}),a.jsx("span",{children:"15m"}),a.jsx("span",{children:"30m"}),a.jsx("span",{children:"1h"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Max consecutive beats (safety limit)"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:h,min:1,max:1e3,onChange:$=>y(parseInt($.target.value)||50)}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Auto-pauses after this many beats with no user interaction."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-gray-500 mb-2 block flex items-center gap-1.5",children:[a.jsx(Gh,{className:"w-3 h-3"}),"Quiet hours (optional)"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] text-gray-600 mb-1 block",children:"Start"}),a.jsx("input",{type:"time",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:g,onChange:$=>v($.target.value),placeholder:"23:00"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] text-gray-600 mb-1 block",children:"End"}),a.jsx("input",{type:"time",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:j,onChange:$=>w($.target.value),placeholder:"07:00"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Custom heartbeat prompt (optional)"}),a.jsx("textarea",{className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 min-h-[60px] resize-y",value:S,onChange:$=>D($.target.value),placeholder:"Leave empty for default: review plan and continue working...",rows:2})]}),a.jsxs("button",{onClick:U,disabled:s,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-sm font-medium transition-colors",children:[a.jsx(pp,{className:"w-4 h-4"}),s?"Saving...":"Save Heartbeat Settings"]})]})]})}function Dw(){var y,g,v,j,w,S,D,E,q;const[n,r]=O.useState(null),[s,o]=O.useState(!1),[u,d]=O.useState(!1),[f,x]=O.useState({}),p=O.useCallback(()=>{fe.getKeyStatus().then(H=>{x(H.providers||{}),Ie.getState().setKeyConfigured(H.current_provider_configured)}).catch(()=>{})},[]);O.useEffect(()=>{fe.getConfig().then(r).catch(()=>{}),p()},[p]);const h=async H=>{o(!0),d(!1);try{await fe.updateConfig(H),d(!0);const K=await fe.getConfig();r(K),setTimeout(()=>d(!1),2500)}catch(K){console.error("Failed to save:",K)}finally{o(!1)}};return n?a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure your AI provider, model, and system preferences"})]}),u&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-lg animate-fade-in",children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Saved"]})]}),a.jsx(zw,{config:n.model||{},onSave:H=>h({model:H}),saving:s,keyStatus:f,onKeyStatusChange:p}),a.jsx(Ow,{config:n.heartbeat||{},onSave:h,saving:s}),a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:a.jsx(ep,{className:"w-5 h-5 text-purple-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Agent Behavior"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Control how the coordinator processes tasks"})]})]}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("label",{className:"text-sm text-gray-300",children:"Max Tool Rounds"}),a.jsx("span",{className:"text-sm font-mono text-plutus-400 bg-plutus-500/10 px-2.5 py-0.5 rounded-md",children:((y=n.agent)==null?void 0:y.max_tool_rounds)||25})]}),a.jsx("input",{type:"range",min:"5",max:"100",step:"5",className:"w-full accent-plutus-500 h-2 rounded-full",defaultValue:((g=n.agent)==null?void 0:g.max_tool_rounds)||25,onChange:H=>h({agent:{max_tool_rounds:parseInt(H.target.value)||25}})}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"5"}),a.jsx("span",{children:"25"}),a.jsx("span",{children:"50"}),a.jsx("span",{children:"75"}),a.jsx("span",{children:"100"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Maximum tool calls (browser, shell, etc.) per message before the agent pauses."})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-gray-800/40",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-300",children:"Scheduler"}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Allow Plutus to create and run cron jobs"})]}),a.jsx("button",{onClick:()=>{var H;return h({scheduler:{enabled:!(((H=n.scheduler)==null?void 0:H.enabled)??!0)}})},className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-200 ${((v=n.scheduler)==null?void 0:v.enabled)!==!1?"bg-plutus-500":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200 ${((j=n.scheduler)==null?void 0:j.enabled)!==!1?"translate-x-6":"translate-x-1"}`})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center",children:a.jsx(gp,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Gateway"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Network settings"})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Host"}),a.jsx("div",{className:"bg-gray-800/50 rounded-lg px-3 py-2 text-sm text-gray-400 font-mono",children:((w=n.gateway)==null?void 0:w.host)||"127.0.0.1"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Port"}),a.jsx("div",{className:"bg-gray-800/50 rounded-lg px-3 py-2 text-sm text-gray-400 font-mono",children:((S=n.gateway)==null?void 0:S.port)||7777})]}),a.jsxs("div",{className:"flex items-start gap-1.5 pt-1",children:[a.jsx($a,{className:"w-3 h-3 text-gray-600 mt-0.5 shrink-0"}),a.jsx("p",{className:"text-[10px] text-gray-600",children:"Restart Plutus to change these values"})]})]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center",children:a.jsx(sp,{className:"w-5 h-5 text-amber-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Memory"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Context & history"})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Context Window"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((D=n.memory)==null?void 0:D.context_window_messages)||20,onChange:H=>h({memory:{context_window_messages:parseInt(H.target.value)||20}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Messages kept in active context"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Max History"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((E=n.memory)==null?void 0:E.max_conversation_history)||100,onChange:H=>h({memory:{max_conversation_history:parseInt(H.target.value)||100}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Total messages stored per conversation"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Auto-Delete After (days)"}),a.jsx("input",{type:"number",min:"0",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((q=n.memory)==null?void 0:q.conversation_auto_delete_days)??30,onChange:H=>h({memory:{conversation_auto_delete_days:parseInt(H.target.value)||0}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Conversations with no activity for this many days are automatically deleted. Set to 0 to disable."})]})]})]})]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Loading settings..."})]})})}function wg(n,r=[]){const[s,o]=O.useState(null),[u,d]=O.useState(!0),[f,x]=O.useState(null),p=O.useCallback(async()=>{d(!0),x(null);try{const h=await n();o(h)}catch(h){x(h instanceof Error?h.message:"Unknown error")}finally{d(!1)}},r);return O.useEffect(()=>{p()},[p]),{data:s,loading:u,error:f,refetch:p}}const Qx={terminal:rn,code:Ii,cpu:bl,monitor:Fa,puzzle:v1},Rw={shell:rn,filesystem:cp,process:bl,system_info:$a,code_editor:od,code_analysis:op,subprocess:$t,tool_creator:vn,browser:Ki,clipboard:rp,desktop:Fa,app_manager:Px},Lw={shell:"Runs commands on your computer, like installing software or running scripts.",filesystem:"Reads, writes, and manages files and folders on your system.",process:"Shows what programs are running and can start or stop them.",system_info:"Checks your computer's health — CPU, memory, disk space, and more.",code_editor:"Creates and edits code files with smart find-and-replace editing.",code_analysis:"Analyzes code to find functions, classes, complexity, and potential issues.",subprocess:"Runs multiple tasks at the same time in isolated processes.",tool_creator:"Creates brand new tools on the fly when the AI needs a new capability.",browser:"Opens websites, fills forms, clicks buttons — like a virtual web assistant.",clipboard:"Reads and writes to your clipboard (copy/paste).",desktop:"Interacts with desktop windows and applications.",app_manager:"Installs, updates, and manages applications on your system."},Uw={core:"from-blue-500/20 to-blue-600/10 border-blue-500/30",code:"from-emerald-500/20 to-emerald-600/10 border-emerald-500/30",subprocess:"from-purple-500/20 to-purple-600/10 border-purple-500/30",desktop:"from-amber-500/20 to-amber-600/10 border-amber-500/30",custom:"from-pink-500/20 to-pink-600/10 border-pink-500/30"},ad={core:"text-blue-400",code:"text-emerald-400",subprocess:"text-purple-400",desktop:"text-amber-400",custom:"text-pink-400"};function Hw({tool:n,category:r}){var x,p,h,y;const[s,o]=O.useState(!1),u=Rw[n.name]||vn,d=ad[r]||"text-gray-400",f=Lw[n.name];return a.jsxs("div",{className:`card hover:border-gray-700 transition-all duration-200 cursor-pointer ${s?"ring-1 ring-gray-700":""}`,onClick:()=>o(!s),children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 bg-gradient-to-br ${Uw[r]}`,children:a.jsx(u,{className:`w-5 h-5 ${d}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:n.name.replace(/_/g," ").replace(/\b\w/g,g=>g.toUpperCase())}),a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${d} bg-gray-800`,children:r})]}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 line-clamp-2",children:f||n.description})]}),a.jsx("button",{className:"text-gray-500 hover:text-gray-300 p-1",children:s?a.jsx(lp,{className:"w-4 h-4"}):a.jsx(Gl,{className:"w-4 h-4"})})]}),s&&a.jsx("div",{className:"mt-4 pt-3 border-t border-gray-800 animate-fade-in",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"What it does"}),a.jsx("p",{className:"text-xs text-gray-300",children:n.description})]}),((x=n.parameters)==null?void 0:x.properties)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Available Options"}),a.jsx("div",{className:"space-y-1.5",children:Object.entries(n.parameters.properties).map(([g,v])=>a.jsxs("div",{className:"flex items-start gap-2 bg-gray-800/50 rounded-lg px-3 py-2",children:[a.jsx("code",{className:"text-[11px] text-plutus-400 font-mono flex-shrink-0",children:g}),a.jsx("span",{className:"text-[11px] text-gray-400",children:v.description||v.type||"—"})]},g))})]}),((y=(h=(p=n.parameters)==null?void 0:p.properties)==null?void 0:h.operation)==null?void 0:y.enum)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Operations"}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.parameters.properties.operation.enum.map(g=>a.jsx("span",{className:`text-[10px] px-2 py-1 rounded-md bg-gray-800 ${d}`,children:g},g))})]})]})})]})}function Bw(){const{data:n,loading:r,error:s,refetch:o}=wg(()=>fe.getToolsDetails(),[]),[u,d]=O.useState(""),[f,x]=O.useState(null);if(r)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(Ya,{className:"w-5 h-5 animate-spin"}),a.jsx("span",{children:"Loading tools..."})]})});if(s)return a.jsxs("div",{className:"card text-center py-8",children:[a.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load tools"}),a.jsx("p",{className:"text-xs text-gray-500",children:s}),a.jsx("button",{onClick:o,className:"btn-primary mt-4 text-sm",children:"Retry"})]});const p=(n==null?void 0:n.categories)||{},h=(n==null?void 0:n.total)||0,y=Object.entries(p).reduce((g,[v,j])=>{if(!j.tools||j.tools.length===0)return g;const w=j.tools.filter(S=>S.name.toLowerCase().includes(u.toLowerCase())||S.description.toLowerCase().includes(u.toLowerCase()));return w.length>0&&(g[v]={...j,tools:w}),g},{});return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6 max-w-4xl mx-auto",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Tools"}),a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"These are all the capabilities your AI agent has. Each tool lets it perform specific actions on your computer."})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:Object.entries(p).map(([g,v])=>{var S;const j=Qx[v.icon]||vn,w=ad[g]||"text-gray-400";return a.jsxs("button",{onClick:()=>x(f===g?null:g),className:`card flex items-center gap-3 hover:border-gray-700 transition-all ${f===g?"ring-1 ring-plutus-500/50":""}`,children:[a.jsx(j,{className:`w-5 h-5 ${w}`}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:"text-lg font-bold text-gray-200",children:((S=v.tools)==null?void 0:S.length)||0}),a.jsx("p",{className:"text-[10px] text-gray-500",children:v.label})]})]},g)})}),a.jsxs("div",{className:"relative",children:[a.jsx(ss,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),a.jsx("input",{type:"text",placeholder:"Search tools... (e.g., 'edit files', 'analyze code')",value:u,onChange:g=>d(g.target.value),className:"input pl-10"})]}),Object.entries(y).map(([g,v])=>{const j=Qx[v.icon]||vn,w=ad[g]||"text-gray-400",S=f===null||f===g;return a.jsxs("div",{className:S?"":"hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(j,{className:`w-4 h-4 ${w}`}),a.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:v.label}),a.jsxs("span",{className:"text-xs text-gray-500",children:["— ",v.description]}),a.jsxs("span",{className:"text-xs text-gray-600 ml-auto",children:[v.tools.length," tool",v.tools.length!==1?"s":""]})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:v.tools.map(D=>a.jsx(Hw,{tool:D,category:g},D.name))})]},g)}),Object.keys(y).length===0&&a.jsxs("div",{className:"card text-center py-12",children:[a.jsx(ss,{className:"w-8 h-8 text-gray-600 mx-auto mb-3"}),a.jsx("p",{className:"text-gray-400",children:"No tools match your search."}),a.jsx("button",{onClick:()=>d(""),className:"text-plutus-400 text-sm mt-2 hover:underline",children:"Clear search"})]}),a.jsxs("div",{className:"text-center text-xs text-gray-600 pb-4",children:[h," tools available · Tools are used automatically by the AI during conversations"]})]})}function fs({status:n}){const r={running:{color:"text-blue-400",bg:"bg-blue-500/10 border border-blue-500/20",label:"Running",pulse:!0},completed:{color:"text-emerald-400",bg:"bg-emerald-500/10 border border-emerald-500/20",label:"Completed"},failed:{color:"text-red-400",bg:"bg-red-500/10 border border-red-500/20",label:"Failed"},cancelled:{color:"text-gray-400",bg:"bg-gray-500/10 border border-gray-500/20",label:"Cancelled"},queued:{color:"text-amber-400",bg:"bg-amber-500/10 border border-amber-500/20",label:"Queued"},timeout:{color:"text-orange-400",bg:"bg-orange-500/10 border border-orange-500/20",label:"Timeout"},active:{color:"text-blue-400",bg:"bg-blue-500/10 border border-blue-500/20",label:"Active",pulse:!0},paused:{color:"text-amber-400",bg:"bg-amber-500/10 border border-amber-500/20",label:"Paused"},idle:{color:"text-gray-400",bg:"bg-gray-500/10 border border-gray-500/20",label:"Idle"}},s=r[n]||r.idle;return a.jsxs("span",{className:`inline-flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-lg ${s.bg} ${s.color}`,children:[s.pulse&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-pulse"}),s.label]})}function gl({icon:n,label:r,value:s,color:o}){const u={blue:"bg-blue-500/10 text-blue-400 border-blue-500/20",emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",red:"bg-red-500/10 text-red-400 border-red-500/20",purple:"bg-purple-500/10 text-purple-400 border-purple-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"};return a.jsxs("div",{className:"bg-[#12122a] border border-gray-800/50 rounded-xl p-4 flex items-center gap-3.5",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center border ${u[o]}`,children:a.jsx(n,{className:"w-5 h-5"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-gray-100 leading-none",children:s}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:r})]})]})}function Vi({icon:n,title:r,count:s,pulse:o,action:u}){return a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsxs("div",{className:"relative",children:[a.jsx(n,{className:"w-4 h-4 text-gray-400"}),o&&s&&s>0&&a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-blue-400 animate-ping"})]}),a.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:r}),s!==void 0&&a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800/60 px-2 py-0.5 rounded-full font-medium",children:s})]}),u]})}function rd({icon:n,text:r,sub:s}){return a.jsxs("div",{className:"bg-[#12122a] border border-gray-800/40 border-dashed rounded-xl text-center py-12",children:[a.jsx(n,{className:"w-8 h-8 text-gray-700 mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-gray-500",children:r}),s&&a.jsx("p",{className:"text-xs text-gray-600 mt-2 max-w-sm mx-auto leading-relaxed",children:s})]})}function kg({text:n}){return a.jsx("div",{className:"flex items-center justify-center h-48",children:a.jsxs("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(Ya,{className:"w-5 h-5 animate-spin"}),a.jsx("span",{className:"text-sm",children:n})]})})}function Ed(n){return!n||n<.001?"—":n<1?`${Math.round(n*1e3)}ms`:n<60?`${n.toFixed(1)}s`:n<3600?`${Math.floor(n/60)}m ${Math.round(n%60)}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function $u(n){return n?new Date(typeof n=="number"?n*1e3:n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function yl(n){if(!n)return"—";const r=new Date(typeof n=="number"?n*1e3:n),s=new Date;if(r.toDateString()===s.toDateString())return`Today ${$u(n)}`;const u=new Date(s);return u.setDate(u.getDate()-1),r.toDateString()===u.toDateString()?`Yesterday ${$u(n)}`:r.toLocaleDateString([],{month:"short",day:"numeric"})+" "+$u(n)}function Ad(n){return n?{"claude-opus":"Opus","claude-sonnet":"Sonnet","claude-haiku":"Haiku","gpt-5.2":"GPT-5.2"}[n]||n:"Auto"}function Md(n){return n?n.includes("opus")?"text-purple-400":n.includes("sonnet")?"text-blue-400":n.includes("haiku")?"text-emerald-400":n.includes("gpt")?"text-cyan-400":"text-gray-400":"text-gray-400"}function Xx({active:n,onClick:r,icon:s,label:o,badge:u}){return a.jsxs("button",{onClick:r,className:`flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 min-w-[160px] ${n?"bg-blue-500/15 text-blue-400 border border-blue-500/30 shadow-lg shadow-blue-500/5":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/40 border border-transparent"}`,children:[a.jsx(s,{className:"w-4 h-4"}),o,u!==void 0&&u>0&&a.jsx("span",{className:"text-[10px] bg-blue-500/20 text-blue-400 px-1.5 py-0.5 rounded-full min-w-[18px] text-center font-bold",children:u})]})}function qw(){const[n,r]=O.useState(null),[s,o]=O.useState(null),[u,d]=O.useState(!0),[f,x]=O.useState(!0),[p,h]=O.useState(5),[y,g]=O.useState(!1),v=O.useCallback(async()=>{var P;try{const[A,ae]=await Promise.all([fe.getWorkers(),fe.getModelRouting().catch(()=>null)]);r(A),o(ae),(P=A==null?void 0:A.stats)!=null&&P.max_workers&&h(A.stats.max_workers)}catch{}finally{d(!1)}},[]);O.useEffect(()=>{v()},[v]),O.useEffect(()=>{if(!f)return;const P=setInterval(v,3e3);return()=>clearInterval(P)},[f,v]);const j=async P=>{try{await fe.cancelWorker(P),v()}catch{}},w=async P=>{h(P);try{await fe.updateWorkerConfig({max_concurrent_workers:P}),v()}catch{}},S=async()=>{var A;const P=((A=s==null?void 0:s.routing)==null?void 0:A.cost_conscious)??!1;try{await fe.updateModelRouting({cost_conscious:!P}),v()}catch{}};if(u)return a.jsx(kg,{text:"Loading workers..."});const D=(n==null?void 0:n.stats)||{},E=Array.isArray(n==null?void 0:n.running)?n.running:[],q=Array.isArray(n==null?void 0:n.queued)?n.queued:[],H=Array.isArray(n==null?void 0:n.completed)?n.completed:[],K=(s==null?void 0:s.routing)||{},U=D.active_count||E.length,L=D.queued_count||q.length,$=D.max_workers||p,ue=$>0?Math.min(U/$*100,100):0;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(gl,{icon:$t,label:"Active Workers",value:U,color:"blue"}),a.jsx(gl,{icon:Gn,label:"In Queue",value:L,color:"amber"}),a.jsx(gl,{icon:qe,label:"Completed",value:D.total_completed||0,color:"emerald"}),a.jsx(gl,{icon:yn,label:"Failed",value:D.total_failed||0,color:"red"})]}),a.jsxs("div",{className:"bg-[#12122a] border border-gray-800/50 rounded-xl p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-sm text-gray-300 flex items-center gap-2",children:[a.jsx(up,{className:"w-4 h-4 text-blue-400"}),"Worker Capacity"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm font-mono text-gray-400",children:[U," ",a.jsx("span",{className:"text-gray-600",children:"/"})," ",$,L>0&&a.jsxs("span",{className:"text-amber-400 ml-2",children:["+",L," queued"]})]}),a.jsx("button",{onClick:()=>g(!y),className:`p-1.5 rounded-lg transition-colors ${y?"bg-blue-500/15 text-blue-400":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/50"}`,title:"Worker settings",children:a.jsx(N1,{className:"w-4 h-4"})})]})]}),a.jsx("div",{className:"w-full bg-gray-800/80 rounded-full h-3 overflow-hidden",children:a.jsx("div",{className:`rounded-full h-3 transition-all duration-700 ease-out ${ue>80?"bg-gradient-to-r from-red-500 to-orange-500":ue>50?"bg-gradient-to-r from-amber-500 to-yellow-500":"bg-gradient-to-r from-blue-500 to-cyan-500"}`,style:{width:`${Math.max(ue,ue>0?4:0)}%`}})}),y&&a.jsxs("div",{className:"mt-5 pt-5 border-t border-gray-800/60 space-y-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("label",{className:"text-sm text-gray-300",children:"Maximum Concurrent Workers"}),a.jsx("span",{className:"text-sm font-mono font-bold text-blue-400 bg-blue-500/10 px-2.5 py-1 rounded-lg",children:p})]}),a.jsx("input",{type:"range",min:1,max:20,value:p,onChange:P=>w(Number(P.target.value)),className:`w-full h-2 bg-gray-800 rounded-full appearance-none cursor-pointer
                  [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5
                  [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-500
                  [&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-blue-500/30
                  [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-all
                  [&::-webkit-slider-thumb]:hover:bg-blue-400 [&::-webkit-slider-thumb]:hover:scale-110`}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"1"}),a.jsx("span",{children:"5"}),a.jsx("span",{children:"10"}),a.jsx("span",{children:"15"}),a.jsx("span",{children:"20"})]}),a.jsx("p",{className:"text-[11px] text-gray-600 mt-2",children:"Controls the maximum number of workers that can run simultaneously. Tasks beyond this limit are automatically queued."})]}),a.jsxs("div",{className:"flex items-center justify-between bg-[#0e0e24] rounded-xl p-4 border border-gray-800/40",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${K.cost_conscious?"bg-emerald-500/10 border border-emerald-500/20":"bg-gray-800/50 border border-gray-700/30"}`,children:a.jsx(bn,{className:`w-4 h-4 ${K.cost_conscious?"text-emerald-400":"text-gray-500"}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Cost-Conscious Mode"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:K.cost_conscious?"Workers prefer cheaper, faster models to save costs":"Workers use the best model for each task regardless of cost"})]})]}),a.jsx("button",{onClick:S,className:`relative inline-flex items-center h-6 w-11 rounded-full transition-colors duration-300 shrink-0 ml-4 ${K.cost_conscious?"bg-emerald-500":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block w-4 h-4 rounded-full bg-white shadow-md transition-transform duration-300 ${K.cost_conscious?"translate-x-6":"translate-x-1"}`})})]})]})]}),a.jsxs("div",{children:[a.jsx(Vi,{icon:Pr,title:"Active Tasks",count:U,pulse:U>0}),E.length===0?a.jsxs("div",{className:"bg-[#12122a] border border-gray-800/40 border-dashed rounded-xl py-8 text-center",children:[a.jsx(Pr,{className:"w-6 h-6 text-gray-700 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No active tasks"}),a.jsx("p",{className:"text-[11px] text-gray-600 mt-1",children:"Workers will appear here when Plutus assigns tasks"})]}):a.jsx("div",{className:"space-y-2",children:E.map(P=>a.jsx(Yw,{worker:P,onCancel:j},P.task_id||P.id))})]}),q.length>0&&a.jsxs("div",{children:[a.jsx(Vi,{icon:h1,title:"Job Queue",count:L}),a.jsx("div",{className:"bg-[#12122a] border border-amber-500/10 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:q.map((P,A)=>a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4",children:[a.jsx("span",{className:"text-[11px] font-mono text-gray-600 w-6 text-center",children:A+1}),a.jsx(Gn,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm text-gray-300 truncate",children:P.name||P.task||P.prompt||P.task_id}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[P.model_key&&a.jsx("span",{className:`text-[10px] font-medium ${Md(P.model_key)}`,children:Ad(P.model_key)}),P.created_at&&a.jsxs("span",{className:"text-[10px] text-gray-600",children:["Queued ",yl(P.created_at)]})]})]}),a.jsx(fs,{status:"queued"}),a.jsx("button",{onClick:()=>j(P.task_id||P.id),className:"p-1.5 rounded-lg text-gray-600 hover:text-red-400 hover:bg-red-500/10 transition-colors shrink-0",title:"Remove from queue",children:a.jsx(yn,{className:"w-3.5 h-3.5"})})]},P.task_id||P.id||A))})]}),a.jsxs("div",{children:[a.jsx(Vi,{icon:Bi,title:"Task History",count:H.length}),H.length===0?a.jsx(rd,{icon:np,text:"No completed tasks yet",sub:"Completed worker tasks will appear here with their results, model used, and duration"}):a.jsx("div",{className:"bg-[#12122a] border border-gray-800/50 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:H.slice(0,25).map((P,A)=>a.jsx(Vw,{task:P},P.task_id||A))})]}),a.jsx("div",{className:"flex justify-center pt-2 pb-4",children:a.jsxs("button",{onClick:()=>x(!f),className:`text-xs px-4 py-2 rounded-xl flex items-center gap-2 transition-all duration-200 ${f?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700/50 hover:text-gray-400"}`,children:[a.jsx(Pr,{className:`w-3.5 h-3.5 ${f?"animate-pulse":""}`}),f?"Live Updates On":"Live Updates Paused"]})})]})}function Yw({worker:n,onCancel:r}){const[s,o]=O.useState(!1),u=n.task_id||n.id,d=n.progress_pct||0;return a.jsxs("div",{className:"bg-[#12122a] border border-blue-500/20 rounded-xl p-4 shadow-lg shadow-blue-500/5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-400 animate-pulse"}),a.jsx("div",{className:"absolute inset-0 w-3 h-3 rounded-full bg-blue-400 animate-ping opacity-20"})]}),a.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>o(!s),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name||n.task||n.prompt||(u==null?void 0:u.slice(0,20))}),a.jsx(fs,{status:"running"})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[11px] text-gray-500",children:[n.model_used&&a.jsxs("span",{className:`flex items-center gap-1 font-medium ${Md(n.model_used)}`,children:[a.jsx(an,{className:"w-3 h-3"}),Ad(n.model_used)]}),n.current_step&&a.jsx("span",{className:"text-gray-400 truncate max-w-[200px]",children:n.current_step}),n.started_at&&a.jsxs("span",{children:["Started ",yl(n.started_at)]}),n.steps_completed>0&&a.jsxs("span",{children:[n.steps_completed," steps"]})]})]}),a.jsx("button",{onClick:()=>r(u),className:"p-2 rounded-lg text-red-400/60 hover:text-red-400 hover:bg-red-500/10 transition-colors shrink-0",title:"Cancel worker",children:a.jsx(yn,{className:"w-4 h-4"})})]}),d>0&&a.jsxs("div",{className:"mt-3",children:[a.jsx("div",{className:"w-full bg-gray-800/80 rounded-full h-1.5 overflow-hidden",children:a.jsx("div",{className:"rounded-full h-1.5 bg-gradient-to-r from-blue-500 to-cyan-400 transition-all duration-500",style:{width:`${d}%`}})}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("span",{className:"text-[10px] text-gray-600",children:n.current_step||"Processing..."}),a.jsxs("span",{className:"text-[10px] text-blue-400 font-mono",children:[d.toFixed(0),"%"]})]})]}),s&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800/60 text-xs text-gray-400 space-y-1.5",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Task ID:"})," ",u]}),n.prompt&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Prompt:"})," ",n.prompt]}),n.model_key&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Assigned Model:"})," ",n.model_key]}),n.started_at&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Started:"})," ",yl(n.started_at)]})]})]})}function Vw({task:n}){var u;const[r,s]=O.useState(!1),o=n.state||n.status||"completed";return a.jsxs("div",{className:`transition-colors ${r?"bg-gray-800/20":"hover:bg-gray-800/10"}`,children:[a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4 cursor-pointer",onClick:()=>s(!r),children:[r?a.jsx(Gl,{className:"w-3.5 h-3.5 text-gray-600 shrink-0"}):a.jsx(gn,{className:"w-3.5 h-3.5 text-gray-600 shrink-0"}),a.jsx(fs,{status:o}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"text-sm text-gray-300 truncate block",children:n.name||n.task||n.prompt||((u=n.task_id)==null?void 0:u.slice(0,20))})}),a.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-gray-600 shrink-0",children:[n.model_used&&a.jsxs("span",{className:`flex items-center gap-1 font-medium ${Md(n.model_used)}`,children:[a.jsx(an,{className:"w-3 h-3"}),Ad(n.model_used)]}),a.jsx("span",{className:"font-mono",children:Ed(n.duration||0)}),a.jsx("span",{children:yl(n.completed_at||n.started_at)})]})]}),r&&a.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[n.result&&a.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-3",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-1.5",children:"Result"}),a.jsx("pre",{className:"text-xs text-gray-300 font-mono whitespace-pre-wrap max-h-32 overflow-y-auto leading-relaxed",children:typeof n.result=="string"?n.result:JSON.stringify(n.result,null,2)})]}),n.error&&a.jsx("div",{className:"bg-red-500/5 border border-red-500/20 rounded-lg p-3",children:a.jsx("p",{className:"text-xs text-red-400 font-mono whitespace-pre-wrap",children:n.error})})]})]})}function Gw(){const[n,r]=O.useState(null),[s,o]=O.useState([]),[u,d]=O.useState(!0),[f,x]=O.useState(!1),p=O.useCallback(async()=>{try{const[D,E]=await Promise.all([fe.getScheduler(),fe.getSchedulerHistory(20)]);r(D),o((E==null?void 0:E.executions)||[])}catch{}finally{d(!1)}},[]);O.useEffect(()=>{p()},[p]),O.useEffect(()=>{const D=setInterval(p,5e3);return()=>clearInterval(D)},[p]);const h=async D=>{try{await fe.pauseJob(D),p()}catch{}},y=async D=>{try{await fe.resumeJob(D),p()}catch{}},g=async D=>{if(confirm("Delete this scheduled job?"))try{await fe.deleteJob(D),p()}catch{}};if(u)return a.jsx(kg,{text:"Loading scheduler..."});const v=(n==null?void 0:n.jobs)||[],j=(n==null?void 0:n.stats)||{},w=v.filter(D=>D.status==="active"),S=v.filter(D=>D.status==="paused");return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(gl,{icon:Ba,label:"Total Jobs",value:j.total_jobs||v.length,color:"purple"}),a.jsx(gl,{icon:Za,label:"Active",value:j.active_jobs||w.length,color:"emerald"}),a.jsx(gl,{icon:hp,label:"Paused",value:j.paused_jobs||S.length,color:"amber"}),a.jsx(gl,{icon:Bi,label:"Executions",value:j.total_executions||s.length,color:"cyan"})]}),a.jsxs("div",{children:[a.jsx(Vi,{icon:Ba,title:"Scheduled Jobs",count:v.length}),v.length===0?a.jsx(rd,{icon:Ba,text:"No scheduled jobs",sub:'Tell Plutus something like "Every day at 6 AM, write a blog post" and it will create a scheduled job'}):a.jsx("div",{className:"space-y-2",children:v.map(D=>a.jsx($w,{job:D,onPause:h,onResume:y,onDelete:g},D.id||D.job_id))})]}),a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>x(!f),className:"flex items-center gap-2 text-sm text-gray-400 hover:text-gray-300 mb-3 transition-colors",children:[f?a.jsx(Gl,{className:"w-4 h-4"}):a.jsx(gn,{className:"w-4 h-4"}),a.jsx(Bi,{className:"w-4 h-4"}),"Execution History",a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800/50 px-2 py-0.5 rounded-full",children:s.length})]}),f&&(s.length===0?a.jsx(rd,{icon:Bi,text:"No executions yet",sub:"History will appear after scheduled jobs run"}):a.jsx("div",{className:"bg-[#12122a] border border-gray-800/50 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:s.map((D,E)=>a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4 hover:bg-gray-800/10 transition-colors",children:[a.jsx(fs,{status:D.status||"completed"}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-sm text-gray-300 truncate",children:D.job_name||D.job_id})}),a.jsxs("div",{className:"text-[11px] text-gray-600 flex items-center gap-4",children:[a.jsx("span",{className:"font-mono",children:Ed(D.duration||0)}),a.jsx("span",{children:yl(D.executed_at||D.timestamp)})]})]},E))}))]})]})}function $w({job:n,onPause:r,onResume:s,onDelete:o}){const[u,d]=O.useState(!1),f=n.id||n.job_id,x=n.status==="paused",p=n.status==="active";return a.jsxs("div",{className:`bg-[#12122a] border rounded-xl p-4 transition-colors ${p?"border-emerald-500/20":x?"border-amber-500/20 opacity-75":"border-gray-800/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ba,{className:`w-4 h-4 shrink-0 ${p?"text-emerald-400":"text-gray-500"}`}),a.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>d(!u),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name||n.task||f}),a.jsx(fs,{status:n.status})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-gray-500",children:[n.schedule&&a.jsx("span",{className:"font-mono bg-gray-800/50 px-1.5 py-0.5 rounded",children:n.schedule}),n.cron&&a.jsx("span",{className:"font-mono bg-gray-800/50 px-1.5 py-0.5 rounded",children:n.cron}),n.interval&&a.jsxs("span",{children:["Every ",Ed(n.interval)]}),n.next_run&&a.jsxs("span",{children:["Next: ",yl(n.next_run)]}),n.last_run&&a.jsxs("span",{children:["Last: ",yl(n.last_run)]}),n.run_count!==void 0&&a.jsxs("span",{children:["Runs: ",n.run_count]})]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p?a.jsx("button",{onClick:()=>r(f),className:"p-2 rounded-lg text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Pause",children:a.jsx(hp,{className:"w-4 h-4"})}):x?a.jsx("button",{onClick:()=>s(f),className:"p-2 rounded-lg text-emerald-400 hover:bg-emerald-500/10 transition-colors",title:"Resume",children:a.jsx(Za,{className:"w-4 h-4"})}):null,a.jsx("button",{onClick:()=>o(f),className:"p-2 rounded-lg text-red-400/60 hover:text-red-400 hover:bg-red-500/10 transition-colors",title:"Delete",children:a.jsx(Ia,{className:"w-4 h-4"})})]})]}),u&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800/60 text-xs text-gray-400 space-y-1.5",children:[n.task&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Task:"})," ",n.task]}),n.description&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Description:"})," ",n.description]}),n.model&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Model:"})," ",n.model]}),n.created_at&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Created:"})," ",yl(n.created_at)]})]})]})}function Qw(){const[n,r]=O.useState("workers"),[s,o]=O.useState(0),[u,d]=O.useState(0);return O.useEffect(()=>{const f=async()=>{var p,h,y;try{const[g,v]=await Promise.all([fe.getWorkers().catch(()=>null),fe.getScheduler().catch(()=>null)]);o(((p=g==null?void 0:g.stats)==null?void 0:p.active_count)||0),d(((h=v==null?void 0:v.stats)==null?void 0:h.active_jobs)||((y=v==null?void 0:v.jobs)==null?void 0:y.length)||0)}catch{}};f();const x=setInterval(f,5e3);return()=>clearInterval(x)},[]),a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-1",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Workers & Automation"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Monitor active workers, job queue, scheduled tasks, and task history."})]}),a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Xx,{active:n==="workers",onClick:()=>r("workers"),icon:bl,label:"Workers",badge:s}),a.jsx(Xx,{active:n==="scheduler",onClick:()=>r("scheduler"),icon:Ba,label:"Scheduler",badge:u})]}),a.jsxs("div",{className:"min-h-[500px]",children:[n==="workers"&&a.jsx(qw,{}),n==="scheduler"&&a.jsx(Gw,{})]})]})})}function Xw({steps:n,currentStep:r}){return a.jsx("div",{className:"flex items-center gap-1 mb-6",children:n.map((s,o)=>a.jsxs("div",{className:"flex items-center",children:[a.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all ${o===r?"bg-plutus-500/20 text-plutus-400 border border-plutus-500/30":o<r?"bg-emerald-500/10 text-emerald-400":"bg-gray-800 text-gray-500"}`,children:[o<r?a.jsx(qe,{className:"w-3.5 h-3.5"}):a.jsx("span",{className:"w-4 h-4 rounded-full bg-gray-700 flex items-center justify-center text-[10px]",children:o+1}),a.jsx("span",{className:"hidden sm:inline",children:s})]}),o<n.length-1&&a.jsx(gn,{className:"w-4 h-4 text-gray-700 mx-1"})]},o))})}const Fw=[{name:"Word Counter",description:"Count words, lines, and characters in a file",icon:od,toolName:"word_counter",code:`"""Count words, lines, and characters in a file."""

def main(args: dict) -> dict:
    path = args.get("path", "")
    if not path:
        return {"success": False, "result": "Please provide a file path"}
    
    try:
        with open(path, "r") as f:
            content = f.read()
        
        lines = content.split("\\n")
        words = content.split()
        
        return {
            "success": True,
            "result": {
                "file": path,
                "lines": len(lines),
                "words": len(words),
                "characters": len(content),
                "non_empty_lines": sum(1 for l in lines if l.strip()),
            }
        }
    except FileNotFoundError:
        return {"success": False, "result": f"File not found: {path}"}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"JSON Formatter",description:"Pretty-print and validate JSON files",icon:Ii,toolName:"json_formatter",code:`"""Format and validate JSON files."""
import json

def main(args: dict) -> dict:
    path = args.get("path", "")
    indent = args.get("indent", 2)
    
    if not path:
        return {"success": False, "result": "Please provide a file path"}
    
    try:
        with open(path, "r") as f:
            data = json.load(f)
        
        formatted = json.dumps(data, indent=indent, sort_keys=True)
        
        # Optionally write back
        if args.get("write_back", False):
            with open(path, "w") as f:
                f.write(formatted)
        
        return {
            "success": True,
            "result": {
                "valid": True,
                "keys": len(data) if isinstance(data, dict) else None,
                "items": len(data) if isinstance(data, list) else None,
                "formatted": formatted[:500],
            }
        }
    except json.JSONDecodeError as e:
        return {"success": False, "result": f"Invalid JSON: {e}"}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"File Search",description:"Search for files by name or content pattern",icon:$l,toolName:"file_search",code:`"""Search for files by name or content."""
import os
import re

def main(args: dict) -> dict:
    directory = args.get("directory", ".")
    pattern = args.get("pattern", "")
    content_pattern = args.get("content", "")
    max_results = args.get("max_results", 20)
    
    if not pattern and not content_pattern:
        return {"success": False, "result": "Provide a 'pattern' or 'content' to search for"}
    
    results = []
    
    try:
        for root, dirs, files in os.walk(directory):
            # Skip hidden directories
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            
            for fname in files:
                if len(results) >= max_results:
                    break
                
                full_path = os.path.join(root, fname)
                
                # Match filename
                if pattern and re.search(pattern, fname, re.IGNORECASE):
                    results.append({"path": full_path, "match": "filename"})
                    continue
                
                # Match content
                if content_pattern:
                    try:
                        with open(full_path, "r", errors="ignore") as f:
                            for i, line in enumerate(f, 1):
                                if re.search(content_pattern, line):
                                    results.append({
                                        "path": full_path,
                                        "match": "content",
                                        "line": i,
                                        "text": line.strip()[:100],
                                    })
                                    break
                    except (PermissionError, IsADirectoryError):
                        pass
        
        return {"success": True, "result": {"matches": results, "count": len(results)}}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"Start from Scratch",description:"Write your own tool from a blank template",icon:ud,toolName:"my_tool",code:`"""Describe what your tool does here."""

def main(args: dict) -> dict:
    """
    Main entry point for the tool.
    
    Args:
        args: Dictionary of arguments passed to the tool.
              Access them with args.get("key", default_value)
    
    Returns:
        Dictionary with "success" (bool) and "result" (any) keys.
    """
    # Your code here
    name = args.get("name", "World")
    
    return {
        "success": True,
        "result": f"Hello, {name}! Your tool is working."
    }
`}];function Zw(){var K;const[n,r]=O.useState(0),[s,o]=O.useState(""),[u,d]=O.useState(""),[f,x]=O.useState(""),[p,h]=O.useState(!1),[y,g]=O.useState(null),{data:v,loading:j,refetch:w}=wg(()=>fe.getCustomTools(),[]),S=["Choose Template","Name & Describe","Write Code","Create"],D=U=>{o(U.toolName),d(U.description),x(U.code),r(1)},E=async()=>{h(!0),g(null);try{const U=await fe.createCustomTool(s,u,f,!0);g({success:!0,message:`Tool "${U.tool_name}" created successfully! ${U.registered?"It's now registered and the AI can use it immediately.":"Saved to disk — it will be available after restart."} (${U.code_lines} lines)`}),w()}catch(U){const $=(U instanceof Error?U.message:"Failed to create tool").replace(/^API error \d+: /,"").replace(/^"|"$/g,"");g({success:!1,message:$})}finally{h(!1)}},q=async U=>{if(confirm(`Delete tool "${U}"? This cannot be undone.`))try{await fe.deleteCustomTool(U),w()}catch(L){console.error("Failed to delete tool:",L)}},H=()=>{r(0),o(""),d(""),x(""),g(null)};return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6 max-w-4xl mx-auto",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Tool Creator"}),a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Create custom tools that extend what the AI can do. Tools are small Python scripts that the AI can call during conversations."})]}),a.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2 space-y-4",children:a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-sm font-semibold text-gray-300 flex items-center gap-2",children:[a.jsx(xp,{className:"w-4 h-4 text-plutus-400"}),"Create New Tool"]}),n>0&&a.jsx("button",{onClick:H,className:"text-xs text-gray-500 hover:text-gray-300",children:"Start over"})]}),a.jsx(Xw,{steps:S,currentStep:n}),n===0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-4",children:"Pick a starting template or start from scratch. Don't worry — you can customize everything in the next steps."}),a.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:Fw.map(U=>{const L=U.icon;return a.jsxs("button",{onClick:()=>D(U),className:"text-left p-4 rounded-xl border border-gray-800 hover:border-plutus-500/50 hover:bg-gray-800/50 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center group-hover:bg-plutus-500/20 transition-colors",children:a.jsx(L,{className:"w-4 h-4 text-plutus-400"})}),a.jsx("h3",{className:"text-sm font-medium text-gray-200",children:U.name})]}),a.jsx("p",{className:"text-xs text-gray-500",children:U.description})]},U.name)})})]}),n===1&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400 mb-1.5 block",children:"Tool Name"}),a.jsx("input",{type:"text",className:"input font-mono",value:s,onChange:U=>o(U.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"my_awesome_tool"}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Use lowercase letters, numbers, and underscores only."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400 mb-1.5 block",children:"Description"}),a.jsx("textarea",{className:"input min-h-[80px] resize-y",value:u,onChange:U=>d(U.target.value),placeholder:"Describe what this tool does in plain English...",rows:3}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"This helps the AI understand when to use your tool."})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(0),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]}),a.jsxs("button",{onClick:()=>r(2),disabled:!s.trim(),className:"btn-primary flex items-center gap-2",children:["Next",a.jsx(gn,{className:"w-4 h-4"})]})]})]}),n===2&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Python Code"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(f)},className:"text-xs text-gray-500 hover:text-gray-300 flex items-center gap-1",children:[a.jsx(qa,{className:"w-3 h-3"}),"Copy"]})})]}),a.jsx("div",{className:"relative",children:a.jsx("textarea",{className:"input font-mono text-xs min-h-[300px] resize-y leading-relaxed",value:f,onChange:U=>x(U.target.value),spellCheck:!1,style:{tabSize:4}})}),a.jsx("div",{className:"bg-blue-500/5 border border-blue-500/20 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Vh,{className:"w-4 h-4 text-blue-400 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"text-xs text-blue-300/80",children:[a.jsx("p",{className:"font-medium mb-1",children:"How tools work:"}),a.jsxs("ul",{className:"space-y-1 text-blue-300/60",children:[a.jsxs("li",{children:["• Your tool must have a"," ",a.jsx("code",{className:"text-blue-400",children:"main(args: dict) → dict"})," ","function"]}),a.jsxs("li",{children:["• Return"," ",a.jsx("code",{className:"text-blue-400",children:'{"success": True, "result": ...}'})]}),a.jsxs("li",{children:["• Access arguments with"," ",a.jsx("code",{className:"text-blue-400",children:'args.get("key", default)'})]}),a.jsx("li",{children:"• The AI will call your tool automatically when needed"})]})]})]})}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(1),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]}),a.jsxs("button",{onClick:()=>r(3),disabled:!f.trim(),className:"btn-primary flex items-center gap-2",children:["Review & Create",a.jsx(gn,{className:"w-4 h-4"})]})]})]}),n===3&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-gray-800/50 rounded-xl p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(Xu,{className:"w-5 h-5 text-plutus-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:s}),a.jsx("p",{className:"text-xs text-gray-400",children:u})]})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-3",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Code Preview"}),a.jsxs("pre",{className:"text-xs text-gray-300 font-mono bg-gray-900 rounded-lg p-3 max-h-40 overflow-y-auto",children:[f.slice(0,500),f.length>500?`
...`:""]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[a.jsxs("span",{children:[f.split(`
`).length," lines"]}),a.jsxs("span",{children:[f.length," characters"]})]})]}),y&&a.jsx("div",{className:`rounded-lg p-4 ${y.success?"bg-emerald-500/10 border border-emerald-500/20":"bg-red-500/10 border border-red-500/20"}`,children:a.jsxs("div",{className:"flex items-start gap-2",children:[y.success?a.jsx(qe,{className:"w-5 h-5 text-emerald-400 flex-shrink-0"}):a.jsx(Yl,{className:"w-5 h-5 text-red-400 flex-shrink-0"}),a.jsx("p",{className:`text-sm ${y.success?"text-emerald-300":"text-red-300"}`,children:y.message})]})}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(2),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Edit Code"]}),a.jsxs("button",{onClick:E,disabled:p,className:"btn-primary flex items-center gap-2",children:[p?a.jsx(Ya,{className:"w-4 h-4 animate-spin"}):a.jsx(ud,{className:"w-4 h-4"}),p?"Creating...":"Create Tool"]}),(y==null?void 0:y.success)&&a.jsx("button",{onClick:H,className:"btn-secondary",children:"Create Another"})]})]})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-sm font-semibold text-gray-300 flex items-center gap-2",children:[a.jsx(vn,{className:"w-4 h-4 text-gray-400"}),"Your Custom Tools"]}),a.jsx("button",{onClick:w,className:"text-gray-500 hover:text-gray-300",children:a.jsx(Ya,{className:"w-3.5 h-3.5"})})]}),j?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(Ya,{className:"w-4 h-4 animate-spin text-gray-500"})}):(K=v==null?void 0:v.tools)!=null&&K.length?a.jsx("div",{className:"space-y-2",children:v.tools.map(U=>a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-gray-800/50 hover:bg-gray-800 transition-colors group",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-pink-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(vn,{className:"w-4 h-4 text-pink-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-xs font-medium text-gray-200",children:U.name}),a.jsx("p",{className:"text-[10px] text-gray-500 line-clamp-2 mt-0.5",children:U.description||"No description"}),U.code_lines&&a.jsxs("span",{className:"text-[10px] text-gray-600",children:[U.code_lines," lines"]})]}),a.jsx("button",{onClick:()=>q(U.name),className:"opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-300 p-1 transition-opacity",title:"Delete tool",children:a.jsx(Ia,{className:"w-3.5 h-3.5"})})]},U.name))}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Xu,{className:"w-8 h-8 text-gray-700 mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No custom tools yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Create one using the wizard, or ask the AI to create one during a conversation."})]})]}),a.jsx("div",{className:"card bg-gradient-to-br from-plutus-500/5 to-purple-500/5 border-plutus-500/20",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Vh,{className:"w-4 h-4 text-plutus-400 mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xs font-semibold text-gray-300 mb-2",children:"Pro Tips"}),a.jsxs("ul",{className:"space-y-1.5 text-[11px] text-gray-400",children:[a.jsxs("li",{children:["💬 You can ask the AI: ",a.jsx("em",{children:'"Create a tool that..."'})," and it will write the code for you"]}),a.jsx("li",{children:"🔄 Custom tools persist across sessions and are available immediately"}),a.jsx("li",{children:"🛡️ Each tool runs in an isolated subprocess for safety"}),a.jsx("li",{children:"📦 Tools can import standard Python libraries (os, json, re, etc.)"})]})]})]})})]})]})]})}const Iw={messaging:{icon:"💬",color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},calendar:{icon:"📅",color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},email:{icon:"📧",color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},music:{icon:"🎵",color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},files:{icon:"📁",color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"},browser:{icon:"🌐",color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},productivity:{icon:"⚡",color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},social:{icon:"👥",color:"text-violet-400",bg:"bg-violet-500/10",border:"border-violet-500/20"},development:{icon:"💻",color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},system:{icon:"⚙️",color:"text-gray-400",bg:"bg-gray-500/10",border:"border-gray-500/20"},custom:{icon:"🧩",color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"}},Kw={icon:"📦",color:"text-white/60",bg:"bg-white/5",border:"border-white/10"};function Hi(n){return Iw[n]||Kw}function Jw(){const[n,r]=O.useState([]),[s,o]=O.useState([]),[u,d]=O.useState([]),[f,x]=O.useState(!0),[p,h]=O.useState("all"),[y,g]=O.useState(""),[v,j]=O.useState(null),[w,S]=O.useState("browse"),[D,E]=O.useState(""),[q,H]=O.useState(null),[K,U]=O.useState(null),[L,$]=O.useState(null),ue=O.useRef(null),P=O.useCallback(async()=>{try{const[z,re]=await Promise.all([fe.getSkills().catch(()=>({skills:[],categories:[]})),fe.getSavedSkills().catch(()=>({skills:[]}))]),oe=Array.isArray(z.skills)?z.skills:[],C=Array.isArray(z.categories)?z.categories:[],_=Array.isArray(re.skills)?re.skills:[];r(oe),d(C),o(_)}catch{}finally{x(!1)}},[]);O.useEffect(()=>{P()},[P]);const A=n.filter(z=>{const re=p==="all"||z.category===p,oe=!y||z.name.toLowerCase().includes(y.toLowerCase())||z.description.toLowerCase().includes(y.toLowerCase())||z.app.toLowerCase().includes(y.toLowerCase())||z.triggers.some(C=>C.toLowerCase().includes(y.toLowerCase()));return re&&oe}),ae=async z=>{H(null);try{const re=JSON.parse(z),oe=await fe.importSkill(re);H({type:"success",msg:oe.message||`Imported skill: ${oe.skill_name}`}),E(""),P()}catch(re){H({type:"error",msg:re.message||"Invalid JSON or import failed"})}},ne=z=>{var C;const re=(C=z.target.files)==null?void 0:C[0];if(!re)return;const oe=new FileReader;oe.onload=_=>{var k;const F=(k=_.target)==null?void 0:k.result;E(F),ae(F)},oe.readAsText(re),z.target.value=""},X=async z=>{U(z),$(null);try{const re=await fe.exportSkill(z);$(JSON.stringify(re,null,2))}catch(re){$(`Error: ${re.message}`)}},W=async z=>{try{await fe.deleteSkill(z),P()}catch{}},te=z=>{navigator.clipboard.writeText(z).catch(()=>{})},M=[{id:"browse",label:"Browse All",icon:"🔍",count:n.length},{id:"my-skills",label:"My Skills",icon:"⭐",count:s.length},{id:"import",label:"Import / Upload",icon:"📥"},{id:"community",label:"Community",icon:"🌍"}];return a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx("div",{className:"bg-gradient-to-br from-violet-600/10 via-purple-600/5 to-fuchsia-600/10 border border-violet-500/20 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[a.jsx("span",{className:"text-3xl",children:"🧠"})," Skills"]}),a.jsx("p",{className:"text-white/50 text-sm mt-1 max-w-xl",children:"Skills are step-by-step recipes that teach Plutus how to use apps on your computer. Browse built-in skills, import community skills, or let Plutus create new ones automatically."})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-violet-400",children:n.length}),a.jsx("div",{className:"text-white/30 text-[10px]",children:"Total"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-emerald-400",children:s.length}),a.jsx("div",{className:"text-white/30 text-[10px]",children:"Custom"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-amber-400",children:u.length}),a.jsx("div",{className:"text-white/30 text-[10px]",children:"Categories"})]})]})]})}),a.jsx("div",{className:"flex gap-1 bg-[#0f0f1a] border border-white/10 rounded-xl p-1",children:M.map(z=>a.jsxs("button",{onClick:()=>S(z.id),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all ${w===z.id?"bg-violet-500/20 text-violet-400 border border-violet-500/30":"text-white/40 hover:text-white/60 hover:bg-white/5 border border-transparent"}`,children:[a.jsx("span",{children:z.icon}),a.jsx("span",{children:z.label}),z.count!==void 0&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-white/5",children:z.count})]},z.id))}),w==="browse"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex gap-3",children:a.jsxs("div",{className:"flex-1 relative",children:[a.jsx("input",{type:"text",value:y,onChange:z=>g(z.target.value),placeholder:"Search skills by name, app, or trigger...",className:"w-full bg-[#1a1a2e] border border-white/10 rounded-xl px-4 py-2.5 text-sm text-white placeholder-white/30 focus:outline-none focus:border-violet-500/50"}),y&&a.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/30 hover:text-white/60 text-xs",children:"✕"})]})}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[a.jsxs("button",{onClick:()=>h("all"),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${p==="all"?"bg-violet-500/20 text-violet-400 border border-violet-500/30":"bg-white/5 text-white/40 border border-white/10 hover:bg-white/10"}`,children:["All (",n.length,")"]}),u.map(z=>{const re=Hi(z),oe=n.filter(C=>C.category===z).length;return a.jsxs("button",{onClick:()=>h(z),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors capitalize flex items-center gap-1.5 ${p===z?`${re.bg} ${re.color} border ${re.border}`:"bg-white/5 text-white/40 border border-white/10 hover:bg-white/10"}`,children:[re.icon," ",z," (",oe,")"]},z)})]}),f?a.jsx("div",{className:"text-center py-12 text-white/30",children:"Loading skills..."}):A.length===0?a.jsxs("div",{className:"text-center py-12 text-white/30",children:[a.jsx("div",{className:"text-3xl mb-2",children:"🔍"}),"No skills found matching your search."]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:A.map(z=>{const re=Hi(z.category),oe=v===z.name;return a.jsxs("div",{className:`bg-[#1a1a2e] border rounded-xl overflow-hidden transition-all cursor-pointer ${oe?`${re.border} shadow-lg`:"border-white/10 hover:border-white/20"}`,onClick:()=>j(oe?null:z.name),children:[a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:`text-xl w-8 h-8 rounded-lg ${re.bg} flex items-center justify-center`,children:re.icon}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:z.app}),a.jsx("code",{className:"text-[10px] font-mono text-violet-400/70",children:z.name})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[z.dynamic&&a.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-rose-500/10 text-rose-400",children:"Custom"}),a.jsx("span",{className:"text-white/20 text-xs",children:oe?"▲":"▼"})]})]}),a.jsx("p",{className:"text-white/50 text-xs leading-relaxed",children:z.description})]}),oe&&a.jsxs("div",{className:"border-t border-white/10 p-4 bg-white/[0.02] space-y-3",children:[z.required_params.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-white/40 text-[10px] uppercase tracking-wider mb-1",children:"Required Parameters"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:z.required_params.map(C=>a.jsx("span",{className:`text-xs ${re.bg} ${re.color} px-2 py-0.5 rounded font-mono`,children:C},C))})]}),z.optional_params.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-white/40 text-[10px] uppercase tracking-wider mb-1",children:"Optional"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:z.optional_params.map(C=>a.jsx("span",{className:"text-xs bg-white/5 text-white/40 px-2 py-0.5 rounded font-mono",children:C},C))})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white/40 text-[10px] uppercase tracking-wider mb-1",children:"Triggers"}),a.jsxs("div",{className:"flex flex-wrap gap-1",children:[z.triggers.slice(0,6).map(C=>a.jsxs("span",{className:"text-[10px] bg-white/5 text-white/30 px-1.5 py-0.5 rounded",children:['"',C,'"']},C)),z.triggers.length>6&&a.jsxs("span",{className:"text-[10px] text-white/20",children:["+",z.triggers.length-6," more"]})]})]}),a.jsxs("div",{className:"flex gap-2 pt-1",children:[a.jsx("button",{onClick:C=>{C.stopPropagation(),X(z.name)},className:"flex-1 text-xs py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"📤 Export"}),a.jsx("button",{onClick:C=>{C.stopPropagation(),Ie.getState().setView("chat")},className:"flex-1 text-xs py-1.5 rounded-lg bg-blue-500/10 text-blue-400 border border-blue-500/20 hover:bg-blue-500/20 transition-colors",children:"💬 Try in Chat"})]})]})]},z.name)})})]}),w==="my-skills"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-white/40 text-sm",children:"Skills created by you or by Plutus during conversations. These are saved permanently on your machine."}),a.jsx("button",{onClick:()=>S("import"),className:"text-xs px-3 py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"+ Import Skill"})]}),s.length===0?a.jsxs("div",{className:"text-center py-16 bg-[#1a1a2e] border border-white/10 rounded-xl",children:[a.jsx("div",{className:"text-4xl mb-3",children:"🌱"}),a.jsx("h3",{className:"text-white/70 font-semibold mb-1",children:"No custom skills yet"}),a.jsx("p",{className:"text-white/30 text-sm max-w-md mx-auto",children:"As you use Plutus, it will automatically create skills for tasks it learns. You can also import skills from the community or create them manually."}),a.jsxs("div",{className:"flex gap-3 justify-center mt-4",children:[a.jsx("button",{onClick:()=>S("import"),className:"text-xs px-4 py-2 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20",children:"📥 Import a Skill"}),a.jsx("button",{onClick:()=>S("community"),className:"text-xs px-4 py-2 rounded-lg bg-blue-500/10 text-blue-400 border border-blue-500/20 hover:bg-blue-500/20",children:"🌍 Browse Community"})]})]}):a.jsx("div",{className:"space-y-2",children:s.map(z=>{const re=Hi(z.category);return a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-4 flex items-center gap-4",children:[a.jsx("span",{className:`text-xl w-10 h-10 rounded-lg ${re.bg} flex items-center justify-center flex-shrink-0`,children:re.icon}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:z.name}),a.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/5 text-white/30",children:["v",z.version||1]}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${re.bg} ${re.color} capitalize`,children:z.category})]}),a.jsx("p",{className:"text-white/40 text-xs mt-0.5 truncate",children:z.description}),z.reason&&a.jsxs("p",{className:"text-white/20 text-[10px] mt-0.5 italic",children:["Created because: ",z.reason]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsxs("span",{className:"text-white/20 text-xs",children:[z.steps_count||"?"," steps"]}),a.jsx("button",{onClick:()=>X(z.name),className:"text-xs px-2.5 py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"📤 Export"}),a.jsx("button",{onClick:()=>W(z.name),className:"text-xs px-2.5 py-1.5 rounded-lg bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition-colors",children:"🗑️"})]})]},z.name)})})]}),w==="import"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-[#1a1a2e] border border-dashed border-violet-500/30 rounded-xl p-8 text-center",children:[a.jsx("div",{className:"text-4xl mb-3",children:"📁"}),a.jsx("h3",{className:"text-white/80 font-semibold mb-1",children:"Upload a Skill File"}),a.jsxs("p",{className:"text-white/30 text-sm mb-4",children:["Drop a ",a.jsx("code",{className:"text-violet-400/70",children:".json"})," skill file here or click to browse"]}),a.jsx("input",{ref:ue,type:"file",accept:".json",onChange:ne,className:"hidden"}),a.jsx("button",{onClick:()=>{var z;return(z=ue.current)==null?void 0:z.click()},className:"px-6 py-2.5 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium",children:"Choose File"})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-white/80 font-semibold mb-1 flex items-center gap-2",children:[a.jsx("span",{children:"📋"})," Paste Skill JSON"]}),a.jsx("p",{className:"text-white/30 text-sm mb-3",children:"Paste a skill JSON exported from another Plutus instance or from the community"}),a.jsx("textarea",{value:D,onChange:z=>E(z.target.value),placeholder:`{
  "plutus_skill": true,
  "skill": {
    "name": "my_skill",
    "description": "What this skill does",
    "app": "MyApp",
    "category": "custom",
    "triggers": ["my trigger"],
    "required_params": ["param1"],
    "optional_params": [],
    "steps": [
      {
        "description": "Step 1",
        "operation": "open_app",
        "params": { "app_name": "{{param1}}" }
      }
    ]
  }
}`,className:"w-full h-48 bg-[#0f0f1a] border border-white/10 rounded-xl p-4 text-xs font-mono text-white/70 placeholder-white/20 focus:outline-none focus:border-violet-500/50 resize-none"}),a.jsxs("div",{className:"flex items-center justify-between mt-3",children:[a.jsx("div",{children:q&&a.jsxs("div",{className:`text-xs px-3 py-1.5 rounded-lg ${q.type==="success"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[q.type==="success"?"✅":"❌"," ",q.msg]})}),a.jsx("button",{onClick:()=>ae(D),disabled:!D.trim(),className:"px-5 py-2 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium disabled:opacity-30 disabled:cursor-not-allowed",children:"Import Skill"})]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-white/80 font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"📖"})," Skill Format Guide"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-xs",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-white/50 font-semibold",children:"Required Fields"}),a.jsx("div",{className:"space-y-1",children:[{field:"name",desc:"Unique identifier (snake_case)"},{field:"description",desc:"What the skill does"},{field:"steps",desc:"Array of step objects"}].map(z=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"text-violet-400/80 bg-violet-500/10 px-1.5 py-0.5 rounded",children:z.field}),a.jsx("span",{className:"text-white/30",children:z.desc})]},z.field))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-white/50 font-semibold",children:"Optional Fields"}),a.jsx("div",{className:"space-y-1",children:[{field:"app",desc:"App name (e.g., WhatsApp)"},{field:"category",desc:"Category (messaging, calendar, etc.)"},{field:"triggers",desc:"Keywords that activate this skill"},{field:"required_params",desc:"Parameters the user must provide"},{field:"optional_params",desc:"Parameters that are optional"}].map(z=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"text-blue-400/80 bg-blue-500/10 px-1.5 py-0.5 rounded",children:z.field}),a.jsx("span",{className:"text-white/30",children:z.desc})]},z.field))})]})]}),a.jsxs("div",{className:"mt-4 text-white/30 text-xs",children:["Each step needs: ",a.jsx("code",{className:"text-violet-400/60",children:"operation"}),' (like "open_app", "browser_click"),'," ",a.jsx("code",{className:"text-violet-400/60",children:"description"}),", and"," ",a.jsx("code",{className:"text-violet-400/60",children:"params"}),". Use ",a.jsx("code",{className:"text-amber-400/60",children:"{{param_name}}"})," for dynamic values."]})]})]}),w==="community"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-gradient-to-br from-blue-600/10 via-indigo-600/5 to-violet-600/10 border border-blue-500/20 rounded-2xl p-8 text-center",children:[a.jsx("div",{className:"text-5xl mb-4",children:"🌍"}),a.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Plutus Skill Community"}),a.jsx("p",{className:"text-white/40 text-sm max-w-lg mx-auto",children:"Share your skills with other Plutus users and discover skills created by the community. Every skill you share helps make Plutus smarter for everyone."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"📤"}),a.jsx("h3",{className:"text-white/80 font-semibold text-sm mb-1",children:"Export & Share"}),a.jsxs("p",{className:"text-white/30 text-xs leading-relaxed",children:["Go to ",a.jsx("strong",{className:"text-white/50",children:"My Skills"}),", click ",a.jsx("strong",{className:"text-violet-400",children:"Export"})," on any skill, and share the JSON file on GitHub, Discord, or any community platform."]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"📥"}),a.jsx("h3",{className:"text-white/80 font-semibold text-sm mb-1",children:"Import from Others"}),a.jsxs("p",{className:"text-white/30 text-xs leading-relaxed",children:["Download a ",a.jsx("code",{className:"text-violet-400/60",children:".json"})," skill file from the community, then use the ",a.jsx("strong",{className:"text-white/50",children:"Import"})," tab to add it to your Plutus."]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"🤖"}),a.jsx("h3",{className:"text-white/80 font-semibold text-sm mb-1",children:"AI-Created Skills"}),a.jsxs("p",{className:"text-white/30 text-xs leading-relaxed",children:["When Plutus creates a skill for you, it appears in ",a.jsx("strong",{className:"text-white/50",children:"My Skills"}),". Export it and share it so others can benefit from what your Plutus learned!"]})]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-white/80 font-semibold mb-4 flex items-center gap-2",children:[a.jsx("span",{children:"🔗"})," Community Channels"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/discussions",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-white/10 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"💬"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white/70 text-sm font-semibold group-hover:text-white/90 transition-colors",children:"GitHub Discussions"}),a.jsx("div",{className:"text-white/30 text-xs",children:"Share skills, ask questions, suggest features"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/tree/main/community-skills",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-white/10 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"📂"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white/70 text-sm font-semibold group-hover:text-white/90 transition-colors",children:"Skill Repository"}),a.jsx("div",{className:"text-white/30 text-xs",children:"Browse and download community-created skills"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/issues/new?template=skill-request.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-white/10 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"💡"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white/70 text-sm font-semibold group-hover:text-white/90 transition-colors",children:"Request a Skill"}),a.jsx("div",{className:"text-white/30 text-xs",children:"Can't find what you need? Request it from the community"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-white/10 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"🤝"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white/70 text-sm font-semibold group-hover:text-white/90 transition-colors",children:"Contributing Guide"}),a.jsx("div",{className:"text-white/30 text-xs",children:"Learn how to contribute skills to the official repo"})]})]})]})]}),a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-white/80 font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"⭐"})," Featured Community Skills"]}),a.jsx("p",{className:"text-white/30 text-sm mb-4",children:"Popular skills shared by the community. Click to import directly."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[{name:"slack_send_message",app:"Slack",cat:"messaging",desc:"Send a message in any Slack channel or DM",author:"community"},{name:"notion_create_page",app:"Notion",cat:"productivity",desc:"Create a new page in Notion with title and content",author:"community"},{name:"zoom_join_meeting",app:"Zoom",cat:"communication",desc:"Join a Zoom meeting by meeting ID",author:"community"},{name:"twitter_post",app:"Twitter/X",cat:"social",desc:"Post a tweet from your account",author:"community"},{name:"google_docs_create",app:"Google Docs",cat:"productivity",desc:"Create a new Google Doc with content",author:"community"},{name:"youtube_search_play",app:"YouTube",cat:"media",desc:"Search YouTube and play the first result",author:"community"}].map(z=>{const re=Hi(z.cat);return a.jsxs("div",{className:"bg-white/[0.03] border border-white/10 rounded-xl p-4 hover:border-violet-500/30 transition-colors cursor-pointer group",onClick:()=>{S("import"),E(JSON.stringify({plutus_skill:!0,skill:{name:z.name,description:z.desc,app:z.app,category:z.cat,triggers:[z.app.toLowerCase(),z.name.replace(/_/g," ")],required_params:[],optional_params:[],steps:[{description:`Open ${z.app}`,operation:"open_app",params:{app_name:z.app}}],reason:`Community skill for ${z.app}`}},null,2))},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:`text-lg w-7 h-7 rounded-lg ${re.bg} flex items-center justify-center`,children:re.icon}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-white/70 group-hover:text-white/90",children:z.app}),a.jsx("code",{className:"text-[9px] text-violet-400/50",children:z.name})]})]}),a.jsx("p",{className:"text-white/30 text-[11px] leading-relaxed",children:z.desc}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("span",{className:"text-[9px] text-white/20",children:["by ",z.author]}),a.jsx("span",{className:"text-[9px] text-violet-400/50 opacity-0 group-hover:opacity-100 transition-opacity",children:"Click to import →"})]})]},z.name)})})]})]}),K&&L&&a.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-[#1a1a2e] border border-white/10 rounded-2xl max-w-2xl w-full max-h-[80vh] overflow-hidden",children:[a.jsxs("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-semibold",children:"Export Skill"}),a.jsx("code",{className:"text-violet-400/70 text-xs",children:K})]}),a.jsx("button",{onClick:()=>{U(null),$(null)},className:"text-white/30 hover:text-white/60 text-lg",children:"✕"})]}),a.jsx("div",{className:"p-6 overflow-y-auto max-h-[50vh]",children:a.jsx("pre",{className:"text-xs font-mono text-white/60 bg-[#0f0f1a] rounded-xl p-4 overflow-x-auto",children:L})}),a.jsxs("div",{className:"p-6 border-t border-white/10 flex gap-3",children:[a.jsx("button",{onClick:()=>te(L),className:"flex-1 py-2.5 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium",children:"📋 Copy to Clipboard"}),a.jsx("button",{onClick:()=>{const z=new Blob([L],{type:"application/json"}),re=URL.createObjectURL(z),oe=document.createElement("a");oe.href=re,oe.download=`${K}.json`,oe.click(),URL.revokeObjectURL(re)},className:"flex-1 py-2.5 rounded-xl bg-blue-500/20 text-blue-400 border border-blue-500/30 hover:bg-blue-500/30 transition-colors text-sm font-medium",children:"💾 Download .json"})]})]})})]})}function La({icon:n,label:r,value:s,color:o}){const u={blue:"text-blue-400 bg-blue-500/10",emerald:"text-emerald-400 bg-emerald-500/10",amber:"text-amber-400 bg-amber-500/10",purple:"text-purple-400 bg-purple-500/10",plutus:"text-plutus-400 bg-plutus-500/10",gray:"text-gray-400 bg-gray-500/10"},d=u[o]||u.gray;return a.jsxs("div",{className:"card flex items-center gap-4",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${d}`,children:a.jsx(n,{className:"w-5 h-5"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-bold text-gray-200",children:s}),a.jsx("p",{className:"text-xs text-gray-500",children:r})]})]})}function Qu({plan:n}){const[r,s]=O.useState(n.status==="active"),o={active:"text-blue-400 bg-blue-500/10",completed:"text-emerald-400 bg-emerald-500/10",cancelled:"text-gray-400 bg-gray-500/10",failed:"text-red-400 bg-red-500/10"},u={done:qe,in_progress:Gn,failed:yn,skipped:ap,pending:Gn},d={done:"text-emerald-400",in_progress:"text-blue-400 animate-pulse",failed:"text-red-400",skipped:"text-gray-500",pending:"text-gray-600"},f=n.steps||[],x=f.filter(h=>h.status==="done"||h.status==="skipped").length,p=f.length>0?Math.round(x/f.length*100):0;return a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>s(!r),children:[r?a.jsx(Gl,{className:"w-4 h-4 text-gray-500"}):a.jsx(gn,{className:"w-4 h-4 text-gray-500"}),a.jsx(qi,{className:"w-5 h-5 text-blue-400"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-200",children:n.title}),n.goal&&a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n.goal})]}),a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${o[n.status]||o.active}`,children:n.status}),a.jsxs("span",{className:"text-xs text-gray-500",children:[x,"/",f.length]})]}),a.jsx("div",{className:"mt-3 bg-gray-800 rounded-full h-1.5",children:a.jsx("div",{className:"bg-blue-500 rounded-full h-1.5 transition-all duration-500",style:{width:`${p}%`}})}),r&&f.length>0&&a.jsx("div",{className:"mt-3 space-y-1.5 ml-6",children:f.map((h,y)=>{const g=u[h.status]||Gn,v=d[h.status]||"text-gray-600";return a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(g,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${v}`}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:`text-sm ${h.status==="done"?"text-gray-400 line-through":h.status==="in_progress"?"text-blue-300 font-medium":"text-gray-400"}`,children:h.description}),h.result&&a.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:h.result})]})]},y)})})]})}function Fx({goal:n}){const r={active:Va,completed:qe,failed:yn,cancelled:ap},s={active:"text-blue-400",completed:"text-emerald-400",failed:"text-red-400",cancelled:"text-gray-500"},o=r[n.status]||Va,u=s[n.status]||"text-gray-400";return a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(o,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${u}`}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:`text-sm ${n.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:n.description}),a.jsxs("p",{className:"text-xs text-gray-600 mt-0.5",children:[n.status," · priority ",n.priority??0]})]})]})}function Pw({fact:n,onDelete:r}){const s={task_context:"bg-blue-500/20 text-blue-400",decision:"bg-purple-500/20 text-purple-400",progress:"bg-emerald-500/20 text-emerald-400",file_path:"bg-amber-500/20 text-amber-400",technical:"bg-cyan-500/20 text-cyan-400",user_preference:"bg-pink-500/20 text-pink-400",environment:"bg-orange-500/20 text-orange-400",credential:"bg-red-500/20 text-red-400",general:"bg-gray-500/20 text-gray-400"},o=s[n.category]||s.general;return a.jsxs("div",{className:"flex items-start gap-3 py-2 group",children:[a.jsx(es,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-600"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${o}`,children:n.category})}),a.jsx("p",{className:"text-sm text-gray-300",children:n.content})]}),a.jsx("button",{onClick:()=>r(n.id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-600 hover:text-red-400",children:a.jsx(Ia,{className:"w-3.5 h-3.5"})})]})}function Zx({summary:n}){return n?a.jsxs("div",{className:"card space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wr,{className:"w-4 h-4 text-purple-400"}),a.jsx("h4",{className:"text-sm font-semibold text-gray-300",children:"Conversation Summary"}),a.jsxs("span",{className:"text-xs text-gray-600 ml-auto",children:[n.summarized_count??0," messages compressed"]})]}),n.goals&&n.goals.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Goals"}),a.jsx("ul",{className:"space-y-1",children:n.goals.map((r,s)=>a.jsxs("li",{className:"text-sm text-blue-300 flex items-start gap-2",children:[a.jsx(Va,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.current_state&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Current State"}),a.jsx("p",{className:"text-sm text-gray-300",children:n.current_state})]}),n.progress&&n.progress.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Progress"}),a.jsx("ul",{className:"space-y-1",children:n.progress.map((r,s)=>a.jsxs("li",{className:"text-sm text-emerald-300 flex items-start gap-2",children:[a.jsx(qe,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.key_facts&&n.key_facts.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Key Facts"}),a.jsx("ul",{className:"space-y-1",children:n.key_facts.map((r,s)=>a.jsxs("li",{className:"text-sm text-gray-400 flex items-start gap-2",children:[a.jsx(es,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 text-gray-600"}),r]},s))})]}),n.next_steps&&n.next_steps.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Next Steps"}),a.jsx("ul",{className:"space-y-1",children:n.next_steps.map((r,s)=>a.jsxs("li",{className:"text-sm text-amber-300 flex items-start gap-2",children:[a.jsx(Gn,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.summary&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Full Summary"}),a.jsx("p",{className:"text-sm text-gray-400 whitespace-pre-wrap",children:n.summary})]})]}):a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Wr,{className:"w-4 h-4 text-gray-500"}),a.jsx("h4",{className:"text-sm font-semibold text-gray-400",children:"Conversation Summary"})]}),a.jsx("p",{className:"text-sm text-gray-600 italic",children:"No summary yet — conversation is short enough to fit in context."})]})}function Ww(){const{conversationId:n}=Ie(),[r,s]=O.useState(null),[o,u]=O.useState([]),[d,f]=O.useState([]),[x,p]=O.useState([]),[h,y]=O.useState(null),[g,v]=O.useState(!0),[j,w]=O.useState("overview"),S=O.useCallback(async()=>{v(!0);try{const[U,L,$,ue]=await Promise.all([fe.getMemoryStats().catch(()=>null),fe.getPlans(n??void 0).catch(()=>[]),fe.getGoals(n??void 0).catch(()=>({goals:[]})),fe.getFacts().catch(()=>({facts:[]}))]);if(s(U),u(Array.isArray(L)?L:[]),f(($==null?void 0:$.goals)||[]),p((ue==null?void 0:ue.facts)||[]),n){const P=await fe.getConversationSummary(n).catch(()=>({summary:null}));y((P==null?void 0:P.summary)||null)}}catch(U){console.error("Failed to load memory data:",U)}finally{v(!1)}},[n]);O.useEffect(()=>{S()},[S]);const D=async U=>{try{await fe.deleteFact(U),p(L=>L.filter($=>$.id!==U))}catch(L){console.error("Failed to delete fact:",L)}},E=o.filter(U=>U.status==="active"),q=o.filter(U=>U.status==="completed"),H=d.filter(U=>U.status==="active"),K=[{id:"overview",label:"Overview",icon:an},{id:"plans",label:"Plans",icon:qi,count:E.length},{id:"goals",label:"Goals",icon:Va,count:H.length},{id:"facts",label:"Facts",icon:es,count:x.length},{id:"summary",label:"Summary",icon:Wr}];return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-1",children:"Memory & Plans"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Persistent memory, goals, and execution plans — the agent never forgets"})]}),a.jsxs("button",{onClick:S,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 text-sm transition-colors",children:[a.jsx(Ya,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"Refresh"]})]}),a.jsx("div",{className:"flex gap-1 bg-gray-900 rounded-lg p-1",children:K.map(U=>{const L=U.icon;return a.jsxs("button",{onClick:()=>w(U.id),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${j===U.id?"bg-gray-800 text-gray-200 shadow-sm":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(L,{className:"w-4 h-4"}),U.label,U.count!==void 0&&U.count>0&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-blue-500/20 text-blue-400 font-semibold",children:U.count})]},U.id)})}),j==="overview"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-4 lg:grid-cols-6",children:[a.jsx(La,{icon:sp,label:"Messages",value:(r==null?void 0:r.messages)??0,color:"blue"}),a.jsx(La,{icon:an,label:"Conversations",value:(r==null?void 0:r.conversations)??0,color:"purple"}),a.jsx(La,{icon:es,label:"Facts",value:(r==null?void 0:r.facts)??0,color:"amber"}),a.jsx(La,{icon:Va,label:"Active Goals",value:(r==null?void 0:r.active_goals)??0,color:"emerald"}),a.jsx(La,{icon:Wr,label:"Summaries",value:(r==null?void 0:r.summaries)??0,color:"plutus"}),a.jsx(La,{icon:qi,label:"Checkpoints",value:(r==null?void 0:r.checkpoints)??0,color:"gray"})]}),E.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active Plans"}),a.jsx("div",{className:"space-y-3",children:E.map(U=>a.jsx(Qu,{plan:U},U.id))})]}),H.length>0&&a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active Goals"}),a.jsx("div",{className:"divide-y divide-gray-800",children:H.slice(0,5).map(U=>a.jsx(Fx,{goal:U},U.id))})]}),n&&a.jsx(Zx,{summary:h})]}),j==="plans"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"card text-center py-8",children:[a.jsx(qi,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No plans yet. The agent creates plans for complex tasks."})]}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active"}),a.jsx("div",{className:"space-y-3",children:E.map(U=>a.jsx(Qu,{plan:U},U.id))})]}),q.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Completed"}),a.jsx("div",{className:"space-y-3",children:q.map(U=>a.jsx(Qu,{plan:U},U.id))})]})]})}),j==="goals"&&a.jsx("div",{className:"card",children:d.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Va,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No goals tracked yet."})]}):a.jsx("div",{className:"divide-y divide-gray-800",children:d.map(U=>a.jsx(Fx,{goal:U},U.id))})}),j==="facts"&&a.jsx("div",{className:"card",children:x.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(es,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No facts stored yet. The agent saves important information here."})]}):a.jsx("div",{className:"divide-y divide-gray-800",children:x.map(U=>a.jsx(Pw,{fact:U,onDelete:D},U.id))})}),j==="summary"&&a.jsx("div",{children:n?a.jsx(Zx,{summary:h}):a.jsxs("div",{className:"card text-center py-8",children:[a.jsx(Wr,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Start a conversation to see summaries here."})]})})]})}const e3={Send:cd,Mail:x1,MessageCircle:p1};function Ix({connector:n,onRefresh:r}){var k;const[s,o]=O.useState(!1),[u,d]=O.useState({}),[f,x]=O.useState(!1),[p,h]=O.useState(!1),[y,g]=O.useState(null),[v,j]=O.useState(!1),[w,S]=O.useState(null),[D,E]=O.useState(""),[q,H]=O.useState({}),[K,U]=O.useState(!1),[L,$]=O.useState(!1),[ue,P]=O.useState(!1),[A,ae]=O.useState(n.auto_start||!1),[ne,X]=O.useState(!1),W=e3[n.icon]||Gi,te=n.name==="telegram";O.useEffect(()=>{const Z={};n.config_schema.forEach(pe=>{Z[pe.name]=n.config[pe.name]||""}),d(Z)},[n]),O.useEffect(()=>{if(!te||!n.configured)return;const Z=async()=>{try{const he=await fe.getBridgeStatus(n.name);$(he.listening||!1),he.auto_start!==void 0&&ae(he.auto_start)}catch{}};Z();const pe=setInterval(Z,5e3);return()=>clearInterval(pe)},[n.name,n.configured,te]);const M=async()=>{x(!0),g(null);try{await fe.updateConnectorConfig(n.name,u),r(),g({success:!0,message:"Configuration saved!"}),setTimeout(()=>g(null),3e3)}catch(Z){g({success:!1,message:`Failed to save: ${Z.message}`})}finally{x(!1)}},z=async()=>{h(!0),g(null);try{const Z=await fe.testConnector(n.name);g({success:Z.success,message:Z.message}),Z.success&&r()}catch(Z){g({success:!1,message:`Test failed: ${Z.message}`})}finally{h(!1)}},re=async()=>{if(D.trim()){j(!0),S(null);try{const Z=await fe.sendConnectorMessage(n.name,D);S({success:Z.success,message:Z.message}),Z.success&&E("")}catch(Z){S({success:!1,message:`Send failed: ${Z.message}`})}finally{j(!1)}}},oe=async()=>{U(!0);try{L&&(await fe.stopConnector(n.name),$(!1)),await fe.disconnectConnector(n.name),r()}catch(Z){console.error("Disconnect failed:",Z)}finally{U(!1)}},C=Z=>{H(pe=>({...pe,[Z]:!pe[Z]}))},_=async()=>{P(!0);try{if(L)await fe.stopConnector(n.name),$(!1);else{const Z=await fe.startConnector(n.name);$(Z.listening||!1)}}catch(Z){console.error("Toggle listener failed:",Z)}finally{P(!1)}},F=async()=>{X(!0);try{const Z=!A;await fe.setConnectorAutoStart(n.name,Z),ae(Z)}catch(Z){console.error("Toggle auto-start failed:",Z)}finally{X(!1)}};return a.jsxs("div",{className:`rounded-xl border transition-all ${n.configured?L?"border-blue-500/30 bg-gray-900/80":"border-emerald-500/30 bg-gray-900/80":"border-gray-700/50 bg-gray-900/50"}`,children:[a.jsxs("button",{onClick:()=>o(!s),className:"w-full flex items-center gap-4 p-5 text-left hover:bg-gray-800/30 rounded-xl transition-colors",children:[a.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center ${L?"bg-blue-500/15 text-blue-400":n.configured?"bg-emerald-500/15 text-emerald-400":"bg-gray-800 text-gray-500"}`,children:a.jsx(W,{className:"w-6 h-6"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-semibold text-gray-100",children:n.display_name}),L&&a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-semibold px-2 py-0.5 rounded-full bg-blue-500/15 text-blue-400",children:[a.jsx($h,{className:"w-3 h-3 animate-pulse"}),"Listening"]}),n.configured&&!L&&a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-semibold px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-400",children:[a.jsx(qe,{className:"w-3 h-3"}),"Connected"]})]}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:L?"Two-way messaging active — chat with Plutus via "+n.display_name:n.description})]}),a.jsx("div",{className:`w-5 h-5 text-gray-500 transition-transform ${s?"rotate-180":""}`,children:a.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),s&&a.jsxs("div",{className:"px-5 pb-5 space-y-4 border-t border-gray-800/50 pt-4",children:[te&&n.configured&&a.jsxs("div",{className:"rounded-lg bg-gray-800/50 border border-gray-700/30 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${L?"bg-blue-500/15 text-blue-400":"bg-gray-700/50 text-gray-500"}`,children:a.jsx(b1,{className:"w-5 h-5"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-200",children:"Two-Way Messaging"}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:L?"Plutus is listening for your Telegram messages and will respond":"Enable to chat with Plutus directly from Telegram"})]})]}),a.jsxs("button",{onClick:_,disabled:ue,className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 ${L?"bg-red-900/30 hover:bg-red-900/50 text-red-400":"bg-blue-600 hover:bg-blue-500 text-white"}`,children:[ue?a.jsx(Ua,{className:"w-3.5 h-3.5 animate-spin"}):L?a.jsx(Pi,{className:"w-3.5 h-3.5"}):a.jsx(Za,{className:"w-3.5 h-3.5"}),L?"Stop":"Start"]})]}),L&&a.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-blue-400/70",children:[a.jsx($h,{className:"w-3 h-3 animate-pulse"}),a.jsx("span",{children:"Messages you send to the bot will be processed by Plutus and replied to automatically"})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between pt-3 border-t border-gray-700/30",children:[a.jsxs("div",{children:[a.jsx("h5",{className:"text-xs font-medium text-gray-300",children:"Start on launch"}),a.jsx("p",{className:"text-[11px] text-gray-600 mt-0.5",children:"Automatically start two-way messaging when Plutus starts"})]}),a.jsx("button",{onClick:F,disabled:ne,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${A?"bg-blue-600":"bg-gray-700"} ${ne?"opacity-50":""}`,children:a.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ${A?"translate-x-[18px]":"translate-x-[3px]"}`})})]})]}),a.jsx("div",{className:"space-y-3",children:n.config_schema.map(Z=>a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs font-medium text-gray-400 mb-1.5 block",children:[Z.label,Z.required&&a.jsx("span",{className:"text-red-400 ml-0.5",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:Z.type==="password"&&!q[Z.name]?"password":Z.type==="number"?"number":"text",className:"w-full bg-gray-800/80 border border-gray-700/50 rounded-lg px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 transition-colors",placeholder:Z.placeholder,value:u[Z.name]||"",onChange:pe=>d(he=>({...he,[Z.name]:pe.target.value}))}),Z.type==="password"&&a.jsx("button",{type:"button",onClick:()=>C(Z.name),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 transition-colors",children:q[Z.name]?a.jsx(id,{className:"w-4 h-4"}):a.jsx($l,{className:"w-4 h-4"})})]}),Z.help&&a.jsx("p",{className:"text-[11px] text-gray-600 mt-1",children:Z.help})]},Z.name))}),a.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[a.jsxs("button",{onClick:M,disabled:f,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium transition-colors disabled:opacity-50",children:[f?a.jsx(Ua,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(Gi,{className:"w-3.5 h-3.5"}),"Save"]}),a.jsxs("button",{onClick:z,disabled:p,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-gray-700 hover:bg-gray-600 text-gray-200 text-sm font-medium transition-colors disabled:opacity-50",children:[p?a.jsx(Ua,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx($t,{className:"w-3.5 h-3.5"}),"Test Connection"]}),n.configured&&a.jsxs("button",{onClick:oe,disabled:K,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-red-900/30 hover:bg-red-900/50 text-red-400 text-sm font-medium transition-colors disabled:opacity-50 ml-auto",children:[K?a.jsx(Ua,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(Ia,{className:"w-3.5 h-3.5"}),"Disconnect"]})]}),y&&a.jsxs("div",{className:`flex items-start gap-2 p-3 rounded-lg text-sm ${y.success?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[y.success?a.jsx(qe,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}):a.jsx(yn,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:y.message})]}),n.configured&&n.name!=="whatsapp"&&a.jsxs("div",{className:"border-t border-gray-800/50 pt-4",children:[a.jsx("label",{className:"text-xs font-medium text-gray-400 mb-1.5 block",children:"Send Test Message"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",className:"flex-1 bg-gray-800/80 border border-gray-700/50 rounded-lg px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 transition-colors",placeholder:`Send a test message via ${n.display_name}...`,value:D,onChange:Z=>E(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&re()}),a.jsxs("button",{onClick:re,disabled:v||!D.trim(),className:"flex items-center gap-1.5 px-4 py-2.5 rounded-lg bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium transition-colors disabled:opacity-50",children:[v?a.jsx(Ua,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(cd,{className:"w-3.5 h-3.5"}),"Send"]})]}),w&&a.jsxs("div",{className:`flex items-center gap-2 mt-2 text-sm ${w.success?"text-emerald-400":"text-red-400"}`,children:[w.success?a.jsx(qe,{className:"w-3.5 h-3.5"}):a.jsx(yn,{className:"w-3.5 h-3.5"}),a.jsx("span",{children:w.message})]})]}),n.name==="telegram"&&n.config.bot_username&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[a.jsx(ip,{className:"w-3.5 h-3.5"}),a.jsxs("span",{children:["Bot:"," ",a.jsx("a",{href:`https://t.me/${(k=n.config.bot_username)==null?void 0:k.replace("@","")}`,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 transition-colors",children:n.config.bot_username})]})]})]})]})}function t3(){const[n,r]=O.useState([]),[s,o]=O.useState(!0),u=O.useCallback(async()=>{try{const x=await fe.getConnectors();r(x.connectors||[])}catch(x){console.error("Failed to load connectors:",x)}finally{o(!1)}},[]);if(O.useEffect(()=>{u()},[u]),s)return a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx(Ua,{className:"w-6 h-6 text-gray-500 animate-spin"})});const d=n.filter(x=>x.configured),f=n.filter(x=>!x.configured);return a.jsxs("div",{className:"h-full overflow-y-auto p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-bold text-gray-100 mb-1 flex items-center gap-2",children:[a.jsx(Gi,{className:"w-5 h-5 text-plutus-400"}),"Connectors"]}),a.jsx("p",{className:"text-sm text-gray-500",children:"Link Plutus with external services for two-way communication — chat with Plutus from Telegram, get email notifications, and more"})]}),d.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3",children:["Connected (",d.length,")"]}),a.jsx("div",{className:"space-y-3",children:d.map(x=>a.jsx(Ix,{connector:x,onRefresh:u},x.name))})]}),f.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3",children:["Available (",f.length,")"]}),a.jsx("div",{className:"space-y-3",children:f.map(x=>a.jsx(Ix,{connector:x,onRefresh:u},x.name))})]}),a.jsxs("div",{className:"rounded-xl bg-gray-800/30 border border-gray-700/30 p-4",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-300 mb-2",children:"How Connectors Work"}),a.jsxs("ul",{className:"text-sm text-gray-500 space-y-1.5",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-plutus-400 mt-0.5",children:"1."}),a.jsx("span",{children:"Configure a connector by entering your credentials above"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-plutus-400 mt-0.5",children:"2."}),a.jsx("span",{children:'Click "Test Connection" to verify everything works'})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-plutus-400 mt-0.5",children:"3."}),a.jsx("span",{children:'Click "Start" to enable two-way messaging — Plutus will listen for your messages and respond automatically'})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-plutus-400 mt-0.5",children:"4."}),a.jsx("span",{children:'You can also ask Plutus in the chat to "send me a Telegram message" or use connectors in skills and automations'})]})]})]})]})}const Sg=[{id:"anthropic",label:"Anthropic",sublabel:"Claude models",icon:"A",color:"from-orange-500 to-amber-600",keyPlaceholder:"sk-ant-...",keyUrl:"https://console.anthropic.com/settings/keys",keyLabel:"Anthropic Console"},{id:"openai",label:"OpenAI",sublabel:"GPT models",icon:"O",color:"from-emerald-500 to-teal-600",keyPlaceholder:"sk-...",keyUrl:"https://platform.openai.com/api-keys",keyLabel:"OpenAI Dashboard"},{id:"ollama",label:"Ollama",sublabel:"Free, local models",icon:"L",color:"from-blue-500 to-indigo-600",keyPlaceholder:"",keyUrl:"",keyLabel:""},{id:"custom",label:"Custom",sublabel:"Any endpoint",icon:"C",color:"from-gray-500 to-gray-600",keyPlaceholder:"your-api-key",keyUrl:"",keyLabel:""}],n3=[{id:"observer",label:"Observer",desc:"Read-only. Plutus can look but not touch anything.",icon:$l,color:"text-gray-400",bg:"bg-gray-500/10 border-gray-700/60",activeBg:"bg-gray-500/20 border-gray-400/40"},{id:"assistant",label:"Assistant",desc:"Every action requires your explicit approval first.",icon:bn,label2:"Recommended for new users",color:"text-blue-400",bg:"bg-blue-500/10 border-blue-700/40",activeBg:"bg-blue-500/20 border-blue-400/40"},{id:"operator",label:"Operator",desc:"Pre-approved safe actions run automatically. Risky ones still ask.",icon:vn,color:"text-amber-400",bg:"bg-amber-500/10 border-amber-700/40",activeBg:"bg-amber-500/20 border-amber-400/40"},{id:"autonomous",label:"Autonomous",desc:"Full system control. No restrictions. For advanced users only.",icon:$t,color:"text-red-400",bg:"bg-red-500/10 border-red-700/40",activeBg:"bg-red-500/20 border-red-400/40"}],l3=[{icon:rn,label:"Run shell commands",desc:"Execute anything in your terminal"},{icon:Ki,label:"Browse the web",desc:"Search, scrape, and interact with sites"},{icon:an,label:"Long-term memory",desc:"Remembers facts across conversations"},{icon:bl,label:"Parallel workers",desc:"Spawn sub-agents for complex tasks"},{icon:Fa,label:"Desktop control",desc:"Click, type, and see your screen"},{icon:vn,label:"Custom tools",desc:"Build your own tools with Python"}];function a3(){const[n,r]=O.useState(0),[s,o]=O.useState("anthropic"),[u,d]=O.useState(""),[f,x]=O.useState(!1),[p,h]=O.useState(!1),[y,g]=O.useState(!1),[v,j]=O.useState(""),[w,S]=O.useState("assistant"),[D,E]=O.useState(!1),[q,H]=O.useState(""),[K,U]=O.useState(null),[L,$]=O.useState(!1),[ue,P]=O.useState(!1),A=Sg.find(_=>_.id===s),ae=s!=="ollama",ne=K?5:4,X=ne-1,[W,te]=O.useState(!1);O.useEffect(()=>{fe.getKeyStatus().then(_=>{var F;te(((F=_.providers)==null?void 0:F[s])??!1)}).catch(()=>{})},[s]),O.useEffect(()=>{fe.getWSLStatus().then(_=>{U(_.is_windows),$(_.wsl_installed),P(_.setup_completed)}).catch(()=>{U(!1)})},[]);const M=()=>n===1?!0:n===2?!ae||y||W:!0,z=async()=>{if(u.trim()){h(!0),j("");try{const _=await fe.setKey(s,u.trim());g(!0),te(!0),d(""),x(!1),_.key_configured&&Ie.getState().setKeyConfigured(!0)}catch{j("Failed to save key. Please try again.")}finally{h(!1)}}},re=async()=>{E(!0);try{const _={anthropic:"claude-sonnet-4-6",openai:"gpt-4.1",ollama:"llama3.2",custom:"gpt-4.1"};await fe.updateConfig({model:{provider:s,model:_[s]||"claude-sonnet-4-6",base_url:q||null},guardrails:{tier:w}}),await fe.completeSetup(),Ie.getState().setOnboardingCompleted(!0),Ie.getState().setView("chat")}catch{Ie.getState().setOnboardingCompleted(!0),Ie.getState().setView("chat")}},oe=()=>r(_=>Math.min(_+1,X)),C=()=>r(_=>Math.max(_-1,0));return K===null?a.jsx("div",{className:"fixed inset-0 bg-gray-950 z-50 flex items-center justify-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-lg shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsx("div",{className:"w-6 h-6 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"})]})}):a.jsxs("div",{className:"fixed inset-0 bg-gray-950 z-50 flex items-center justify-center overflow-y-auto",children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[a.jsx("div",{className:"absolute -top-1/2 -left-1/4 w-[800px] h-[800px] rounded-full bg-plutus-600/5 blur-[120px]"}),a.jsx("div",{className:"absolute -bottom-1/2 -right-1/4 w-[600px] h-[600px] rounded-full bg-indigo-600/5 blur-[100px]"})]}),a.jsxs("div",{className:"relative w-full max-w-2xl mx-auto px-6 py-12",children:[a.jsx("div",{className:"flex items-center gap-2 mb-10",children:Array.from({length:ne}).map((_,F)=>a.jsx("div",{className:`h-1 flex-1 rounded-full transition-all duration-500 ${F<=n?"bg-plutus-500":"bg-gray-800"}`},F))}),a.jsxs("div",{className:"min-h-[480px]",children:[n===0&&a.jsx(r3,{}),n===1&&a.jsx(s3,{provider:s,setProvider:_=>{o(_),g(!1),d(""),j("")},baseUrl:q,setBaseUrl:H}),n===2&&a.jsx(i3,{provider:A,needsKey:ae,apiKey:u,setApiKey:d,showKey:f,setShowKey:x,savingKey:p,keySaved:y||W,keyError:v,onSaveKey:z}),n===3&&!K&&a.jsx(Kx,{tier:w,setTier:S}),n===3&&K&&a.jsx(Kx,{tier:w,setTier:S}),n===4&&K&&a.jsx(c3,{wslDetected:L,wslSetupDone:ue,onSetupComplete:()=>P(!0)})]}),a.jsxs("div",{className:"flex items-center justify-between mt-8",children:[a.jsx("div",{children:n>0&&a.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800/60 transition-all",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-xs text-gray-600",children:[n+1," of ",ne]}),n<X?a.jsxs("button",{onClick:oe,disabled:!M(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-40 disabled:hover:bg-plutus-600 text-white text-sm font-medium transition-all shadow-lg shadow-plutus-600/20 hover:shadow-plutus-500/30",children:["Continue",a.jsx(gn,{className:"w-4 h-4"})]}):a.jsx("button",{onClick:re,disabled:D,className:"flex items-center gap-2 px-8 py-2.5 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-60 text-white text-sm font-medium transition-all shadow-lg shadow-plutus-600/20 hover:shadow-plutus-500/30",children:D?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Setting up..."]}):a.jsxs(a.Fragment,{children:["Launch Plutus",a.jsx($t,{className:"w-4 h-4"})]})})]})]})]})]})}function r3(){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center text-2xl font-bold shadow-xl shadow-plutus-600/30 ring-1 ring-white/10",children:"P"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-100",children:"Welcome to Plutus"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"Your autonomous AI agent"})]})]}),a.jsx("p",{className:"text-gray-400 mt-6 text-[15px] leading-relaxed max-w-xl",children:"Plutus is an AI assistant that can control your computer, run commands, browse the web, manage files, and automate complex tasks — all from a single chat interface."}),a.jsx("p",{className:"text-gray-500 mt-3 text-sm leading-relaxed max-w-xl",children:"This setup takes about 60 seconds. We'll connect an AI provider, set your safety preferences, and you'll be ready to go."}),a.jsx("div",{className:"grid grid-cols-2 gap-3 mt-8",children:l3.map(n=>{const r=n.icon;return a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-gray-900/60 border border-gray-800/50",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx(r,{className:"w-4 h-4 text-plutus-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:n.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n.desc})]})]},n.label)})})]})}function s3({provider:n,setProvider:r,baseUrl:s,setBaseUrl:o}){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Choose your AI provider"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Select which AI service will power Plutus. You can change this later in Settings."}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:Sg.map(u=>{const d=n===u.id;return a.jsxs("button",{onClick:()=>r(u.id),className:`relative flex items-center gap-4 p-5 rounded-xl border-2 transition-all text-left ${d?"border-plutus-500/60 bg-plutus-500/5 shadow-lg shadow-plutus-500/10":"border-gray-800/60 bg-gray-900/40 hover:border-gray-700/60 hover:bg-gray-900/60"}`,children:[a.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br ${u.color} flex items-center justify-center text-white text-lg font-bold shadow-md`,children:u.icon}),a.jsxs("div",{children:[a.jsx("p",{className:"text-base font-semibold text-gray-200",children:u.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u.sublabel})]}),d&&a.jsx("div",{className:"absolute top-3 right-3",children:a.jsx(qe,{className:"w-5 h-5 text-plutus-400"})})]},u.id)})}),(n==="custom"||n==="ollama")&&a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Base URL"}),a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-xl px-4 py-3 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:s,onChange:u=>o(u.target.value),placeholder:n==="ollama"?"http://localhost:11434":"https://your-api-endpoint.com/v1"}),n==="ollama"&&a.jsx("p",{className:"text-xs text-gray-600 mt-2",children:"Make sure Ollama is running locally. Default: http://localhost:11434"})]})]})}function i3({provider:n,needsKey:r,apiKey:s,setApiKey:o,showKey:u,setShowKey:d,savingKey:f,keySaved:x,keyError:p,onSaveKey:h}){return r?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("h2",{className:"text-2xl font-bold text-gray-100",children:["Connect your ",n.label," key"]}),a.jsxs("p",{className:"text-sm text-gray-500 mt-2 mb-2",children:["Plutus needs an API key to communicate with ",n.label,". Your key is stored locally and never sent anywhere except ",n.label,"'s API."]}),n.keyUrl&&a.jsxs("p",{className:"text-sm text-gray-500 mb-8",children:["Don't have one?"," ",a.jsxs("a",{href:n.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 underline underline-offset-2",children:["Get a key from ",n.keyLabel]})]}),x?a.jsxs("div",{className:"flex items-center gap-3 p-5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 mb-4",children:[a.jsx(qe,{className:"w-6 h-6 text-emerald-400 shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-emerald-300",children:"API key configured"}),a.jsx("p",{className:"text-xs text-emerald-400/60 mt-0.5",children:"Stored securely at ~/.plutus/.secrets.json"})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"text-sm text-gray-400 mb-2 block",children:[a.jsx(rs,{className:"w-3.5 h-3.5 inline mr-1.5 -mt-0.5"}),"API Key"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx("input",{type:u?"text":"password",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-xl px-4 py-3.5 pr-11 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-2 focus:ring-plutus-500/20 font-mono",value:s,onChange:y=>o(y.target.value),placeholder:n.keyPlaceholder,onKeyDown:y=>{y.key==="Enter"&&h()},autoFocus:!0}),a.jsx("button",{onClick:()=>d(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 p-1",children:u?a.jsx(id,{className:"w-4 h-4"}):a.jsx($l,{className:"w-4 h-4"})})]}),a.jsxs("button",{onClick:h,disabled:f||!s.trim(),className:"flex items-center gap-2 px-5 py-3 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-40 disabled:hover:bg-plutus-600 text-white text-sm font-medium transition-all whitespace-nowrap",children:[f?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx(rs,{className:"w-4 h-4"}),f?"Saving...":"Save Key"]})]})]}),p&&a.jsx("p",{className:"text-xs text-red-400",children:p})]}),a.jsx("div",{className:"mt-8 p-4 rounded-xl bg-gray-900/60 border border-gray-800/50",children:a.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:[a.jsx("span",{className:"text-gray-400 font-medium",children:"Privacy:"})," Your API key is stored in ",a.jsx("code",{className:"text-gray-400 bg-gray-800 px-1.5 py-0.5 rounded text-[11px]",children:"~/.plutus/.secrets.json"})," with restricted file permissions (owner-only). It is never included in config files or sent to any service other than your chosen provider."]})})]}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"No API key needed"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Ollama runs locally on your machine — no API key or account required. Just make sure Ollama is installed and running."}),a.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(qe,{className:"w-5 h-5 text-emerald-400 shrink-0"}),a.jsx("p",{className:"text-sm text-emerald-300",children:"You're all set! Click Continue to pick your safety tier."})]})]})}function Kx({tier:n,setTier:r}){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Set your safety level"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Guardrails control what Plutus can do without asking. You can change this anytime from the Guardrails page."}),a.jsx("div",{className:"space-y-3",children:n3.map(s=>{const o=s.icon,u=n===s.id;return a.jsxs("button",{onClick:()=>r(s.id),className:`w-full flex items-start gap-4 p-4 rounded-xl border-2 transition-all text-left ${u?s.activeBg:`${s.bg} hover:brightness-110`}`,children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center shrink-0 mt-0.5 ${u?"bg-white/10":"bg-white/5"}`,children:a.jsx(o,{className:`w-5 h-5 ${s.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-semibold text-gray-200",children:s.label}),s.label2&&a.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-blue-500/15 text-blue-400 font-medium",children:s.label2})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s.desc})]}),u&&a.jsx(qe,{className:`w-5 h-5 shrink-0 mt-1 ${s.color}`})]},s.id)})})]})}const o3=[{icon:Xu,label:"Package managers",desc:"apt, pip, npm, cargo — install anything in seconds"},{icon:Ii,label:"Dev tools",desc:"GCC, Python, Node.js, Rust, Go, and more"},{icon:gp,label:"Server tools",desc:"Docker, nginx, PostgreSQL, Redis, SSH"},{icon:s1,label:"Shell scripting",desc:"Full Bash with grep, sed, awk, and thousands of CLI tools"}];function c3({wslDetected:n,wslSetupDone:r,onSetupComplete:s}){const[o,u]=O.useState(!1),[d,f]=O.useState(!1),x=async()=>{f(!0);try{await fe.completeWSLSetup(),s()}catch{s()}finally{f(!1)}};return r?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Linux Superpowers"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-6",children:"WSL is configured and ready to go."}),a.jsxs("div",{className:"flex items-center gap-4 p-5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 mb-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-emerald-500/20 flex items-center justify-center",children:a.jsx(qe,{className:"w-6 h-6 text-emerald-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-base font-semibold text-emerald-300",children:"WSL is active"}),a.jsx("p",{className:"text-sm text-emerald-400/60 mt-0.5",children:"Plutus has full access to Linux tools on your Windows machine."})]})]}),a.jsxs("p",{className:"text-sm text-gray-500",children:["Click ",a.jsx("span",{className:"text-gray-300",children:"Launch Plutus"})," to start using your AI agent."]})]}):o?a.jsx(u3,{wslDetected:n,onComplete:x,onBack:()=>u(!1)}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-amber-600 flex items-center justify-center shadow-lg shadow-orange-600/20",children:a.jsx(rn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Unlock Linux Superpowers"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"Recommended for the full Plutus experience"})]})]}),a.jsx("div",{className:"mt-5 p-4 rounded-xl bg-orange-500/5 border border-orange-500/15",children:a.jsxs("p",{className:"text-sm text-gray-300 leading-relaxed",children:[a.jsx("span",{className:"text-orange-400 font-semibold",children:"WSL (Windows Subsystem for Linux)"})," gives Plutus access to the entire Linux ecosystem directly on your Windows PC — no virtual machine, no dual-boot, no complexity. It's like giving your AI agent a second brain."]})}),a.jsx("div",{className:"grid grid-cols-2 gap-3 mt-5",children:o3.map(p=>{const h=p.icon;return a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-gray-900/60 border border-gray-800/50",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-orange-500/10 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx(h,{className:"w-4 h-4 text-orange-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:p.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:p.desc})]})]},p.label)})}),n&&a.jsxs("div",{className:"mt-5 flex items-center gap-3 p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(qe,{className:"w-5 h-5 text-emerald-400 shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-emerald-300 font-medium",children:"WSL is already installed"}),a.jsx("p",{className:"text-xs text-emerald-400/60 mt-0.5",children:"We detected WSL on your system. You can activate it right away."})]})]}),a.jsxs("div",{className:"mt-6 space-y-3",children:[n?a.jsxs("button",{onClick:x,disabled:d,className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 disabled:opacity-60 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx($t,{className:"w-4 h-4"}),d?"Activating...":"Activate Linux Superpowers"]}):a.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[a.jsx(rn,{className:"w-4 h-4"}),"Set up WSL now",a.jsx(Wx,{className:"w-4 h-4"})]}),a.jsx("p",{className:"text-center text-xs text-gray-600",children:"You can also set this up later from Settings. It takes about 10 minutes."})]})]})}function u3({wslDetected:n,onComplete:r,onBack:s}){const[o,u]=O.useState([]),[d,f]=O.useState(0),[x,p]=O.useState(new Set),[h,y]=O.useState(!0),[g,v]=O.useState(null),[j,w]=O.useState(!1),[S,D]=O.useState([]);O.useEffect(()=>{fe.getWSLSetupGuide().then(U=>{if(!U.needed){r();return}if(u(U.steps),D(U.troubleshooting||[]),n&&U.steps.length>0){const L=new Set;for(const P of U.steps)(P.id==="open_terminal"||P.id==="install_wsl"||P.id==="reboot")&&L.add(P.id);p(L);const $=U.steps.findIndex(P=>P.id==="verify"),ue=U.steps.findIndex(P=>P.id==="create_user");f(ue>=0?ue:$>=0?$:0)}}).catch(()=>{}).finally(()=>y(!1))},[n,r]);const E=U=>{navigator.clipboard.writeText(U).then(()=>{v(U),setTimeout(()=>v(null),2e3)})},q=U=>{p(L=>new Set([...L,U])),d<o.length-1&&f(d+1)},H=o.length>0&&o.every(U=>x.has(U.id)),K=o[d];return h?a.jsx("div",{className:"animate-onboard-in flex items-center justify-center min-h-[400px]",children:a.jsx("div",{className:"w-8 h-8 border-2 border-orange-500/30 border-t-orange-500 rounded-full animate-spin"})}):H?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-emerald-500 to-green-600 flex items-center justify-center shadow-xl shadow-emerald-600/20",children:a.jsx(qe,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"All set!"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"WSL is installed and ready to go."})]})]}),a.jsx("p",{className:"text-sm text-gray-400 mb-6",children:"Plutus can now use Linux tools like apt, Docker, SSH, compilers, and thousands more — all running natively on your Windows machine."}),a.jsxs("button",{onClick:r,className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[a.jsx($t,{className:"w-4 h-4"}),"Activate Linux Superpowers"]})]}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("button",{onClick:s,className:"flex items-center gap-1 text-sm text-gray-500 hover:text-gray-300 transition-colors",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back to overview"]}),a.jsxs("span",{className:"text-xs text-orange-400/80 font-medium px-2.5 py-1 bg-orange-500/10 rounded-lg",children:["Step ",d+1," of ",o.length]})]}),a.jsx("div",{className:"flex items-center gap-1.5 mb-6",children:o.map((U,L)=>a.jsx("button",{onClick:()=>f(L),className:`h-1.5 flex-1 rounded-full transition-all duration-300 cursor-pointer ${x.has(U.id)?"bg-orange-500":L===d?"bg-orange-500/40":"bg-gray-800 hover:bg-gray-700"}`},U.id))}),K&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-orange-500/15 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-sm font-bold text-orange-400",children:d+1})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-100",children:K.title}),x.has(K.id)&&a.jsxs("span",{className:"text-xs text-emerald-400 flex items-center gap-1 mt-1",children:[a.jsx(qe,{className:"w-3.5 h-3.5"})," Completed"]})]})]}),a.jsx("p",{className:"text-sm text-gray-400 leading-relaxed mb-4",children:K.description}),K.substeps&&K.substeps.length>0&&a.jsx("div",{className:"space-y-2 mb-4",children:K.substeps.map((U,L)=>a.jsxs("div",{className:"flex items-start gap-2.5 text-sm",children:[a.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-800 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-[10px] font-bold text-gray-400",children:L+1})}),a.jsx("span",{className:"text-gray-400",children:U})]},L))}),K.command&&a.jsxs("div",{className:"relative group mb-4",children:[a.jsx("div",{className:"bg-gray-900 rounded-lg border border-gray-800/60 p-4 font-mono text-sm text-orange-300 overflow-x-auto",children:K.command}),a.jsx("button",{onClick:()=>E(K.command),className:"absolute top-2 right-2 p-2 rounded-lg bg-gray-800/80 hover:bg-gray-700/80 text-gray-400 hover:text-gray-200 opacity-0 group-hover:opacity-100 transition-all",children:g===K.command?a.jsx(qe,{className:"w-4 h-4 text-emerald-400"}):a.jsx("span",{className:"text-xs font-medium",children:"Copy"})})]}),K.command_verify&&a.jsxs("div",{className:"relative group mb-4",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1.5",children:"Then run this to verify:"}),a.jsx("div",{className:"bg-gray-900 rounded-lg border border-gray-800/60 p-4 font-mono text-sm text-orange-300/80 overflow-x-auto",children:K.command_verify}),a.jsx("button",{onClick:()=>E(K.command_verify),className:"absolute top-8 right-2 p-2 rounded-lg bg-gray-800/80 hover:bg-gray-700/80 text-gray-400 hover:text-gray-200 opacity-0 group-hover:opacity-100 transition-all",children:g===K.command_verify?a.jsx(qe,{className:"w-4 h-4 text-emerald-400"}):a.jsx("span",{className:"text-xs font-medium",children:"Copy"})})]}),K.warning&&a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-amber-500/5 border border-amber-500/20 mb-4",children:[a.jsx(Yl,{className:"w-4 h-4 text-amber-400 shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-amber-300/80 leading-relaxed",children:K.warning})]}),a.jsx("div",{className:"bg-gray-900/40 rounded-lg p-3 border border-gray-800/30 mb-4",children:a.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:[a.jsx("span",{className:"text-gray-400 font-medium",children:"Tip:"})," ",K.note]})}),a.jsxs("div",{className:"flex items-center justify-between",children:[x.has(K.id)?a.jsx("div",{}):a.jsxs("button",{onClick:()=>q(K.id),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-orange-500/10 hover:bg-orange-500/20 border border-orange-500/20 text-orange-400 text-sm font-medium transition-all",children:[a.jsx(qe,{className:"w-4 h-4"}),"I've done this step"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[d>0&&a.jsx("button",{onClick:()=>f(d-1),className:"px-3 py-2 rounded-xl text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800/60 transition-all",children:"Prev"}),d<o.length-1&&a.jsxs("button",{onClick:()=>f(d+1),className:"flex items-center gap-1 px-3 py-2 rounded-xl text-sm text-gray-300 hover:text-white bg-gray-800/60 hover:bg-gray-700/60 transition-all",children:["Next ",a.jsx(gn,{className:"w-3.5 h-3.5"})]})]})]})]}),S.length>0&&a.jsxs("div",{className:"mt-6 border-t border-gray-800/40 pt-4",children:[a.jsxs("button",{onClick:()=>w(!j),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[a.jsx(Yl,{className:"w-3.5 h-3.5"}),j?"Hide troubleshooting":"Having problems? Click here",a.jsx(gn,{className:`w-3.5 h-3.5 transition-transform ${j?"rotate-90":""}`})]}),j&&a.jsx("div",{className:"mt-3 space-y-3 max-h-[200px] overflow-y-auto pr-1",children:S.map(U=>a.jsxs("div",{className:"bg-gray-900/40 rounded-lg p-3 border border-gray-800/30",children:[a.jsx("p",{className:"text-xs font-medium text-gray-300 mb-1",children:U.problem}),a.jsx("p",{className:"text-xs text-gray-500 leading-relaxed whitespace-pre-line",children:U.solution})]},U.id))})]})]})}function d3(){const{updateInfo:n,setUpdateInfo:r}=Ie(),[s,o]=O.useState(!1),[u,d]=O.useState(null),[f,x]=O.useState(!1);if(!n||!n.available||n.dismissed)return null;const p=async()=>{try{await fe.dismissUpdate(n.latestVersion)}catch{}r({...n,dismissed:!0})},h=async()=>{o(!0),d(null);try{const y=await fe.applyUpdate();y.success?d({success:!0,message:`Updated to v${y.new_version||n.latestVersion}`,restartRequired:y.restart_required}):d({success:!1,message:y.error||"Update failed. Try updating manually."})}catch(y){d({success:!1,message:y instanceof Error?y.message:"Update failed"})}finally{o(!1)}};return u?a.jsxs("div",{className:`shrink-0 border-b px-4 py-3 flex items-center gap-3 ${u.success?"bg-emerald-500/5 border-emerald-500/20":"bg-red-500/5 border-red-500/20"}`,children:[u.success?a.jsx(qe,{className:"w-4 h-4 text-emerald-400 shrink-0"}):a.jsx(Yl,{className:"w-4 h-4 text-red-400 shrink-0"}),a.jsx("p",{className:`text-sm flex-1 ${u.success?"text-emerald-300":"text-red-300"}`,children:u.message}),u.restartRequired&&u.success&&a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(j1,{className:"w-3.5 h-3.5 text-emerald-400"}),a.jsx("span",{className:"text-xs text-emerald-400 font-medium",children:"Restart Plutus to finish"})]}),!u.success&&a.jsx("button",{onClick:()=>d(null),className:"text-xs text-gray-400 hover:text-gray-200 px-2 py-1 rounded-lg hover:bg-gray-800/60 transition-colors",children:"Retry"}),a.jsx("button",{onClick:()=>{d(null),r({...n,dismissed:!0})},className:"p-1 text-gray-500 hover:text-gray-300 transition-colors",children:a.jsx(Qa,{className:"w-3.5 h-3.5"})})]}):a.jsxs("div",{className:"shrink-0 bg-plutus-500/5 border-b border-plutus-500/20 px-4 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(i1,{className:"w-4 h-4 text-plutus-400 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("p",{className:"text-sm text-gray-200",children:[a.jsxs("span",{className:"font-medium text-plutus-300",children:["v",n.latestVersion]}),n.releaseName&&n.releaseName!==`v${n.latestVersion}`&&a.jsxs("span",{className:"text-gray-400",children:[" — ",n.releaseName]}),a.jsxs("span",{className:"text-gray-500 ml-1.5",children:["(you're on v",n.currentVersion,")"]})]}),n.releaseNotes&&a.jsx("button",{onClick:()=>x(!f),className:"text-xs text-gray-500 hover:text-gray-300 mt-0.5 transition-colors",children:f?"Hide release notes":"View release notes"})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.releaseUrl&&a.jsx("a",{href:n.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 text-gray-500 hover:text-gray-300 transition-colors",title:"View on GitHub",children:a.jsx(ip,{className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:h,disabled:s,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-xs font-medium transition-all shadow-sm shadow-plutus-600/20",children:s?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Updating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(c1,{className:"w-3 h-3"}),"Update now"]})}),a.jsx("button",{onClick:p,className:"p-1.5 text-gray-600 hover:text-gray-400 transition-colors",title:"Dismiss",children:a.jsx(Qa,{className:"w-3.5 h-3.5"})})]})]}),f&&n.releaseNotes&&a.jsx("div",{className:"mt-2 p-3 rounded-lg bg-gray-900/60 border border-gray-800/40 max-h-40 overflow-y-auto",children:a.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-sans leading-relaxed",children:n.releaseNotes})})]})}function f3(){const{view:n,addMessage:r,setProcessing:s,setConnected:o,setCurrentTier:u,setConversationId:d,setKeyConfigured:f,clearMessages:x,onboardingCompleted:p,setOnboardingCompleted:h,setUpdateInfo:y}=Ie(),g=O.useCallback(S=>{var D,E,q,H,K,U,L,$,ue,P,A,ae;switch(S.type){case"thinking":s(!0);break;case"text":r({role:"assistant",content:S.content});break;case"tool_call":{const ne=S.tool||"",X=S.arguments||{};if(ne.startsWith("computer.")){const W=ne.replace("computer.",""),te={screenshot:"Taking screenshot...",click:`Clicking at (${(D=X.coordinate)==null?void 0:D[0]}, ${(E=X.coordinate)==null?void 0:E[1]})`,left_click:`Clicking at (${(q=X.coordinate)==null?void 0:q[0]}, ${(H=X.coordinate)==null?void 0:H[1]})`,right_click:`Right-clicking at (${(K=X.coordinate)==null?void 0:K[0]}, ${(U=X.coordinate)==null?void 0:U[1]})`,double_click:`Double-clicking at (${(L=X.coordinate)==null?void 0:L[0]}, ${($=X.coordinate)==null?void 0:$[1]})`,type:`Typing: "${(X.text||"").slice(0,50)}${(X.text||"").length>50?"...":""}"`,key:`Pressing: ${X.text}`,scroll:`Scrolling ${X.coordinate?`at (${X.coordinate[0]}, ${X.coordinate[1]})`:""}`,move:`Moving to (${(ue=X.coordinate)==null?void 0:ue[0]}, ${(P=X.coordinate)==null?void 0:P[1]})`,wait:"Waiting...",triple_click:`Triple-clicking at (${(A=X.coordinate)==null?void 0:A[0]}, ${(ae=X.coordinate)==null?void 0:ae[1]})`};r({role:"assistant",content:te[W]||W,tool_calls:[{id:S.id||"",name:ne,arguments:X}]})}else{const W=X.operation||X.action||"",te=W?W.replace(/_/g," "):ne.replace(/_/g," ");r({role:"assistant",content:`Using tool: **${te}**`,tool_calls:[{id:S.id||"",name:ne,arguments:X}]})}break}case"tool_result":{S.screenshot&&S.image_base64?r({role:"tool",content:`__SCREENSHOT__:${S.image_base64}`,tool_call_id:S.id}):S.error?r({role:"tool",content:`[ERROR] ${S.result||"Unknown error"}`,tool_call_id:S.id}):r({role:"tool",content:S.result||"Done",tool_call_id:S.id});break}case"tool_approval_needed":r({role:"system",content:`Approval needed for **${S.tool}**: ${S.reason}`,approval_id:S.approval_id});break;case"mode":break;case"iteration":r({role:"system",content:`Step ${S.number}/${S.max}`});break;case"error":r({role:"system",content:`Error: ${S.message}`}),s(!1);break;case"done":s(!1);break;case"cancelled":case"task_stopped":r({role:"system",content:`${S.message||"Task stopped"}`}),s(!1);break;case"conversation_started":d(S.conversation_id);break;case"conversation_resumed":d(S.conversation_id),x(),S.messages.forEach(ne=>{if(ne.role==="user"&&typeof ne.content=="string"){if(ne.content.startsWith("[HEARTBEAT]")){r({...ne,role:"system"});return}if(ne.content.startsWith("[SYSTEM NOTIFICATION]")){r({...ne,role:"system"});return}if(ne.content.startsWith("[SYSTEM]")){r({...ne,role:"system"});return}}r(ne)});break;case"heartbeat":r({role:"system",content:`Heartbeat #${S.beat}/${S.max}`}),s(!0);break;case"heartbeat_paused":r({role:"system",content:`Heartbeat paused: ${S.reason} (after ${S.count} beats)`});break;case"attachment":{if(S.is_image&&S.image_base64){const ne=S.caption?`
${S.caption}`:"";r({role:"tool",content:`__ATTACHMENT_IMAGE__:${S.file_name}:${S.image_base64}${ne}`})}else{const ne=Math.round((S.file_size||0)/1024),X=S.caption?` — ${S.caption}`:"";r({role:"tool",content:`__ATTACHMENT_FILE__:${S.file_name}:${ne}:${S.file_path}${X}`})}break}case"plan_update":break;case"worker_result":{const ne=S.name||"Worker",X=S.model||"",W=S.result||"(no output)";r({role:"assistant",content:`__WORKER_RESULT__:${ne}:${X}:${W}`});break}case"worker_started":{const ne=S.worker||{};r({role:"system",content:`__WORKER_STARTED__:${ne.name||ne.task_id}:${ne.model||"auto"}`});break}}},[r,s,d,x]),{send:v,connected:j}=t1(g);if(O.useEffect(()=>{o(j)},[j,o]),O.useEffect(()=>{fe.getStatus().then(S=>{var D;(D=S==null?void 0:S.guardrails)!=null&&D.tier&&u(S.guardrails.tier),(S==null?void 0:S.key_configured)!==void 0&&f(S.key_configured),h((S==null?void 0:S.onboarding_completed)??!0)}).catch(()=>{h(!0)})},[u,f,h]),O.useEffect(()=>{const S=()=>{fe.checkForUpdate().then(q=>{q.update_available&&y({available:!0,dismissed:q.dismissed??!1,currentVersion:q.current_version,latestVersion:q.latest_version,releaseName:q.release_name||"",releaseNotes:q.release_notes||"",releaseUrl:q.release_url||"",publishedAt:q.published_at||""})}).catch(()=>{})},D=setTimeout(S,5e3),E=setInterval(S,360*60*1e3);return()=>{clearTimeout(D),clearInterval(E)}},[y]),p===null)return a.jsx("div",{className:"h-screen flex items-center justify-center bg-gray-950",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-lg shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsx("div",{className:"w-6 h-6 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"})]})});if(!p)return a.jsx(a3,{});const w={chat:a.jsx(vw,{send:v}),dashboard:a.jsx(Sw,{}),guardrails:a.jsx(Aw,{}),settings:a.jsx(Dw,{}),tools:a.jsx(Bw,{}),workers:a.jsx(Qw,{}),"tool-creator":a.jsx(Zw,{}),skills:a.jsx(Jw,{}),memory:a.jsx(Ww,{}),connectors:a.jsx(t3,{})};return a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsx(M1,{send:v}),a.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[a.jsx(d3,{}),a.jsx(O1,{}),a.jsx("main",{className:`flex-1 flex flex-col overflow-hidden ${n==="chat"?"":"p-6"}`,children:w[n]||w.chat})]})]})}Kb.createRoot(document.getElementById("root")).render(a.jsx(Jr.StrictMode,{children:a.jsx(f3,{})}));
