teleton 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -12
- package/dist/{chunk-DAMCNMYL.js → chunk-BGC2IUM5.js} +9 -9
- package/dist/{chunk-FNV5FF35.js → chunk-EK7M5K26.js} +29 -13
- package/dist/{chunk-BU453WX4.js → chunk-LAQOUFOJ.js} +2034 -1551
- package/dist/chunk-QOQWUUA4.js +158 -0
- package/dist/{chunk-RBU6JXD3.js → chunk-XDYDA2KV.js} +1 -1
- package/dist/{chunk-A4GCOHCE.js → chunk-YFG2QHLA.js} +178 -6
- package/dist/cli/index.js +154 -273
- package/dist/index.js +5 -5
- package/dist/{memory-5SS3Q5EA.js → memory-JQZ6MTRU.js} +2 -2
- package/dist/{migrate-M7SJMDOL.js → migrate-GS5ACQDA.js} +2 -2
- package/dist/{server-FOC5P7U6.js → server-TCJOBV3D.js} +292 -10
- package/dist/{setup-server-BVVD2PR6.js → setup-server-YHYJLAMA.js} +6 -110
- package/dist/{tool-index-MIVK3D7H.js → tool-index-6HBRVXVG.js} +1 -1
- package/dist/web/assets/index-B6M9knfJ.css +1 -0
- package/dist/web/assets/index-DAGeQfVZ.js +72 -0
- package/dist/web/assets/{index.es-7MTSV5SL.js → index.es-CqZHj0tz.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +2 -2
- package/dist/web/assets/index-By_fs4Jl.js +0 -72
- package/dist/web/assets/index-CRDIf07k.css +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var Xf=Object.defineProperty;var Zf=(o,a,u)=>a in o?Xf(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u;var Ot=(o,a,u)=>Zf(o,typeof a!="symbol"?a+"":a,u);function ep(o,a){for(var u=0;u<a.length;u++){const d=a[u];if(typeof d!="string"&&!Array.isArray(d)){for(const p in d)if(p!=="default"&&!(p in o)){const m=Object.getOwnPropertyDescriptor(d,p);m&&Object.defineProperty(o,p,m.get?m:{enumerable:!0,get:()=>d[p]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))d(p);new MutationObserver(p=>{for(const m of p)if(m.type==="childList")for(const S of m.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&d(S)}).observe(document,{childList:!0,subtree:!0});function u(p){const m={};return p.integrity&&(m.integrity=p.integrity),p.referrerPolicy&&(m.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?m.credentials="include":p.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function d(p){if(p.ep)return;p.ep=!0;const m=u(p);fetch(p.href,m)}})();function tp(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var si={exports:{}},Xr={},oi={exports:{}},ye={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var uc;function np(){if(uc)return ye;uc=1;var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),S=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),k=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),w=Symbol.iterator;function z(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,x={};function N(C,M,pe){this.props=C,this.context=M,this.refs=x,this.updater=pe||B}N.prototype.isReactComponent={},N.prototype.setState=function(C,M){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,M,"setState")},N.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function R(){}R.prototype=N.prototype;function $(C,M,pe){this.props=C,this.context=M,this.refs=x,this.updater=pe||B}var D=$.prototype=new R;D.constructor=$,O(D,N.prototype),D.isPureReactComponent=!0;var P=Array.isArray,I=Object.prototype.hasOwnProperty,W={current:null},ue={key:!0,ref:!0,__self:!0,__source:!0};function me(C,M,pe){var he,ve={},Se=null,Ee=null;if(M!=null)for(he in M.ref!==void 0&&(Ee=M.ref),M.key!==void 0&&(Se=""+M.key),M)I.call(M,he)&&!ue.hasOwnProperty(he)&&(ve[he]=M[he]);var ke=arguments.length-2;if(ke===1)ve.children=pe;else if(1<ke){for(var _e=Array(ke),et=0;et<ke;et++)_e[et]=arguments[et+2];ve.children=_e}if(C&&C.defaultProps)for(he in ke=C.defaultProps,ke)ve[he]===void 0&&(ve[he]=ke[he]);return{$$typeof:o,type:C,key:Se,ref:Ee,props:ve,_owner:W.current}}function G(C,M){return{$$typeof:o,type:C.type,key:M,ref:C.ref,props:C.props,_owner:C._owner}}function Oe(C){return typeof C=="object"&&C!==null&&C.$$typeof===o}function le(C){var M={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(pe){return M[pe]})}var ge=/\/+/g;function Y(C,M){return typeof C=="object"&&C!==null&&C.key!=null?le(""+C.key):M.toString(36)}function ie(C,M,pe,he,ve){var Se=typeof C;(Se==="undefined"||Se==="boolean")&&(C=null);var Ee=!1;if(C===null)Ee=!0;else switch(Se){case"string":case"number":Ee=!0;break;case"object":switch(C.$$typeof){case o:case a:Ee=!0}}if(Ee)return Ee=C,ve=ve(Ee),C=he===""?"."+Y(Ee,0):he,P(ve)?(pe="",C!=null&&(pe=C.replace(ge,"$&/")+"/"),ie(ve,M,pe,"",function(et){return et})):ve!=null&&(Oe(ve)&&(ve=G(ve,pe+(!ve.key||Ee&&Ee.key===ve.key?"":(""+ve.key).replace(ge,"$&/")+"/")+C)),M.push(ve)),1;if(Ee=0,he=he===""?".":he+":",P(C))for(var ke=0;ke<C.length;ke++){Se=C[ke];var _e=he+Y(Se,ke);Ee+=ie(Se,M,pe,_e,ve)}else if(_e=z(C),typeof _e=="function")for(C=_e.call(C),ke=0;!(Se=C.next()).done;)Se=Se.value,_e=he+Y(Se,ke++),Ee+=ie(Se,M,pe,_e,ve);else if(Se==="object")throw M=String(C),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return Ee}function V(C,M,pe){if(C==null)return C;var he=[],ve=0;return ie(C,he,"","",function(Se){return M.call(pe,Se,ve++)}),he}function ce(C){if(C._status===-1){var M=C._result;M=M(),M.then(function(pe){(C._status===0||C._status===-1)&&(C._status=1,C._result=pe)},function(pe){(C._status===0||C._status===-1)&&(C._status=2,C._result=pe)}),C._status===-1&&(C._status=0,C._result=M)}if(C._status===1)return C._result.default;throw C._result}var de={current:null},K={transition:null},re={ReactCurrentDispatcher:de,ReactCurrentBatchConfig:K,ReactCurrentOwner:W};function X(){throw Error("act(...) is not supported in production builds of React.")}return ye.Children={map:V,forEach:function(C,M,pe){V(C,function(){M.apply(this,arguments)},pe)},count:function(C){var M=0;return V(C,function(){M++}),M},toArray:function(C){return V(C,function(M){return M})||[]},only:function(C){if(!Oe(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},ye.Component=N,ye.Fragment=u,ye.Profiler=p,ye.PureComponent=$,ye.StrictMode=d,ye.Suspense=y,ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,ye.act=X,ye.cloneElement=function(C,M,pe){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var he=O({},C.props),ve=C.key,Se=C.ref,Ee=C._owner;if(M!=null){if(M.ref!==void 0&&(Se=M.ref,Ee=W.current),M.key!==void 0&&(ve=""+M.key),C.type&&C.type.defaultProps)var ke=C.type.defaultProps;for(_e in M)I.call(M,_e)&&!ue.hasOwnProperty(_e)&&(he[_e]=M[_e]===void 0&&ke!==void 0?ke[_e]:M[_e])}var _e=arguments.length-2;if(_e===1)he.children=pe;else if(1<_e){ke=Array(_e);for(var et=0;et<_e;et++)ke[et]=arguments[et+2];he.children=ke}return{$$typeof:o,type:C.type,key:ve,ref:Se,props:he,_owner:Ee}},ye.createContext=function(C){return C={$$typeof:S,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:m,_context:C},C.Consumer=C},ye.createElement=me,ye.createFactory=function(C){var M=me.bind(null,C);return M.type=C,M},ye.createRef=function(){return{current:null}},ye.forwardRef=function(C){return{$$typeof:j,render:C}},ye.isValidElement=Oe,ye.lazy=function(C){return{$$typeof:_,_payload:{_status:-1,_result:C},_init:ce}},ye.memo=function(C,M){return{$$typeof:k,type:C,compare:M===void 0?null:M}},ye.startTransition=function(C){var M=K.transition;K.transition={};try{C()}finally{K.transition=M}},ye.unstable_act=X,ye.useCallback=function(C,M){return de.current.useCallback(C,M)},ye.useContext=function(C){return de.current.useContext(C)},ye.useDebugValue=function(){},ye.useDeferredValue=function(C){return de.current.useDeferredValue(C)},ye.useEffect=function(C,M){return de.current.useEffect(C,M)},ye.useId=function(){return de.current.useId()},ye.useImperativeHandle=function(C,M,pe){return de.current.useImperativeHandle(C,M,pe)},ye.useInsertionEffect=function(C,M){return de.current.useInsertionEffect(C,M)},ye.useLayoutEffect=function(C,M){return de.current.useLayoutEffect(C,M)},ye.useMemo=function(C,M){return de.current.useMemo(C,M)},ye.useReducer=function(C,M,pe){return de.current.useReducer(C,M,pe)},ye.useRef=function(C){return de.current.useRef(C)},ye.useState=function(C){return de.current.useState(C)},ye.useSyncExternalStore=function(C,M,pe){return de.current.useSyncExternalStore(C,M,pe)},ye.useTransition=function(){return de.current.useTransition()},ye.version="18.3.1",ye}var cc;function yi(){return cc||(cc=1,oi.exports=np()),oi.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var dc;function rp(){if(dc)return Xr;dc=1;var o=yi(),a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function S(j,y,k){var _,w={},z=null,B=null;k!==void 0&&(z=""+k),y.key!==void 0&&(z=""+y.key),y.ref!==void 0&&(B=y.ref);for(_ in y)d.call(y,_)&&!m.hasOwnProperty(_)&&(w[_]=y[_]);if(j&&j.defaultProps)for(_ in y=j.defaultProps,y)w[_]===void 0&&(w[_]=y[_]);return{$$typeof:a,type:j,key:z,ref:B,props:w,_owner:p.current}}return Xr.Fragment=u,Xr.jsx=S,Xr.jsxs=S,Xr}var fc;function lp(){return fc||(fc=1,si.exports=rp()),si.exports}var l=lp(),f=yi();const Mc=tp(f),sp=ep({__proto__:null,default:Mc},[f]);var ps={},ii={exports:{}},ut={},ai={exports:{}},ui={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var pc;function op(){return pc||(pc=1,(function(o){function a(K,re){var X=K.length;K.push(re);e:for(;0<X;){var C=X-1>>>1,M=K[C];if(0<p(M,re))K[C]=re,K[X]=M,X=C;else break e}}function u(K){return K.length===0?null:K[0]}function d(K){if(K.length===0)return null;var re=K[0],X=K.pop();if(X!==re){K[0]=X;e:for(var C=0,M=K.length,pe=M>>>1;C<pe;){var he=2*(C+1)-1,ve=K[he],Se=he+1,Ee=K[Se];if(0>p(ve,X))Se<M&&0>p(Ee,ve)?(K[C]=Ee,K[Se]=X,C=Se):(K[C]=ve,K[he]=X,C=he);else if(Se<M&&0>p(Ee,X))K[C]=Ee,K[Se]=X,C=Se;else break e}}return re}function p(K,re){var X=K.sortIndex-re.sortIndex;return X!==0?X:K.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;o.unstable_now=function(){return m.now()}}else{var S=Date,j=S.now();o.unstable_now=function(){return S.now()-j}}var y=[],k=[],_=1,w=null,z=3,B=!1,O=!1,x=!1,N=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function D(K){for(var re=u(k);re!==null;){if(re.callback===null)d(k);else if(re.startTime<=K)d(k),re.sortIndex=re.expirationTime,a(y,re);else break;re=u(k)}}function P(K){if(x=!1,D(K),!O)if(u(y)!==null)O=!0,ce(I);else{var re=u(k);re!==null&&de(P,re.startTime-K)}}function I(K,re){O=!1,x&&(x=!1,R(me),me=-1),B=!0;var X=z;try{for(D(re),w=u(y);w!==null&&(!(w.expirationTime>re)||K&&!le());){var C=w.callback;if(typeof C=="function"){w.callback=null,z=w.priorityLevel;var M=C(w.expirationTime<=re);re=o.unstable_now(),typeof M=="function"?w.callback=M:w===u(y)&&d(y),D(re)}else d(y);w=u(y)}if(w!==null)var pe=!0;else{var he=u(k);he!==null&&de(P,he.startTime-re),pe=!1}return pe}finally{w=null,z=X,B=!1}}var W=!1,ue=null,me=-1,G=5,Oe=-1;function le(){return!(o.unstable_now()-Oe<G)}function ge(){if(ue!==null){var K=o.unstable_now();Oe=K;var re=!0;try{re=ue(!0,K)}finally{re?Y():(W=!1,ue=null)}}else W=!1}var Y;if(typeof $=="function")Y=function(){$(ge)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,V=ie.port2;ie.port1.onmessage=ge,Y=function(){V.postMessage(null)}}else Y=function(){N(ge,0)};function ce(K){ue=K,W||(W=!0,Y())}function de(K,re){me=N(function(){K(o.unstable_now())},re)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(K){K.callback=null},o.unstable_continueExecution=function(){O||B||(O=!0,ce(I))},o.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<K?Math.floor(1e3/K):5},o.unstable_getCurrentPriorityLevel=function(){return z},o.unstable_getFirstCallbackNode=function(){return u(y)},o.unstable_next=function(K){switch(z){case 1:case 2:case 3:var re=3;break;default:re=z}var X=z;z=re;try{return K()}finally{z=X}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(K,re){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var X=z;z=K;try{return re()}finally{z=X}},o.unstable_scheduleCallback=function(K,re,X){var C=o.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?C+X:C):X=C,K){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=X+M,K={id:_++,callback:re,priorityLevel:K,startTime:X,expirationTime:M,sortIndex:-1},X>C?(K.sortIndex=X,a(k,K),u(y)===null&&K===u(k)&&(x?(R(me),me=-1):x=!0,de(P,X-C))):(K.sortIndex=M,a(y,K),O||B||(O=!0,ce(I))),K},o.unstable_shouldYield=le,o.unstable_wrapCallback=function(K){var re=z;return function(){var X=z;z=re;try{return K.apply(this,arguments)}finally{z=X}}}})(ui)),ui}var hc;function ip(){return hc||(hc=1,ai.exports=op()),ai.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var mc;function ap(){if(mc)return ut;mc=1;var o=yi(),a=ip();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var d=new Set,p={};function m(e,t){S(e,t),S(e+"Capture",t)}function S(e,t){for(p[e]=t,e=0;e<t.length;e++)d.add(t[e])}var j=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,k=/^[: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]*$/,_={},w={};function z(e){return y.call(w,e)?!0:y.call(_,e)?!1:k.test(e)?w[e]=!0:(_[e]=!0,!1)}function B(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,t,n,r){if(t===null||typeof t>"u"||B(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function x(e,t,n,r,s,i,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=c}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new x(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new x(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new x(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new x(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new x(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new x(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new x(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new x(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new x(e,5,!1,e.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function $(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(R,$);N[t]=new x(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(R,$);N[t]=new x(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(R,$);N[t]=new x(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new x(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new x(e,1,!1,e.toLowerCase(),null,!0,!0)});function D(e,t,n,r){var s=N.hasOwnProperty(t)?N[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(O(t,n,s,r)&&(n=null),r||s===null?z(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var P=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),W=Symbol.for("react.portal"),ue=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Oe=Symbol.for("react.provider"),le=Symbol.for("react.context"),ge=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),de=Symbol.for("react.offscreen"),K=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,C;function M(e){if(C===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);C=t&&t[1]||""}return`
|
|
34
|
-
`+C+e}var pe=!1;function he(e,t){if(!e||pe)return"";pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(L){var r=L}Reflect.construct(e,[],t)}else{try{t.call()}catch(L){r=L}e.call(t.prototype)}else{try{throw Error()}catch(L){r=L}e()}}catch(L){if(L&&r&&typeof L.stack=="string"){for(var s=L.stack.split(`
|
|
35
|
-
`),i=r.stack.split(`
|
|
36
|
-
`),c=s.length-1,h=i.length-1;1<=c&&0<=h&&s[c]!==i[h];)h--;for(;1<=c&&0<=h;c--,h--)if(s[c]!==i[h]){if(c!==1||h!==1)do if(c--,h--,0>h||s[c]!==i[h]){var g=`
|
|
37
|
-
`+s[c].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),g}while(1<=c&&0<=h);break}}}finally{pe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?M(e):""}function ve(e){switch(e.tag){case 5:return M(e.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return e=he(e.type,!1),e;case 11:return e=he(e.type.render,!1),e;case 1:return e=he(e.type,!0),e;default:return""}}function Se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ue:return"Fragment";case W:return"Portal";case G:return"Profiler";case me:return"StrictMode";case Y:return"Suspense";case ie:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case le:return(e.displayName||"Context")+".Consumer";case Oe:return(e._context.displayName||"Context")+".Provider";case ge:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case ce:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Ee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(t);case 8:return t===me?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _e(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function et(e){var t=_e(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(c){r=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(c){r=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rn(e){e._valueTracker||(e._valueTracker=et(e))}function nl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_e(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zn(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}}function fr(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pr(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function In(e,t){t=t.checked,t!=null&&D(e,"checked",t,!1)}function Ht(e,t){In(e,t);var n=ke(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?J(e,t.type,n):t.hasOwnProperty("defaultValue")&&J(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function J(e,t,n){(t!=="number"||zn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var H=Array.isArray;function Re(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ke(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Dn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mt(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(u(92));if(H(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ke(n)}}function hr(e,t){var n=ke(t.value),r=ke(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function rl(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mr(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function On(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mn,ll=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mn=Mn||document.createElement("div"),Mn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ce(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},An=["Webkit","ms","Moz","O"];Object.keys(Tt).forEach(function(e){An.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tt[t]=Tt[e]})});function sl(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tt.hasOwnProperty(e)&&Tt[e]?(""+t).trim():t+"px"}function Ni(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=sl(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var nd=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gs(e,t){if(t){if(nd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function ys(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 xs=null;function vs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ss=null,Fn=null,Un=null;function Ei(e){if(e=Ar(e)){if(typeof Ss!="function")throw Error(u(280));var t=e.stateNode;t&&(t=Pl(t),Ss(e.stateNode,e.type,t))}}function _i(e){Fn?Un?Un.push(e):Un=[e]:Fn=e}function Pi(){if(Fn){var e=Fn,t=Un;if(Un=Fn=null,Ei(e),t)for(e=0;e<t.length;e++)Ei(t[e])}}function Ti(e,t){return e(t)}function Li(){}var js=!1;function Ri(e,t,n){if(js)return e(t,n);js=!0;try{return Ti(e,t,n)}finally{js=!1,(Fn!==null||Un!==null)&&(Li(),Pi())}}function gr(e,t){var n=e.stateNode;if(n===null)return null;var r=Pl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var ws=!1;if(j)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){ws=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{ws=!1}function rd(e,t,n,r,s,i,c,h,g){var L=Array.prototype.slice.call(arguments,3);try{t.apply(n,L)}catch(F){this.onError(F)}}var xr=!1,ol=null,il=!1,ks=null,ld={onError:function(e){xr=!0,ol=e}};function sd(e,t,n,r,s,i,c,h,g){xr=!1,ol=null,rd.apply(ld,arguments)}function od(e,t,n,r,s,i,c,h,g){if(sd.apply(this,arguments),xr){if(xr){var L=ol;xr=!1,ol=null}else throw Error(u(198));il||(il=!0,ks=L)}}function gn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function zi(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 Ii(e){if(gn(e)!==e)throw Error(u(188))}function id(e){var t=e.alternate;if(!t){if(t=gn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Ii(s),e;if(i===r)return Ii(s),t;i=i.sibling}throw Error(u(188))}if(n.return!==r.return)n=s,r=i;else{for(var c=!1,h=s.child;h;){if(h===n){c=!0,n=s,r=i;break}if(h===r){c=!0,r=s,n=i;break}h=h.sibling}if(!c){for(h=i.child;h;){if(h===n){c=!0,n=i,r=s;break}if(h===r){c=!0,r=i,n=s;break}h=h.sibling}if(!c)throw Error(u(189))}}if(n.alternate!==r)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Di(e){return e=id(e),e!==null?Oi(e):null}function Oi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Oi(e);if(t!==null)return t;e=e.sibling}return null}var Mi=a.unstable_scheduleCallback,Ai=a.unstable_cancelCallback,ad=a.unstable_shouldYield,ud=a.unstable_requestPaint,Ae=a.unstable_now,cd=a.unstable_getCurrentPriorityLevel,Cs=a.unstable_ImmediatePriority,Fi=a.unstable_UserBlockingPriority,al=a.unstable_NormalPriority,dd=a.unstable_LowPriority,Ui=a.unstable_IdlePriority,ul=null,Lt=null;function fd(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(ul,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:md,pd=Math.log,hd=Math.LN2;function md(e){return e>>>=0,e===0?32:31-(pd(e)/hd|0)|0}var cl=64,dl=4194304;function vr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function fl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,c=n&268435455;if(c!==0){var h=c&~s;h!==0?r=vr(h):(i&=c,i!==0&&(r=vr(i)))}else c=n&~s,c!==0?r=vr(c):i!==0&&(r=vr(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&s)===0&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-wt(t),s=1<<n,r|=e[n],t&=~s;return r}function gd(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var c=31-wt(i),h=1<<c,g=s[c];g===-1?((h&n)===0||(h&r)!==0)&&(s[c]=gd(h,t)):g<=t&&(e.expiredLanes|=h),i&=~h}}function Ns(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Bi(){var e=cl;return cl<<=1,(cl&4194240)===0&&(cl=64),e}function Es(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Sr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function xd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-wt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function _s(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Ne=0;function Wi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var bi,Ps,$i,Vi,Ki,Ts=!1,pl=[],Qt=null,Yt=null,Jt=null,jr=new Map,wr=new Map,Gt=[],vd="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 submit".split(" ");function Hi(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Yt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":jr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wr.delete(t.pointerId)}}function kr(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ar(t),t!==null&&Ps(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Sd(e,t,n,r,s){switch(t){case"focusin":return Qt=kr(Qt,e,t,n,r,s),!0;case"dragenter":return Yt=kr(Yt,e,t,n,r,s),!0;case"mouseover":return Jt=kr(Jt,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return jr.set(i,kr(jr.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,wr.set(i,kr(wr.get(i)||null,e,t,n,r,s)),!0}return!1}function Qi(e){var t=yn(e.target);if(t!==null){var n=gn(t);if(n!==null){if(t=n.tag,t===13){if(t=zi(n),t!==null){e.blockedOn=t,Ki(e.priority,function(){$i(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function hl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xs=r,n.target.dispatchEvent(r),xs=null}else return t=Ar(n),t!==null&&Ps(t),e.blockedOn=n,!1;t.shift()}return!0}function Yi(e,t,n){hl(e)&&n.delete(t)}function jd(){Ts=!1,Qt!==null&&hl(Qt)&&(Qt=null),Yt!==null&&hl(Yt)&&(Yt=null),Jt!==null&&hl(Jt)&&(Jt=null),jr.forEach(Yi),wr.forEach(Yi)}function Cr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ts||(Ts=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,jd)))}function Nr(e){function t(s){return Cr(s,e)}if(0<pl.length){Cr(pl[0],e);for(var n=1;n<pl.length;n++){var r=pl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Qt!==null&&Cr(Qt,e),Yt!==null&&Cr(Yt,e),Jt!==null&&Cr(Jt,e),jr.forEach(t),wr.forEach(t),n=0;n<Gt.length;n++)r=Gt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Gt.length&&(n=Gt[0],n.blockedOn===null);)Qi(n),n.blockedOn===null&&Gt.shift()}var Bn=P.ReactCurrentBatchConfig,ml=!0;function wd(e,t,n,r){var s=Ne,i=Bn.transition;Bn.transition=null;try{Ne=1,Ls(e,t,n,r)}finally{Ne=s,Bn.transition=i}}function kd(e,t,n,r){var s=Ne,i=Bn.transition;Bn.transition=null;try{Ne=4,Ls(e,t,n,r)}finally{Ne=s,Bn.transition=i}}function Ls(e,t,n,r){if(ml){var s=Rs(e,t,n,r);if(s===null)Ys(e,t,r,gl,n),Hi(e,r);else if(Sd(s,e,t,n,r))r.stopPropagation();else if(Hi(e,r),t&4&&-1<vd.indexOf(e)){for(;s!==null;){var i=Ar(s);if(i!==null&&bi(i),i=Rs(e,t,n,r),i===null&&Ys(e,t,r,gl,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Ys(e,t,r,null,n)}}var gl=null;function Rs(e,t,n,r){if(gl=null,e=vs(r),e=yn(e),e!==null)if(t=gn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=zi(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gl=e,null}function Ji(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cd()){case Cs:return 1;case Fi:return 4;case al:case dd:return 16;case Ui:return 536870912;default:return 16}default:return 16}}var qt=null,zs=null,yl=null;function Gi(){if(yl)return yl;var e,t=zs,n=t.length,r,s="value"in qt?qt.value:qt.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var c=n-e;for(r=1;r<=c&&t[n-r]===s[i-r];r++);return yl=s.slice(e,1<r?1-r:void 0)}function xl(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 vl(){return!0}function qi(){return!1}function ct(e){function t(n,r,s,i,c){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?vl:qi,this.isPropagationStopped=qi,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vl)},persist:function(){},isPersistent:vl}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Is=ct(Wn),Er=X({},Wn,{view:0,detail:0}),Cd=ct(Er),Ds,Os,_r,Sl=X({},Er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:As,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!==_r&&(_r&&e.type==="mousemove"?(Ds=e.screenX-_r.screenX,Os=e.screenY-_r.screenY):Os=Ds=0,_r=e),Ds)},movementY:function(e){return"movementY"in e?e.movementY:Os}}),Xi=ct(Sl),Nd=X({},Sl,{dataTransfer:0}),Ed=ct(Nd),_d=X({},Er,{relatedTarget:0}),Ms=ct(_d),Pd=X({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),Td=ct(Pd),Ld=X({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rd=ct(Ld),zd=X({},Wn,{data:0}),Zi=ct(zd),Id={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dd={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"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Md(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Od[e])?!!t[e]:!1}function As(){return Md}var Ad=X({},Er,{key:function(e){if(e.key){var t=Id[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:As,charCode:function(e){return e.type==="keypress"?xl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fd=ct(Ad),Ud=X({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ea=ct(Ud),Bd=X({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:As}),Wd=ct(Bd),bd=X({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),$d=ct(bd),Vd=X({},Sl,{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}),Kd=ct(Vd),Hd=[9,13,27,32],Fs=j&&"CompositionEvent"in window,Pr=null;j&&"documentMode"in document&&(Pr=document.documentMode);var Qd=j&&"TextEvent"in window&&!Pr,ta=j&&(!Fs||Pr&&8<Pr&&11>=Pr),na=" ",ra=!1;function la(e,t){switch(e){case"keyup":return Hd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bn=!1;function Yd(e,t){switch(e){case"compositionend":return sa(t);case"keypress":return t.which!==32?null:(ra=!0,na);case"textInput":return e=t.data,e===na&&ra?null:e;default:return null}}function Jd(e,t){if(bn)return e==="compositionend"||!Fs&&la(e,t)?(e=Gi(),yl=zs=qt=null,bn=!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 ta&&t.locale!=="ko"?null:t.data;default:return null}}var Gd={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 oa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gd[e.type]:t==="textarea"}function ia(e,t,n,r){_i(r),t=Nl(t,"onChange"),0<t.length&&(n=new Is("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Lr=null;function qd(e){Na(e,0)}function jl(e){var t=Qn(e);if(nl(t))return e}function Xd(e,t){if(e==="change")return t}var aa=!1;if(j){var Us;if(j){var Bs="oninput"in document;if(!Bs){var ua=document.createElement("div");ua.setAttribute("oninput","return;"),Bs=typeof ua.oninput=="function"}Us=Bs}else Us=!1;aa=Us&&(!document.documentMode||9<document.documentMode)}function ca(){Tr&&(Tr.detachEvent("onpropertychange",da),Lr=Tr=null)}function da(e){if(e.propertyName==="value"&&jl(Lr)){var t=[];ia(t,Lr,e,vs(e)),Ri(qd,t)}}function Zd(e,t,n){e==="focusin"?(ca(),Tr=t,Lr=n,Tr.attachEvent("onpropertychange",da)):e==="focusout"&&ca()}function ef(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jl(Lr)}function tf(e,t){if(e==="click")return jl(t)}function nf(e,t){if(e==="input"||e==="change")return jl(t)}function rf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:rf;function Rr(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!y.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function fa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pa(e,t){var n=fa(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fa(n)}}function ha(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ha(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ma(){for(var e=window,t=zn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zn(e.document)}return t}function Ws(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")}function lf(e){var t=ma(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ha(n.ownerDocument.documentElement,n)){if(r!==null&&Ws(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=pa(n,i);var c=pa(n,r);s&&c&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sf=j&&"documentMode"in document&&11>=document.documentMode,$n=null,bs=null,zr=null,$s=!1;function ga(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$s||$n==null||$n!==zn(r)||(r=$n,"selectionStart"in r&&Ws(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Rr(zr,r)||(zr=r,r=Nl(bs,"onSelect"),0<r.length&&(t=new Is("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=$n)))}function wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vn={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},Vs={},ya={};j&&(ya=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function kl(e){if(Vs[e])return Vs[e];if(!Vn[e])return e;var t=Vn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ya)return Vs[e]=t[n];return e}var xa=kl("animationend"),va=kl("animationiteration"),Sa=kl("animationstart"),ja=kl("transitionend"),wa=new Map,ka="abort auxClick 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(" ");function Xt(e,t){wa.set(e,t),m(t,[e])}for(var Ks=0;Ks<ka.length;Ks++){var Hs=ka[Ks],of=Hs.toLowerCase(),af=Hs[0].toUpperCase()+Hs.slice(1);Xt(of,"on"+af)}Xt(xa,"onAnimationEnd"),Xt(va,"onAnimationIteration"),Xt(Sa,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(ja,"onTransitionEnd"),S("onMouseEnter",["mouseout","mouseover"]),S("onMouseLeave",["mouseout","mouseover"]),S("onPointerEnter",["pointerout","pointerover"]),S("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(" "),uf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function Ca(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,od(r,t,void 0,e),e.currentTarget=null}function Na(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var c=r.length-1;0<=c;c--){var h=r[c],g=h.instance,L=h.currentTarget;if(h=h.listener,g!==i&&s.isPropagationStopped())break e;Ca(s,h,L),i=g}else for(c=0;c<r.length;c++){if(h=r[c],g=h.instance,L=h.currentTarget,h=h.listener,g!==i&&s.isPropagationStopped())break e;Ca(s,h,L),i=g}}}if(il)throw e=ks,il=!1,ks=null,e}function Te(e,t){var n=t[eo];n===void 0&&(n=t[eo]=new Set);var r=e+"__bubble";n.has(r)||(Ea(t,e,2,!1),n.add(r))}function Qs(e,t,n){var r=0;t&&(r|=4),Ea(n,e,r,t)}var Cl="_reactListening"+Math.random().toString(36).slice(2);function Dr(e){if(!e[Cl]){e[Cl]=!0,d.forEach(function(n){n!=="selectionchange"&&(uf.has(n)||Qs(n,!1,e),Qs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cl]||(t[Cl]=!0,Qs("selectionchange",!1,t))}}function Ea(e,t,n,r){switch(Ji(t)){case 1:var s=wd;break;case 4:s=kd;break;default:s=Ls}n=s.bind(null,t,n,e),s=void 0,!ws||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Ys(e,t,n,r,s){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var h=r.stateNode.containerInfo;if(h===s||h.nodeType===8&&h.parentNode===s)break;if(c===4)for(c=r.return;c!==null;){var g=c.tag;if((g===3||g===4)&&(g=c.stateNode.containerInfo,g===s||g.nodeType===8&&g.parentNode===s))return;c=c.return}for(;h!==null;){if(c=yn(h),c===null)return;if(g=c.tag,g===5||g===6){r=i=c;continue e}h=h.parentNode}}r=r.return}Ri(function(){var L=i,F=vs(n),U=[];e:{var A=wa.get(e);if(A!==void 0){var q=Is,ee=e;switch(e){case"keypress":if(xl(n)===0)break e;case"keydown":case"keyup":q=Fd;break;case"focusin":ee="focus",q=Ms;break;case"focusout":ee="blur",q=Ms;break;case"beforeblur":case"afterblur":q=Ms;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Xi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Wd;break;case xa:case va:case Sa:q=Td;break;case ja:q=$d;break;case"scroll":q=Cd;break;case"wheel":q=Kd;break;case"copy":case"cut":case"paste":q=Rd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=ea}var te=(t&4)!==0,Fe=!te&&e==="scroll",E=te?A!==null?A+"Capture":null:A;te=[];for(var v=L,T;v!==null;){T=v;var b=T.stateNode;if(T.tag===5&&b!==null&&(T=b,E!==null&&(b=gr(v,E),b!=null&&te.push(Or(v,b,T)))),Fe)break;v=v.return}0<te.length&&(A=new q(A,ee,null,n,F),U.push({event:A,listeners:te}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",A&&n!==xs&&(ee=n.relatedTarget||n.fromElement)&&(yn(ee)||ee[At]))break e;if((q||A)&&(A=F.window===F?F:(A=F.ownerDocument)?A.defaultView||A.parentWindow:window,q?(ee=n.relatedTarget||n.toElement,q=L,ee=ee?yn(ee):null,ee!==null&&(Fe=gn(ee),ee!==Fe||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(q=null,ee=L),q!==ee)){if(te=Xi,b="onMouseLeave",E="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(te=ea,b="onPointerLeave",E="onPointerEnter",v="pointer"),Fe=q==null?A:Qn(q),T=ee==null?A:Qn(ee),A=new te(b,v+"leave",q,n,F),A.target=Fe,A.relatedTarget=T,b=null,yn(F)===L&&(te=new te(E,v+"enter",ee,n,F),te.target=T,te.relatedTarget=Fe,b=te),Fe=b,q&&ee)t:{for(te=q,E=ee,v=0,T=te;T;T=Kn(T))v++;for(T=0,b=E;b;b=Kn(b))T++;for(;0<v-T;)te=Kn(te),v--;for(;0<T-v;)E=Kn(E),T--;for(;v--;){if(te===E||E!==null&&te===E.alternate)break t;te=Kn(te),E=Kn(E)}te=null}else te=null;q!==null&&_a(U,A,q,te,!1),ee!==null&&Fe!==null&&_a(U,Fe,ee,te,!0)}}e:{if(A=L?Qn(L):window,q=A.nodeName&&A.nodeName.toLowerCase(),q==="select"||q==="input"&&A.type==="file")var ne=Xd;else if(oa(A))if(aa)ne=nf;else{ne=ef;var se=Zd}else(q=A.nodeName)&&q.toLowerCase()==="input"&&(A.type==="checkbox"||A.type==="radio")&&(ne=tf);if(ne&&(ne=ne(e,L))){ia(U,ne,n,F);break e}se&&se(e,A,L),e==="focusout"&&(se=A._wrapperState)&&se.controlled&&A.type==="number"&&J(A,"number",A.value)}switch(se=L?Qn(L):window,e){case"focusin":(oa(se)||se.contentEditable==="true")&&($n=se,bs=L,zr=null);break;case"focusout":zr=bs=$n=null;break;case"mousedown":$s=!0;break;case"contextmenu":case"mouseup":case"dragend":$s=!1,ga(U,n,F);break;case"selectionchange":if(sf)break;case"keydown":case"keyup":ga(U,n,F)}var oe;if(Fs)e:{switch(e){case"compositionstart":var fe="onCompositionStart";break e;case"compositionend":fe="onCompositionEnd";break e;case"compositionupdate":fe="onCompositionUpdate";break e}fe=void 0}else bn?la(e,n)&&(fe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(fe="onCompositionStart");fe&&(ta&&n.locale!=="ko"&&(bn||fe!=="onCompositionStart"?fe==="onCompositionEnd"&&bn&&(oe=Gi()):(qt=F,zs="value"in qt?qt.value:qt.textContent,bn=!0)),se=Nl(L,fe),0<se.length&&(fe=new Zi(fe,e,null,n,F),U.push({event:fe,listeners:se}),oe?fe.data=oe:(oe=sa(n),oe!==null&&(fe.data=oe)))),(oe=Qd?Yd(e,n):Jd(e,n))&&(L=Nl(L,"onBeforeInput"),0<L.length&&(F=new Zi("onBeforeInput","beforeinput",null,n,F),U.push({event:F,listeners:L}),F.data=oe))}Na(U,t)})}function Or(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=gr(e,n),i!=null&&r.unshift(Or(e,i,s)),i=gr(e,t),i!=null&&r.push(Or(e,i,s))),e=e.return}return r}function Kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _a(e,t,n,r,s){for(var i=t._reactName,c=[];n!==null&&n!==r;){var h=n,g=h.alternate,L=h.stateNode;if(g!==null&&g===r)break;h.tag===5&&L!==null&&(h=L,s?(g=gr(n,i),g!=null&&c.unshift(Or(n,g,h))):s||(g=gr(n,i),g!=null&&c.push(Or(n,g,h)))),n=n.return}c.length!==0&&e.push({event:t,listeners:c})}var cf=/\r\n?/g,df=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(cf,`
|
|
38
|
-
`).replace(df,"")}function El(e,t,n){if(t=Pa(t),Pa(e)!==t&&n)throw Error(u(425))}function _l(){}var Js=null,Gs=null;function qs(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xs=typeof setTimeout=="function"?setTimeout:void 0,ff=typeof clearTimeout=="function"?clearTimeout:void 0,Ta=typeof Promise=="function"?Promise:void 0,pf=typeof queueMicrotask=="function"?queueMicrotask:typeof Ta<"u"?function(e){return Ta.resolve(null).then(e).catch(hf)}:Xs;function hf(e){setTimeout(function(){throw e})}function Zs(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Nr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Nr(t)}function Zt(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==="$?")break;if(t==="/$")return null}}return e}function La(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Hn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Hn,Mr="__reactProps$"+Hn,At="__reactContainer$"+Hn,eo="__reactEvents$"+Hn,mf="__reactListeners$"+Hn,gf="__reactHandles$"+Hn;function yn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[At]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=La(e);e!==null;){if(n=e[Rt])return n;e=La(e)}return t}e=n,n=e.parentNode}return null}function Ar(e){return e=e[Rt]||e[At],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function Pl(e){return e[Mr]||null}var to=[],Yn=-1;function en(e){return{current:e}}function Le(e){0>Yn||(e.current=to[Yn],to[Yn]=null,Yn--)}function Pe(e,t){Yn++,to[Yn]=e.current,e.current=t}var tn={},Je=en(tn),lt=en(!1),xn=tn;function Jn(e,t){var n=e.type.contextTypes;if(!n)return tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function st(e){return e=e.childContextTypes,e!=null}function Tl(){Le(lt),Le(Je)}function Ra(e,t,n){if(Je.current!==tn)throw Error(u(168));Pe(Je,t),Pe(lt,n)}function za(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(u(108,Ee(e)||"Unknown",s));return X({},n,r)}function Ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,xn=Je.current,Pe(Je,e),Pe(lt,lt.current),!0}function Ia(e,t,n){var r=e.stateNode;if(!r)throw Error(u(169));n?(e=za(e,t,xn),r.__reactInternalMemoizedMergedChildContext=e,Le(lt),Le(Je),Pe(Je,e)):Le(lt),Pe(lt,n)}var Ft=null,Rl=!1,no=!1;function Da(e){Ft===null?Ft=[e]:Ft.push(e)}function yf(e){Rl=!0,Da(e)}function nn(){if(!no&&Ft!==null){no=!0;var e=0,t=Ne;try{var n=Ft;for(Ne=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ft=null,Rl=!1}catch(s){throw Ft!==null&&(Ft=Ft.slice(e+1)),Mi(Cs,nn),s}finally{Ne=t,no=!1}}return null}var Gn=[],qn=0,zl=null,Il=0,gt=[],yt=0,vn=null,Ut=1,Bt="";function Sn(e,t){Gn[qn++]=Il,Gn[qn++]=zl,zl=e,Il=t}function Oa(e,t,n){gt[yt++]=Ut,gt[yt++]=Bt,gt[yt++]=vn,vn=e;var r=Ut;e=Bt;var s=32-wt(r)-1;r&=~(1<<s),n+=1;var i=32-wt(t)+s;if(30<i){var c=s-s%5;i=(r&(1<<c)-1).toString(32),r>>=c,s-=c,Ut=1<<32-wt(t)+s|n<<s|r,Bt=i+e}else Ut=1<<i|n<<s|r,Bt=e}function ro(e){e.return!==null&&(Sn(e,1),Oa(e,1,0))}function lo(e){for(;e===zl;)zl=Gn[--qn],Gn[qn]=null,Il=Gn[--qn],Gn[qn]=null;for(;e===vn;)vn=gt[--yt],gt[yt]=null,Bt=gt[--yt],gt[yt]=null,Ut=gt[--yt],gt[yt]=null}var dt=null,ft=null,ze=!1,Ct=null;function Ma(e,t){var n=jt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Aa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dt=e,ft=Zt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dt=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=vn!==null?{id:Ut,overflow:Bt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dt=e,ft=null,!0):!1;default:return!1}}function so(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oo(e){if(ze){var t=ft;if(t){var n=t;if(!Aa(e,t)){if(so(e))throw Error(u(418));t=Zt(n.nextSibling);var r=dt;t&&Aa(e,t)?Ma(r,n):(e.flags=e.flags&-4097|2,ze=!1,dt=e)}}else{if(so(e))throw Error(u(418));e.flags=e.flags&-4097|2,ze=!1,dt=e}}}function Fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dt=e}function Dl(e){if(e!==dt)return!1;if(!ze)return Fa(e),ze=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qs(e.type,e.memoizedProps)),t&&(t=ft)){if(so(e))throw Ua(),Error(u(418));for(;t;)Ma(e,t),t=Zt(t.nextSibling)}if(Fa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ft=Zt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=dt?Zt(e.stateNode.nextSibling):null;return!0}function Ua(){for(var e=ft;e;)e=Zt(e.nextSibling)}function Xn(){ft=dt=null,ze=!1}function io(e){Ct===null?Ct=[e]:Ct.push(e)}var xf=P.ReactCurrentBatchConfig;function Fr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(u(309));var r=n.stateNode}if(!r)throw Error(u(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(c){var h=s.refs;c===null?delete h[i]:h[i]=c},t._stringRef=i,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function Ol(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ba(e){var t=e._init;return t(e._payload)}function Wa(e){function t(E,v){if(e){var T=E.deletions;T===null?(E.deletions=[v],E.flags|=16):T.push(v)}}function n(E,v){if(!e)return null;for(;v!==null;)t(E,v),v=v.sibling;return null}function r(E,v){for(E=new Map;v!==null;)v.key!==null?E.set(v.key,v):E.set(v.index,v),v=v.sibling;return E}function s(E,v){return E=dn(E,v),E.index=0,E.sibling=null,E}function i(E,v,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<v?(E.flags|=2,v):T):(E.flags|=2,v)):(E.flags|=1048576,v)}function c(E){return e&&E.alternate===null&&(E.flags|=2),E}function h(E,v,T,b){return v===null||v.tag!==6?(v=Zo(T,E.mode,b),v.return=E,v):(v=s(v,T),v.return=E,v)}function g(E,v,T,b){var ne=T.type;return ne===ue?F(E,v,T.props.children,b,T.key):v!==null&&(v.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ce&&Ba(ne)===v.type)?(b=s(v,T.props),b.ref=Fr(E,v,T),b.return=E,b):(b=ss(T.type,T.key,T.props,null,E.mode,b),b.ref=Fr(E,v,T),b.return=E,b)}function L(E,v,T,b){return v===null||v.tag!==4||v.stateNode.containerInfo!==T.containerInfo||v.stateNode.implementation!==T.implementation?(v=ei(T,E.mode,b),v.return=E,v):(v=s(v,T.children||[]),v.return=E,v)}function F(E,v,T,b,ne){return v===null||v.tag!==7?(v=Pn(T,E.mode,b,ne),v.return=E,v):(v=s(v,T),v.return=E,v)}function U(E,v,T){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Zo(""+v,E.mode,T),v.return=E,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case I:return T=ss(v.type,v.key,v.props,null,E.mode,T),T.ref=Fr(E,null,v),T.return=E,T;case W:return v=ei(v,E.mode,T),v.return=E,v;case ce:var b=v._init;return U(E,b(v._payload),T)}if(H(v)||re(v))return v=Pn(v,E.mode,T,null),v.return=E,v;Ol(E,v)}return null}function A(E,v,T,b){var ne=v!==null?v.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return ne!==null?null:h(E,v,""+T,b);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case I:return T.key===ne?g(E,v,T,b):null;case W:return T.key===ne?L(E,v,T,b):null;case ce:return ne=T._init,A(E,v,ne(T._payload),b)}if(H(T)||re(T))return ne!==null?null:F(E,v,T,b,null);Ol(E,T)}return null}function q(E,v,T,b,ne){if(typeof b=="string"&&b!==""||typeof b=="number")return E=E.get(T)||null,h(v,E,""+b,ne);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case I:return E=E.get(b.key===null?T:b.key)||null,g(v,E,b,ne);case W:return E=E.get(b.key===null?T:b.key)||null,L(v,E,b,ne);case ce:var se=b._init;return q(E,v,T,se(b._payload),ne)}if(H(b)||re(b))return E=E.get(T)||null,F(v,E,b,ne,null);Ol(v,b)}return null}function ee(E,v,T,b){for(var ne=null,se=null,oe=v,fe=v=0,Ke=null;oe!==null&&fe<T.length;fe++){oe.index>fe?(Ke=oe,oe=null):Ke=oe.sibling;var we=A(E,oe,T[fe],b);if(we===null){oe===null&&(oe=Ke);break}e&&oe&&we.alternate===null&&t(E,oe),v=i(we,v,fe),se===null?ne=we:se.sibling=we,se=we,oe=Ke}if(fe===T.length)return n(E,oe),ze&&Sn(E,fe),ne;if(oe===null){for(;fe<T.length;fe++)oe=U(E,T[fe],b),oe!==null&&(v=i(oe,v,fe),se===null?ne=oe:se.sibling=oe,se=oe);return ze&&Sn(E,fe),ne}for(oe=r(E,oe);fe<T.length;fe++)Ke=q(oe,E,fe,T[fe],b),Ke!==null&&(e&&Ke.alternate!==null&&oe.delete(Ke.key===null?fe:Ke.key),v=i(Ke,v,fe),se===null?ne=Ke:se.sibling=Ke,se=Ke);return e&&oe.forEach(function(fn){return t(E,fn)}),ze&&Sn(E,fe),ne}function te(E,v,T,b){var ne=re(T);if(typeof ne!="function")throw Error(u(150));if(T=ne.call(T),T==null)throw Error(u(151));for(var se=ne=null,oe=v,fe=v=0,Ke=null,we=T.next();oe!==null&&!we.done;fe++,we=T.next()){oe.index>fe?(Ke=oe,oe=null):Ke=oe.sibling;var fn=A(E,oe,we.value,b);if(fn===null){oe===null&&(oe=Ke);break}e&&oe&&fn.alternate===null&&t(E,oe),v=i(fn,v,fe),se===null?ne=fn:se.sibling=fn,se=fn,oe=Ke}if(we.done)return n(E,oe),ze&&Sn(E,fe),ne;if(oe===null){for(;!we.done;fe++,we=T.next())we=U(E,we.value,b),we!==null&&(v=i(we,v,fe),se===null?ne=we:se.sibling=we,se=we);return ze&&Sn(E,fe),ne}for(oe=r(E,oe);!we.done;fe++,we=T.next())we=q(oe,E,fe,we.value,b),we!==null&&(e&&we.alternate!==null&&oe.delete(we.key===null?fe:we.key),v=i(we,v,fe),se===null?ne=we:se.sibling=we,se=we);return e&&oe.forEach(function(qf){return t(E,qf)}),ze&&Sn(E,fe),ne}function Fe(E,v,T,b){if(typeof T=="object"&&T!==null&&T.type===ue&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case I:e:{for(var ne=T.key,se=v;se!==null;){if(se.key===ne){if(ne=T.type,ne===ue){if(se.tag===7){n(E,se.sibling),v=s(se,T.props.children),v.return=E,E=v;break e}}else if(se.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ce&&Ba(ne)===se.type){n(E,se.sibling),v=s(se,T.props),v.ref=Fr(E,se,T),v.return=E,E=v;break e}n(E,se);break}else t(E,se);se=se.sibling}T.type===ue?(v=Pn(T.props.children,E.mode,b,T.key),v.return=E,E=v):(b=ss(T.type,T.key,T.props,null,E.mode,b),b.ref=Fr(E,v,T),b.return=E,E=b)}return c(E);case W:e:{for(se=T.key;v!==null;){if(v.key===se)if(v.tag===4&&v.stateNode.containerInfo===T.containerInfo&&v.stateNode.implementation===T.implementation){n(E,v.sibling),v=s(v,T.children||[]),v.return=E,E=v;break e}else{n(E,v);break}else t(E,v);v=v.sibling}v=ei(T,E.mode,b),v.return=E,E=v}return c(E);case ce:return se=T._init,Fe(E,v,se(T._payload),b)}if(H(T))return ee(E,v,T,b);if(re(T))return te(E,v,T,b);Ol(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,v!==null&&v.tag===6?(n(E,v.sibling),v=s(v,T),v.return=E,E=v):(n(E,v),v=Zo(T,E.mode,b),v.return=E,E=v),c(E)):n(E,v)}return Fe}var Zn=Wa(!0),ba=Wa(!1),Ml=en(null),Al=null,er=null,ao=null;function uo(){ao=er=Al=null}function co(e){var t=Ml.current;Le(Ml),e._currentValue=t}function fo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function tr(e,t){Al=e,ao=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(ao!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(Al===null)throw Error(u(308));er=e,Al.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var jn=null;function po(e){jn===null?jn=[e]:jn.push(e)}function $a(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,po(t)):(n.next=s.next,s.next=n),t.interleaved=n,Wt(e,r)}function Wt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rn=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(je&2)!==0){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Wt(e,n)}return s=r.interleaved,s===null?(t.next=t,po(r)):(t.next=s.next,s.next=t),r.interleaved=t,Wt(e,n)}function Fl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_s(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=c:i=i.next=c,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ul(e,t,n,r){var s=e.updateQueue;rn=!1;var i=s.firstBaseUpdate,c=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var g=h,L=g.next;g.next=null,c===null?i=L:c.next=L,c=g;var F=e.alternate;F!==null&&(F=F.updateQueue,h=F.lastBaseUpdate,h!==c&&(h===null?F.firstBaseUpdate=L:h.next=L,F.lastBaseUpdate=g))}if(i!==null){var U=s.baseState;c=0,F=L=g=null,h=i;do{var A=h.lane,q=h.eventTime;if((r&A)===A){F!==null&&(F=F.next={eventTime:q,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,next:null});e:{var ee=e,te=h;switch(A=t,q=n,te.tag){case 1:if(ee=te.payload,typeof ee=="function"){U=ee.call(q,U,A);break e}U=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=te.payload,A=typeof ee=="function"?ee.call(q,U,A):ee,A==null)break e;U=X({},U,A);break e;case 2:rn=!0}}h.callback!==null&&h.lane!==0&&(e.flags|=64,A=s.effects,A===null?s.effects=[h]:A.push(h))}else q={eventTime:q,lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},F===null?(L=F=q,g=U):F=F.next=q,c|=A;if(h=h.next,h===null){if(h=s.shared.pending,h===null)break;A=h,h=A.next,A.next=null,s.lastBaseUpdate=A,s.shared.pending=null}}while(!0);if(F===null&&(g=U),s.baseState=g,s.firstBaseUpdate=L,s.lastBaseUpdate=F,t=s.shared.interleaved,t!==null){s=t;do c|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Cn|=c,e.lanes=c,e.memoizedState=U}}function Ha(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(u(191,s));s.call(r)}}}var Ur={},zt=en(Ur),Br=en(Ur),Wr=en(Ur);function wn(e){if(e===Ur)throw Error(u(174));return e}function mo(e,t){switch(Pe(Wr,t),Pe(Br,e),Pe(zt,Ur),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:On(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=On(t,e)}Le(zt),Pe(zt,t)}function nr(){Le(zt),Le(Br),Le(Wr)}function Qa(e){wn(Wr.current);var t=wn(zt.current),n=On(t,e.type);t!==n&&(Pe(Br,e),Pe(zt,n))}function go(e){Br.current===e&&(Le(zt),Le(Br))}var Ie=en(0);function Bl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 yo=[];function xo(){for(var e=0;e<yo.length;e++)yo[e]._workInProgressVersionPrimary=null;yo.length=0}var Wl=P.ReactCurrentDispatcher,vo=P.ReactCurrentBatchConfig,kn=0,De=null,We=null,$e=null,bl=!1,br=!1,$r=0,vf=0;function Ge(){throw Error(u(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function jo(e,t,n,r,s,i){if(kn=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wl.current=e===null||e.memoizedState===null?kf:Cf,e=n(r,s),br){i=0;do{if(br=!1,$r=0,25<=i)throw Error(u(301));i+=1,$e=We=null,t.updateQueue=null,Wl.current=Nf,e=n(r,s)}while(br)}if(Wl.current=Kl,t=We!==null&&We.next!==null,kn=0,$e=We=De=null,bl=!1,t)throw Error(u(300));return e}function wo(){var e=$r!==0;return $r=0,e}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?De.memoizedState=$e=e:$e=$e.next=e,$e}function vt(){if(We===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=$e===null?De.memoizedState:$e.next;if(t!==null)$e=t,We=e;else{if(e===null)throw Error(u(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},$e===null?De.memoizedState=$e=e:$e=$e.next=e}return $e}function Vr(e,t){return typeof t=="function"?t(e):t}function ko(e){var t=vt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=We,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var c=s.next;s.next=i.next,i.next=c}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var h=c=null,g=null,L=i;do{var F=L.lane;if((kn&F)===F)g!==null&&(g=g.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),r=L.hasEagerState?L.eagerState:e(r,L.action);else{var U={lane:F,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};g===null?(h=g=U,c=r):g=g.next=U,De.lanes|=F,Cn|=F}L=L.next}while(L!==null&&L!==i);g===null?c=r:g.next=h,kt(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=c,t.baseQueue=g,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,De.lanes|=i,Cn|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Co(e){var t=vt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var c=s=s.next;do i=e(i,c.action),c=c.next;while(c!==s);kt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ya(){}function Ja(e,t){var n=De,r=vt(),s=t(),i=!kt(r.memoizedState,s);if(i&&(r.memoizedState=s,ot=!0),r=r.queue,No(Xa.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||$e!==null&&$e.memoizedState.tag&1){if(n.flags|=2048,Kr(9,qa.bind(null,n,r,s,t),void 0,null),Ve===null)throw Error(u(349));(kn&30)!==0||Ga(n,t,s)}return s}function Ga(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qa(e,t,n,r){t.value=n,t.getSnapshot=r,Za(t)&&eu(e)}function Xa(e,t,n){return n(function(){Za(t)&&eu(e)})}function Za(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function eu(e){var t=Wt(e,1);t!==null&&Pt(t,e,1,-1)}function tu(e){var t=It();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:e},t.queue=e,e=e.dispatch=wf.bind(null,De,e),[t.memoizedState,e]}function Kr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function nu(){return vt().memoizedState}function $l(e,t,n,r){var s=It();De.flags|=e,s.memoizedState=Kr(1|t,n,void 0,r===void 0?null:r)}function Vl(e,t,n,r){var s=vt();r=r===void 0?null:r;var i=void 0;if(We!==null){var c=We.memoizedState;if(i=c.destroy,r!==null&&So(r,c.deps)){s.memoizedState=Kr(t,n,i,r);return}}De.flags|=e,s.memoizedState=Kr(1|t,n,i,r)}function ru(e,t){return $l(8390656,8,e,t)}function No(e,t){return Vl(2048,8,e,t)}function lu(e,t){return Vl(4,2,e,t)}function su(e,t){return Vl(4,4,e,t)}function ou(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function iu(e,t,n){return n=n!=null?n.concat([e]):null,Vl(4,4,ou.bind(null,t,e),n)}function Eo(){}function au(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function uu(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&So(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cu(e,t,n){return(kn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n):(kt(n,t)||(n=Bi(),De.lanes|=n,Cn|=n,e.baseState=!0),t)}function Sf(e,t){var n=Ne;Ne=n!==0&&4>n?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{Ne=n,vo.transition=r}}function du(){return vt().memoizedState}function jf(e,t,n){var r=un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fu(e))pu(t,n);else if(n=$a(e,t,n,r),n!==null){var s=nt();Pt(n,e,r,s),hu(n,t,r)}}function wf(e,t,n){var r=un(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fu(e))pu(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,h=i(c,n);if(s.hasEagerState=!0,s.eagerState=h,kt(h,c)){var g=t.interleaved;g===null?(s.next=s,po(t)):(s.next=g.next,g.next=s),t.interleaved=s;return}}catch{}finally{}n=$a(e,t,s,r),n!==null&&(s=nt(),Pt(n,e,r,s),hu(n,t,r))}}function fu(e){var t=e.alternate;return e===De||t!==null&&t===De}function pu(e,t){br=bl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_s(e,n)}}var Kl={readContext:xt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},kf={readContext:xt,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$l(4194308,4,ou.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $l(4194308,4,e,t)},useInsertionEffect:function(e,t){return $l(4,2,e,t)},useMemo:function(e,t){var n=It();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=It();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jf.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:tu,useDebugValue:Eo,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=tu(!1),t=e[0];return e=Sf.bind(null,e[1]),It().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,s=It();if(ze){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ve===null)throw Error(u(349));(kn&30)!==0||Ga(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,ru(Xa.bind(null,r,i,e),[e]),r.flags|=2048,Kr(9,qa.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=It(),t=Ve.identifierPrefix;if(ze){var n=Bt,r=Ut;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=$r++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vf++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cf={readContext:xt,useCallback:au,useContext:xt,useEffect:No,useImperativeHandle:iu,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:ko,useRef:nu,useState:function(){return ko(Vr)},useDebugValue:Eo,useDeferredValue:function(e){var t=vt();return cu(t,We.memoizedState,e)},useTransition:function(){var e=ko(Vr)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Ya,useSyncExternalStore:Ja,useId:du,unstable_isNewReconciler:!1},Nf={readContext:xt,useCallback:au,useContext:xt,useEffect:No,useImperativeHandle:iu,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:Co,useRef:nu,useState:function(){return Co(Vr)},useDebugValue:Eo,useDeferredValue:function(e){var t=vt();return We===null?t.memoizedState=e:cu(t,We.memoizedState,e)},useTransition:function(){var e=Co(Vr)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Ya,useSyncExternalStore:Ja,useId:du,unstable_isNewReconciler:!1};function Nt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _o(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hl={isMounted:function(e){return(e=e._reactInternals)?gn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=nt(),s=un(e),i=bt(r,s);i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(Pt(t,e,s,r),Fl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=nt(),s=un(e),i=bt(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(Pt(t,e,s,r),Fl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),r=un(e),s=bt(n,r);s.tag=2,t!=null&&(s.callback=t),t=ln(e,s,r),t!==null&&(Pt(t,e,r,n),Fl(t,e,r))}};function mu(e,t,n,r,s,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,c):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(s,i):!0}function gu(e,t,n){var r=!1,s=tn,i=t.contextType;return typeof i=="object"&&i!==null?i=xt(i):(s=st(t)?xn:Je.current,r=t.contextTypes,i=(r=r!=null)?Jn(e,s):tn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Hl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function yu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hl.enqueueReplaceState(t,t.state,null)}function Po(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},ho(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=xt(i):(i=st(t)?xn:Je.current,s.context=Jn(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(_o(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Hl.enqueueReplaceState(s,s.state,null),Ul(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function rr(e,t){try{var n="",r=t;do n+=ve(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
39
|
-
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function To(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ef=typeof WeakMap=="function"?WeakMap:Map;function xu(e,t,n){n=bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zl||(Zl=!0,Ko=r),Lo(e,t)},n}function vu(e,t,n){n=bt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Lo(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Lo(e,t),typeof r!="function"&&(on===null?on=new Set([this]):on.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),n}function Su(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ef;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Bf.bind(null,e,t,n),t.then(e,e))}function ju(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function wu(e,t,n,r,s){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bt(-1,1),t.tag=2,ln(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=s,e)}var _f=P.ReactCurrentOwner,ot=!1;function tt(e,t,n,r){t.child=e===null?ba(t,null,n,r):Zn(t,e.child,n,r)}function ku(e,t,n,r,s){n=n.render;var i=t.ref;return tr(t,s),r=jo(e,t,n,r,i,s),n=wo(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,$t(e,t,s)):(ze&&n&&ro(t),t.flags|=1,tt(e,t,r,s),t.child)}function Cu(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Xo(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Nu(e,t,i,r,s)):(e=ss(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&s)===0){var c=i.memoizedProps;if(n=n.compare,n=n!==null?n:Rr,n(c,r)&&e.ref===t.ref)return $t(e,t,s)}return t.flags|=1,e=dn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nu(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Rr(i,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=i,(e.lanes&s)!==0)(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,$t(e,t,s)}return Ro(e,t,n,r,s)}function Eu(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(sr,pt),pt|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(sr,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(sr,pt),pt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(sr,pt),pt|=r;return tt(e,t,s,n),t.child}function _u(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ro(e,t,n,r,s){var i=st(n)?xn:Je.current;return i=Jn(t,i),tr(t,s),n=jo(e,t,n,r,i,s),r=wo(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,$t(e,t,s)):(ze&&r&&ro(t),t.flags|=1,tt(e,t,n,s),t.child)}function Pu(e,t,n,r,s){if(st(n)){var i=!0;Ll(t)}else i=!1;if(tr(t,s),t.stateNode===null)Yl(e,t),gu(t,n,r),Po(t,n,r,s),r=!0;else if(e===null){var c=t.stateNode,h=t.memoizedProps;c.props=h;var g=c.context,L=n.contextType;typeof L=="object"&&L!==null?L=xt(L):(L=st(n)?xn:Je.current,L=Jn(t,L));var F=n.getDerivedStateFromProps,U=typeof F=="function"||typeof c.getSnapshotBeforeUpdate=="function";U||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==r||g!==L)&&yu(t,c,r,L),rn=!1;var A=t.memoizedState;c.state=A,Ul(t,r,c,s),g=t.memoizedState,h!==r||A!==g||lt.current||rn?(typeof F=="function"&&(_o(t,n,F,r),g=t.memoizedState),(h=rn||mu(t,n,h,r,A,g,L))?(U||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=g),c.props=r,c.state=g,c.context=L,r=h):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,Va(e,t),h=t.memoizedProps,L=t.type===t.elementType?h:Nt(t.type,h),c.props=L,U=t.pendingProps,A=c.context,g=n.contextType,typeof g=="object"&&g!==null?g=xt(g):(g=st(n)?xn:Je.current,g=Jn(t,g));var q=n.getDerivedStateFromProps;(F=typeof q=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==U||A!==g)&&yu(t,c,r,g),rn=!1,A=t.memoizedState,c.state=A,Ul(t,r,c,s);var ee=t.memoizedState;h!==U||A!==ee||lt.current||rn?(typeof q=="function"&&(_o(t,n,q,r),ee=t.memoizedState),(L=rn||mu(t,n,L,r,A,ee,g)||!1)?(F||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,ee,g),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,ee,g)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ee),c.props=r,c.state=ee,c.context=g,r=L):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),r=!1)}return zo(e,t,n,r,i,s)}function zo(e,t,n,r,s,i){_u(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return s&&Ia(t,n,!1),$t(e,t,i);r=t.stateNode,_f.current=t;var h=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=Zn(t,e.child,null,i),t.child=Zn(t,null,h,i)):tt(e,t,h,i),t.memoizedState=r.state,s&&Ia(t,n,!0),t.child}function Tu(e){var t=e.stateNode;t.pendingContext?Ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ra(e,t.context,!1),mo(e,t.containerInfo)}function Lu(e,t,n,r,s){return Xn(),io(s),t.flags|=256,tt(e,t,n,r),t.child}var Io={dehydrated:null,treeContext:null,retryLane:0};function Do(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ru(e,t,n){var r=t.pendingProps,s=Ie.current,i=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(s&2)!==0),h?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Pe(Ie,s&1),e===null)return oo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(c=r.children,e=r.fallback,i?(r=t.mode,i=t.child,c={mode:"hidden",children:c},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=c):i=os(c,r,0,null),e=Pn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Do(n),t.memoizedState=Io,e):Oo(t,c));if(s=e.memoizedState,s!==null&&(h=s.dehydrated,h!==null))return Pf(e,t,c,r,h,s,n);if(i){i=r.fallback,c=t.mode,s=e.child,h=s.sibling;var g={mode:"hidden",children:r.children};return(c&1)===0&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=g,t.deletions=null):(r=dn(s,g),r.subtreeFlags=s.subtreeFlags&14680064),h!==null?i=dn(h,i):(i=Pn(i,c,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,c=e.child.memoizedState,c=c===null?Do(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},i.memoizedState=c,i.childLanes=e.childLanes&~n,t.memoizedState=Io,r}return i=e.child,e=i.sibling,r=dn(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Oo(e,t){return t=os({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ql(e,t,n,r){return r!==null&&io(r),Zn(t,e.child,null,n),e=Oo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pf(e,t,n,r,s,i,c){if(n)return t.flags&256?(t.flags&=-257,r=To(Error(u(422))),Ql(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=os({mode:"visible",children:r.children},s,0,null),i=Pn(i,s,c,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Zn(t,e.child,null,c),t.child.memoizedState=Do(c),t.memoizedState=Io,i);if((t.mode&1)===0)return Ql(e,t,c,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var h=r.dgst;return r=h,i=Error(u(419)),r=To(i,r,void 0),Ql(e,t,c,r)}if(h=(c&e.childLanes)!==0,ot||h){if(r=Ve,r!==null){switch(c&-c){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=(s&(r.suspendedLanes|c))!==0?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Wt(e,s),Pt(r,e,s,-1))}return qo(),r=To(Error(u(421))),Ql(e,t,c,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Wf.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,ft=Zt(s.nextSibling),dt=t,ze=!0,Ct=null,e!==null&&(gt[yt++]=Ut,gt[yt++]=Bt,gt[yt++]=vn,Ut=e.id,Bt=e.overflow,vn=t),t=Oo(t,r.children),t.flags|=4096,t)}function zu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fo(e.return,t,n)}function Mo(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Iu(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(tt(e,t,r.children,n),r=Ie.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zu(e,n,t);else if(e.tag===19)zu(e,n,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}r&=1}if(Pe(Ie,r),(t.mode&1)===0)t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Bl(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Mo(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Bl(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Mo(t,!0,n,null,i);break;case"together":Mo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $t(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tf(e,t,n){switch(t.tag){case 3:Tu(t),Xn();break;case 5:Qa(t);break;case 1:st(t.type)&&Ll(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Pe(Ml,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(Ie,Ie.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Ru(e,t,n):(Pe(Ie,Ie.current&1),e=$t(e,t,n),e!==null?e.sibling:null);Pe(Ie,Ie.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Iu(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Pe(Ie,Ie.current),r)break;return null;case 22:case 23:return t.lanes=0,Eu(e,t,n)}return $t(e,t,n)}var Du,Ao,Ou,Mu;Du=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ao=function(){},Ou=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,wn(zt.current);var i=null;switch(n){case"input":s=fr(e,s),r=fr(e,r),i=[];break;case"select":s=X({},s,{value:void 0}),r=X({},r,{value:void 0}),i=[];break;case"textarea":s=Dn(e,s),r=Dn(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_l)}gs(n,r);var c;n=null;for(L in s)if(!r.hasOwnProperty(L)&&s.hasOwnProperty(L)&&s[L]!=null)if(L==="style"){var h=s[L];for(c in h)h.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else L!=="dangerouslySetInnerHTML"&&L!=="children"&&L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(p.hasOwnProperty(L)?i||(i=[]):(i=i||[]).push(L,null));for(L in r){var g=r[L];if(h=s!=null?s[L]:void 0,r.hasOwnProperty(L)&&g!==h&&(g!=null||h!=null))if(L==="style")if(h){for(c in h)!h.hasOwnProperty(c)||g&&g.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in g)g.hasOwnProperty(c)&&h[c]!==g[c]&&(n||(n={}),n[c]=g[c])}else n||(i||(i=[]),i.push(L,n)),n=g;else L==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,h=h?h.__html:void 0,g!=null&&h!==g&&(i=i||[]).push(L,g)):L==="children"?typeof g!="string"&&typeof g!="number"||(i=i||[]).push(L,""+g):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&(p.hasOwnProperty(L)?(g!=null&&L==="onScroll"&&Te("scroll",e),i||h===g||(i=[])):(i=i||[]).push(L,g))}n&&(i=i||[]).push("style",n);var L=i;(t.updateQueue=L)&&(t.flags|=4)}},Mu=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hr(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lf(e,t,n){var r=t.pendingProps;switch(lo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return st(t.type)&&Tl(),qe(t),null;case 3:return r=t.stateNode,nr(),Le(lt),Le(Je),xo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ct!==null&&(Yo(Ct),Ct=null))),Ao(e,t),qe(t),null;case 5:go(t);var s=wn(Wr.current);if(n=t.type,e!==null&&t.stateNode!=null)Ou(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(e=wn(zt.current),Dl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rt]=t,r[Mr]=i,e=(t.mode&1)!==0,n){case"dialog":Te("cancel",r),Te("close",r);break;case"iframe":case"object":case"embed":Te("load",r);break;case"video":case"audio":for(s=0;s<Ir.length;s++)Te(Ir[s],r);break;case"source":Te("error",r);break;case"img":case"image":case"link":Te("error",r),Te("load",r);break;case"details":Te("toggle",r);break;case"input":pr(r,i),Te("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Te("invalid",r);break;case"textarea":mt(r,i),Te("invalid",r)}gs(n,i),s=null;for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];c==="children"?typeof h=="string"?r.textContent!==h&&(i.suppressHydrationWarning!==!0&&El(r.textContent,h,e),s=["children",h]):typeof h=="number"&&r.textContent!==""+h&&(i.suppressHydrationWarning!==!0&&El(r.textContent,h,e),s=["children",""+h]):p.hasOwnProperty(c)&&h!=null&&c==="onScroll"&&Te("scroll",r)}switch(n){case"input":Rn(r),Q(r,i,!0);break;case"textarea":Rn(r),rl(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=_l)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=mr(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Rt]=t,e[Mr]=r,Du(e,t,!1,!1),t.stateNode=e;e:{switch(c=ys(n,r),n){case"dialog":Te("cancel",e),Te("close",e),s=r;break;case"iframe":case"object":case"embed":Te("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ir.length;s++)Te(Ir[s],e);s=r;break;case"source":Te("error",e),s=r;break;case"img":case"image":case"link":Te("error",e),Te("load",e),s=r;break;case"details":Te("toggle",e),s=r;break;case"input":pr(e,r),s=fr(e,r),Te("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=X({},r,{value:void 0}),Te("invalid",e);break;case"textarea":mt(e,r),s=Dn(e,r),Te("invalid",e);break;default:s=r}gs(n,s),h=s;for(i in h)if(h.hasOwnProperty(i)){var g=h[i];i==="style"?Ni(e,g):i==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,g!=null&&ll(e,g)):i==="children"?typeof g=="string"?(n!=="textarea"||g!=="")&&Ce(e,g):typeof g=="number"&&Ce(e,""+g):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(p.hasOwnProperty(i)?g!=null&&i==="onScroll"&&Te("scroll",e):g!=null&&D(e,i,g,c))}switch(n){case"input":Rn(e),Q(e,r,!1);break;case"textarea":Rn(e),rl(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ke(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Re(e,!!r.multiple,i,!1):r.defaultValue!=null&&Re(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=_l)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)Mu(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(u(166));if(n=wn(Wr.current),wn(zt.current),Dl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rt]=t,(i=r.nodeValue!==n)&&(e=dt,e!==null))switch(e.tag){case 3:El(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&El(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rt]=t,t.stateNode=r}return qe(t),null;case 13:if(Le(Ie),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ze&&ft!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ua(),Xn(),t.flags|=98560,i=!1;else if(i=Dl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[Rt]=t}else Xn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),i=!1}else Ct!==null&&(Yo(Ct),Ct=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ie.current&1)!==0?be===0&&(be=3):qo())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return nr(),Ao(e,t),e===null&&Dr(t.stateNode.containerInfo),qe(t),null;case 10:return co(t.type._context),qe(t),null;case 17:return st(t.type)&&Tl(),qe(t),null;case 19:if(Le(Ie),i=t.memoizedState,i===null)return qe(t),null;if(r=(t.flags&128)!==0,c=i.rendering,c===null)if(r)Hr(i,!1);else{if(be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Bl(e),c!==null){for(t.flags|=128,Hr(i,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,c=i.alternate,c===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,e=c.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Pe(Ie,Ie.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ae()>or&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Bl(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!ze)return qe(t),null}else 2*Ae()-i.renderingStartTime>or&&n!==1073741824&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(n=i.last,n!==null?n.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ae(),t.sibling=null,n=Ie.current,Pe(Ie,r?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return Go(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(pt&1073741824)!==0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function Rf(e,t){switch(lo(t),t.tag){case 1:return st(t.type)&&Tl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(),Le(lt),Le(Je),xo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return go(t),null;case 13:if(Le(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(Ie),null;case 4:return nr(),null;case 10:return co(t.type._context),null;case 22:case 23:return Go(),null;case 24:return null;default:return null}}var Jl=!1,Xe=!1,zf=typeof WeakSet=="function"?WeakSet:Set,Z=null;function lr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Fo(e,t,n){try{n()}catch(r){Me(e,t,r)}}var Au=!1;function If(e,t){if(Js=ml,e=ma(),Ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var c=0,h=-1,g=-1,L=0,F=0,U=e,A=null;t:for(;;){for(var q;U!==n||s!==0&&U.nodeType!==3||(h=c+s),U!==i||r!==0&&U.nodeType!==3||(g=c+r),U.nodeType===3&&(c+=U.nodeValue.length),(q=U.firstChild)!==null;)A=U,U=q;for(;;){if(U===e)break t;if(A===n&&++L===s&&(h=c),A===i&&++F===r&&(g=c),(q=U.nextSibling)!==null)break;U=A,A=U.parentNode}U=q}n=h===-1||g===-1?null:{start:h,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gs={focusedElem:e,selectionRange:n},ml=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var te=ee.memoizedProps,Fe=ee.memoizedState,E=t.stateNode,v=E.getSnapshotBeforeUpdate(t.elementType===t.type?te:Nt(t.type,te),Fe);E.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(b){Me(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return ee=Au,Au=!1,ee}function Qr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Fo(t,n,i)}s=s.next}while(s!==r)}}function Gl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Fu(e){var t=e.alternate;t!==null&&(e.alternate=null,Fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Mr],delete t[eo],delete t[mf],delete t[gf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uu(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uu(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.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 Bo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_l));else if(r!==4&&(e=e.child,e!==null))for(Bo(e,t,n),e=e.sibling;e!==null;)Bo(e,t,n),e=e.sibling}function Wo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wo(e,t,n),e=e.sibling;e!==null;)Wo(e,t,n),e=e.sibling}var He=null,Et=!1;function sn(e,t,n){for(n=n.child;n!==null;)Wu(e,t,n),n=n.sibling}function Wu(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(ul,n)}catch{}switch(n.tag){case 5:Xe||lr(n,t);case 6:var r=He,s=Et;He=null,sn(e,t,n),He=r,Et=s,He!==null&&(Et?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Et?(e=He,n=n.stateNode,e.nodeType===8?Zs(e.parentNode,n):e.nodeType===1&&Zs(e,n),Nr(e)):Zs(He,n.stateNode));break;case 4:r=He,s=Et,He=n.stateNode.containerInfo,Et=!0,sn(e,t,n),He=r,Et=s;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,c=i.destroy;i=i.tag,c!==void 0&&((i&2)!==0||(i&4)!==0)&&Fo(n,t,c),s=s.next}while(s!==r)}sn(e,t,n);break;case 1:if(!Xe&&(lr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(h){Me(n,t,h)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,sn(e,t,n),Xe=r):sn(e,t,n);break;default:sn(e,t,n)}}function bu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zf),t.forEach(function(r){var s=bf.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _t(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,c=t,h=c;e:for(;h!==null;){switch(h.tag){case 5:He=h.stateNode,Et=!1;break e;case 3:He=h.stateNode.containerInfo,Et=!0;break e;case 4:He=h.stateNode.containerInfo,Et=!0;break e}h=h.return}if(He===null)throw Error(u(160));Wu(i,c,s),He=null,Et=!1;var g=s.alternate;g!==null&&(g.return=null),s.return=null}catch(L){Me(s,t,L)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$u(t,e),t=t.sibling}function $u(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_t(t,e),Dt(e),r&4){try{Qr(3,e,e.return),Gl(3,e)}catch(te){Me(e,e.return,te)}try{Qr(5,e,e.return)}catch(te){Me(e,e.return,te)}}break;case 1:_t(t,e),Dt(e),r&512&&n!==null&&lr(n,n.return);break;case 5:if(_t(t,e),Dt(e),r&512&&n!==null&&lr(n,n.return),e.flags&32){var s=e.stateNode;try{Ce(s,"")}catch(te){Me(e,e.return,te)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,c=n!==null?n.memoizedProps:i,h=e.type,g=e.updateQueue;if(e.updateQueue=null,g!==null)try{h==="input"&&i.type==="radio"&&i.name!=null&&In(s,i),ys(h,c);var L=ys(h,i);for(c=0;c<g.length;c+=2){var F=g[c],U=g[c+1];F==="style"?Ni(s,U):F==="dangerouslySetInnerHTML"?ll(s,U):F==="children"?Ce(s,U):D(s,F,U,L)}switch(h){case"input":Ht(s,i);break;case"textarea":hr(s,i);break;case"select":var A=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var q=i.value;q!=null?Re(s,!!i.multiple,q,!1):A!==!!i.multiple&&(i.defaultValue!=null?Re(s,!!i.multiple,i.defaultValue,!0):Re(s,!!i.multiple,i.multiple?[]:"",!1))}s[Mr]=i}catch(te){Me(e,e.return,te)}}break;case 6:if(_t(t,e),Dt(e),r&4){if(e.stateNode===null)throw Error(u(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(te){Me(e,e.return,te)}}break;case 3:if(_t(t,e),Dt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nr(t.containerInfo)}catch(te){Me(e,e.return,te)}break;case 4:_t(t,e),Dt(e);break;case 13:_t(t,e),Dt(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Vo=Ae())),r&4&&bu(e);break;case 22:if(F=n!==null&&n.memoizedState!==null,e.mode&1?(Xe=(L=Xe)||F,_t(t,e),Xe=L):_t(t,e),Dt(e),r&8192){if(L=e.memoizedState!==null,(e.stateNode.isHidden=L)&&!F&&(e.mode&1)!==0)for(Z=e,F=e.child;F!==null;){for(U=Z=F;Z!==null;){switch(A=Z,q=A.child,A.tag){case 0:case 11:case 14:case 15:Qr(4,A,A.return);break;case 1:lr(A,A.return);var ee=A.stateNode;if(typeof ee.componentWillUnmount=="function"){r=A,n=A.return;try{t=r,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(te){Me(r,n,te)}}break;case 5:lr(A,A.return);break;case 22:if(A.memoizedState!==null){Hu(U);continue}}q!==null?(q.return=A,Z=q):Hu(U)}F=F.sibling}e:for(F=null,U=e;;){if(U.tag===5){if(F===null){F=U;try{s=U.stateNode,L?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(h=U.stateNode,g=U.memoizedProps.style,c=g!=null&&g.hasOwnProperty("display")?g.display:null,h.style.display=sl("display",c))}catch(te){Me(e,e.return,te)}}}else if(U.tag===6){if(F===null)try{U.stateNode.nodeValue=L?"":U.memoizedProps}catch(te){Me(e,e.return,te)}}else if((U.tag!==22&&U.tag!==23||U.memoizedState===null||U===e)&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===e)break e;for(;U.sibling===null;){if(U.return===null||U.return===e)break e;F===U&&(F=null),U=U.return}F===U&&(F=null),U.sibling.return=U.return,U=U.sibling}}break;case 19:_t(t,e),Dt(e),r&4&&bu(e);break;case 21:break;default:_t(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Uu(n)){var r=n;break e}n=n.return}throw Error(u(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ce(s,""),r.flags&=-33);var i=Bu(e);Wo(e,i,s);break;case 3:case 4:var c=r.stateNode.containerInfo,h=Bu(e);Bo(e,h,c);break;default:throw Error(u(161))}}catch(g){Me(e,e.return,g)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Df(e,t,n){Z=e,Vu(e)}function Vu(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var s=Z,i=s.child;if(s.tag===22&&r){var c=s.memoizedState!==null||Jl;if(!c){var h=s.alternate,g=h!==null&&h.memoizedState!==null||Xe;h=Jl;var L=Xe;if(Jl=c,(Xe=g)&&!L)for(Z=s;Z!==null;)c=Z,g=c.child,c.tag===22&&c.memoizedState!==null?Qu(s):g!==null?(g.return=c,Z=g):Qu(s);for(;i!==null;)Z=i,Vu(i),i=i.sibling;Z=s,Jl=h,Xe=L}Ku(e)}else(s.subtreeFlags&8772)!==0&&i!==null?(i.return=s,Z=i):Ku(e)}}function Ku(e){for(;Z!==null;){var t=Z;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Xe||Gl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Xe)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ha(t,i,r);break;case 3:var c=t.updateQueue;if(c!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ha(t,c,n)}break;case 5:var h=t.stateNode;if(n===null&&t.flags&4){n=h;var g=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":g.autoFocus&&n.focus();break;case"img":g.src&&(n.src=g.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var L=t.alternate;if(L!==null){var F=L.memoizedState;if(F!==null){var U=F.dehydrated;U!==null&&Nr(U)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Xe||t.flags&512&&Uo(t)}catch(A){Me(t,t.return,A)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Hu(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Qu(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gl(4,t)}catch(g){Me(t,n,g)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(g){Me(t,s,g)}}var i=t.return;try{Uo(t)}catch(g){Me(t,i,g)}break;case 5:var c=t.return;try{Uo(t)}catch(g){Me(t,c,g)}}}catch(g){Me(t,t.return,g)}if(t===e){Z=null;break}var h=t.sibling;if(h!==null){h.return=t.return,Z=h;break}Z=t.return}}var Of=Math.ceil,ql=P.ReactCurrentDispatcher,bo=P.ReactCurrentOwner,St=P.ReactCurrentBatchConfig,je=0,Ve=null,Be=null,Qe=0,pt=0,sr=en(0),be=0,Yr=null,Cn=0,Xl=0,$o=0,Jr=null,it=null,Vo=0,or=1/0,Vt=null,Zl=!1,Ko=null,on=null,es=!1,an=null,ts=0,Gr=0,Ho=null,ns=-1,rs=0;function nt(){return(je&6)!==0?Ae():ns!==-1?ns:ns=Ae()}function un(e){return(e.mode&1)===0?1:(je&2)!==0&&Qe!==0?Qe&-Qe:xf.transition!==null?(rs===0&&(rs=Bi()),rs):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:Ji(e.type)),e)}function Pt(e,t,n,r){if(50<Gr)throw Gr=0,Ho=null,Error(u(185));Sr(e,n,r),((je&2)===0||e!==Ve)&&(e===Ve&&((je&2)===0&&(Xl|=n),be===4&&cn(e,Qe)),at(e,r),n===1&&je===0&&(t.mode&1)===0&&(or=Ae()+500,Rl&&nn()))}function at(e,t){var n=e.callbackNode;yd(e,t);var r=fl(e,e===Ve?Qe:0);if(r===0)n!==null&&Ai(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ai(n),t===1)e.tag===0?yf(Ju.bind(null,e)):Da(Ju.bind(null,e)),pf(function(){(je&6)===0&&nn()}),n=null;else{switch(Wi(r)){case 1:n=Cs;break;case 4:n=Fi;break;case 16:n=al;break;case 536870912:n=Ui;break;default:n=al}n=rc(n,Yu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yu(e,t){if(ns=-1,rs=0,(je&6)!==0)throw Error(u(327));var n=e.callbackNode;if(ir()&&e.callbackNode!==n)return null;var r=fl(e,e===Ve?Qe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=ls(e,r);else{t=r;var s=je;je|=2;var i=qu();(Ve!==e||Qe!==t)&&(Vt=null,or=Ae()+500,En(e,t));do try{Ff();break}catch(h){Gu(e,h)}while(!0);uo(),ql.current=i,je=s,Be!==null?t=0:(Ve=null,Qe=0,t=be)}if(t!==0){if(t===2&&(s=Ns(e),s!==0&&(r=s,t=Qo(e,s))),t===1)throw n=Yr,En(e,0),cn(e,r),at(e,Ae()),n;if(t===6)cn(e,r);else{if(s=e.current.alternate,(r&30)===0&&!Mf(s)&&(t=ls(e,r),t===2&&(i=Ns(e),i!==0&&(r=i,t=Qo(e,i))),t===1))throw n=Yr,En(e,0),cn(e,r),at(e,Ae()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(u(345));case 2:_n(e,it,Vt);break;case 3:if(cn(e,r),(r&130023424)===r&&(t=Vo+500-Ae(),10<t)){if(fl(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){nt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Xs(_n.bind(null,e,it,Vt),t);break}_n(e,it,Vt);break;case 4:if(cn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var c=31-wt(r);i=1<<c,c=t[c],c>s&&(s=c),r&=~i}if(r=s,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Of(r/1960))-r,10<r){e.timeoutHandle=Xs(_n.bind(null,e,it,Vt),r);break}_n(e,it,Vt);break;case 5:_n(e,it,Vt);break;default:throw Error(u(329))}}}return at(e,Ae()),e.callbackNode===n?Yu.bind(null,e):null}function Qo(e,t){var n=Jr;return e.current.memoizedState.isDehydrated&&(En(e,t).flags|=256),e=ls(e,t),e!==2&&(t=it,it=n,t!==null&&Yo(t)),e}function Yo(e){it===null?it=e:it.push.apply(it,e)}function Mf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!kt(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 cn(e,t){for(t&=~$o,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wt(t),r=1<<n;e[n]=-1,t&=~r}}function Ju(e){if((je&6)!==0)throw Error(u(327));ir();var t=fl(e,0);if((t&1)===0)return at(e,Ae()),null;var n=ls(e,t);if(e.tag!==0&&n===2){var r=Ns(e);r!==0&&(t=r,n=Qo(e,r))}if(n===1)throw n=Yr,En(e,0),cn(e,t),at(e,Ae()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_n(e,it,Vt),at(e,Ae()),null}function Jo(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(or=Ae()+500,Rl&&nn())}}function Nn(e){an!==null&&an.tag===0&&(je&6)===0&&ir();var t=je;je|=1;var n=St.transition,r=Ne;try{if(St.transition=null,Ne=1,e)return e()}finally{Ne=r,St.transition=n,je=t,(je&6)===0&&nn()}}function Go(){pt=sr.current,Le(sr)}function En(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ff(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(lo(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tl();break;case 3:nr(),Le(lt),Le(Je),xo();break;case 5:go(r);break;case 4:nr();break;case 13:Le(Ie);break;case 19:Le(Ie);break;case 10:co(r.type._context);break;case 22:case 23:Go()}n=n.return}if(Ve=e,Be=e=dn(e.current,null),Qe=pt=t,be=0,Yr=null,$o=Xl=Cn=0,it=Jr=null,jn!==null){for(t=0;t<jn.length;t++)if(n=jn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var c=i.next;i.next=s,r.next=c}n.pending=r}jn=null}return e}function Gu(e,t){do{var n=Be;try{if(uo(),Wl.current=Kl,bl){for(var r=De.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}bl=!1}if(kn=0,$e=We=De=null,br=!1,$r=0,bo.current=null,n===null||n.return===null){be=1,Yr=t,Be=null;break}e:{var i=e,c=n.return,h=n,g=t;if(t=Qe,h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){var L=g,F=h,U=F.tag;if((F.mode&1)===0&&(U===0||U===11||U===15)){var A=F.alternate;A?(F.updateQueue=A.updateQueue,F.memoizedState=A.memoizedState,F.lanes=A.lanes):(F.updateQueue=null,F.memoizedState=null)}var q=ju(c);if(q!==null){q.flags&=-257,wu(q,c,h,i,t),q.mode&1&&Su(i,L,t),t=q,g=L;var ee=t.updateQueue;if(ee===null){var te=new Set;te.add(g),t.updateQueue=te}else ee.add(g);break e}else{if((t&1)===0){Su(i,L,t),qo();break e}g=Error(u(426))}}else if(ze&&h.mode&1){var Fe=ju(c);if(Fe!==null){(Fe.flags&65536)===0&&(Fe.flags|=256),wu(Fe,c,h,i,t),io(rr(g,h));break e}}i=g=rr(g,h),be!==4&&(be=2),Jr===null?Jr=[i]:Jr.push(i),i=c;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var E=xu(i,g,t);Ka(i,E);break e;case 1:h=g;var v=i.type,T=i.stateNode;if((i.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(on===null||!on.has(T)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=vu(i,h,t);Ka(i,b);break e}}i=i.return}while(i!==null)}Zu(n)}catch(ne){t=ne,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function qu(){var e=ql.current;return ql.current=Kl,e===null?Kl:e}function qo(){(be===0||be===3||be===2)&&(be=4),Ve===null||(Cn&268435455)===0&&(Xl&268435455)===0||cn(Ve,Qe)}function ls(e,t){var n=je;je|=2;var r=qu();(Ve!==e||Qe!==t)&&(Vt=null,En(e,t));do try{Af();break}catch(s){Gu(e,s)}while(!0);if(uo(),je=n,ql.current=r,Be!==null)throw Error(u(261));return Ve=null,Qe=0,be}function Af(){for(;Be!==null;)Xu(Be)}function Ff(){for(;Be!==null&&!ad();)Xu(Be)}function Xu(e){var t=nc(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?Zu(e):Be=t,bo.current=null}function Zu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Lf(n,t,pt),n!==null){Be=n;return}}else{if(n=Rf(n,t),n!==null){n.flags&=32767,Be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{be=6,Be=null;return}}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);be===0&&(be=5)}function _n(e,t,n){var r=Ne,s=St.transition;try{St.transition=null,Ne=1,Uf(e,t,n,r)}finally{St.transition=s,Ne=r}return null}function Uf(e,t,n,r){do ir();while(an!==null);if((je&6)!==0)throw Error(u(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(xd(e,i),e===Ve&&(Be=Ve=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||es||(es=!0,rc(al,function(){return ir(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=St.transition,St.transition=null;var c=Ne;Ne=1;var h=je;je|=4,bo.current=null,If(e,n),$u(n,e),lf(Gs),ml=!!Js,Gs=Js=null,e.current=n,Df(n),ud(),je=h,Ne=c,St.transition=i}else e.current=n;if(es&&(es=!1,an=e,ts=s),i=e.pendingLanes,i===0&&(on=null),fd(n.stateNode),at(e,Ae()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Zl)throw Zl=!1,e=Ko,Ko=null,e;return(ts&1)!==0&&e.tag!==0&&ir(),i=e.pendingLanes,(i&1)!==0?e===Ho?Gr++:(Gr=0,Ho=e):Gr=0,nn(),null}function ir(){if(an!==null){var e=Wi(ts),t=St.transition,n=Ne;try{if(St.transition=null,Ne=16>e?16:e,an===null)var r=!1;else{if(e=an,an=null,ts=0,(je&6)!==0)throw Error(u(331));var s=je;for(je|=4,Z=e.current;Z!==null;){var i=Z,c=i.child;if((Z.flags&16)!==0){var h=i.deletions;if(h!==null){for(var g=0;g<h.length;g++){var L=h[g];for(Z=L;Z!==null;){var F=Z;switch(F.tag){case 0:case 11:case 15:Qr(8,F,i)}var U=F.child;if(U!==null)U.return=F,Z=U;else for(;Z!==null;){F=Z;var A=F.sibling,q=F.return;if(Fu(F),F===L){Z=null;break}if(A!==null){A.return=q,Z=A;break}Z=q}}}var ee=i.alternate;if(ee!==null){var te=ee.child;if(te!==null){ee.child=null;do{var Fe=te.sibling;te.sibling=null,te=Fe}while(te!==null)}}Z=i}}if((i.subtreeFlags&2064)!==0&&c!==null)c.return=i,Z=c;else e:for(;Z!==null;){if(i=Z,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Qr(9,i,i.return)}var E=i.sibling;if(E!==null){E.return=i.return,Z=E;break e}Z=i.return}}var v=e.current;for(Z=v;Z!==null;){c=Z;var T=c.child;if((c.subtreeFlags&2064)!==0&&T!==null)T.return=c,Z=T;else e:for(c=v;Z!==null;){if(h=Z,(h.flags&2048)!==0)try{switch(h.tag){case 0:case 11:case 15:Gl(9,h)}}catch(ne){Me(h,h.return,ne)}if(h===c){Z=null;break e}var b=h.sibling;if(b!==null){b.return=h.return,Z=b;break e}Z=h.return}}if(je=s,nn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(ul,e)}catch{}r=!0}return r}finally{Ne=n,St.transition=t}}return!1}function ec(e,t,n){t=rr(n,t),t=xu(e,t,1),e=ln(e,t,1),t=nt(),e!==null&&(Sr(e,1,t),at(e,t))}function Me(e,t,n){if(e.tag===3)ec(e,e,n);else for(;t!==null;){if(t.tag===3){ec(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(on===null||!on.has(r))){e=rr(n,e),e=vu(t,e,1),t=ln(t,e,1),e=nt(),t!==null&&(Sr(t,1,e),at(t,e));break}}t=t.return}}function Bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Qe&n)===n&&(be===4||be===3&&(Qe&130023424)===Qe&&500>Ae()-Vo?En(e,0):$o|=n),at(e,t)}function tc(e,t){t===0&&((e.mode&1)===0?t=1:(t=dl,dl<<=1,(dl&130023424)===0&&(dl=4194304)));var n=nt();e=Wt(e,t),e!==null&&(Sr(e,t,n),at(e,n))}function Wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tc(e,n)}function bf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),tc(e,n)}var nc;nc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,Tf(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,ze&&(t.flags&1048576)!==0&&Oa(t,Il,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yl(e,t),e=t.pendingProps;var s=Jn(t,Je.current);tr(t,n),s=jo(null,t,r,e,s,n);var i=wo();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)?(i=!0,Ll(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ho(t),s.updater=Hl,t.stateNode=s,s._reactInternals=t,Po(t,r,e,n),t=zo(null,t,r,!0,i,n)):(t.tag=0,ze&&i&&ro(t),tt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Vf(r),e=Nt(r,e),s){case 0:t=Ro(null,t,r,e,n);break e;case 1:t=Pu(null,t,r,e,n);break e;case 11:t=ku(null,t,r,e,n);break e;case 14:t=Cu(null,t,r,Nt(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Ro(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Pu(e,t,r,s,n);case 3:e:{if(Tu(t),e===null)throw Error(u(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Va(e,t),Ul(t,r,null,n);var c=t.memoizedState;if(r=c.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=rr(Error(u(423)),t),t=Lu(e,t,r,n,s);break e}else if(r!==s){s=rr(Error(u(424)),t),t=Lu(e,t,r,n,s);break e}else for(ft=Zt(t.stateNode.containerInfo.firstChild),dt=t,ze=!0,Ct=null,n=ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Xn(),r===s){t=$t(e,t,n);break e}tt(e,t,r,n)}t=t.child}return t;case 5:return Qa(t),e===null&&oo(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,c=s.children,qs(r,s)?c=null:i!==null&&qs(r,i)&&(t.flags|=32),_u(e,t),tt(e,t,c,n),t.child;case 6:return e===null&&oo(t),null;case 13:return Ru(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zn(t,null,r,n):tt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),ku(e,t,r,s,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,c=s.value,Pe(Ml,r._currentValue),r._currentValue=c,i!==null)if(kt(i.value,c)){if(i.children===s.children&&!lt.current){t=$t(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var h=i.dependencies;if(h!==null){c=i.child;for(var g=h.firstContext;g!==null;){if(g.context===r){if(i.tag===1){g=bt(-1,n&-n),g.tag=2;var L=i.updateQueue;if(L!==null){L=L.shared;var F=L.pending;F===null?g.next=g:(g.next=F.next,F.next=g),L.pending=g}}i.lanes|=n,g=i.alternate,g!==null&&(g.lanes|=n),fo(i.return,n,t),h.lanes|=n;break}g=g.next}}else if(i.tag===10)c=i.type===t.type?null:i.child;else if(i.tag===18){if(c=i.return,c===null)throw Error(u(341));c.lanes|=n,h=c.alternate,h!==null&&(h.lanes|=n),fo(c,n,t),c=i.sibling}else c=i.child;if(c!==null)c.return=i;else for(c=i;c!==null;){if(c===t){c=null;break}if(i=c.sibling,i!==null){i.return=c.return,c=i;break}c=c.return}i=c}tt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,tr(t,n),s=xt(s),r=r(s),t.flags|=1,tt(e,t,r,n),t.child;case 14:return r=t.type,s=Nt(r,t.pendingProps),s=Nt(r.type,s),Cu(e,t,r,s,n);case 15:return Nu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Yl(e,t),t.tag=1,st(r)?(e=!0,Ll(t)):e=!1,tr(t,n),gu(t,r,s),Po(t,r,s,n),zo(null,t,r,!0,e,n);case 19:return Iu(e,t,n);case 22:return Eu(e,t,n)}throw Error(u(156,t.tag))};function rc(e,t){return Mi(e,t)}function $f(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,n,r){return new $f(e,t,n,r)}function Xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vf(e){if(typeof e=="function")return Xo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ge)return 11;if(e===V)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ss(e,t,n,r,s,i){var c=2;if(r=e,typeof e=="function")Xo(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case ue:return Pn(n.children,s,i,t);case me:c=8,s|=8;break;case G:return e=jt(12,n,t,s|2),e.elementType=G,e.lanes=i,e;case Y:return e=jt(13,n,t,s),e.elementType=Y,e.lanes=i,e;case ie:return e=jt(19,n,t,s),e.elementType=ie,e.lanes=i,e;case de:return os(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oe:c=10;break e;case le:c=9;break e;case ge:c=11;break e;case V:c=14;break e;case ce:c=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=jt(c,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Pn(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function os(e,t,n,r){return e=jt(22,e,r,t),e.elementType=de,e.lanes=n,e.stateNode={isHidden:!1},e}function Zo(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function ei(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kf(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Es(0),this.expirationTimes=Es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Es(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ti(e,t,n,r,s,i,c,h,g){return e=new Kf(e,t,n,h,g),t===1?(t=1,i===!0&&(t|=8)):t=0,i=jt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ho(i),e}function Hf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lc(e){if(!e)return tn;e=e._reactInternals;e:{if(gn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(st(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(st(n))return za(e,n,t)}return t}function sc(e,t,n,r,s,i,c,h,g){return e=ti(n,r,!0,e,s,i,c,h,g),e.context=lc(null),n=e.current,r=nt(),s=un(n),i=bt(r,s),i.callback=t??null,ln(n,i,s),e.current.lanes=s,Sr(e,s,r),at(e,r),e}function is(e,t,n,r){var s=t.current,i=nt(),c=un(s);return n=lc(n),t.context===null?t.context=n:t.pendingContext=n,t=bt(i,c),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ln(s,t,c),e!==null&&(Pt(e,s,c,i),Fl(e,s,c)),c}function as(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function oc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ni(e,t){oc(e,t),(e=e.alternate)&&oc(e,t)}function Qf(){return null}var ic=typeof reportError=="function"?reportError:function(e){console.error(e)};function ri(e){this._internalRoot=e}us.prototype.render=ri.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));is(e,t,null,null)},us.prototype.unmount=ri.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nn(function(){is(null,e,null,null)}),t[At]=null}};function us(e){this._internalRoot=e}us.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gt.length&&t!==0&&t<Gt[n].priority;n++);Gt.splice(n,0,e),n===0&&Qi(e)}};function li(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ac(){}function Yf(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var L=as(c);i.call(L)}}var c=sc(t,r,e,0,null,!1,!1,"",ac);return e._reactRootContainer=c,e[At]=c.current,Dr(e.nodeType===8?e.parentNode:e),Nn(),c}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var h=r;r=function(){var L=as(g);h.call(L)}}var g=ti(e,0,!1,null,null,!1,!1,"",ac);return e._reactRootContainer=g,e[At]=g.current,Dr(e.nodeType===8?e.parentNode:e),Nn(function(){is(t,g,n,r)}),g}function ds(e,t,n,r,s){var i=n._reactRootContainer;if(i){var c=i;if(typeof s=="function"){var h=s;s=function(){var g=as(c);h.call(g)}}is(t,c,e,s)}else c=Yf(n,t,e,s,r);return as(c)}bi=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=vr(t.pendingLanes);n!==0&&(_s(t,n|1),at(t,Ae()),(je&6)===0&&(or=Ae()+500,nn()))}break;case 13:Nn(function(){var r=Wt(e,1);if(r!==null){var s=nt();Pt(r,e,1,s)}}),ni(e,1)}},Ps=function(e){if(e.tag===13){var t=Wt(e,134217728);if(t!==null){var n=nt();Pt(t,e,134217728,n)}ni(e,134217728)}},$i=function(e){if(e.tag===13){var t=un(e),n=Wt(e,t);if(n!==null){var r=nt();Pt(n,e,t,r)}ni(e,t)}},Vi=function(){return Ne},Ki=function(e,t){var n=Ne;try{return Ne=e,t()}finally{Ne=n}},Ss=function(e,t,n){switch(t){case"input":if(Ht(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Pl(r);if(!s)throw Error(u(90));nl(r),Ht(r,s)}}}break;case"textarea":hr(e,n);break;case"select":t=n.value,t!=null&&Re(e,!!n.multiple,t,!1)}},Ti=Jo,Li=Nn;var Jf={usingClientEntryPoint:!1,Events:[Ar,Qn,Pl,_i,Pi,Jo]},qr={findFiberByHostInstance:yn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Gf={bundleType:qr.bundleType,version:qr.version,rendererPackageName:qr.rendererPackageName,rendererConfig:qr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Di(e),e===null?null:e.stateNode},findFiberByHostInstance:qr.findFiberByHostInstance||Qf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fs.isDisabled&&fs.supportsFiber)try{ul=fs.inject(Gf),Lt=fs}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jf,ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!li(t))throw Error(u(200));return Hf(e,t,null,n)},ut.createRoot=function(e,t){if(!li(e))throw Error(u(299));var n=!1,r="",s=ic;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ti(e,1,!1,null,null,n,!1,r,s),e[At]=t.current,Dr(e.nodeType===8?e.parentNode:e),new ri(t)},ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Di(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return Nn(e)},ut.hydrate=function(e,t,n){if(!cs(t))throw Error(u(200));return ds(null,e,t,!0,n)},ut.hydrateRoot=function(e,t,n){if(!li(e))throw Error(u(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",c=ic;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=sc(t,null,e,1,n??null,s,!1,i,c),e[At]=t.current,Dr(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new us(t)},ut.render=function(e,t,n){if(!cs(t))throw Error(u(200));return ds(null,e,t,!1,n)},ut.unmountComponentAtNode=function(e){if(!cs(e))throw Error(u(40));return e._reactRootContainer?(Nn(function(){ds(null,null,e,!1,function(){e._reactRootContainer=null,e[At]=null})}),!0):!1},ut.unstable_batchedUpdates=Jo,ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cs(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return ds(e,t,n,!1,r)},ut.version="18.3.1-next-f1338f8080-20240426",ut}var gc;function Ac(){if(gc)return ii.exports;gc=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(a){console.error(a)}}return o(),ii.exports=ap(),ii.exports}var yc;function up(){if(yc)return ps;yc=1;var o=Ac();return ps.createRoot=o.createRoot,ps.hydrateRoot=o.hydrateRoot,ps}var cp=up(),dp=Ac();/**
|
|
41
|
-
* @remix-run/router v1.23.2
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function Zr(){return Zr=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},Zr.apply(this,arguments)}var pn;(function(o){o.Pop="POP",o.Push="PUSH",o.Replace="REPLACE"})(pn||(pn={}));const xc="popstate";function fp(o){o===void 0&&(o={});function a(d,p){let{pathname:m,search:S,hash:j}=d.location;return pi("",{pathname:m,search:S,hash:j},p.state&&p.state.usr||null,p.state&&p.state.key||"default")}function u(d,p){return typeof p=="string"?p:hs(p)}return hp(a,u,null,o)}function Ue(o,a){if(o===!1||o===null||typeof o>"u")throw new Error(a)}function xi(o,a){if(!o){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function pp(){return Math.random().toString(36).substr(2,8)}function vc(o,a){return{usr:o.state,key:o.key,idx:a}}function pi(o,a,u,d){return u===void 0&&(u=null),Zr({pathname:typeof o=="string"?o:o.pathname,search:"",hash:""},typeof a=="string"?ur(a):a,{state:u,key:a&&a.key||d||pp()})}function hs(o){let{pathname:a="/",search:u="",hash:d=""}=o;return u&&u!=="?"&&(a+=u.charAt(0)==="?"?u:"?"+u),d&&d!=="#"&&(a+=d.charAt(0)==="#"?d:"#"+d),a}function ur(o){let a={};if(o){let u=o.indexOf("#");u>=0&&(a.hash=o.substr(u),o=o.substr(0,u));let d=o.indexOf("?");d>=0&&(a.search=o.substr(d),o=o.substr(0,d)),o&&(a.pathname=o)}return a}function hp(o,a,u,d){d===void 0&&(d={});let{window:p=document.defaultView,v5Compat:m=!1}=d,S=p.history,j=pn.Pop,y=null,k=_();k==null&&(k=0,S.replaceState(Zr({},S.state,{idx:k}),""));function _(){return(S.state||{idx:null}).idx}function w(){j=pn.Pop;let N=_(),R=N==null?null:N-k;k=N,y&&y({action:j,location:x.location,delta:R})}function z(N,R){j=pn.Push;let $=pi(x.location,N,R);k=_()+1;let D=vc($,k),P=x.createHref($);try{S.pushState(D,"",P)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;p.location.assign(P)}m&&y&&y({action:j,location:x.location,delta:1})}function B(N,R){j=pn.Replace;let $=pi(x.location,N,R);k=_();let D=vc($,k),P=x.createHref($);S.replaceState(D,"",P),m&&y&&y({action:j,location:x.location,delta:0})}function O(N){let R=p.location.origin!=="null"?p.location.origin:p.location.href,$=typeof N=="string"?N:hs(N);return $=$.replace(/ $/,"%20"),Ue(R,"No window.location.(origin|href) available to create URL for href: "+$),new URL($,R)}let x={get action(){return j},get location(){return o(p,S)},listen(N){if(y)throw new Error("A history only accepts one active listener");return p.addEventListener(xc,w),y=N,()=>{p.removeEventListener(xc,w),y=null}},createHref(N){return a(p,N)},createURL:O,encodeLocation(N){let R=O(N);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:z,replace:B,go(N){return S.go(N)}};return x}var Sc;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(Sc||(Sc={}));function mp(o,a,u){return u===void 0&&(u="/"),gp(o,a,u)}function gp(o,a,u,d){let p=typeof a=="string"?ur(a):a,m=vi(p.pathname||"/",u);if(m==null)return null;let S=Fc(o);yp(S);let j=null;for(let y=0;j==null&&y<S.length;++y){let k=Tp(m);j=Ep(S[y],k)}return j}function Fc(o,a,u,d){a===void 0&&(a=[]),u===void 0&&(u=[]),d===void 0&&(d="");let p=(m,S,j)=>{let y={relativePath:j===void 0?m.path||"":j,caseSensitive:m.caseSensitive===!0,childrenIndex:S,route:m};y.relativePath.startsWith("/")&&(Ue(y.relativePath.startsWith(d),'Absolute route path "'+y.relativePath+'" nested under path '+('"'+d+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),y.relativePath=y.relativePath.slice(d.length));let k=hn([d,y.relativePath]),_=u.concat(y);m.children&&m.children.length>0&&(Ue(m.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+k+'".')),Fc(m.children,a,_,k)),!(m.path==null&&!m.index)&&a.push({path:k,score:Cp(k,m.index),routesMeta:_})};return o.forEach((m,S)=>{var j;if(m.path===""||!((j=m.path)!=null&&j.includes("?")))p(m,S);else for(let y of Uc(m.path))p(m,S,y)}),a}function Uc(o){let a=o.split("/");if(a.length===0)return[];let[u,...d]=a,p=u.endsWith("?"),m=u.replace(/\?$/,"");if(d.length===0)return p?[m,""]:[m];let S=Uc(d.join("/")),j=[];return j.push(...S.map(y=>y===""?m:[m,y].join("/"))),p&&j.push(...S),j.map(y=>o.startsWith("/")&&y===""?"/":y)}function yp(o){o.sort((a,u)=>a.score!==u.score?u.score-a.score:Np(a.routesMeta.map(d=>d.childrenIndex),u.routesMeta.map(d=>d.childrenIndex)))}const xp=/^:[\w-]+$/,vp=3,Sp=2,jp=1,wp=10,kp=-2,jc=o=>o==="*";function Cp(o,a){let u=o.split("/"),d=u.length;return u.some(jc)&&(d+=kp),a&&(d+=Sp),u.filter(p=>!jc(p)).reduce((p,m)=>p+(xp.test(m)?vp:m===""?jp:wp),d)}function Np(o,a){return o.length===a.length&&o.slice(0,-1).every((d,p)=>d===a[p])?o[o.length-1]-a[a.length-1]:0}function Ep(o,a,u){let{routesMeta:d}=o,p={},m="/",S=[];for(let j=0;j<d.length;++j){let y=d[j],k=j===d.length-1,_=m==="/"?a:a.slice(m.length)||"/",w=_p({path:y.relativePath,caseSensitive:y.caseSensitive,end:k},_),z=y.route;if(!w)return null;Object.assign(p,w.params),S.push({params:p,pathname:hn([m,w.pathname]),pathnameBase:Dp(hn([m,w.pathnameBase])),route:z}),w.pathnameBase!=="/"&&(m=hn([m,w.pathnameBase]))}return S}function _p(o,a){typeof o=="string"&&(o={path:o,caseSensitive:!1,end:!0});let[u,d]=Pp(o.path,o.caseSensitive,o.end),p=a.match(u);if(!p)return null;let m=p[0],S=m.replace(/(.)\/+$/,"$1"),j=p.slice(1);return{params:d.reduce((k,_,w)=>{let{paramName:z,isOptional:B}=_;if(z==="*"){let x=j[w]||"";S=m.slice(0,m.length-x.length).replace(/(.)\/+$/,"$1")}const O=j[w];return B&&!O?k[z]=void 0:k[z]=(O||"").replace(/%2F/g,"/"),k},{}),pathname:m,pathnameBase:S,pattern:o}}function Pp(o,a,u){a===void 0&&(a=!1),u===void 0&&(u=!0),xi(o==="*"||!o.endsWith("*")||o.endsWith("/*"),'Route path "'+o+'" will be treated as if it were '+('"'+o.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+o.replace(/\*$/,"/*")+'".'));let d=[],p="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(S,j,y)=>(d.push({paramName:j,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)"));return o.endsWith("*")?(d.push({paramName:"*"}),p+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?p+="\\/*$":o!==""&&o!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),d]}function Tp(o){try{return o.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xi(!1,'The URL path "'+o+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),o}}function vi(o,a){if(a==="/")return o;if(!o.toLowerCase().startsWith(a.toLowerCase()))return null;let u=a.endsWith("/")?a.length-1:a.length,d=o.charAt(u);return d&&d!=="/"?null:o.slice(u)||"/"}const Lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rp=o=>Lp.test(o);function zp(o,a){a===void 0&&(a="/");let{pathname:u,search:d="",hash:p=""}=typeof o=="string"?ur(o):o,m;if(u)if(Rp(u))m=u;else{if(u.includes("//")){let S=u;u=u.replace(/\/\/+/g,"/"),xi(!1,"Pathnames cannot have embedded double slashes - normalizing "+(S+" -> "+u))}u.startsWith("/")?m=wc(u.substring(1),"/"):m=wc(u,a)}else m=a;return{pathname:m,search:Op(d),hash:Mp(p)}}function wc(o,a){let u=a.replace(/\/+$/,"").split("/");return o.split("/").forEach(p=>{p===".."?u.length>1&&u.pop():p!=="."&&u.push(p)}),u.length>1?u.join("/"):"/"}function ci(o,a,u,d){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(d)+"]. Please separate it out to the ")+("`to."+u+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ip(o){return o.filter((a,u)=>u===0||a.route.path&&a.route.path.length>0)}function Si(o,a){let u=Ip(o);return a?u.map((d,p)=>p===u.length-1?d.pathname:d.pathnameBase):u.map(d=>d.pathnameBase)}function ji(o,a,u,d){d===void 0&&(d=!1);let p;typeof o=="string"?p=ur(o):(p=Zr({},o),Ue(!p.pathname||!p.pathname.includes("?"),ci("?","pathname","search",p)),Ue(!p.pathname||!p.pathname.includes("#"),ci("#","pathname","hash",p)),Ue(!p.search||!p.search.includes("#"),ci("#","search","hash",p)));let m=o===""||p.pathname==="",S=m?"/":p.pathname,j;if(S==null)j=u;else{let w=a.length-1;if(!d&&S.startsWith("..")){let z=S.split("/");for(;z[0]==="..";)z.shift(),w-=1;p.pathname=z.join("/")}j=w>=0?a[w]:"/"}let y=zp(p,j),k=S&&S!=="/"&&S.endsWith("/"),_=(m||S===".")&&u.endsWith("/");return!y.pathname.endsWith("/")&&(k||_)&&(y.pathname+="/"),y}const hn=o=>o.join("/").replace(/\/\/+/g,"/"),Dp=o=>o.replace(/\/+$/,"").replace(/^\/*/,"/"),Op=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,Mp=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o;function Ap(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}const Bc=["post","put","patch","delete"];new Set(Bc);const Fp=["get",...Bc];new Set(Fp);/**
|
|
50
|
-
* React Router v6.30.3
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function el(){return el=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},el.apply(this,arguments)}const wi=f.createContext(null),Up=f.createContext(null),mn=f.createContext(null),ms=f.createContext(null),Kt=f.createContext({outlet:null,matches:[],isDataRoute:!1}),Wc=f.createContext(null);function Bp(o,a){let{relative:u}=a===void 0?{}:a;cr()||Ue(!1);let{basename:d,navigator:p}=f.useContext(mn),{hash:m,pathname:S,search:j}=Vc(o,{relative:u}),y=S;return d!=="/"&&(y=S==="/"?d:hn([d,S])),p.createHref({pathname:y,search:j,hash:m})}function cr(){return f.useContext(ms)!=null}function dr(){return cr()||Ue(!1),f.useContext(ms).location}function bc(o){f.useContext(mn).static||f.useLayoutEffect(o)}function $c(){let{isDataRoute:o}=f.useContext(Kt);return o?th():Wp()}function Wp(){cr()||Ue(!1);let o=f.useContext(wi),{basename:a,future:u,navigator:d}=f.useContext(mn),{matches:p}=f.useContext(Kt),{pathname:m}=dr(),S=JSON.stringify(Si(p,u.v7_relativeSplatPath)),j=f.useRef(!1);return bc(()=>{j.current=!0}),f.useCallback(function(k,_){if(_===void 0&&(_={}),!j.current)return;if(typeof k=="number"){d.go(k);return}let w=ji(k,JSON.parse(S),m,_.relative==="path");o==null&&a!=="/"&&(w.pathname=w.pathname==="/"?a:hn([a,w.pathname])),(_.replace?d.replace:d.push)(w,_.state,_)},[a,d,S,m,o])}const bp=f.createContext(null);function $p(o){let a=f.useContext(Kt).outlet;return a&&f.createElement(bp.Provider,{value:o},a)}function Vc(o,a){let{relative:u}=a===void 0?{}:a,{future:d}=f.useContext(mn),{matches:p}=f.useContext(Kt),{pathname:m}=dr(),S=JSON.stringify(Si(p,d.v7_relativeSplatPath));return f.useMemo(()=>ji(o,JSON.parse(S),m,u==="path"),[o,S,m,u])}function Vp(o,a){return Kp(o,a)}function Kp(o,a,u,d){cr()||Ue(!1);let{navigator:p}=f.useContext(mn),{matches:m}=f.useContext(Kt),S=m[m.length-1],j=S?S.params:{};S&&S.pathname;let y=S?S.pathnameBase:"/";S&&S.route;let k=dr(),_;if(a){var w;let N=typeof a=="string"?ur(a):a;y==="/"||(w=N.pathname)!=null&&w.startsWith(y)||Ue(!1),_=N}else _=k;let z=_.pathname||"/",B=z;if(y!=="/"){let N=y.replace(/^\//,"").split("/");B="/"+z.replace(/^\//,"").split("/").slice(N.length).join("/")}let O=mp(o,{pathname:B}),x=Gp(O&&O.map(N=>Object.assign({},N,{params:Object.assign({},j,N.params),pathname:hn([y,p.encodeLocation?p.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:hn([y,p.encodeLocation?p.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),m,u,d);return a&&x?f.createElement(ms.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},_),navigationType:pn.Pop}},x):x}function Hp(){let o=eh(),a=Ap(o)?o.status+" "+o.statusText:o instanceof Error?o.message:JSON.stringify(o),u=o instanceof Error?o.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},a),u?f.createElement("pre",{style:p},u):null,null)}const Qp=f.createElement(Hp,null);class Yp extends f.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,u){return u.location!==a.location||u.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:u.error,location:u.location,revalidation:a.revalidation||u.revalidation}}componentDidCatch(a,u){console.error("React Router caught the following error during render",a,u)}render(){return this.state.error!==void 0?f.createElement(Kt.Provider,{value:this.props.routeContext},f.createElement(Wc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Jp(o){let{routeContext:a,match:u,children:d}=o,p=f.useContext(wi);return p&&p.static&&p.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=u.route.id),f.createElement(Kt.Provider,{value:a},d)}function Gp(o,a,u,d){var p;if(a===void 0&&(a=[]),u===void 0&&(u=null),d===void 0&&(d=null),o==null){var m;if(!u)return null;if(u.errors)o=u.matches;else if((m=d)!=null&&m.v7_partialHydration&&a.length===0&&!u.initialized&&u.matches.length>0)o=u.matches;else return null}let S=o,j=(p=u)==null?void 0:p.errors;if(j!=null){let _=S.findIndex(w=>w.route.id&&(j==null?void 0:j[w.route.id])!==void 0);_>=0||Ue(!1),S=S.slice(0,Math.min(S.length,_+1))}let y=!1,k=-1;if(u&&d&&d.v7_partialHydration)for(let _=0;_<S.length;_++){let w=S[_];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(k=_),w.route.id){let{loaderData:z,errors:B}=u,O=w.route.loader&&z[w.route.id]===void 0&&(!B||B[w.route.id]===void 0);if(w.route.lazy||O){y=!0,k>=0?S=S.slice(0,k+1):S=[S[0]];break}}}return S.reduceRight((_,w,z)=>{let B,O=!1,x=null,N=null;u&&(B=j&&w.route.id?j[w.route.id]:void 0,x=w.route.errorElement||Qp,y&&(k<0&&z===0?(nh("route-fallback"),O=!0,N=null):k===z&&(O=!0,N=w.route.hydrateFallbackElement||null)));let R=a.concat(S.slice(0,z+1)),$=()=>{let D;return B?D=x:O?D=N:w.route.Component?D=f.createElement(w.route.Component,null):w.route.element?D=w.route.element:D=_,f.createElement(Jp,{match:w,routeContext:{outlet:_,matches:R,isDataRoute:u!=null},children:D})};return u&&(w.route.ErrorBoundary||w.route.errorElement||z===0)?f.createElement(Yp,{location:u.location,revalidation:u.revalidation,component:x,error:B,children:$(),routeContext:{outlet:null,matches:R,isDataRoute:!0}}):$()},null)}var Kc=(function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o})(Kc||{}),Hc=(function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o})(Hc||{});function qp(o){let a=f.useContext(wi);return a||Ue(!1),a}function Xp(o){let a=f.useContext(Up);return a||Ue(!1),a}function Zp(o){let a=f.useContext(Kt);return a||Ue(!1),a}function Qc(o){let a=Zp(),u=a.matches[a.matches.length-1];return u.route.id||Ue(!1),u.route.id}function eh(){var o;let a=f.useContext(Wc),u=Xp(),d=Qc();return a!==void 0?a:(o=u.errors)==null?void 0:o[d]}function th(){let{router:o}=qp(Kc.UseNavigateStable),a=Qc(Hc.UseNavigateStable),u=f.useRef(!1);return bc(()=>{u.current=!0}),f.useCallback(function(p,m){m===void 0&&(m={}),u.current&&(typeof p=="number"?o.navigate(p):o.navigate(p,el({fromRouteId:a},m)))},[o,a])}const kc={};function nh(o,a,u){kc[o]||(kc[o]=!0)}function rh(o,a){o==null||o.v7_startTransition,o==null||o.v7_relativeSplatPath}function lh(o){let{to:a,replace:u,state:d,relative:p}=o;cr()||Ue(!1);let{future:m,static:S}=f.useContext(mn),{matches:j}=f.useContext(Kt),{pathname:y}=dr(),k=$c(),_=ji(a,Si(j,m.v7_relativeSplatPath),y,p==="path"),w=JSON.stringify(_);return f.useEffect(()=>k(JSON.parse(w),{replace:u,state:d,relative:p}),[k,w,p,u,d]),null}function Yc(o){return $p(o.context)}function rt(o){Ue(!1)}function sh(o){let{basename:a="/",children:u=null,location:d,navigationType:p=pn.Pop,navigator:m,static:S=!1,future:j}=o;cr()&&Ue(!1);let y=a.replace(/^\/*/,"/"),k=f.useMemo(()=>({basename:y,navigator:m,static:S,future:el({v7_relativeSplatPath:!1},j)}),[y,j,m,S]);typeof d=="string"&&(d=ur(d));let{pathname:_="/",search:w="",hash:z="",state:B=null,key:O="default"}=d,x=f.useMemo(()=>{let N=vi(_,y);return N==null?null:{location:{pathname:N,search:w,hash:z,state:B,key:O},navigationType:p}},[y,_,w,z,B,O,p]);return x==null?null:f.createElement(mn.Provider,{value:k},f.createElement(ms.Provider,{children:u,value:x}))}function Jc(o){let{children:a,location:u}=o;return Vp(hi(a),u)}new Promise(()=>{});function hi(o,a){a===void 0&&(a=[]);let u=[];return f.Children.forEach(o,(d,p)=>{if(!f.isValidElement(d))return;let m=[...a,p];if(d.type===f.Fragment){u.push.apply(u,hi(d.props.children,m));return}d.type!==rt&&Ue(!1),!d.props.index||!d.props.children||Ue(!1);let S={id:d.props.id||m.join("-"),caseSensitive:d.props.caseSensitive,element:d.props.element,Component:d.props.Component,index:d.props.index,path:d.props.path,loader:d.props.loader,action:d.props.action,errorElement:d.props.errorElement,ErrorBoundary:d.props.ErrorBoundary,hasErrorBoundary:d.props.ErrorBoundary!=null||d.props.errorElement!=null,shouldRevalidate:d.props.shouldRevalidate,handle:d.props.handle,lazy:d.props.lazy};d.props.children&&(S.children=hi(d.props.children,m)),u.push(S)}),u}/**
|
|
59
|
-
* React Router DOM v6.30.3
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function mi(){return mi=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},mi.apply(this,arguments)}function oh(o,a){if(o==null)return{};var u={},d=Object.keys(o),p,m;for(m=0;m<d.length;m++)p=d[m],!(a.indexOf(p)>=0)&&(u[p]=o[p]);return u}function ih(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function ah(o,a){return o.button===0&&(!a||a==="_self")&&!ih(o)}const uh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ch="6";try{window.__reactRouterVersion=ch}catch{}const dh="startTransition",Cc=sp[dh];function Gc(o){let{basename:a,children:u,future:d,window:p}=o,m=f.useRef();m.current==null&&(m.current=fp({window:p,v5Compat:!0}));let S=m.current,[j,y]=f.useState({action:S.action,location:S.location}),{v7_startTransition:k}=d||{},_=f.useCallback(w=>{k&&Cc?Cc(()=>y(w)):y(w)},[y,k]);return f.useLayoutEffect(()=>S.listen(_),[S,_]),f.useEffect(()=>rh(d),[d]),f.createElement(sh,{basename:a,children:u,location:j.location,navigationType:j.action,navigator:S,future:d})}const fh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ph=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mt=f.forwardRef(function(a,u){let{onClick:d,relative:p,reloadDocument:m,replace:S,state:j,target:y,to:k,preventScrollReset:_,viewTransition:w}=a,z=oh(a,uh),{basename:B}=f.useContext(mn),O,x=!1;if(typeof k=="string"&&ph.test(k)&&(O=k,fh))try{let D=new URL(window.location.href),P=k.startsWith("//")?new URL(D.protocol+k):new URL(k),I=vi(P.pathname,B);P.origin===D.origin&&I!=null?k=I+P.search+P.hash:x=!0}catch{}let N=Bp(k,{relative:p}),R=hh(k,{replace:S,state:j,target:y,preventScrollReset:_,relative:p,viewTransition:w});function $(D){d&&d(D),D.defaultPrevented||R(D)}return f.createElement("a",mi({},z,{href:O||N,onClick:x||m?d:$,ref:u,target:y}))});var Nc;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(Nc||(Nc={}));var Ec;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(Ec||(Ec={}));function hh(o,a){let{target:u,replace:d,state:p,preventScrollReset:m,relative:S,viewTransition:j}=a===void 0?{}:a,y=$c(),k=dr(),_=Vc(o,{relative:S});return f.useCallback(w=>{if(ah(w,u)){w.preventDefault();let z=d!==void 0?d:hs(k)===hs(_);y(o,{replace:z,state:p,preventScrollReset:m,relative:S,viewTransition:j})}},[k,y,_,d,p,u,o,m,S,j])}function qc({sidebar:o,children:a}){return l.jsxs("div",{className:"container",children:[l.jsxs("aside",{className:"sidebar",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx("img",{src:"/logo_dark.png",alt:"Teleton",style:{height:"64px"}})}),o]}),l.jsx("main",{className:"main",children:a??l.jsx(Yc,{})})]})}const mh="/api/agent/events",gh="/api/agent/status",yh=5,xh=3e4,vh=3e3;function Sh(o){const a=Math.min(1e3*2**o,xh),u=a*.3*Math.random();return a+u}function jh(){const[o,a]=f.useState("stopped"),[u,d]=f.useState(null),p=f.useRef(!0),m=f.useRef(null),S=f.useRef(0),j=f.useRef(null),y=f.useRef(null),k=f.useRef(!1);return f.useEffect(()=>{p.current=!0;function _(N){if(p.current)try{const R=JSON.parse(N.data);a(R.state),d(R.error??null),S.current=0}catch{}}function w(){m.current&&(m.current.removeEventListener("status",_),m.current.close(),m.current=null)}function z(){y.current&&(clearInterval(y.current),y.current=null)}function B(){if(y.current)return;const N=async()=>{if(p.current)try{const R=await fetch(gh,{credentials:"include"});if(!R.ok)return;const $=await R.json(),D=$.data??$;p.current&&(a(D.state),d(D.error??null))}catch{}};N(),y.current=setInterval(N,vh)}function O(){if(!p.current)return;w();const N=new EventSource(mh,{withCredentials:!0});m.current=N,N.addEventListener("status",_),N.addEventListener("open",()=>{S.current=0,k.current=!1,z()}),N.onerror=()=>{if(w(),!!p.current)if(S.current+=1,S.current<=yh){const R=Sh(S.current-1);j.current=setTimeout(O,R)}else k.current=!0,B()}}function x(){document.hidden?(w(),z(),j.current&&(clearTimeout(j.current),j.current=null)):(S.current=0,k.current=!1,O())}return O(),document.addEventListener("visibilitychange",x),()=>{p.current=!1,w(),z(),j.current&&(clearTimeout(j.current),j.current=null),document.removeEventListener("visibilitychange",x)}},[]),{state:o,error:u}}const _c="/api",wh=3,kh=[1e3,2e3,4e3];function Ch(o){return o+o*.3*Math.random()}const Nh={stopped:{dot:"var(--text-tertiary)",label:"Stopped",pulse:!1},starting:{dot:"#FFD60A",label:"Starting...",pulse:!0},running:{dot:"var(--green)",label:"Running",pulse:!0},stopping:{dot:"#FF9F0A",label:"Stopping...",pulse:!0},error:{dot:"var(--red)",label:"Error",pulse:!1}};function Eh(){const{state:o,error:a}=jh(),[u,d]=f.useState(!1),[p,m]=f.useState(!1),[S,j]=f.useState(null),[y,k]=f.useState(!1),_=f.useRef(null),w=f.useRef(null),z=a&&o==="stopped"?"error":o,B=Nh[z],O=f.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),k(!1)},[]),x=f.useCallback(async(I=0)=>{d(!0),j(null),w.current=new AbortController;try{const W=await fetch(`${_c}/agent/start`,{method:"POST",credentials:"include",signal:AbortSignal.timeout(1e4)}),ue=await W.json();if(!W.ok&&ue.error)throw new Error(ue.error)}catch(W){if(!_.current&&I<wh){k(!0);const ue=Ch(kh[I]??4e3);_.current=setTimeout(()=>{_.current=null,x(I+1)},ue),j(W instanceof Error?W.message:String(W)),d(!1);return}j(W instanceof Error?W.message:String(W)),k(!1)}finally{d(!1),w.current=null}},[]),N=f.useCallback(async()=>{m(!1),d(!0),j(null),O();try{const I=await fetch(`${_c}/agent/stop`,{method:"POST",credentials:"include",signal:AbortSignal.timeout(1e4)}),W=await I.json();if(!I.ok&&W.error)throw new Error(W.error)}catch(I){j(I instanceof Error?I.message:String(I))}finally{d(!1)}},[O]),R=()=>{O(),x(0)},$=()=>{m(!0)},D=z==="stopped"||z==="error",P=z==="running";return l.jsxs("div",{style:{padding:"0 12px",marginBottom:"8px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[l.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:B.dot,animation:B.pulse?"agent-pulse 2s ease-in-out infinite":"none",flexShrink:0}}),l.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"var(--text-secondary)"},children:B.label})]}),D&&!y&&l.jsx("button",{onClick:R,disabled:u,style:{width:"100%",background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(48, 209, 88, 0.2)",fontSize:"12px",padding:"6px 12px"},children:u?"Starting...":"Start Agent"}),P&&l.jsx("button",{onClick:$,disabled:u,className:"btn-danger",style:{width:"100%",fontSize:"12px",padding:"6px 12px"},children:u?"Stopping...":"Stop Agent"}),y&&l.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:"Retrying..."}),S&&!y&&l.jsx("div",{style:{fontSize:"11px",color:"var(--red)",marginTop:"4px",lineHeight:"1.4",wordBreak:"break-word"},children:S}),p&&dp.createPortal(l.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:l.jsxs("div",{className:"modal",onClick:I=>I.stopPropagation(),style:{maxWidth:"360px"},children:[l.jsx("h2",{style:{fontSize:"15px",fontWeight:600,marginBottom:"8px"},children:"Stop Agent?"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginBottom:"20px",lineHeight:"1.5"},children:"Active Telegram sessions will be interrupted."}),l.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[l.jsx("button",{className:"btn-ghost",onClick:()=>m(!1),style:{fontSize:"13px"},children:"Cancel"}),l.jsx("button",{className:"btn-danger",onClick:N,style:{fontSize:"13px"},children:"Stop"})]})]})}),document.body),l.jsx("style",{children:`
|
|
68
|
-
@keyframes agent-pulse {
|
|
69
|
-
0%, 100% { opacity: 1; }
|
|
70
|
-
50% { opacity: 0.4; }
|
|
71
|
-
}
|
|
72
|
-
`})]})}const ki="/api";async function Ze(o,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ki}${o}`,{...a,headers:u});if(!d.ok){const m=await d.json().catch(()=>({error:d.statusText}));throw new Error(m.error||`HTTP ${d.status}`)}const p=await d.json();return p.data!==void 0?p.data:p}async function xe(o,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ki}${o}`,{...a,headers:u,credentials:"include"});if(!d.ok){const p=await d.json().catch(()=>({error:d.statusText}));throw new Error(p.error||`HTTP ${d.status}`)}return d.json()}async function _h(){var o;try{const u=await(await fetch("/auth/check",{credentials:"include"})).json();return u.success&&((o=u.data)==null?void 0:o.authenticated)}catch{return!1}}async function Pc(o){try{return(await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:o}),credentials:"include"})).ok}catch{return!1}}async function Ph(){await fetch("/auth/logout",{method:"POST",credentials:"include"}).catch(()=>{})}const ae={async getStatus(){return xe("/status")},async getTools(){return xe("/tools")},async getMemoryStats(){return xe("/memory/stats")},async searchKnowledge(o,a=10){return xe(`/memory/search?q=${encodeURIComponent(o)}&limit=${a}`)},async getSoulFile(o){return xe(`/soul/${o}`)},async updateSoulFile(o,a){return xe(`/soul/${o}`,{method:"PUT",body:JSON.stringify({content:a})})},async getPlugins(){return xe("/plugins")},async getToolRag(){return xe("/tools/rag")},async updateToolRag(o){return xe("/tools/rag",{method:"PUT",body:JSON.stringify(o)})},async getMcpServers(){return xe("/mcp")},async addMcpServer(o){return xe("/mcp",{method:"POST",body:JSON.stringify(o)})},async removeMcpServer(o){return xe(`/mcp/${encodeURIComponent(o)}`,{method:"DELETE"})},async updateToolConfig(o,a){return xe(`/tools/${o}`,{method:"PUT",body:JSON.stringify(a)})},async workspaceList(o="",a=!1){const u=new URLSearchParams;o&&u.set("path",o),a&&u.set("recursive","true");const d=u.toString();return xe(`/workspace${d?`?${d}`:""}`)},async workspaceRead(o){return xe(`/workspace/read?path=${encodeURIComponent(o)}`)},async workspaceWrite(o,a){return xe("/workspace/write",{method:"POST",body:JSON.stringify({path:o,content:a})})},async workspaceMkdir(o){return xe("/workspace/mkdir",{method:"POST",body:JSON.stringify({path:o})})},async workspaceDelete(o,a=!1){return xe("/workspace",{method:"DELETE",body:JSON.stringify({path:o,recursive:a})})},async workspaceRename(o,a){return xe("/workspace/rename",{method:"POST",body:JSON.stringify({from:o,to:a})})},async workspaceInfo(){return xe("/workspace/info")},async tasksList(o){const a=o?`?status=${o}`:"";return xe(`/tasks${a}`)},async tasksGet(o){return xe(`/tasks/${o}`)},async tasksDelete(o){return xe(`/tasks/${o}`,{method:"DELETE"})},async tasksCancel(o){return xe(`/tasks/${o}/cancel`,{method:"POST"})},async tasksCleanDone(){return xe("/tasks/clean-done",{method:"POST"})},async getConfigKeys(){return xe("/config")},async setConfigKey(o,a){return xe(`/config/${o}`,{method:"PUT",body:JSON.stringify({value:a})})},async unsetConfigKey(o){return xe(`/config/${o}`,{method:"DELETE"})},async getMarketplace(o=!1){return xe(`/marketplace${o?"?refresh=true":""}`)},async installPlugin(o){return xe("/marketplace/install",{method:"POST",body:JSON.stringify({id:o})})},async uninstallPlugin(o){return xe("/marketplace/uninstall",{method:"POST",body:JSON.stringify({id:o})})},async updatePlugin(o){return xe("/marketplace/update",{method:"POST",body:JSON.stringify({id:o})})},async getPluginSecrets(o){return xe(`/marketplace/secrets/${encodeURIComponent(o)}`)},async setPluginSecret(o,a,u){return xe(`/marketplace/secrets/${encodeURIComponent(o)}/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({value:u})})},async unsetPluginSecret(o,a){return xe(`/marketplace/secrets/${encodeURIComponent(o)}/${encodeURIComponent(a)}`,{method:"DELETE"})},connectLogs(o,a){const u=`${ki}/logs/stream`,d=new EventSource(u);return d.addEventListener("log",p=>{try{const m=JSON.parse(p.data);o(m)}catch(m){console.error("Failed to parse log entry:",m)}}),d.onerror=p=>{a==null||a(p)},()=>d.close()}},Ye={getStatus:()=>Ze("/setup/status"),getProviders:()=>Ze("/setup/providers"),getModels:o=>Ze(`/setup/models/${encodeURIComponent(o)}`),validateApiKey:(o,a)=>Ze("/setup/validate/api-key",{method:"POST",body:JSON.stringify({provider:o,apiKey:a})}),detectClaudeCodeKey:()=>Ze("/setup/detect-claude-code-key"),validateBotToken:o=>Ze("/setup/validate/bot-token",{method:"POST",body:JSON.stringify({token:o})}),initWorkspace:o=>Ze("/setup/workspace/init",{method:"POST",body:JSON.stringify({agentName:o})}),getWalletStatus:()=>Ze("/setup/wallet/status"),generateWallet:()=>Ze("/setup/wallet/generate",{method:"POST"}),importWallet:o=>Ze("/setup/wallet/import",{method:"POST",body:JSON.stringify({mnemonic:o})}),sendCode:(o,a,u)=>Ze("/setup/telegram/send-code",{method:"POST",body:JSON.stringify({apiId:o,apiHash:a,phone:u})}),verifyCode:(o,a)=>Ze("/setup/telegram/verify-code",{method:"POST",body:JSON.stringify({authSessionId:o,code:a})}),verifyPassword:(o,a)=>Ze("/setup/telegram/verify-password",{method:"POST",body:JSON.stringify({authSessionId:o,password:a})}),resendCode:o=>Ze("/setup/telegram/resend-code",{method:"POST",body:JSON.stringify({authSessionId:o})}),saveConfig:o=>Ze("/setup/config/save",{method:"POST",body:JSON.stringify(o)}),launch:()=>Ze("/setup/launch",{method:"POST"}),pollHealth:async(o=3e4)=>{const a=Date.now(),u=1e3;for(await new Promise(d=>setTimeout(d,1500));Date.now()-a<o;){try{const d=await fetch("/auth/check",{signal:AbortSignal.timeout(2e3)});if(d.ok){const p=await d.json();if(p.success&&p.data&&!p.data.setup)return}}catch{}await new Promise(d=>setTimeout(d,u))}throw new Error("Agent did not start within the expected time")}};function Th(){const o=dr(),a=d=>o.pathname===d,u=async()=>{await Ph(),window.location.href="/"};return l.jsxs(l.Fragment,{children:[l.jsxs("nav",{children:[l.jsx(Mt,{to:"/",className:a("/")?"active":"",children:"Dashboard"}),l.jsx(Mt,{to:"/tools",className:a("/tools")?"active":"",children:"Tools"}),l.jsx(Mt,{to:"/plugins",className:a("/plugins")?"active":"",children:"Plugins"}),l.jsx(Mt,{to:"/soul",className:a("/soul")?"active":"",children:"Soul"}),l.jsx(Mt,{to:"/memory",className:a("/memory")?"active":"",children:"Memory"}),l.jsx(Mt,{to:"/logs",className:a("/logs")?"active":"",children:"Logs"}),l.jsx(Mt,{to:"/workspace",className:a("/workspace")?"active":"",children:"Workspace"}),l.jsx(Mt,{to:"/tasks",className:a("/tasks")?"active":"",children:"Tasks"}),l.jsx(Mt,{to:"/mcp",className:a("/mcp")?"active":"",children:"MCP"}),l.jsx(Mt,{to:"/config",className:a("/config")?"active":"",children:"Config"})]}),l.jsxs("div",{style:{marginTop:"auto"},children:[l.jsx(Eh,{}),l.jsx("div",{style:{padding:"0 12px 14px"},children:l.jsx("button",{onClick:u,style:{width:"100%",opacity:.7,fontSize:"13px"},children:"Logout"})})]})]})}function Lh(){return l.jsx(qc,{sidebar:l.jsx(Th,{})})}class Xc extends f.Component{constructor(){super(...arguments);Ot(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(u){return{hasError:!0,error:u.message}}render(){return this.state.hasError?l.jsxs("div",{className:"card",style:{textAlign:"center",padding:"40px 20px"},children:[l.jsx("h2",{style:{color:"var(--red)",marginBottom:"8px"},children:"Something went wrong"}),l.jsx("p",{style:{color:"var(--text-secondary)",marginBottom:"16px"},children:this.state.error}),l.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),children:"Try Again"})]}):this.props.children}}function ht({value:o,options:a,labels:u,onChange:d,style:p}){const[m,S]=f.useState(!1),[j,y]=f.useState(-1),k=f.useRef(null),_=f.useRef(null),w=f.useRef(Math.random().toString(36).slice(2));f.useEffect(()=>{if(!m)return;const O=x=>{k.current&&!k.current.contains(x.target)&&S(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[m]),f.useEffect(()=>{if(m){const O=a.indexOf(o);y(O>=0?O:0)}},[m,a,o]),f.useEffect(()=>{if(!m||j<0||!_.current)return;const O=_.current.children[j];O==null||O.scrollIntoView({block:"nearest"})},[m,j]);const z=f.useCallback(O=>{if(!m){(O.key==="Enter"||O.key===" "||O.key==="ArrowDown")&&(O.preventDefault(),S(!0));return}switch(O.key){case"ArrowDown":O.preventDefault(),y(x=>(x+1)%a.length);break;case"ArrowUp":O.preventDefault(),y(x=>(x-1+a.length)%a.length);break;case"Enter":case" ":O.preventDefault(),j>=0&&j<a.length&&(d(a[j]),S(!1));break;case"Escape":O.preventDefault(),S(!1);break;case"Home":O.preventDefault(),y(0);break;case"End":O.preventDefault(),y(a.length-1);break}},[m,j,a,d]),B=`select-menu-${w.current}`;return l.jsxs("div",{ref:k,className:"custom-select",style:p,children:[l.jsxs("button",{type:"button",className:"custom-select-trigger",onClick:()=>S(!m),onKeyDown:z,"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?B:void 0,children:[l.jsx("span",{children:u?u[a.indexOf(o)]??o:o}),l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M6 9l6 6 6-6"})})]}),m&&l.jsx("div",{ref:_,id:B,className:"custom-select-menu",role:"listbox","aria-activedescendant":j>=0?`${B}-opt-${j}`:void 0,children:a.map((O,x)=>l.jsx("div",{id:`${B}-opt-${x}`,role:"option","aria-selected":O===o,className:`custom-select-option${O===o?" active":""}${x===j?" focused":""}`,onClick:()=>{d(O),S(!1)},onMouseEnter:()=>y(x),children:u?u[x]??O:O},O))})]})}function Rh(){const[o,a]=f.useState(null),[u,d]=f.useState(null),[p,m]=f.useState(null),[S,j]=f.useState(!0),[y,k]=f.useState(null),[_,w]=f.useState(null),[z,B]=f.useState({}),O=f.useCallback(()=>{Promise.all([ae.getStatus(),ae.getMemoryStats(),ae.getConfigKeys(),ae.getToolRag()]).then(([P,I,W,ue])=>{a(P.data),d(I.data),m(ue.data);const me={};for(const G of W.data)G.value!=null&&(me[G.key]=G.value);B(me),j(!1)}).catch(P=>{k(P.message),j(!1)})},[]);f.useEffect(()=>{O()},[O]);const x=P=>z[P]??"",N=(P,I)=>{B(W=>({...W,[P]:I}))},R=async(P,I)=>{if(I.trim())try{k(null),await ae.setConfigKey(P,I.trim()),await O(),D(`Saved ${P.split(".").pop()}`)}catch(W){k(W instanceof Error?W.message:String(W))}},$=async P=>{try{const I=await ae.updateToolRag(P);m(I.data),D("Tool RAG updated")}catch(I){k(I instanceof Error?I.message:String(I))}},D=P=>{w(P),setTimeout(()=>w(null),2e3)};return S?l.jsx("div",{className:"loading",children:"Loading..."}):!o||!u?l.jsx("div",{className:"alert error",children:"Failed to load dashboard data"}):l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Dashboard"}),l.jsx("p",{children:"System status and settings"})]}),y&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[y,l.jsx("button",{onClick:()=>k(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),_&&l.jsx("div",{className:"alert success",style:{marginBottom:"16px"},children:_}),l.jsxs("div",{className:"stats",children:[l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Uptime"}),l.jsxs("div",{className:"value",children:[Math.floor(o.uptime/60),"m"]})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Model"}),l.jsx("div",{className:"value",style:{fontSize:"14px"},children:o.model})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Sessions"}),l.jsx("div",{className:"value",children:o.sessionCount})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Tools"}),l.jsx("div",{className:"value",children:o.toolCount})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Memory"}),l.jsxs("div",{className:"stats",style:{marginBottom:0},children:[l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Knowledge"}),l.jsx("div",{className:"value",children:u.knowledge})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Messages"}),l.jsx("div",{className:"value",children:u.messages})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Chats"}),l.jsx("div",{className:"value",children:u.chats})]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Agent"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Provider"}),l.jsx(ht,{value:x("agent.provider"),options:["anthropic","openai","google","xai","groq","openrouter"],onChange:P=>R("agent.provider",P)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Model"}),l.jsx("input",{type:"text",value:x("agent.model"),onChange:P=>N("agent.model",P.target.value),onBlur:P=>R("agent.model",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("agent.model",P.currentTarget.value),style:{width:"100%"}})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Temperature (0-2)"}),l.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:x("agent.temperature"),onChange:P=>N("agent.temperature",P.target.value),onBlur:P=>R("agent.temperature",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("agent.temperature",P.currentTarget.value)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Max Tokens"}),l.jsx("input",{type:"number",min:"1",value:x("agent.max_tokens"),onChange:P=>N("agent.max_tokens",P.target.value),onBlur:P=>R("agent.max_tokens",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("agent.max_tokens",P.currentTarget.value)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Max Iterations (1-20)"}),l.jsx("input",{type:"number",min:"1",max:"20",value:x("agent.max_agentic_iterations"),onChange:P=>N("agent.max_agentic_iterations",P.target.value),onBlur:P=>R("agent.max_agentic_iterations",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("agent.max_agentic_iterations",P.currentTarget.value)})]})]})]})]}),p&&l.jsxs("div",{className:"card",children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[l.jsxs("div",{children:[l.jsx("div",{className:"section-title",style:{marginBottom:"4px"},children:"Tool RAG"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",margin:0},children:"Semantic tool selection — sends only the most relevant tools to the LLM per message."})]}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:p.enabled,onChange:()=>$({enabled:!p.enabled})}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"13px",color:"var(--text-secondary)"},children:[l.jsxs("span",{children:["Indexed: ",p.indexed?"Yes":"No"]}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Top-K:",l.jsx(ht,{value:String(p.topK),options:["10","15","20","25","30","40","50"],onChange:P=>$({topK:Number(P)}),style:{display:"inline-block",minWidth:"70px"}})]}),l.jsxs("span",{children:["Total: ",p.totalTools]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Telegram"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"DM Policy"}),l.jsx(ht,{value:x("telegram.dm_policy"),options:["open","pairing","admin"],onChange:P=>R("telegram.dm_policy",P)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Group Policy"}),l.jsx(ht,{value:x("telegram.group_policy"),options:["open","admin","disabled"],onChange:P=>R("telegram.group_policy",P)})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"require-mention",children:"Require Mention"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"require-mention",type:"checkbox",checked:x("telegram.require_mention")==="true",onChange:P=>R("telegram.require_mention",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"typing-sim",children:"Typing Simulation"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"typing-sim",type:"checkbox",checked:x("telegram.typing_simulation")==="true",onChange:P=>R("telegram.typing_simulation",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Debounce (ms)"}),l.jsx("input",{type:"number",min:"0",value:x("telegram.debounce_ms"),onChange:P=>N("telegram.debounce_ms",P.target.value),onBlur:P=>R("telegram.debounce_ms",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("telegram.debounce_ms",P.currentTarget.value),style:{width:"100%"}})]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Session"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"daily-reset",children:"Daily Reset"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"daily-reset",type:"checkbox",checked:x("agent.session_reset_policy.daily_reset_enabled")==="true",onChange:P=>R("agent.session_reset_policy.daily_reset_enabled",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Reset Hour (0-23)"}),l.jsx(ht,{value:x("agent.session_reset_policy.daily_reset_hour"),options:Array.from({length:24},(P,I)=>String(I)),onChange:P=>R("agent.session_reset_policy.daily_reset_hour",P)})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"idle-expiry",children:"Idle Expiry"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"idle-expiry",type:"checkbox",checked:x("agent.session_reset_policy.idle_expiry_enabled")==="true",onChange:P=>R("agent.session_reset_policy.idle_expiry_enabled",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Idle Minutes"}),l.jsx("input",{type:"number",min:"1",value:x("agent.session_reset_policy.idle_expiry_minutes"),onChange:P=>N("agent.session_reset_policy.idle_expiry_minutes",P.target.value),onBlur:P=>R("agent.session_reset_policy.idle_expiry_minutes",P.target.value),onKeyDown:P=>P.key==="Enter"&&R("agent.session_reset_policy.idle_expiry_minutes",P.currentTarget.value),style:{width:"100%"}})]})]})]})]})}function Zc({tool:o,updating:a,onToggle:u,onScope:d}){return l.jsxs("div",{className:"tool-row",style:{opacity:o.enabled?1:.5,display:"grid",gridTemplateColumns:"1fr auto auto",gap:"10px",alignItems:"center"},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsx("div",{className:"tool-name",children:o.name}),l.jsx("div",{className:"tool-desc",children:o.description})]}),l.jsx("div",{className:`scope-seg${!o.enabled||a===o.name?" disabled":""}`,children:["always","dm-only","group-only","admin-only"].map(p=>l.jsx("button",{className:o.scope===p?"active":"",disabled:!o.enabled||a===o.name,onClick:()=>d(o.name,p),children:p==="always"?"All":p==="dm-only"?"DM":p==="group-only"?"Group":"Admin"},p))}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:o.enabled,onChange:()=>u(o.name,o.enabled),disabled:a===o.name}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})}function zh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,j]=f.useState(null),[y,k]=f.useState(null),_=()=>(d(!0),ae.getTools().then(R=>{a(R.data),d(!1)}).catch(R=>{m(R instanceof Error?R.message:String(R)),d(!1)}));f.useEffect(()=>{_()},[]);const w=async(R,$)=>{j(R);try{await ae.updateToolConfig(R,{enabled:!$}),await _()}catch(D){m(D instanceof Error?D.message:String(D))}finally{j(null)}},z=async(R,$)=>{j(R);try{await ae.updateToolConfig(R,{scope:$}),await _()}catch(D){m(D instanceof Error?D.message:String(D))}finally{j(null)}},B=async(R,$)=>{j(R.name);try{for(const D of R.tools)D.enabled!==$&&await ae.updateToolConfig(D.name,{enabled:$});await _()}catch(D){m(D instanceof Error?D.message:String(D))}finally{j(null)}},O=async(R,$)=>{j(R.name);try{for(const D of R.tools)D.scope!==$&&await ae.updateToolConfig(D.name,{scope:$});await _()}catch(D){m(D instanceof Error?D.message:String(D))}finally{j(null)}};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const x=o.filter(R=>!R.isPlugin),N=x.reduce((R,$)=>R+$.toolCount,0);return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Tools"}),l.jsxs("p",{children:[N," built-in tools across ",x.length," modules"]})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("span",{children:p}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>m(null),children:"Dismiss"}),l.jsx("button",{className:"btn-sm",onClick:()=>{m(null),_()},children:"Retry"})]})]}),x.map(R=>{const $=y===R.name,D=R.tools.some(G=>G.enabled),P=R.tools.every(G=>!G.enabled),I=new Set(R.tools.map(G=>G.scope)),W=I.size>1,ue=W?"":I.values().next().value??"always",me=S===R.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>k($?null:R.name),className:"accordion-header",children:[l.jsx("span",{className:"accordion-chevron",children:$?"▼":"▶"}),l.jsx("div",{style:{flex:1,minWidth:0},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("h2",{style:{margin:0},children:R.name}),l.jsxs("span",{className:"badge count",children:[R.toolCount," tools"]}),P&&l.jsx("span",{className:"badge warn",children:"Disabled"})]})}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},onClick:G=>G.stopPropagation(),children:[l.jsx(ht,{value:ue,options:["","always","dm-only","group-only","admin-only"],labels:[W?"Mixed":"Scope","All","DM only","Group only","Admin only"],onChange:G=>G&&O(R,G),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:D,onChange:()=>B(R,!D),disabled:me}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})]}),$&&l.jsx("div",{style:{borderTop:"1px solid var(--separator)",padding:"10px 16px 16px"},children:l.jsx("div",{style:{display:"grid",gap:"6px"},children:R.tools.map(G=>l.jsx(Zc,{tool:G,updating:S,onToggle:w,onScope:z},G.name))})})]},R.name)})]})}function Ih(){const[o,a]=f.useState("installed"),[u,d]=f.useState([]),[p,m]=f.useState([]),[S,j]=f.useState(!0),[y,k]=f.useState(null),[_,w]=f.useState(null),[z,B]=f.useState([]),[O,x]=f.useState(!1),[N,R]=f.useState(null),[$,D]=f.useState(""),[P,I]=f.useState(""),[W,ue]=f.useState(null),[me,G]=f.useState({}),[Oe,le]=f.useState(!1),[ge,Y]=f.useState(null),[ie,V]=f.useState(null),[ce,de]=f.useState(null),[K,re]=f.useState(null),[X,C]=f.useState(""),M=()=>(j(!0),Promise.all([ae.getPlugins(),ae.getTools()]).then(([Q,J])=>{d(Q.data),m(J.data.filter(H=>H.isPlugin)),j(!1)}).catch(Q=>{k(Q.message),j(!1)})),pe=(Q=!1)=>(x(!0),ae.getMarketplace(Q).then(J=>{B(J.data),x(!1)}).catch(J=>{k(J.message),x(!1)}));f.useEffect(()=>{M(),pe()},[]);const he=async(Q,J)=>{w(Q);try{await ae.updateToolConfig(Q,{enabled:!J}),await M()}catch(H){k(H instanceof Error?H.message:String(H))}finally{w(null)}},ve=async(Q,J)=>{w(Q);try{await ae.updateToolConfig(Q,{scope:J}),await M()}catch(H){k(H instanceof Error?H.message:String(H))}finally{w(null)}},Se=async(Q,J)=>{w(Q.name);try{for(const H of Q.tools)H.enabled!==J&&await ae.updateToolConfig(H.name,{enabled:J});await M()}catch(H){k(H instanceof Error?H.message:String(H))}finally{w(null)}},Ee=async(Q,J)=>{w(Q.name);try{for(const H of Q.tools)H.scope!==J&&await ae.updateToolConfig(H.name,{scope:J});await M()}catch(H){k(H instanceof Error?H.message:String(H))}finally{w(null)}},ke=async Q=>{const J=z.find(H=>H.id===Q);R(Q);try{if(await ae.installPlugin(Q),await Promise.all([pe(),M()]),J!=null&&J.secrets&&Object.keys(J.secrets).length>0){try{const H=await ae.getPluginSecrets(Q),Re=Object.entries(J.secrets).filter(([,mt])=>mt.required).map(([mt])=>mt);if(Re.every(mt=>H.data.configured.includes(mt))&&Re.length>0)return}catch{}ue({pluginId:Q,pluginName:J.name,secrets:J.secrets}),G({})}}catch(H){k(H instanceof Error?H.message:String(H))}finally{R(null)}},_e=async Q=>{if(confirm(`Uninstall plugin "${Q}"? This will remove its files.`)){R(Q);try{await ae.uninstallPlugin(Q),await Promise.all([pe(),M()])}catch(J){k(J instanceof Error?J.message:String(J))}finally{R(null)}}},et=async Q=>{R(Q);try{await ae.updatePlugin(Q),await Promise.all([pe(),M()])}catch(J){k(J instanceof Error?J.message:String(J))}finally{R(null)}},Rn=async()=>{const Q=z.filter(J=>J.status==="updatable");for(const J of Q){R(J.id);try{await ae.updatePlugin(J.id)}catch(H){k(H instanceof Error?H.message:String(H));break}}R(null),await Promise.all([pe(),M()])},nl=async Q=>{if(ie===Q){V(null),re(null);return}try{const J=await ae.getPluginSecrets(Q);de(J.data),V(Q),re(null)}catch(J){k(J instanceof Error?J.message:String(J))}},zn=async(Q,J)=>{if(X.trim())try{await ae.setPluginSecret(Q,J,X.trim()),re(null),C("");const H=await ae.getPluginSecrets(Q);de(H.data)}catch(H){k(H instanceof Error?H.message:String(H))}},fr=async(Q,J)=>{try{await ae.unsetPluginSecret(Q,J);const H=await ae.getPluginSecrets(Q);de(H.data)}catch(H){k(H instanceof Error?H.message:String(H))}},pr=z.filter(Q=>{if($){const J=$.toLowerCase();if(!Q.name.toLowerCase().includes(J)&&!Q.description.toLowerCase().includes(J))return!1}return!(P&&!Q.tags.includes(P))}),In=Array.from(new Set(z.flatMap(Q=>Q.tags))).sort(),Ht=z.filter(Q=>Q.status==="updatable").length;return S?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Plugins"}),l.jsx("p",{children:"Manage installed plugins and browse the community marketplace"})]}),y&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("span",{children:y}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>k(null),children:"Dismiss"}),l.jsx("button",{className:"btn-sm",onClick:()=>{k(null),M()},children:"Retry"})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"16px",flexWrap:"wrap"},children:[l.jsxs("div",{className:"tabs",style:{marginBottom:0,flexShrink:0},children:[l.jsxs("button",{className:`tab ${o==="installed"?"active":""}`,onClick:()=>a("installed"),children:["Installed",l.jsx("span",{className:"tab-count",children:u.length})]}),l.jsxs("button",{className:`tab ${o==="marketplace"?"active":""}`,onClick:()=>a("marketplace"),children:["Marketplace",Ht>0&&l.jsx("span",{className:"tab-count",style:{background:"rgba(255,255,255,0.08)",color:"var(--text-secondary)"},children:Ht})]})]}),l.jsxs("div",{style:{position:"relative",flex:1,minWidth:"120px"},children:[l.jsx("input",{type:"text",placeholder:"Search plugins...",value:$,onChange:Q=>D(Q.target.value),style:{width:"100%",paddingLeft:"34px"}}),l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-tertiary)",pointerEvents:"none"},children:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("path",{d:"M21 21l-4.35-4.35"})]})]}),In.length>0&&l.jsx(ht,{value:P,options:["",...In],labels:["All tags",...In],onChange:Q=>I(Q),style:{minWidth:"140px"}}),o==="marketplace"&&l.jsxs(l.Fragment,{children:[Ht>0?l.jsx("button",{className:"btn-sm",onClick:Rn,disabled:!!N||O,style:{whiteSpace:"nowrap"},children:N?"Updating...":`Update All (${Ht})`}):z.length>0?l.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"All up to date"}):null,l.jsx("button",{className:"btn-ghost",onClick:()=>pe(!0),disabled:O,style:{whiteSpace:"nowrap"},children:O?"Refreshing...":"Refresh"})]})]}),o==="installed"&&(()=>{const Q=u.filter(J=>{if($){const H=$.toLowerCase();if(!J.name.toLowerCase().includes(H)&&!(J.description??"").toLowerCase().includes(H))return!1}if(P){const H=z.find(Re=>Re.name===J.name);if(!H||!H.tags.includes(P))return!1}return!0});return l.jsx(l.Fragment,{children:u.length===0?l.jsxs("div",{className:"card",style:{textAlign:"center",padding:"40px 20px"},children:[l.jsx("p",{style:{color:"var(--text-secondary)",marginBottom:"12px"},children:"No plugins installed yet"}),l.jsx("button",{className:"btn-sm",onClick:()=>a("marketplace"),children:"Browse Marketplace"})]}):Q.length===0?l.jsx("div",{className:"card",style:{textAlign:"center",padding:"20px",color:"var(--text-secondary)"},children:"No installed plugins match your search"}):Q.map(J=>{const H=p.find(Ce=>Ce.name===J.name),Re=z.find(Ce=>Ce.name===J.name),Dn=(Re==null?void 0:Re.secrets)&&Object.keys(Re.secrets).length>0,mt=ge===J.name,hr=H?H.tools.some(Ce=>Ce.enabled):!1,rl=H?H.tools.every(Ce=>!Ce.enabled):!0,mr=H?new Set(H.tools.map(Ce=>Ce.scope)):new Set,On=mr.size>1,Mn=On?"":mr.values().next().value??"always",ll=_===J.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>Y(mt?null:J.name),className:"accordion-header",children:[l.jsx("span",{className:"accordion-chevron",children:mt?"▼":"▶"}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[l.jsx("h2",{style:{margin:0},children:J.name}),H&&l.jsxs("span",{className:"badge count",children:[H.toolCount," tools"]}),l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:["v",J.version]}),rl&&H&&H.tools.length>0&&l.jsx("span",{className:"badge warn",children:"Disabled"})]}),J.description&&l.jsx("p",{style:{fontSize:"12px",color:"var(--text-secondary)",margin:"4px 0 0"},children:J.description})]}),H&&H.tools.length>0&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},onClick:Ce=>Ce.stopPropagation(),children:[l.jsx(ht,{value:Mn,options:["","always","dm-only","group-only","admin-only"],labels:[On?"Mixed":"Scope","All","DM only","Group only","Admin only"],onChange:Ce=>Ce&&Ee(H,Ce),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:hr,onChange:()=>Se(H,!hr),disabled:ll}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})]}),mt&&l.jsxs("div",{style:{borderTop:"1px solid var(--separator)",padding:"10px 16px 16px"},children:[H&&H.tools.length>0&&l.jsx("div",{style:{display:"grid",gap:"6px"},children:H.tools.map(Ce=>l.jsx(Zc,{tool:Ce,updating:_,onToggle:he,onScope:ve},Ce.name))}),Dn&&Re&&l.jsxs("div",{style:{marginTop:"10px",borderTop:"1px solid var(--separator)",paddingTop:"10px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>nl(Re.id),children:ie===Re.id?"Hide Secrets":"Manage Secrets"}),ie===Re.id&&ce&&l.jsx("div",{style:{marginTop:"8px",display:"grid",gap:"6px"},children:Object.entries(ce.declared).map(([Ce,Tt])=>{const An=ce.configured.includes(Ce);return l.jsxs("div",{className:"tool-row",style:{padding:"8px 12px",flexWrap:"wrap"},children:[l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("span",{style:{fontWeight:600,fontSize:"13px"},children:Ce}),Tt.required&&l.jsx("span",{style:{color:"var(--text-secondary)",marginLeft:"4px",fontSize:"11px"},children:"required"}),l.jsx("span",{className:`badge ${An?"always":"warn"}`,style:{marginLeft:"8px",fontSize:"10px"},children:An?"Set":"Not set"}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-tertiary)",margin:"2px 0 0 0"},children:Tt.description}),Tt.env&&l.jsxs("code",{style:{fontSize:"11px",color:"var(--text-tertiary)",opacity:.7},children:["Env: ",Tt.env]})]}),l.jsx("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:K===Ce?l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"password",value:X,onChange:sl=>C(sl.target.value),placeholder:"Enter value...",style:{width:"200px"}}),l.jsx("button",{className:"btn-sm",onClick:()=>zn(Re.id,Ce),children:"Save"}),l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>re(null),children:"Cancel"})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>{re(Ce),C("")},children:An?"Change":"Set"}),An&&l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>fr(Re.id,Ce),children:"Remove"})]})})]},Ce)})})]})]})]},J.name)})})})(),W&&l.jsx("div",{className:"modal-overlay",onClick:()=>!Oe&&ue(null),children:l.jsxs("div",{className:"modal",onClick:Q=>Q.stopPropagation(),children:[l.jsxs("h2",{style:{marginBottom:"4px"},children:["Configure ",W.pluginName]}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"13px",marginBottom:"16px"},children:"This plugin needs API keys to work. You can configure them now or later."}),Object.entries(W.secrets).map(([Q,J])=>l.jsxs("div",{style:{marginBottom:"12px"},children:[l.jsxs("label",{style:{display:"block",fontSize:"13px",fontWeight:600,marginBottom:"4px"},children:[Q," ",J.required&&l.jsx("span",{style:{color:"var(--text-secondary)"},children:"*"})]}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-tertiary)",margin:"0 0 4px 0"},children:J.description}),J.env&&l.jsxs("code",{style:{display:"block",fontSize:"11px",color:"var(--text-tertiary)",opacity:.7,marginBottom:"6px"},children:["Env: ",J.env]}),l.jsx("input",{type:"password",placeholder:`Enter ${Q}...`,value:me[Q]||"",onChange:H=>G(Re=>({...Re,[Q]:H.target.value})),style:{width:"100%"}})]},Q)),l.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"16px"},children:[l.jsx("button",{className:"btn-ghost",onClick:()=>ue(null),children:"Skip"}),l.jsx("button",{className:"btn-sm",disabled:Oe,onClick:async()=>{le(!0);try{for(const[Q,J]of Object.entries(me))J.trim()&&await ae.setPluginSecret(W.pluginId,Q,J.trim());ue(null)}catch(Q){k(Q instanceof Error?Q.message:String(Q))}finally{le(!1)}},children:Oe?"Saving...":"Save"})]})]})}),o==="marketplace"&&l.jsx(l.Fragment,{children:O&&z.length===0?l.jsx("div",{className:"loading",children:"Loading marketplace..."}):pr.length===0?l.jsx("div",{className:"empty",children:$||P?"No plugins match your search":"Marketplace is empty"}):l.jsx("div",{style:{display:"grid",gap:"10px"},children:pr.map(Q=>l.jsx(Dh,{plugin:Q,operating:N,onInstall:ke,onUninstall:_e,onUpdate:et},Q.id))})})]})}function Dh({plugin:o,operating:a,onInstall:u,onUninstall:d,onUpdate:p}){const m=a===o.id,S=!!a,j=o.secrets&&Object.values(o.secrets).some(y=>y.required);return l.jsx("div",{className:"card",style:{marginBottom:"0"},children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px",flexWrap:"wrap"},children:[l.jsx("h2",{style:{margin:0},children:o.name}),o.status==="installed"&&l.jsx("span",{className:"badge always",style:{fontSize:"10px"},children:"Installed"}),o.status==="updatable"&&l.jsx("span",{className:"badge warn",style:{fontSize:"10px"},children:"Update available"}),j&&o.status==="available"&&l.jsx("span",{className:"badge warn",style:{fontSize:"10px"},children:"Requires API Key"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",margin:"0 0 8px 0",lineHeight:"1.5"},children:o.description}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[o.tags.map(y=>l.jsx("span",{className:"badge",style:{background:"var(--surface)",color:"var(--text-tertiary)"},children:y},y)),l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:["by ",o.author," · v",o.remoteVersion," · ",o.toolCount," tools"]})]})]}),l.jsxs("div",{style:{flexShrink:0,display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"},children:[o.status==="available"&&l.jsx("button",{className:"btn-sm",onClick:()=>u(o.id),disabled:S,children:m?"Installing...":"Install"}),o.status==="installed"&&l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(o.id),disabled:S,children:m?"Removing...":"Uninstall"}),o.status==="updatable"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-sm",onClick:()=>p(o.id),disabled:S,children:m?"Updating...":`Update to v${o.remoteVersion}`}),l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(o.id),disabled:S,children:"Uninstall"})]})]})]})})}const Tc=["SOUL.md","SECURITY.md","STRATEGY.md","MEMORY.md"];function Oh(){const[o,a]=f.useState(Tc[0]),[u,d]=f.useState(""),[p,m]=f.useState(""),[S,j]=f.useState(!1),[y,k]=f.useState(!1),[_,w]=f.useState(null),z=u!==p,B=f.useCallback(async N=>{j(!0),w(null);try{const R=await ae.getSoulFile(N);d(R.data.content),m(R.data.content)}catch(R){w({type:"error",text:R instanceof Error?R.message:String(R)})}finally{j(!1)}},[]),O=async()=>{k(!0),w(null);try{const N=await ae.updateSoulFile(o,u);m(u),w({type:"success",text:N.data.message})}catch(N){w({type:"error",text:N instanceof Error?N.message:String(N)})}finally{k(!1)}};f.useEffect(()=>{const N=R=>{z&&R.preventDefault()};return window.addEventListener("beforeunload",N),()=>window.removeEventListener("beforeunload",N)},[z]);const x=N=>{N!==o&&(z&&!window.confirm("You have unsaved changes. Discard them?")||a(N))};return f.useEffect(()=>{B(o)},[o,B]),l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Soul Editor"}),l.jsx("p",{children:"Edit system prompt files"})]}),_&&l.jsx("div",{className:`alert ${_.type}`,children:_.text}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"tabs",children:Tc.map(N=>l.jsxs("button",{className:`tab ${o===N?"active":""}`,onClick:()=>x(N),children:[N,o===N&&z?" *":""]},N))}),S?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs(l.Fragment,{children:[l.jsx("textarea",{value:u,onChange:N=>d(N.target.value),placeholder:`Edit ${o}...`}),l.jsxs("div",{style:{marginTop:"14px",display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("button",{onClick:O,disabled:y||!z,children:y?"Saving...":"Save"}),z&&l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"13px"},children:"Unsaved changes"})]})]})]})]})}function Mh(){const[o,a]=f.useState(""),[u,d]=f.useState([]),[p,m]=f.useState(!1),[S,j]=f.useState(null),[y,k]=f.useState(!1),_=async()=>{if(o.trim()){m(!0),j(null);try{const w=await ae.searchKnowledge(o);d(w.data),k(!0)}catch(w){j(w instanceof Error?w.message:String(w))}finally{m(!1)}}};return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Memory"}),l.jsx("p",{children:"Search knowledge base"})]}),l.jsxs("div",{className:"card",children:[l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Search query"}),l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsx("input",{type:"text",value:o,onChange:w=>a(w.target.value),onKeyDown:w=>w.key==="Enter"&&_(),placeholder:"Enter search query...",style:{flex:1}}),l.jsx("button",{onClick:_,disabled:p,children:p?"Searching...":"Search"})]})]}),S&&l.jsx("div",{className:"alert error",children:S}),y&&u.length===0&&!S&&l.jsx("div",{style:{marginTop:"16px",color:"var(--text-secondary)",textAlign:"center"},children:"No results found"}),u.length>0&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsxs("div",{className:"section-title",children:["Results (",u.length,")"]}),u.map((w,z)=>{var B;return l.jsxs("div",{className:"result-item",children:[l.jsxs("div",{className:"result-meta",children:[w.source," · Score: ",((B=w.score)==null?void 0:B.toFixed(3))??"—"]}),l.jsx("div",{className:"result-text",children:w.text})]},w.id||z)})]})]})]})}const Lc=2e3,di=1e3,Ah=3e4;class Fh{constructor(){Ot(this,"logs",[]);Ot(this,"snapshot",[]);Ot(this,"listeners",new Set);Ot(this,"disconnect",null);Ot(this,"_connected",!1);Ot(this,"reconnectTimer",null);Ot(this,"reconnectDelay",di);Ot(this,"shouldReconnect",!1)}connect(){this.disconnect||(this.shouldReconnect=!0,this.reconnectDelay=di,this.doConnect())}doConnect(){this.disconnect||(this.disconnect=ae.connectLogs(a=>{this.logs.push(a),this.logs.length>Lc&&(this.logs=this.logs.slice(-Lc)),this._connected=!0,this.reconnectDelay=di,this.snapshot=[...this.logs],this.notify()},()=>{this._connected=!1,this.disconnect&&(this.disconnect(),this.disconnect=null),this.notify(),this.scheduleReconnect()}))}scheduleReconnect(){!this.shouldReconnect||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.shouldReconnect&&!this.disconnect&&this.doConnect()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2,Ah))}stop(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.disconnect&&(this.disconnect(),this.disconnect=null),this._connected=!1,this.notify()}getLogs(){return this.snapshot}isConnected(){return this._connected}clear(){this.logs=[],this.snapshot=[],this.notify()}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){for(const a of this.listeners)a()}}const Tn=new Fh;function Uh(){const o=f.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.getLogs()),a=f.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.isConnected()),u=f.useRef(null);return f.useEffect(()=>{Tn.connect()},[]),f.useEffect(()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})},[o]),l.jsxs("div",{children:[l.jsx("div",{className:"header",children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h1",{children:"Live Logs"}),l.jsxs("p",{children:[l.jsx("span",{className:`status-dot ${a?"connected":"disconnected"}`}),a?"Connected":"Disconnected"]})]}),l.jsx("button",{onClick:()=>Tn.clear(),children:"Clear"})]})}),l.jsxs("div",{className:"card",style:{maxHeight:"70vh",overflow:"auto",padding:"14px"},children:[o.length===0?l.jsx("div",{className:"empty",children:"Waiting for logs..."}):o.map((d,p)=>l.jsxs("div",{className:"log-entry",children:[l.jsx("span",{className:`badge ${d.level==="warn"?"warn":d.level==="error"?"error":"info"}`,children:d.level.toUpperCase()})," ",l.jsx("span",{style:{color:"var(--text-tertiary)"},children:new Date(d.timestamp).toLocaleTimeString()})," ",d.message]},p)),l.jsx("div",{ref:u})]})]})}function Rc(o){return o===0?"—":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`}function Bh(o){return new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Wh(){const[o,a]=f.useState(""),[u,d]=f.useState([]),[p,m]=f.useState(null),[S,j]=f.useState(!0),[y,k]=f.useState(null),[_,w]=f.useState(null),[z,B]=f.useState(""),[O,x]=f.useState(!1),[N,R]=f.useState(!1),[$,D]=f.useState(null),[P,I]=f.useState(""),W=f.useCallback(async V=>{j(!0),k(null);try{const ce=await ae.workspaceList(V);d(ce.data??[]),a(V)}catch(ce){k(ce instanceof Error?ce.message:String(ce))}finally{j(!1)}},[]),ue=f.useCallback(async()=>{try{const V=await ae.workspaceInfo();m(V.data??null)}catch{}},[]);f.useEffect(()=>{W(""),ue()},[W,ue]);const me=V=>{le()&&W(V)},G=o?o.split("/"):[],Oe=async V=>{var ce;try{k(null);const de=await ae.workspaceRead(V);w(V),B(((ce=de.data)==null?void 0:ce.content)??""),x(!1)}catch(de){k(de instanceof Error?de.message:String(de))}},le=()=>O&&!confirm("You have unsaved changes. Discard?")?!1:(w(null),B(""),x(!1),!0),ge=async()=>{if(_){R(!0);try{await ae.workspaceWrite(_,z),x(!1),W(o)}catch(V){k(V instanceof Error?V.message:String(V))}finally{R(!1)}}},Y=async V=>{const ce=V.isDirectory?"directory":"file";if(confirm(`Delete ${ce} "${V.name}"?`))try{await ae.workspaceDelete(V.path,V.isDirectory),_===V.path&&(w(null),B(""),x(!1)),W(o),ue()}catch(de){k(de instanceof Error?de.message:String(de))}},ie=async()=>{const V=P.trim();if(!V||!$)return;const ce=o?`${o}/${V}`:V;try{if($.type==="newFile")await ae.workspaceWrite(ce,"");else if($.type==="newFolder")await ae.workspaceMkdir(ce);else if($.type==="rename"&&$.target){const de=o?`${o}/${V}`:V;await ae.workspaceRename($.target,de),_===$.target&&(w(null),B(""),x(!1))}D(null),I(""),W(o),ue()}catch(de){k(de instanceof Error?de.message:String(de))}};return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Workspace"}),l.jsxs("p",{children:["Browse and manage agent workspace files",p&&l.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-secondary)"},children:[p.totalFiles," files · ",Rc(p.totalSize)]})]})]}),y&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[y,l.jsx("button",{onClick:()=>k(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),l.jsxs("div",{className:"card",style:{padding:"8px 14px",marginBottom:"14px",display:"flex",alignItems:"center",gap:"4px",flexWrap:"wrap"},children:[l.jsx("span",{onClick:()=>me(""),style:{cursor:"pointer",fontWeight:o?"normal":"bold",color:"var(--accent)"},children:"workspace"}),G.map((V,ce)=>{const de=G.slice(0,ce+1).join("/"),K=ce===G.length-1;return l.jsxs("span",{children:[l.jsx("span",{style:{color:"var(--text-secondary)",margin:"0 2px"},children:"/"}),l.jsx("span",{onClick:()=>!K&&me(de),style:{cursor:K?"default":"pointer",fontWeight:K?"bold":"normal",color:K?"var(--text)":"var(--accent)"},children:V})]},de)}),l.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"6px"},children:[l.jsx("button",{style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>{D({type:"newFile"}),I("")},children:"+ File"}),l.jsx("button",{style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>{D({type:"newFolder"}),I("")},children:"+ Folder"})]})]}),$&&l.jsxs("div",{className:"card",style:{padding:"10px 14px",marginBottom:"14px",display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",whiteSpace:"nowrap"},children:$.type==="newFile"?"New file:":$.type==="newFolder"?"New folder:":"Rename to:"}),l.jsx("input",{type:"text",value:P,onChange:V=>I(V.target.value),onKeyDown:V=>V.key==="Enter"&&ie(),placeholder:"name...",autoFocus:!0,style:{flex:1,padding:"4px 8px",fontSize:"13px"}}),l.jsx("button",{style:{padding:"4px 10px",fontSize:"12px"},onClick:ie,children:"OK"}),l.jsx("button",{style:{padding:"4px 10px",fontSize:"12px",opacity:.7},onClick:()=>D(null),children:"Cancel"})]}),l.jsx("div",{className:"card",style:{padding:0},children:S?l.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading..."}):u.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:"Empty directory"}):l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--separator)",color:"var(--text-secondary)",fontSize:"11px",textTransform:"uppercase"},children:[l.jsx("th",{style:{textAlign:"left",padding:"8px 14px"},children:"Name"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"80px"},children:"Size"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"140px"},children:"Modified"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"70px"}})]})}),l.jsxs("tbody",{children:[o&&l.jsxs("tr",{onClick:()=>{const V=o.split("/");V.pop(),me(V.join("/"))},style:{cursor:"pointer",borderBottom:"1px solid var(--separator)"},className:"file-row",children:[l.jsxs("td",{style:{padding:"6px 14px"},children:[l.jsx("span",{style:{marginRight:"8px"},children:"📂"}),".."]}),l.jsx("td",{}),l.jsx("td",{}),l.jsx("td",{})]}),u.map(V=>l.jsxs("tr",{onClick:()=>V.isDirectory?me(V.path):Oe(V.path),style:{cursor:"pointer",borderBottom:"1px solid var(--separator)"},className:"file-row",children:[l.jsxs("td",{style:{padding:"6px 14px"},children:[l.jsx("span",{style:{marginRight:"8px"},children:V.isDirectory?"📂":"📄"}),V.name]}),l.jsx("td",{style:{textAlign:"right",padding:"6px 14px",color:"var(--text-secondary)"},children:V.isDirectory?"":Rc(V.size)}),l.jsx("td",{style:{textAlign:"right",padding:"6px 14px",color:"var(--text-secondary)"},children:Bh(V.mtime)}),l.jsxs("td",{style:{textAlign:"right",padding:"6px 14px",whiteSpace:"nowrap"},onClick:ce=>ce.stopPropagation(),children:[l.jsx("button",{className:"icon-button",onClick:()=>{D({type:"rename",target:V.path}),I(V.name)},title:"Rename",children:"✎"}),l.jsx("button",{className:"icon-button",onClick:()=>Y(V),title:"Delete",children:"🗑"})]})]},V.path))]})]})}),_&&l.jsxs("div",{className:"card",style:{marginTop:"14px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[l.jsxs("h2",{style:{margin:0,fontSize:"14px"},children:[_,O&&l.jsx("span",{style:{color:"var(--accent)",marginLeft:"6px"},children:"*"})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{style:{padding:"4px 12px",fontSize:"12px"},onClick:ge,disabled:N||!O,children:N?"Saving...":"Save"}),l.jsx("button",{style:{padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:le,children:"Close"})]})]}),l.jsx("textarea",{value:z,onChange:V=>{B(V.target.value),x(!0)},onKeyDown:V=>{(V.ctrlKey||V.metaKey)&&V.key==="s"&&(V.preventDefault(),ge())},style:{width:"100%",minHeight:"300px",fontFamily:"monospace",fontSize:"13px",padding:"10px",border:"1px solid var(--separator)",borderRadius:"4px",backgroundColor:"var(--surface)",color:"var(--text)",resize:"vertical",tabSize:2},spellCheck:!1})]})]})}const ed={pending:"#f0ad4e",in_progress:"#5bc0de",done:"#5cb85c",failed:"#d9534f",cancelled:"#777"},gi={pending:"Pending",in_progress:"Running",done:"Done",failed:"Failed",cancelled:"Cancelled"};function zc({status:o}){return l.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:600,color:"#fff",backgroundColor:ed[o]},children:gi[o]})}function ar(o){return o?new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function bh({priority:o}){if(o===0)return l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"11px"},children:"—"});const a=Math.min(o,10);return l.jsxs("span",{title:`Priority: ${o}/10`,style:{fontSize:"11px",letterSpacing:"1px"},children:["●".repeat(Math.min(a,5)),"○".repeat(Math.max(0,5-a))]})}function fi(o,a){return o?o.length>a?o.slice(0,a)+"...":o:""}function $h(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,j]=f.useState(""),[y,k]=f.useState(null),_=f.useCallback(async()=>{d(!0),m(null);try{const N=(await ae.tasksList()).data??[];a(N),k(R=>R?N.find($=>$.id===R.id)??null:null)}catch(x){m(x instanceof Error?x.message:String(x))}finally{d(!1)}},[]);f.useEffect(()=>{_()},[_]);const w=async x=>{if(confirm("Cancel this task?"))try{await ae.tasksCancel(x),_(),(y==null?void 0:y.id)===x&&k(null)}catch(N){m(N instanceof Error?N.message:String(N))}},z=async x=>{if(confirm("Permanently delete this task?"))try{await ae.tasksDelete(x),_(),(y==null?void 0:y.id)===x&&k(null)}catch(N){m(N instanceof Error?N.message:String(N))}},B=o.reduce((x,N)=>(x[N.status]=(x[N.status]||0)+1,x),{}),O=S?o.filter(x=>x.status===S):o;return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Tasks"}),l.jsx("p",{children:"Scheduled and queued agent tasks"})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),l.jsxs("div",{className:"card",style:{padding:"10px 14px",marginBottom:"14px",display:"flex",gap:"16px",alignItems:"center",flexWrap:"wrap"},children:[l.jsxs("span",{onClick:()=>j(""),style:{cursor:"pointer",fontWeight:S===""?"bold":"normal",color:S===""?"var(--text)":"var(--text-secondary)",fontSize:"13px"},children:["All (",o.length,")"]}),["pending","in_progress","done","failed","cancelled"].map(x=>l.jsxs("span",{onClick:()=>j(S===x?"":x),style:{cursor:"pointer",fontWeight:S===x?"bold":"normal",color:S===x?ed[x]:"var(--text-secondary)",fontSize:"13px"},children:[gi[x]," (",B[x]||0,")"]},x)),(B.done||0)>0&&l.jsxs("button",{style:{marginLeft:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:async()=>{if(confirm(`Delete all ${B.done} done tasks?`))try{await ae.tasksCleanDone(),m(null),_(),k(null)}catch(x){m(x instanceof Error?x.message:String(x))}},children:["Clean done (",B.done,")"]}),l.jsx("button",{style:{marginLeft:B.done?void 0:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:_,children:"Refresh"})]}),l.jsx("div",{className:"card",style:{padding:0},children:u?l.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading..."}):O.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:S?`No ${gi[S].toLowerCase()} tasks`:"No tasks yet"}):l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",tableLayout:"fixed"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--separator)",color:"var(--text-secondary)",fontSize:"11px",textTransform:"uppercase"},children:[l.jsx("th",{style:{textAlign:"left",padding:"8px 14px"},children:"Description"}),l.jsx("th",{style:{textAlign:"center",padding:"8px 10px",width:80},children:"Status"}),l.jsx("th",{style:{textAlign:"center",padding:"8px 10px",width:60},children:"Priority"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:120},children:"Scheduled"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:120},children:"Created"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:70}})]})}),l.jsx("tbody",{children:O.map(x=>{const N=(y==null?void 0:y.id)===x.id;return l.jsxs(Mc.Fragment,{children:[l.jsxs("tr",{onClick:()=>k(N?null:x),style:{cursor:"pointer",borderBottom:N?"none":"1px solid var(--separator)",backgroundColor:N?"rgba(255,255,255,0.03)":void 0},className:"file-row",children:[l.jsxs("td",{style:{padding:"8px 14px"},children:[l.jsxs("div",{children:[l.jsx("span",{style:{display:"inline-block",width:"14px",fontSize:"10px",color:"var(--text-secondary)"},children:N?"▼":"▶"}),fi(x.description,80)]}),x.reason&&l.jsx("div",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"2px",paddingLeft:"14px"},children:fi(x.reason,60)})]}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx(zc,{status:x.status})}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx(bh,{priority:x.priority})}),l.jsx("td",{style:{textAlign:"right",padding:"8px 14px",color:"var(--text-secondary)"},children:ar(x.scheduledFor)}),l.jsx("td",{style:{textAlign:"right",padding:"8px 14px",color:"var(--text-secondary)"},children:ar(x.createdAt)}),l.jsxs("td",{style:{textAlign:"right",padding:"8px 14px",whiteSpace:"nowrap"},onClick:R=>R.stopPropagation(),children:[(x.status==="pending"||x.status==="in_progress")&&l.jsx("button",{className:"icon-button",onClick:()=>w(x.id),title:"Cancel",children:"✖"}),l.jsx("button",{className:"icon-button",onClick:()=>z(x.id),title:"Delete",children:"🗑"})]})]}),N&&y&&l.jsx("tr",{style:{backgroundColor:"rgba(255,255,255,0.03)",borderBottom:"1px solid var(--separator)"},children:l.jsxs("td",{colSpan:6,style:{padding:"0 14px 14px 14px",overflow:"hidden"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",gap:"6px 12px",fontSize:"13px",padding:"10px 0"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"ID"}),l.jsx("code",{style:{fontSize:"11px",wordBreak:"break-all"},children:y.id}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Status"}),l.jsx("span",{children:l.jsx(zc,{status:y.status})}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Priority"}),l.jsxs("span",{children:[y.priority,"/10"]}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Description"}),l.jsx("span",{children:y.description}),y.reason&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Reason"}),l.jsx("span",{children:y.reason})]}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Created by"}),l.jsx("span",{children:y.createdBy||"—"}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Created"}),l.jsx("span",{children:ar(y.createdAt)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Scheduled for"}),l.jsx("span",{children:ar(y.scheduledFor)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Started"}),l.jsx("span",{children:ar(y.startedAt)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Completed"}),l.jsx("span",{children:ar(y.completedAt)}),y.dependencies.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Depends on"}),l.jsxs("span",{style:{fontSize:"11px"},children:[y.dependencies.length," task(s)"]})]}),y.dependents.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Dependents"}),l.jsxs("span",{style:{fontSize:"11px"},children:[y.dependents.length," task(s)"]})]})]}),y.payload&&l.jsxs("div",{style:{marginTop:"4px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Payload"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.2)",fontSize:"11px",overflow:"auto",maxHeight:"150px",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(()=>{try{return JSON.stringify(JSON.parse(y.payload),null,2)}catch{return y.payload}})()})]}),y.result&&l.jsxs("div",{style:{marginTop:"12px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#5cb85c",marginBottom:"4px"},children:"Result"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.2)",fontSize:"11px",overflow:"auto",maxHeight:"200px",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:fi(y.result,2e3)})]}),y.error&&l.jsxs("div",{style:{marginTop:"12px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#d9534f",marginBottom:"4px"},children:"Error"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(100,0,0,0.15)",fontSize:"11px",overflow:"auto",maxHeight:"150px",margin:0,color:"#f99"},children:y.error})]})]})})]},x.id)})})]})})]})}function Vh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,j]=f.useState(new Set),[y,k]=f.useState(!1),[_,w]=f.useState(""),[z,B]=f.useState(""),[O,x]=f.useState(""),[N,R]=f.useState([]),[$,D]=f.useState(!1),[P,I]=f.useState(null),[W,ue]=f.useState(null),me=(Y=!1)=>{Y&&d(!0),ae.getMcpServers().then(ie=>{a(ie.data),d(!1)}).catch(ie=>{m(ie instanceof Error?ie.message:String(ie)),d(!1)})};f.useEffect(()=>{me(!0)},[]);const G=Y=>{j(ie=>{const V=new Set(ie);return V.has(Y)?V.delete(Y):V.add(Y),V})},Oe=async()=>{if(_.trim()){D(!0),m(null);try{const Y=z.trim()?z.trim().split(/\s+/):void 0,ie=_.startsWith("http://")||_.startsWith("https://"),V={};for(const de of N)de.key.trim()&&(V[de.key.trim()]=de.value);const ce=await ae.addMcpServer({...ie?{url:_.trim()}:{package:_.trim()},name:O.trim()||void 0,args:ie?void 0:Y,env:Object.keys(V).length>0?V:void 0});ue(ce.data.message),w(""),B(""),x(""),R([]),k(!1),me()}catch(Y){m(Y instanceof Error?Y.message:String(Y))}finally{D(!1)}}},le=async Y=>{if(confirm(`Remove MCP server "${Y}"?`)){I(Y),m(null);try{const ie=await ae.removeMcpServer(Y);ue(ie.data.message),me()}catch(ie){m(ie instanceof Error?ie.message:String(ie))}finally{I(null)}}};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const ge=o.filter(Y=>Y.connected).length;return l.jsxs("div",{children:[l.jsx("div",{className:"header",children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h1",{children:"MCP Servers"}),l.jsx("p",{children:"External tool servers connected via Model Context Protocol"})]}),l.jsx("button",{onClick:()=>k(!y),style:{fontSize:"13px"},children:y?"Cancel":"+ Add Server"})]})}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),W&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[W,l.jsx("button",{onClick:()=>ue(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),y&&l.jsxs("div",{className:"card",style:{marginBottom:"14px"},children:[l.jsx("h2",{style:{margin:"0 0 10px"},children:"Add MCP Server"}),l.jsxs("div",{style:{display:"grid",gap:"8px"},children:[l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Package or URL *"}),l.jsx("input",{type:"text",value:_,onChange:Y=>w(Y.target.value),placeholder:"@modelcontextprotocol/server-filesystem or http://localhost:3001/mcp",style:{width:"100%",fontSize:"13px"}})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Arguments (space-separated)"}),l.jsx("input",{type:"text",value:z,onChange:Y=>B(Y.target.value),placeholder:"/tmp /home/user/docs",style:{width:"100%",fontSize:"13px"}})]}),l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Name (auto-derived if empty)"}),l.jsx("input",{type:"text",value:O,onChange:Y=>x(Y.target.value),placeholder:"filesystem",style:{width:"100%",fontSize:"13px"}})]})]}),l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[l.jsx("label",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:"Environment Variables"}),l.jsx("button",{type:"button",onClick:()=>R([...N,{key:"",value:"",id:crypto.randomUUID()}]),style:{fontSize:"11px",padding:"1px 6px",opacity:.7},children:"+ Add"})]}),N.map((Y,ie)=>l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr auto",gap:"6px",marginBottom:"4px"},children:[l.jsx("input",{type:"text",value:Y.key,onChange:V=>{const ce=[...N];ce[ie]={...ce[ie],key:V.target.value},R(ce)},placeholder:"BRAVE_API_KEY",style:{fontSize:"12px",fontFamily:"monospace"}}),l.jsx("input",{type:"password",value:Y.value,onChange:V=>{const ce=[...N];ce[ie]={...ce[ie],value:V.target.value},R(ce)},placeholder:"sk-xxx...",style:{fontSize:"12px",fontFamily:"monospace"}}),l.jsx("button",{type:"button",onClick:()=>R(N.filter((V,ce)=>ce!==ie)),style:{fontSize:"11px",padding:"2px 6px",opacity:.6},children:"×"})]},Y.id))]}),l.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"4px"},children:[l.jsx("button",{onClick:()=>k(!1),style:{fontSize:"13px",opacity:.7},children:"Cancel"}),l.jsx("button",{onClick:Oe,disabled:$||!_.trim(),style:{fontSize:"13px"},children:$?"Adding...":"Add Server"})]})]}),l.jsx("p",{style:{fontSize:"11px",color:"var(--text-secondary)",margin:"8px 0 0"},children:"Changes are saved to config.yaml. Restart teleton to connect."})]}),o.length===0&&!y&&l.jsxs("div",{className:"empty",children:[l.jsx("p",{children:"No MCP servers configured"}),l.jsxs("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"8px"},children:['Click "+ Add Server" above or use CLI: ',l.jsx("code",{children:"teleton mcp add @modelcontextprotocol/server-filesystem /tmp"})]})]}),o.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)",marginBottom:"14px"},children:[ge,"/",o.length," connected · ",o.reduce((Y,ie)=>Y+ie.toolCount,0)," tools total"]}),o.map(Y=>l.jsxs("div",{className:"card",style:{marginBottom:"10px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("h2",{style:{margin:0},children:Y.name}),l.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:Y.type}),Y.scope!=="always"&&l.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:Y.scope})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"12px",color:Y.connected?"var(--green)":"var(--red)"},children:[l.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:Y.connected?"var(--green)":"var(--red)"}}),Y.connected?"Connected":"Disconnected"]}),!Y.enabled&&l.jsx("span",{style:{fontSize:"11px",color:"var(--text-secondary)"},children:"disabled"}),l.jsx("button",{onClick:()=>le(Y.name),disabled:P===Y.name,style:{fontSize:"11px",padding:"2px 8px",opacity:.6,cursor:P===Y.name?"wait":"pointer"},children:P===Y.name?"...":"Remove"})]})]}),l.jsx("div",{style:{fontSize:"12px",fontFamily:"monospace",color:"var(--text-secondary)",marginBottom:"8px"},children:Y.target}),Y.envKeys.length>0&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"8px"},children:Y.envKeys.map(ie=>l.jsxs("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)",fontFamily:"monospace"},children:[ie,"=••••"]},ie))}),Y.toolCount>0&&l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>G(Y.name),style:{background:"none",border:"none",padding:0,fontSize:"12px",color:"var(--accent)",cursor:"pointer"},children:[S.has(Y.name)?"▾":"▸"," ",Y.toolCount," tools"]}),S.has(Y.name)&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"8px"},children:Y.tools.map(ie=>l.jsx("span",{style:{fontSize:"11px",padding:"2px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:ie},ie))})]})]},Y.name))]})]})}const Kh=["API Keys","Agent","Telegram","Embedding","WebUI","Deals","Developer"];function Hh(o){const a=new Map;for(const d of o){const p=d.category||"Other";a.has(p)||a.set(p,[]),a.get(p).push(d)}const u=new Map;for(const d of Kh)a.has(d)&&(u.set(d,a.get(d)),a.delete(d));for(const[d,p]of a)u.set(d,p);return u}function Qh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,j]=f.useState(null),[y,k]=f.useState(null),[_,w]=f.useState(""),[z,B]=f.useState(!1),O=(P=!1)=>{P&&d(!0),ae.getConfigKeys().then(I=>{a(I.data),d(!1)}).catch(I=>{m(I instanceof Error?I.message:String(I)),d(!1)})};f.useEffect(()=>{O(!0)},[]);const x=P=>{var I;k(P.key),P.type==="boolean"?w(P.set&&P.value!==null?P.value:"true"):P.type==="enum"&&((I=P.options)!=null&&I.length)?w(P.set&&P.value!==null?P.value:P.options[0]):w("")},N=async P=>{const I=o.find(ue=>ue.key===P);if(!(!((I==null?void 0:I.type)==="boolean"||(I==null?void 0:I.type)==="enum")&&!_.trim())){B(!0),m(null),j(null);try{await ae.setConfigKey(P,_.trim()),k(null),w(""),j(`${P} updated successfully`),O()}catch(ue){m(ue instanceof Error?ue.message:String(ue))}finally{B(!1)}}},R=async P=>{B(!0),m(null),j(null);try{await ae.unsetConfigKey(P),j(`${P} removed`),O()}catch(I){m(I instanceof Error?I.message:String(I))}finally{B(!1)}},$=()=>{k(null),w("")};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const D=Hh(o);return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Configuration"}),l.jsx("p",{children:"Manage API keys and settings"})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),S&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[S,l.jsx("button",{onClick:()=>j(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),Array.from(D.entries()).map(([P,I])=>l.jsxs("div",{className:"card",style:{marginBottom:"10px"},children:[l.jsx("h2",{style:{marginBottom:"8px"},children:P}),I.map((W,ue)=>l.jsxs("div",{style:{padding:"12px 0",borderBottom:ue<I.length-1?"1px solid var(--separator)":"none"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("strong",{style:{fontFamily:"monospace"},children:W.key}),l.jsx("span",{style:{marginLeft:"10px",fontSize:"11px",padding:"2px 8px",borderRadius:"4px",background:W.set?"var(--accent)":"var(--surface)",color:W.set?"var(--text-on-accent)":"var(--text-secondary)"},children:W.set?"Set":"Not set"}),W.sensitive&&l.jsx("span",{style:{marginLeft:"6px",fontSize:"11px",color:"var(--text-secondary)"},children:"sensitive"})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{onClick:()=>x(W),style:{padding:"4px 12px",fontSize:"12px"},disabled:z,children:"Edit"}),W.set&&l.jsx("button",{onClick:()=>R(W.key),style:{padding:"4px 12px",fontSize:"12px",opacity:.7},disabled:z,children:"Remove"})]})]}),l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginTop:"4px"},children:W.description}),W.set&&W.value&&y!==W.key&&l.jsx("div",{style:{marginTop:"6px",fontSize:"13px",color:"var(--text-secondary)",fontFamily:"monospace"},children:W.value}),y===W.key&&l.jsxs("div",{className:"form-group",style:{marginTop:"10px",marginBottom:0},children:[W.type==="boolean"?l.jsx(ht,{value:_,options:["true","false"],onChange:w,style:{width:"100%",marginBottom:"8px"}}):W.type==="enum"&&W.options?l.jsx(ht,{value:_,options:W.options,onChange:w,style:{width:"100%",marginBottom:"8px"}}):l.jsx("input",{type:W.type==="number"?"number":W.sensitive?"password":"text",value:_,onChange:me=>w(me.target.value),onKeyDown:me=>me.key==="Enter"&&N(W.key),placeholder:`Enter value for ${W.key}...`,autoFocus:!0,style:{width:"100%",marginBottom:"8px"}}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{onClick:()=>N(W.key),disabled:z||W.type!=="boolean"&&W.type!=="enum"&&!_.trim(),children:z?"Saving...":"Save"}),l.jsx("button",{onClick:$,style:{opacity:.7},disabled:z,children:"Cancel"})]})]})]},W.key))]},P))]})}function Yh({data:o,onChange:a}){const[u,d]=f.useState(null),[p,m]=f.useState(!0),[S,j]=f.useState(""),[y,k]=f.useState(!1);f.useEffect(()=>{Ye.getStatus().then(w=>d(w)).catch(w=>j(w instanceof Error?w.message:String(w))).finally(()=>m(!1))},[]);const _=async w=>{if(a({...o,riskAccepted:w}),w&&!y)try{await Ye.initWorkspace(o.agentName||void 0),k(!0)}catch(z){j(z instanceof Error?z.message:String(z))}};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Welcome to Teleton Setup"}),l.jsx("p",{className:"step-description",children:"Configure your autonomous Telegram agent in a few steps."}),l.jsxs("details",{className:"guide-dropdown",children:[l.jsx("summary",{children:"Security Notice"}),l.jsxs("div",{className:"guide-content",children:["This software is an autonomous AI agent that can:",l.jsxs("ul",{style:{margin:"8px 0 8px 20px"},children:[l.jsx("li",{children:"Send and receive Telegram messages on your behalf"}),l.jsx("li",{children:"Execute cryptocurrency transactions using your wallet"}),l.jsx("li",{children:"Access and store conversation data"}),l.jsx("li",{children:"Make decisions and take actions autonomously"})]}),"You are solely responsible for all actions taken by this agent. By proceeding, you acknowledge that you understand these risks and accept full responsibility for the agent's behavior.",l.jsx("br",{}),l.jsx("br",{}),l.jsx("strong",{children:"Never share your API keys, wallet mnemonics, or session files."})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Agent Name"}),l.jsx("input",{type:"text",value:o.agentName,onChange:w=>a({...o,agentName:w.target.value}),placeholder:"Nova",className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Your agent's display name in conversations."})]}),(u==null?void 0:u.configExists)&&l.jsx("div",{className:"info-box",children:"Existing configuration detected. It will be overwritten when setup completes."}),S&&l.jsx("div",{className:"alert error",children:S}),l.jsx("div",{className:"form-group",children:l.jsxs("label",{className:"label-inline",children:[l.jsx("input",{type:"checkbox",checked:o.riskAccepted,onChange:w=>_(w.target.checked)}),l.jsx("span",{children:"I understand the risks and accept full responsibility"})]})}),p&&l.jsx("div",{className:"loading",children:"Checking workspace..."})]})}function Jh({data:o,onChange:a}){const[u,d]=f.useState([]),[p,m]=f.useState(!0),[S,j]=f.useState(""),[y,k]=f.useState(null),[_,w]=f.useState(""),[z,B]=f.useState(!1),O=f.useRef(null),[x,N]=f.useState(null),[R,$]=f.useState(!1),[D,P]=f.useState(!1);f.useEffect(()=>{Ye.getProviders().then(G=>d(G)).catch(G=>j(G instanceof Error?G.message:String(G))).finally(()=>m(!1))},[]);const I=u.find(G=>G.id===o.provider);f.useEffect(()=>{I!=null&&I.autoDetectsKey&&($(!0),N(null),P(!1),Ye.detectClaudeCodeKey().then(G=>{N(G),G.found&&a({...o,apiKey:""})}).catch(()=>N({found:!1,maskedKey:null,valid:!1})).finally(()=>$(!1)))},[I==null?void 0:I.id]);const W=G=>{a({...o,provider:G,apiKey:"",model:"",customModel:""}),k(null),w(""),N(null),P(!1),O.current&&clearTimeout(O.current)},ue=async(G,Oe)=>{if(!(!Oe||!G)){B(!0);try{const le=await Ye.validateApiKey(G,Oe);k(le.valid),w(le.error||"")}catch{k(null),w("")}finally{B(!1)}}},me=G=>{a({...o,apiKey:G}),k(null),w(""),O.current&&clearTimeout(O.current),G.length>0&&o.provider&&(O.current=setTimeout(()=>ue(o.provider,G),500))};return p?l.jsx("div",{className:"loading",children:"Loading providers..."}):S?l.jsx("div",{className:"alert error",children:S}):l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Choose Your LLM Provider"}),l.jsx("p",{className:"step-description",children:"This is the AI model that powers your agent's intelligence. Pick the one you have an API key for."}),l.jsx("div",{className:"provider-grid",children:u.map(G=>l.jsxs("div",{className:`provider-card${o.provider===G.id?" selected":""}`,onClick:()=>W(G.id),children:[l.jsx("h3",{children:G.displayName}),l.jsx("div",{className:"provider-meta",children:G.defaultModel}),G.toolLimit===null&&l.jsx("span",{className:"badge always",style:{marginTop:"6px"},children:"Recommended"})]},G.id))}),I&&I.toolLimit!==null&&l.jsxs("div",{className:"info-box",style:{marginTop:"16px"},children:["Teleton has ~116 tools. With a ",I.toolLimit,"-tool limit, some tools may be truncated or unavailable."]}),I&&I.autoDetectsKey&&l.jsxs("div",{style:{marginTop:"16px"},children:[R&&l.jsxs("div",{className:"info-panel",children:[l.jsx("span",{className:"spinner sm"})," Detecting Claude Code credentials..."]}),!R&&(x==null?void 0:x.found)&&l.jsxs("div",{className:"info-panel",children:[l.jsx("div",{style:{marginBottom:"4px",color:"var(--color-success, #4caf50)"},children:l.jsx("strong",{children:"Credentials auto-detected from Claude Code"})}),l.jsx("code",{style:{fontSize:"0.85em",opacity:.8},children:x.maskedKey}),l.jsx("div",{className:"helper-text",style:{marginTop:"6px"},children:"Token will auto-refresh when it expires. No configuration needed."})]}),!R&&x&&!x.found&&!D&&l.jsxs("div",{className:"info-panel",style:{borderColor:"var(--color-warning, #ff9800)"},children:[l.jsxs("div",{style:{marginBottom:"8px"},children:["Claude Code credentials not found. Make sure Claude Code is installed and authenticated (",l.jsx("code",{children:"claude login"}),")."]}),l.jsx("button",{className:"btn btn-sm",onClick:()=>P(!0),children:"Enter API key manually instead"})]}),!R&&D&&l.jsxs("div",{className:"form-group",style:{marginTop:"8px"},children:[l.jsx("label",{children:"API Key (fallback)"}),l.jsx("input",{type:"password",value:o.apiKey,onChange:G=>me(G.target.value),placeholder:I.keyPrefix?`${I.keyPrefix}...`:"Enter API key",className:"w-full"}),z&&l.jsxs("div",{className:"helper-text",children:[l.jsx("span",{className:"spinner sm"})," Validating..."]}),!z&&y===!0&&l.jsx("div",{className:"helper-text success",children:"Key format looks valid."}),!z&&y===!1&&_&&l.jsx("div",{className:"helper-text error",children:_}),l.jsxs("div",{className:"helper-text",children:["Get your key at:"," ",l.jsx("a",{href:"https://console.anthropic.com/",target:"_blank",rel:"noopener noreferrer",children:"https://console.anthropic.com/"})]})]})]}),I&&I.requiresApiKey&&l.jsxs("div",{className:"form-group",style:{marginTop:"16px"},children:[l.jsx("label",{children:"API Key"}),l.jsx("input",{type:"password",value:o.apiKey,onChange:G=>me(G.target.value),placeholder:I.keyPrefix?`${I.keyPrefix}...`:"Enter API key",className:"w-full"}),z&&l.jsxs("div",{className:"helper-text",children:[l.jsx("span",{className:"spinner sm"})," Validating..."]}),!z&&y===!0&&l.jsx("div",{className:"helper-text success",children:"Key format looks valid."}),!z&&y===!1&&_&&l.jsx("div",{className:"helper-text error",children:_}),I.consoleUrl&&l.jsxs("div",{className:"helper-text",children:["Get your key at:"," ",l.jsx("a",{href:I.consoleUrl,target:"_blank",rel:"noopener noreferrer",children:I.consoleUrl})]})]}),I&&!I.requiresApiKey&&I.id==="cocoon"&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsx("div",{className:"info-panel",children:"Cocoon Network uses a local proxy. No API key required."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Cocoon Proxy Port"}),l.jsx("input",{type:"number",value:o.cocoonPort,onChange:G=>a({...o,cocoonPort:parseInt(G.target.value)||0}),min:1,max:65535,className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Port where the Cocoon client proxy is running (1-65535)."})]})]}),I&&I.id==="local"&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsx("div",{className:"info-panel",children:"Connect to any OpenAI-compatible server (Ollama, vLLM, LM Studio, llama.cpp). No API key required."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Server URL"}),l.jsx("input",{type:"url",value:o.localUrl,onChange:G=>a({...o,localUrl:G.target.value}),placeholder:"http://localhost:11434/v1",className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Ollama :11434 · vLLM :8000 · LM Studio :1234 · llama.cpp :8080"})]})]})]})}function Gh({data:o,onChange:a}){return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Telegram Credentials"}),l.jsx("p",{className:"step-description",children:"These credentials allow your agent to use your Telegram account to send and receive messages."}),l.jsxs("details",{className:"guide-dropdown",children:[l.jsx("summary",{children:"How to get these credentials"}),l.jsxs("div",{className:"guide-content",children:[l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"API ID & API Hash"}),l.jsxs("ol",{children:[l.jsxs("li",{children:["Open ",l.jsx("a",{href:"https://my.telegram.org",target:"_blank",rel:"noopener noreferrer",children:"my.telegram.org"})," in your browser"]}),l.jsx("li",{children:"Log in with your phone number (the one linked to your Telegram account)"}),l.jsxs("li",{children:["Click ",l.jsx("strong",{children:"API development tools"})]}),l.jsx("li",{children:`If prompted, create a new app — the name and platform don't matter (e.g. "MyApp", Desktop)`}),l.jsxs("li",{children:["Copy ",l.jsx("strong",{children:"App api_id"})," (a number) and ",l.jsx("strong",{children:"App api_hash"})," (a hex string)"]})]})]}),l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"Phone Number"}),l.jsx("p",{children:"The phone number linked to your Telegram account, with country code (e.g. +33612345678)."})]}),l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"User ID"}),l.jsxs("ol",{children:[l.jsxs("li",{children:["Open Telegram and search for ",l.jsx("a",{href:"https://t.me/userinfobot",target:"_blank",rel:"noopener noreferrer",children:"@userinfobot"})]}),l.jsxs("li",{children:["Send ",l.jsx("code",{children:"/start"})," — the bot will reply with your numeric User ID"]})]})]})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"API ID"}),l.jsx("input",{type:"number",value:o.apiId||"",onChange:u=>a({...o,apiId:parseInt(u.target.value)||0}),placeholder:"12345678",className:"w-full"})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"API Hash"}),l.jsx("input",{type:"text",value:o.apiHash,onChange:u=>a({...o,apiHash:u.target.value}),placeholder:"abcdef0123456789abcdef0123456789",className:"w-full"}),o.apiHash.length>0&&o.apiHash.length<10&&l.jsx("div",{className:"helper-text",children:"API Hash should be at least 10 characters."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Phone Number"}),l.jsx("input",{type:"text",value:o.phone,onChange:u=>a({...o,phone:u.target.value}),placeholder:"+33612345678",className:"w-full"}),o.phone.length>0&&!o.phone.startsWith("+")&&l.jsx("div",{className:"helper-text",children:'Phone number must start with "+"'})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Admin User ID"}),l.jsx("input",{type:"number",value:o.userId||"",onChange:u=>a({...o,userId:parseInt(u.target.value)||0}),placeholder:"123456789",className:"w-full"}),l.jsxs("div",{className:"helper-text",children:["This account will have admin control over the agent in DMs and groups. Get your ID from ",l.jsx("a",{href:"https://t.me/userinfobot",target:"_blank",rel:"noopener noreferrer",children:"@userinfobot"})," on Telegram."]})]})]})}function qh({data:o,onChange:a}){const[u,d]=f.useState([]),[p,m]=f.useState(!1),[S,j]=f.useState(!1),[y,k]=f.useState(null),[_,w]=f.useState(!1),[z,B]=f.useState(""),O=async()=>{if(o.botToken){j(!0),B(""),k(null),w(!1);try{const D=await Ye.validateBotToken(o.botToken);D.valid&&D.bot?(k(!0),a({...o,botUsername:D.bot.username})):D.networkError?w(!0):(k(!1),B(D.error||"Invalid bot token"))}catch(D){B(D instanceof Error?D.message:String(D))}finally{j(!1)}}};f.useEffect(()=>{o.provider==="cocoon"||o.provider==="local"||!o.provider||(m(!0),Ye.getModels(o.provider).then(D=>{d(D),!o.model&&D.length>0&&a({...o,model:D[0].value})}).catch(()=>d([])).finally(()=>m(!1)))},[o.provider]);const x=["open","allowlist","disabled"],N=["Open","Allowlist","Disabled"],R={open:"Anyone can message the agent in DMs.",allowlist:"Only admin users can DM the agent.",disabled:"Agent ignores all DMs."},$={open:"Agent responds in any group it's added to.",allowlist:"Agent only responds in groups explicitly allowed by admins.",disabled:"Agent ignores all group messages."};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Configuration"}),l.jsx("p",{className:"step-description",children:"Configure your agent's model and behavior. Defaults are pre-filled — adjust what you need."}),o.provider==="cocoon"||o.provider==="local"?l.jsxs("div",{className:"info-panel",children:["Model is auto-discovered from the ",o.provider==="local"?"local server":"Cocoon proxy"," at startup."]}):l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Model"}),p?l.jsxs("div",{className:"text-muted",children:[l.jsx("span",{className:"spinner sm"})," Loading models..."]}):l.jsx(ht,{value:o.model,options:u.map(D=>D.value),labels:u.map(D=>D.isCustom?"Custom...":`${D.name} - ${D.description}`),onChange:D=>a({...o,model:D}),style:{width:"100%"}}),o.model==="__custom__"&&l.jsx("input",{type:"text",value:o.customModel,onChange:D=>a({...o,customModel:D.target.value}),placeholder:"Enter custom model ID",className:"w-full",style:{marginTop:"8px"}})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"DM Policy"}),l.jsx(ht,{value:o.dmPolicy,options:x,labels:N,onChange:D=>a({...o,dmPolicy:D}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:R[o.dmPolicy]||""})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Group Policy"}),l.jsx(ht,{value:o.groupPolicy,options:x,labels:N,onChange:D=>a({...o,groupPolicy:D}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:$[o.groupPolicy]||""})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("div",{className:"card-toggle",children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:"Require @mention in groups"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:o.requireMention,onChange:D=>a({...o,requireMention:D.target.checked})}),l.jsx("div",{className:"toggle-track"}),l.jsx("div",{className:"toggle-thumb"})]})]}),l.jsx("div",{className:"helper-text",children:"When enabled, the agent only responds when mentioned by name in group chats."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Max Agentic Iterations"}),l.jsx("input",{type:"number",value:o.maxIterations,onChange:D=>a({...o,maxIterations:parseInt(D.target.value)||1}),min:1,max:50,className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Maximum tool-call loops per message (1-50). Higher values allow more complex tasks."})]}),l.jsx("h3",{style:{fontSize:"14px",fontWeight:600,marginTop:"24px",marginBottom:"12px"},children:"Optional API Keys"}),l.jsxs("div",{className:"module-list",children:[l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Bot Token"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(recommended)"})]}),l.jsx("input",{type:"password",value:o.botToken,onChange:D=>{a({...o,botToken:D.target.value,botUsername:""}),k(null),w(!1),B("")},placeholder:"123456:ABC-DEF...",style:{flex:1}}),l.jsx("button",{onClick:O,disabled:S||!o.botToken,type:"button",children:S?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Validating"]}):"Validate"})]}),y&&o.botUsername&&l.jsxs("div",{className:"alert success",children:["Bot verified: @",o.botUsername]}),_&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"info-box",children:"Could not reach Telegram API. Enter the bot username manually."}),l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center",marginTop:"8px"},children:[l.jsx("div",{style:{flex:1},children:l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Bot Username"})}),l.jsx("input",{type:"text",value:o.botUsername,onChange:D=>a({...o,botUsername:D.target.value}),placeholder:"my_bot",style:{flex:1}})]})]}),y===!1&&z&&l.jsx("div",{className:"alert error",children:z}),l.jsxs("div",{className:"helper-text",children:["Inline buttons and rich interactions. Create via ",l.jsx("a",{href:"https://t.me/BotFather",target:"_blank",rel:"noopener noreferrer",children:"@BotFather"}),"."]})]}),l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"TonAPI Key"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(optional)"})]}),l.jsx("input",{type:"text",value:o.tonapiKey,onChange:D=>a({...o,tonapiKey:D.target.value}),placeholder:"Your TonAPI key",style:{flex:1}})]}),l.jsxs("div",{className:"helper-text",children:["Enhanced blockchain queries. Free key from ",l.jsx("a",{href:"https://t.me/tonapibot",target:"_blank",rel:"noopener noreferrer",children:"@tonapibot"}),"."]})]}),l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Web Search"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(optional)"})]}),l.jsx("input",{type:"text",value:o.tavilyKey,onChange:D=>a({...o,tavilyKey:D.target.value}),placeholder:"tvly-...",style:{flex:1}})]}),l.jsxs("div",{className:"helper-text",children:["Tavily web search. Free plan at ",l.jsx("a",{href:"https://tavily.com",target:"_blank",rel:"noopener noreferrer",children:"tavily.com"}),"."]})]})]})]})}function Ic({text:o}){const[a,u]=f.useState(!1),d=f.useCallback(()=>{navigator.clipboard.writeText(o).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)})},[o]);return l.jsx("button",{type:"button",className:"btn-ghost btn-sm",onClick:d,style:{marginLeft:"8px"},children:a?"Copied":"Copy"})}function Xh({data:o,onChange:a}){const[u,d]=f.useState(null),[p,m]=f.useState(!0),[S,j]=f.useState(!1),[y,k]=f.useState(""),[_,w]=f.useState([]);f.useEffect(()=>{Ye.getWalletStatus().then(x=>{d(x),x.exists&&x.address&&a({...o,walletAddress:x.address,walletAction:"keep"})}).catch(x=>k(x instanceof Error?x.message:String(x))).finally(()=>m(!1))},[]);const z=async()=>{j(!0),k("");try{if(o.walletAction==="import"){const x=o.mnemonic.trim().split(/\s+/);if(x.length!==24){k("Mnemonic must be exactly 24 words."),j(!1);return}const N=await Ye.importWallet(o.mnemonic.trim());a({...o,walletAddress:N.address}),w(x)}else{const x=await Ye.generateWallet();a({...o,walletAddress:x.address}),w(x.mnemonic)}}catch(x){k(x instanceof Error?x.message:String(x))}finally{j(!1)}};if(p)return l.jsx("div",{className:"loading",children:"Checking wallet..."});const B=_.length>0,O=o.walletAction!=="keep"&&!B;return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"TON Wallet"}),l.jsx("p",{className:"step-description",children:"Your agent needs a TON wallet to send and receive crypto. You can create a new one or import an existing wallet."}),y&&l.jsx("div",{className:"alert error",children:y}),(u==null?void 0:u.exists)&&u.address&&!B&&l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"helper-text",style:{marginTop:0,marginBottom:"4px"},children:"Current wallet"}),l.jsx("div",{className:"mono",style:{fontSize:"13px",wordBreak:"break-all"},children:u.address})]}),!B&&l.jsx("div",{className:"form-group",children:(u!=null&&u.exists?["keep","generate","import"]:["generate","import"]).map(x=>l.jsxs("label",{className:"label-inline",style:{marginBottom:"8px"},children:[l.jsx("input",{type:"radio",name:"walletAction",value:x,checked:o.walletAction===x,onChange:()=>{a({...o,walletAction:x,mnemonic:"",mnemonicSaved:!1})}}),l.jsxs("span",{children:[x==="keep"&&"Keep existing wallet",x==="generate"&&"Generate new wallet",x==="import"&&"Import from mnemonic"]})]},x))}),o.walletAction==="import"&&!B&&l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Recovery Phrase (24 words)"}),l.jsx("textarea",{value:o.mnemonic,onChange:x=>a({...o,mnemonic:x.target.value}),placeholder:"word1 word2 word3 ... word24",className:"w-full mono",style:{minHeight:"80px"}})]}),O&&o.walletAction!=="keep"&&l.jsx("button",{onClick:z,disabled:S||o.walletAction==="import"&&o.mnemonic.trim().split(/\s+/).length!==24,type:"button",children:S?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Working..."]}):o.walletAction==="generate"?"Generate Wallet":"Import Wallet"}),B&&l.jsxs(l.Fragment,{children:[o.walletAddress&&l.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Wallet Address"}),l.jsxs("div",{className:"form-row",style:{alignItems:"center"},children:[l.jsx("span",{className:"mono",style:{fontWeight:600,fontSize:"14px",wordBreak:"break-all",color:"var(--text)"},children:o.walletAddress}),l.jsx(Ic,{text:o.walletAddress})]})]}),l.jsxs("div",{className:"warning-card",children:[l.jsx("strong",{children:"WRITE DOWN THESE 24 WORDS"}),l.jsx("br",{}),"This is your only way to recover your wallet. Store them securely offline. Never share them."]}),l.jsx("ol",{className:"mnemonic-grid",children:_.map((x,N)=>l.jsxs("li",{className:"mnemonic-word",children:[l.jsxs("span",{className:"num",children:[N+1,"."]}),x]},N))}),l.jsx("div",{className:"form-row",style:{justifyContent:"flex-end",marginBottom:"8px"},children:l.jsx(Ic,{text:_.join(" ")})}),l.jsx("div",{className:"form-group",style:{marginTop:"16px"},children:l.jsxs("label",{className:"label-inline",style:{color:"var(--text)"},children:[l.jsx("input",{type:"checkbox",checked:o.mnemonicSaved,onChange:x=>a({...o,mnemonicSaved:x.target.checked})}),l.jsx("span",{style:{fontWeight:500},children:"I have saved my recovery phrase"})]})})]})]})}const Zh="modulepreload",em=function(o){return"/"+o},Dc={},tl=function(a,u,d){let p=Promise.resolve();if(u&&u.length>0){let S=function(k){return Promise.all(k.map(_=>Promise.resolve(_).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),y=(j==null?void 0:j.nonce)||(j==null?void 0:j.getAttribute("nonce"));p=S(u.map(k=>{if(k=em(k),k in Dc)return;Dc[k]=!0;const _=k.endsWith(".css"),w=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${k}"]${w}`))return;const z=document.createElement("link");if(z.rel=_?"stylesheet":Zh,_||(z.as="script"),z.crossOrigin="",z.href=k,y&&z.setAttribute("nonce",y),document.head.appendChild(z),_)return new Promise((B,O)=>{z.addEventListener("load",B),z.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${k}`)))})}))}function m(S){const j=new Event("vite:preloadError",{cancelable:!0});if(j.payload=S,window.dispatchEvent(j),!j.defaultPrevented)throw S}return p.then(S=>{for(const j of S||[])j.status==="rejected"&&m(j.reason);return a().catch(m)})},tm=f.lazy(()=>tl(()=>import("./index.es-7MTSV5SL.js"),[])),nm=()=>tl(()=>import("./run-DOrDowjK.js"),[]).then(o=>o.default),rm=()=>tl(()=>import("./login-telegram-BP7CJDmx.js"),[]).then(o=>o.default);function Oc({loader:o,size:a}){const[u,d]=f.useState(null);return f.useEffect(()=>{o().then(d)},[]),u?l.jsx(f.Suspense,{fallback:l.jsx("div",{style:{width:a,height:a,margin:"0 auto 16px"}}),children:l.jsx(tm,{animationData:u,loop:!0,style:{width:a,height:a,margin:"0 auto 16px"}})}):l.jsx("div",{style:{width:a,height:a,margin:"0 auto 16px"}})}function lm({data:o,onChange:a}){const[u,d]=f.useState("idle"),[p,m]=f.useState(!1),[S,j]=f.useState(""),[y,k]=f.useState(""),[_,w]=f.useState(""),[z,B]=f.useState(""),[O,x]=f.useState("sms"),[N,R]=f.useState(""),[$,D]=f.useState(!1),[P,I]=f.useState(0),W=f.useRef(null);f.useEffect(()=>{if(!(P<=0))return W.current=setInterval(()=>{I(le=>le<=1?(W.current&&clearInterval(W.current),0):le-1)},1e3),()=>{W.current&&clearInterval(W.current)}},[P>0]),f.useEffect(()=>{if(u!=="code_sent")return;const le=setTimeout(()=>D(!0),3e4);return()=>clearTimeout(le)},[u]),f.useEffect(()=>{o.telegramUser&&d("done")},[]);const ue=async()=>{var le;m(!0),j("");try{const ge=await Ye.sendCode(o.apiId,o.apiHash,o.phone);a({...o,authSessionId:ge.authSessionId}),x(ge.codeDelivery),ge.fragmentUrl&&R(ge.fragmentUrl),d("code_sent"),D(!1)}catch(ge){const Y=ge instanceof Error?ge.message:String(ge);if(Y.includes("FLOOD")){const ie=parseInt(((le=Y.match(/(\d+)/))==null?void 0:le[1])||"60");I(ie)}j(Y)}finally{m(!1)}},me=async le=>{if(k(le),!(le.length<5)){m(!0),j("");try{const ge=await Ye.verifyCode(o.authSessionId,le);ge.status==="authenticated"&&ge.user?(a({...o,telegramUser:ge.user,skipConnect:!1}),d("done")):ge.status==="2fa_required"&&(B(ge.passwordHint||""),d("2fa"))}catch(ge){const Y=ge instanceof Error?ge.message:String(ge);j(Y)}finally{m(!1)}}},G=async()=>{m(!0),j("");try{const le=await Ye.verifyPassword(o.authSessionId,_);le.status==="authenticated"&&le.user&&(a({...o,telegramUser:le.user,skipConnect:!1}),d("done"))}catch(le){j(le instanceof Error?le.message:String(le))}finally{m(!1)}},Oe=async()=>{m(!0),j("");try{const le=await Ye.resendCode(o.authSessionId);x(le.codeDelivery),le.fragmentUrl&&R(le.fragmentUrl),k(""),D(!1)}catch(le){j(le instanceof Error?le.message:String(le))}finally{m(!1)}};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Connect to Telegram"}),l.jsx("p",{className:"step-description",children:"Authenticate with your Telegram account. This lets the agent send and receive messages as you."}),S&&l.jsx("div",{className:"alert error",children:S}),u==="idle"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Oc,{loader:nm,size:200}),l.jsx("button",{onClick:ue,disabled:p||P>0,type:"button",className:"btn-lg",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Connecting..."]}):P>0?`Wait ${P}s`:"Connect to Telegram"})]}),u==="code_sent"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Oc,{loader:rm,size:180}),O==="fragment"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"info-panel",style:{textAlign:"left",marginBottom:"16px"},children:[l.jsx("strong",{children:"Anonymous number detected (+888)"}),l.jsx("p",{className:"text-muted",style:{margin:"8px 0"},children:'Your number is an anonymous number purchased on Fragment. To receive the login code, open Fragment.com, connect your TON wallet, and navigate to "My Assets" to find the code.'}),N&&l.jsxs("a",{href:N,target:"_blank",rel:"noopener noreferrer",className:"btn-lg btn-ghost",style:{display:"inline-flex",alignItems:"center",gap:"6px",marginTop:"4px"},children:["Open Fragment.com",l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l.jsx("polyline",{points:"15 3 21 3 21 9"}),l.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]})]}),l.jsx("div",{className:"text-muted",style:{marginBottom:"16px"},children:"Enter the code shown on Fragment"})]}):l.jsxs("div",{className:"text-muted",style:{marginBottom:"16px"},children:["Code sent via ",O==="app"?"Telegram app":"SMS"]}),l.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16px"},children:l.jsx("input",{className:"code-input",type:"text",inputMode:"numeric",value:y,onChange:le=>{const ge=le.target.value.replace(/\D/g,"").slice(0,5);me(ge)},placeholder:"12345",maxLength:5,autoFocus:!0,disabled:p})}),p&&l.jsxs("div",{className:"text-muted",children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}),$&&!p&&l.jsx("button",{type:"button",className:"btn-ghost",onClick:Oe,children:"Resend code"})]}),u==="2fa"&&l.jsxs("div",{style:{padding:"20px 0"},children:[l.jsx("div",{className:"text-muted text-center",style:{marginBottom:"12px"},children:"Two-factor authentication required"}),z&&l.jsxs("div",{className:"info-panel text-center",children:["Hint: ",z]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Password"}),l.jsx("input",{type:"password",value:_,onChange:le=>w(le.target.value),onKeyDown:le=>le.key==="Enter"&&G(),placeholder:"Enter your 2FA password",className:"w-full",autoFocus:!0})]}),l.jsx("button",{onClick:G,disabled:p||!_,type:"button",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}):"Submit"})]}),u==="done"&&o.telegramUser&&l.jsxs("div",{className:"alert success text-center",style:{padding:"20px"},children:["Connected as ",l.jsx("strong",{children:o.telegramUser.firstName}),o.telegramUser.username&&l.jsxs(l.Fragment,{children:[" (@",o.telegramUser.username,")"]})]})]})}const Ln=[{id:"welcome",label:"Welcome"},{id:"provider",label:"Provider"},{id:"telegram",label:"Telegram"},{id:"config",label:"Config"},{id:"wallet",label:"Wallet"},{id:"connect",label:"Connect"}],sm={riskAccepted:!1,agentName:"Nova",provider:"",apiKey:"",cocoonPort:11435,localUrl:"http://localhost:11434/v1",apiId:0,apiHash:"",phone:"",userId:0,mode:"quick",model:"",customModel:"",dmPolicy:"open",groupPolicy:"allowlist",requireMention:!0,maxIterations:5,botToken:"",botUsername:"",tonapiKey:"",tavilyKey:"",customizeThresholds:!1,buyMaxFloor:100,sellMinFloor:105,walletAction:"generate",mnemonic:"",walletAddress:"",mnemonicSaved:!1,authSessionId:"",telegramUser:null,skipConnect:!1,webuiEnabled:!1};function om(o,a){switch(o){case 0:return a.riskAccepted;case 1:if(!a.provider)return!1;if(a.provider==="cocoon")return a.cocoonPort>=1&&a.cocoonPort<=65535;if(a.provider==="local")try{return new URL(a.localUrl),!0}catch{return!1}return a.provider==="claude-code"?!0:a.apiKey.length>0;case 2:return a.apiId>0&&a.apiHash.length>=10&&a.phone.startsWith("+")&&a.userId>0;case 3:return a.provider!=="cocoon"&&a.provider!=="local"&&!(a.model==="__custom__"?a.customModel:a.model)?!1:a.maxIterations>=1&&a.maxIterations<=50;case 4:return a.walletAction==="keep"?!0:a.walletAddress?a.mnemonicSaved:!1;case 5:return a.telegramUser!==null||a.skipConnect;default:return!1}}const td=f.createContext(null);function Ci(){const o=f.useContext(td);if(!o)throw new Error("useSetup must be used inside SetupProvider");return o}function im({children:o}){const[a,u]=f.useState(0),[d,p]=f.useState(sm),[m,S]=f.useState(!1),[j,y]=f.useState(""),[k,_]=f.useState(!1),[w,z]=f.useState(!1),[B,O]=f.useState(""),x=om(a,d),N=f.useCallback(()=>{x&&u(I=>Math.min(I+1,Ln.length-1))},[x]),R=f.useCallback(()=>{u(I=>Math.max(I-1,0))},[]),$=f.useCallback(async()=>{S(!0),y("");try{const I=d.model==="__custom__"?d.customModel:d.model||void 0,W={agent:{provider:d.provider,...d.provider!=="cocoon"&&d.provider!=="local"&&d.apiKey?{api_key:d.apiKey}:{},...d.provider==="local"?{base_url:d.localUrl}:{},...I?{model:I}:{},max_agentic_iterations:d.maxIterations},telegram:{api_id:d.apiId,api_hash:d.apiHash,phone:d.phone,admin_ids:[d.userId],owner_id:d.userId,dm_policy:d.dmPolicy,group_policy:d.groupPolicy,require_mention:d.requireMention,...d.botToken?{bot_token:d.botToken}:{},...d.botUsername?{bot_username:d.botUsername}:{}},...d.provider==="cocoon"?{cocoon:{port:d.cocoonPort}}:{},...d.customizeThresholds?{deals:{buy_max_floor_percent:d.buyMaxFloor,sell_min_floor_percent:d.sellMinFloor}}:{},...d.tonapiKey?{tonapi_key:d.tonapiKey}:{},...d.tavilyKey?{tavily_api_key:d.tavilyKey}:{},webui:{enabled:!0}};await Ye.saveConfig(W),_(!0)}catch(I){y(I instanceof Error?I.message:String(I))}finally{S(!1)}},[d]),D=f.useCallback(async()=>{z(!0),O("");try{const{token:I}=await Ye.launch();await Ye.pollHealth(3e4),window.location.href=`/auth/exchange?token=${encodeURIComponent(I)}`}catch(I){O(I instanceof Error?I.message:String(I))}finally{z(!1)}},[]),P=f.useRef($);return P.current=$,f.useEffect(()=>{a===Ln.length-1&&d.telegramUser&&!k&&!m&&P.current()},[a,d.telegramUser,k,m]),l.jsx(td.Provider,{value:{step:a,data:d,loading:m,error:j,saved:k,launching:w,launchError:B,canAdvance:x,setData:p,next:N,prev:R,handleSave:$,handleLaunch:D},children:o})}const am=f.lazy(()=>tl(()=>import("./index.es-7MTSV5SL.js"),[])),um=()=>tl(()=>import("./complete-fZLnb5Ot.js"),[]).then(o=>o.default);function cm(){const[o,a]=f.useState(null);f.useEffect(()=>{um().then(a)},[]);const u=200;return o?l.jsx(f.Suspense,{fallback:l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}}),children:l.jsx(am,{animationData:o,loop:!0,style:{width:u,height:u,margin:"0 auto 24px"}})}):l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}})}function dm(){const{launching:o,launchError:a,handleLaunch:u}=Ci();return l.jsxs("div",{className:"step-content text-center",style:{paddingTop:"40px"},children:[l.jsx(cm,{}),l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,letterSpacing:"-0.3px",marginBottom:"8px"},children:"Your Agent is ready"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginBottom:"32px"},children:"Configuration saved. Start your agent to begin."}),l.jsx("button",{onClick:u,disabled:o,className:"btn-lg",style:{minWidth:"200px"},children:o?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Starting..."]}):"Start Agent"}),o&&l.jsx("p",{className:"helper-text",style:{marginTop:"16px"},children:"Booting your agent... this may take a few seconds."}),a&&l.jsxs("div",{style:{marginTop:"20px"},children:[l.jsx("div",{className:"alert error",children:a}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"13px",marginTop:"8px"},children:"Start manually:"}),l.jsx("code",{className:"code-block",style:{marginTop:"8px"},children:"teleton start"})]})]})}const fm=[Yh,Jh,Gh,qh,Xh,lm];function pm(){const{step:o,data:a,loading:u,error:d,saved:p,canAdvance:m,setData:S,next:j,prev:y}=Ci();if(p)return l.jsx(dm,{});const k=fm[o],_=o<Ln.length-1?Ln[o+1].label:"";return l.jsxs(l.Fragment,{children:[l.jsx(k,{data:a,onChange:S}),d&&l.jsx("div",{className:"alert error",children:d}),l.jsxs("div",{className:"setup-nav",children:[o>0&&l.jsx("button",{className:"btn-ghost",onClick:y,type:"button",children:"Back"}),l.jsx("div",{style:{flex:1}}),o<Ln.length-1&&l.jsx("button",{onClick:j,disabled:!m||u,type:"button",children:u?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Next"]}):`Next: ${_}`})]})]})}function hm(){const{step:o}=Ci();return l.jsx("div",{className:"step-indicator",children:Ln.map((a,u)=>{const d=u<o,p=u===o;return l.jsxs("div",{className:"step-cell",children:[l.jsxs("div",{className:"step-cell-top",children:[l.jsx("div",{className:`step-dot${p?" active":""}${d?" completed":""}`,children:d?l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsx("span",{children:u+1})}),u<Ln.length-1&&l.jsx("div",{className:`step-line${d?" completed":""}`})]}),l.jsx("div",{className:`step-label${p?" active":""}${d?" completed":""}`,children:a.label})]},a.id)})})}const mm=[{label:"Dashboard",path:"/"},{label:"Tools",path:"/tools"},{label:"Plugins",path:"/plugins"},{label:"Soul",path:"/soul"},{label:"Memory",path:"/memory"},{label:"Logs",path:"/logs"},{label:"Workspace",path:"/workspace"},{label:"Tasks",path:"/tasks"},{label:"MCP",path:"/mcp"},{label:"Config",path:"/config"}];function gm(){return l.jsx("nav",{children:mm.map(o=>l.jsx("span",{className:"sidebar-link-disabled",children:o.label},o.path))})}function ym(){return l.jsxs(l.Fragment,{children:[l.jsx(hm,{}),l.jsx(Yc,{})]})}function xm(){return l.jsx(im,{children:l.jsx(qc,{sidebar:l.jsx(gm,{}),children:l.jsx(ym,{})})})}function vm(){return window.location.pathname.startsWith("/setup")?l.jsx(Gc,{children:l.jsx(Xc,{children:l.jsx(Jc,{children:l.jsx(rt,{path:"/setup",element:l.jsx(xm,{}),children:l.jsx(rt,{index:!0,element:l.jsx(pm,{})})})})})}):l.jsx(Sm,{})}function Sm(){const[o,a]=f.useState(!1),[u,d]=f.useState(!0),[p,m]=f.useState(""),[S,j]=f.useState("");f.useEffect(()=>{const _=new URLSearchParams(window.location.search).get("token");if(window.location.pathname==="/auth/exchange"&&_){Pc(_).then(w=>{w?window.location.href="/":(d(!1),j("Token exchange failed"))});return}_h().then(w=>{a(w),d(!1)})},[]),f.useEffect(()=>{o&&Tn.connect()},[o]);const y=async()=>{const k=p.trim();if(!k)return;j(""),await Pc(k)?a(!0):j("Invalid token")};return u?l.jsx("div",{className:"login-container",children:l.jsx("div",{className:"login-card",children:l.jsx("p",{children:"Loading..."})})}):o?l.jsx(Gc,{children:l.jsx(Xc,{children:l.jsx(Jc,{children:l.jsxs(rt,{path:"/",element:l.jsx(Lh,{}),children:[l.jsx(rt,{index:!0,element:l.jsx(Rh,{})}),l.jsx(rt,{path:"tools",element:l.jsx(zh,{})}),l.jsx(rt,{path:"plugins",element:l.jsx(Ih,{})}),l.jsx(rt,{path:"soul",element:l.jsx(Oh,{})}),l.jsx(rt,{path:"memory",element:l.jsx(Mh,{})}),l.jsx(rt,{path:"logs",element:l.jsx(Uh,{})}),l.jsx(rt,{path:"workspace",element:l.jsx(Wh,{})}),l.jsx(rt,{path:"tasks",element:l.jsx($h,{})}),l.jsx(rt,{path:"mcp",element:l.jsx(Vh,{})}),l.jsx(rt,{path:"config",element:l.jsx(Qh,{})}),l.jsx(rt,{path:"*",element:l.jsx(lh,{to:"/",replace:!0})})]})})})}):l.jsx("div",{className:"login-container",children:l.jsxs("div",{className:"login-card",children:[l.jsx("h1",{children:"Teleton"}),l.jsx("p",{children:"Enter your authentication token to access the dashboard."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Token"}),l.jsx("input",{type:"password",value:p,onChange:k=>m(k.target.value),onKeyDown:k=>k.key==="Enter"&&y(),placeholder:"Paste token from config...",style:{width:"100%"}})]}),S&&l.jsx("div",{className:"alert error",style:{marginBottom:"1rem"},children:S}),l.jsx("button",{onClick:y,style:{width:"100%"},children:"Sign In"})]})})}cp.createRoot(document.getElementById("root")).render(l.jsx(f.StrictMode,{children:l.jsx(vm,{})}));export{Mc as R,tp as g,f as r};
|