@ww-ai-lab/openclaw-office 2026.3.8 → 2026.3.21
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 +14 -30
- package/README.zh.md +14 -30
- package/bin/openclaw-office.js +342 -16
- package/dist/assets/{ActivityHeatmap-CnKWcUWF.js → ActivityHeatmap-CvGomuJN.js} +1 -1
- package/dist/assets/{CostPieChart-DmUzkXKt.js → CostPieChart-BIcqqhp7.js} +3 -3
- package/dist/assets/{NetworkGraph-C0F11y9I.js → NetworkGraph-B-nEMJ_M.js} +1 -1
- package/dist/assets/{Scene3D-q5P1N1qu.js → Scene3D-DC1g2KU1.js} +2 -2
- package/dist/assets/{TokenLineChart-odcmdCAg.js → TokenLineChart-CfPgD-hP.js} +1 -1
- package/dist/assets/{generateCategoricalChart-Onj3oDrM.js → generateCategoricalChart-DUrRp22n.js} +1 -1
- package/dist/assets/index-DehfYC23.css +1 -0
- package/dist/assets/index-DqQHpfxy.js +462 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/bin/openclaw-office-config.d.ts +0 -44
- package/bin/openclaw-office-config.js +0 -219
- package/bin/openclaw-office-server.d.ts +0 -34
- package/bin/openclaw-office-server.js +0 -342
- package/dist/assets/index-DweWoR1-.css +0 -1
- package/dist/assets/index-QZYyP0qG.js +0 -462
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TokenLineChart-odcmdCAg.js","assets/generateCategoricalChart-Onj3oDrM.js","assets/CostPieChart-DmUzkXKt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var i2=Object.defineProperty;var s2=(e,t,a)=>t in e?i2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var _e=(e,t,a)=>s2(e,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function a(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();var Hz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uf={exports:{}},Ms={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Ty;function l2(){if(Ty)return Ms;Ty=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(i,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:u,ref:s!==void 0?s:null,props:o}}return Ms.Fragment=t,Ms.jsx=a,Ms.jsxs=a,Ms}var My;function o2(){return My||(My=1,uf.exports=l2()),uf.exports}var c=o2(),df={exports:{}},je={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Dy;function c2(){if(Dy)return je;Dy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=b&&R[b]||R["@@iterator"],typeof R=="function"?R:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function S(R,Q,M){this.props=R,this.context=Q,this.refs=E,this.updater=M||w}S.prototype.isReactComponent={},S.prototype.setState=function(R,Q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Q,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=S.prototype;function D(R,Q,M){this.props=R,this.context=Q,this.refs=E,this.updater=M||w}var U=D.prototype=new N;U.constructor=D,C(U,S.prototype),U.isPureReactComponent=!0;var z=Array.isArray;function L(){}var G={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function F(R,Q,M){var ce=M.ref;return{$$typeof:e,type:R,key:Q,ref:ce!==void 0?ce:null,props:M}}function _(R,Q){return F(R.type,Q,R.props)}function q(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function V(R){var Q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(M){return Q[M]})}var re=/\/+/g;function W(R,Q){return typeof R=="object"&&R!==null&&R.key!=null?V(""+R.key):Q.toString(36)}function J(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(L,L):(R.status="pending",R.then(function(Q){R.status==="pending"&&(R.status="fulfilled",R.value=Q)},function(Q){R.status==="pending"&&(R.status="rejected",R.reason=Q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function B(R,Q,M,ce,me){var ye=typeof R;(ye==="undefined"||ye==="boolean")&&(R=null);var Me=!1;if(R===null)Me=!0;else switch(ye){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(R.$$typeof){case e:case t:Me=!0;break;case x:return Me=R._init,B(Me(R._payload),Q,M,ce,me)}}if(Me)return me=me(R),Me=ce===""?"."+W(R,0):ce,z(me)?(M="",Me!=null&&(M=Me.replace(re,"$&/")+"/"),B(me,Q,M,"",function(Ot){return Ot})):me!=null&&(q(me)&&(me=_(me,M+(me.key==null||R&&R.key===me.key?"":(""+me.key).replace(re,"$&/")+"/")+Me)),Q.push(me)),1;Me=0;var rt=ce===""?".":ce+":";if(z(R))for(var Ge=0;Ge<R.length;Ge++)ce=R[Ge],ye=rt+W(ce,Ge),Me+=B(ce,Q,M,ye,me);else if(Ge=v(R),typeof Ge=="function")for(R=Ge.call(R),Ge=0;!(ce=R.next()).done;)ce=ce.value,ye=rt+W(ce,Ge++),Me+=B(ce,Q,M,ye,me);else if(ye==="object"){if(typeof R.then=="function")return B(J(R),Q,M,ce,me);throw Q=String(R),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return Me}function ee(R,Q,M){if(R==null)return R;var ce=[],me=0;return B(R,ce,"","",function(ye){return Q.call(M,ye,me++)}),ce}function de(R){if(R._status===-1){var Q=R._result;Q=Q(),Q.then(function(M){(R._status===0||R._status===-1)&&(R._status=1,R._result=M)},function(M){(R._status===0||R._status===-1)&&(R._status=2,R._result=M)}),R._status===-1&&(R._status=0,R._result=Q)}if(R._status===1)return R._result.default;throw R._result}var ke=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},T={map:ee,forEach:function(R,Q,M){ee(R,function(){Q.apply(this,arguments)},M)},count:function(R){var Q=0;return ee(R,function(){Q++}),Q},toArray:function(R){return ee(R,function(Q){return Q})||[]},only:function(R){if(!q(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return je.Activity=p,je.Children=T,je.Component=S,je.Fragment=a,je.Profiler=s,je.PureComponent=D,je.StrictMode=i,je.Suspense=h,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,je.__COMPILER_RUNTIME={__proto__:null,c:function(R){return G.H.useMemoCache(R)}},je.cache=function(R){return function(){return R.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(R,Q,M){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ce=C({},R.props),me=R.key;if(Q!=null)for(ye in Q.key!==void 0&&(me=""+Q.key),Q)!X.call(Q,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&Q.ref===void 0||(ce[ye]=Q[ye]);var ye=arguments.length-2;if(ye===1)ce.children=M;else if(1<ye){for(var Me=Array(ye),rt=0;rt<ye;rt++)Me[rt]=arguments[rt+2];ce.children=Me}return F(R.type,me,ce)},je.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:o,_context:R},R},je.createElement=function(R,Q,M){var ce,me={},ye=null;if(Q!=null)for(ce in Q.key!==void 0&&(ye=""+Q.key),Q)X.call(Q,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(me[ce]=Q[ce]);var Me=arguments.length-2;if(Me===1)me.children=M;else if(1<Me){for(var rt=Array(Me),Ge=0;Ge<Me;Ge++)rt[Ge]=arguments[Ge+2];me.children=rt}if(R&&R.defaultProps)for(ce in Me=R.defaultProps,Me)me[ce]===void 0&&(me[ce]=Me[ce]);return F(R,ye,me)},je.createRef=function(){return{current:null}},je.forwardRef=function(R){return{$$typeof:f,render:R}},je.isValidElement=q,je.lazy=function(R){return{$$typeof:x,_payload:{_status:-1,_result:R},_init:de}},je.memo=function(R,Q){return{$$typeof:g,type:R,compare:Q===void 0?null:Q}},je.startTransition=function(R){var Q=G.T,M={};G.T=M;try{var ce=R(),me=G.S;me!==null&&me(M,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(L,ke)}catch(ye){ke(ye)}finally{Q!==null&&M.types!==null&&(Q.types=M.types),G.T=Q}},je.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},je.use=function(R){return G.H.use(R)},je.useActionState=function(R,Q,M){return G.H.useActionState(R,Q,M)},je.useCallback=function(R,Q){return G.H.useCallback(R,Q)},je.useContext=function(R){return G.H.useContext(R)},je.useDebugValue=function(){},je.useDeferredValue=function(R,Q){return G.H.useDeferredValue(R,Q)},je.useEffect=function(R,Q){return G.H.useEffect(R,Q)},je.useEffectEvent=function(R){return G.H.useEffectEvent(R)},je.useId=function(){return G.H.useId()},je.useImperativeHandle=function(R,Q,M){return G.H.useImperativeHandle(R,Q,M)},je.useInsertionEffect=function(R,Q){return G.H.useInsertionEffect(R,Q)},je.useLayoutEffect=function(R,Q){return G.H.useLayoutEffect(R,Q)},je.useMemo=function(R,Q){return G.H.useMemo(R,Q)},je.useOptimistic=function(R,Q){return G.H.useOptimistic(R,Q)},je.useReducer=function(R,Q,M){return G.H.useReducer(R,Q,M)},je.useRef=function(R){return G.H.useRef(R)},je.useState=function(R){return G.H.useState(R)},je.useSyncExternalStore=function(R,Q,M){return G.H.useSyncExternalStore(R,Q,M)},je.useTransition=function(){return G.H.useTransition()},je.version="19.2.4",je}var _y;function Cc(){return _y||(_y=1,df.exports=c2()),df.exports}var j=Cc();const wr=$h(j);var ff={exports:{}},Ds={},hf={exports:{}},gf={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Ry;function u2(){return Ry||(Ry=1,(function(e){function t(B,ee){var de=B.length;B.push(ee);e:for(;0<de;){var ke=de-1>>>1,T=B[ke];if(0<s(T,ee))B[ke]=ee,B[de]=T,de=ke;else break e}}function a(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var ee=B[0],de=B.pop();if(de!==ee){B[0]=de;e:for(var ke=0,T=B.length,R=T>>>1;ke<R;){var Q=2*(ke+1)-1,M=B[Q],ce=Q+1,me=B[ce];if(0>s(M,de))ce<T&&0>s(me,M)?(B[ke]=me,B[ce]=de,ke=ce):(B[ke]=M,B[Q]=de,ke=Q);else if(ce<T&&0>s(me,de))B[ke]=me,B[ce]=de,ke=ce;else break e}}return ee}function s(B,ee){var de=B.sortIndex-ee.sortIndex;return de!==0?de:B.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],g=[],x=1,p=null,b=3,v=!1,w=!1,C=!1,E=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function U(B){for(var ee=a(g);ee!==null;){if(ee.callback===null)i(g);else if(ee.startTime<=B)i(g),ee.sortIndex=ee.expirationTime,t(h,ee);else break;ee=a(g)}}function z(B){if(C=!1,U(B),!w)if(a(h)!==null)w=!0,L||(L=!0,V());else{var ee=a(g);ee!==null&&J(z,ee.startTime-B)}}var L=!1,G=-1,X=5,F=-1;function _(){return E?!0:!(e.unstable_now()-F<X)}function q(){if(E=!1,L){var B=e.unstable_now();F=B;var ee=!0;try{e:{w=!1,C&&(C=!1,N(G),G=-1),v=!0;var de=b;try{t:{for(U(B),p=a(h);p!==null&&!(p.expirationTime>B&&_());){var ke=p.callback;if(typeof ke=="function"){p.callback=null,b=p.priorityLevel;var T=ke(p.expirationTime<=B);if(B=e.unstable_now(),typeof T=="function"){p.callback=T,U(B),ee=!0;break t}p===a(h)&&i(h),U(B)}else i(h);p=a(h)}if(p!==null)ee=!0;else{var R=a(g);R!==null&&J(z,R.startTime-B),ee=!1}}break e}finally{p=null,b=de,v=!1}ee=void 0}}finally{ee?V():L=!1}}}var V;if(typeof D=="function")V=function(){D(q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,W=re.port2;re.port1.onmessage=q,V=function(){W.postMessage(null)}}else V=function(){S(q,0)};function J(B,ee){G=S(function(){B(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(B){switch(b){case 1:case 2:case 3:var ee=3;break;default:ee=b}var de=b;b=ee;try{return B()}finally{b=de}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(B,ee){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var de=b;b=B;try{return ee()}finally{b=de}},e.unstable_scheduleCallback=function(B,ee,de){var ke=e.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?ke+de:ke):de=ke,B){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=de+T,B={id:x++,callback:ee,priorityLevel:B,startTime:de,expirationTime:T,sortIndex:-1},de>ke?(B.sortIndex=de,t(g,B),a(h)===null&&B===a(g)&&(C?(N(G),G=-1):C=!0,J(z,de-ke))):(B.sortIndex=T,t(h,B),w||v||(w=!0,L||(L=!0,V()))),B},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(B){var ee=b;return function(){var de=b;b=ee;try{return B.apply(this,arguments)}finally{b=de}}}})(gf)),gf}var Oy;function d2(){return Oy||(Oy=1,hf.exports=u2()),hf.exports}var mf={exports:{}},Tt={};/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Ly;function f2(){if(Ly)return Tt;Ly=1;var e=Cc();function t(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,g,x){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:g,implementation:x}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Tt.createPortal=function(h,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return o(h,g,null,x)},Tt.flushSync=function(h){var g=u.T,x=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=g,i.p=x,i.d.f()}},Tt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(h,g))},Tt.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},Tt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var x=g.as,p=f(x,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,v=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?i.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):x==="script"&&i.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Tt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=f(g.as,g.crossOrigin);i.d.M(h,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(h)},Tt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,p=f(x,g.crossOrigin);i.d.L(h,x,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Tt.preloadModule=function(h,g){if(typeof h=="string")if(g){var x=f(g.as,g.crossOrigin);i.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(h)},Tt.requestFormReset=function(h){i.d.r(h)},Tt.unstable_batchedUpdates=function(h,g){return h(g)},Tt.useFormState=function(h,g,x){return u.H.useFormState(h,g,x)},Tt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Tt.version="19.2.4",Tt}var zy;function h2(){if(zy)return mf.exports;zy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mf.exports=f2(),mf.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Hy;function g2(){if(Hy)return Ds;Hy=1;var e=d2(),t=Cc(),a=h2();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function o(n){var r=n,l=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(l=r.return),n=r.return;while(n)}return r.tag===3?l:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(o(n)!==n)throw Error(i(188))}function g(n){var r=n.alternate;if(!r){if(r=o(n),r===null)throw Error(i(188));return r!==n?null:n}for(var l=n,d=r;;){var m=l.return;if(m===null)break;var y=m.alternate;if(y===null){if(d=m.return,d!==null){l=d;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===l)return h(m),n;if(y===d)return h(m),r;y=y.sibling}throw Error(i(188))}if(l.return!==d.return)l=m,d=y;else{for(var k=!1,A=m.child;A;){if(A===l){k=!0,l=m,d=y;break}if(A===d){k=!0,d=m,l=y;break}A=A.sibling}if(!k){for(A=y.child;A;){if(A===l){k=!0,l=y,d=m;break}if(A===d){k=!0,d=y,l=m;break}A=A.sibling}if(!k)throw Error(i(189))}}if(l.alternate!==d)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?n:r}function x(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=x(n),r!==null)return r;n=n.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),D=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),_=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function V(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var re=Symbol.for("react.client.reference");function W(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===re?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case C:return"Fragment";case S:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case F:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case D:return n.displayName||"Context";case N:return(n._context.displayName||"Context")+".Consumer";case U:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case G:return r=n.displayName||null,r!==null?r:W(n.type)||"Memo";case X:r=n._payload,n=n._init;try{return W(n(r))}catch{}}return null}var J=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},ke=[],T=-1;function R(n){return{current:n}}function Q(n){0>T||(n.current=ke[T],ke[T]=null,T--)}function M(n,r){T++,ke[T]=n.current,n.current=r}var ce=R(null),me=R(null),ye=R(null),Me=R(null);function rt(n,r){switch(M(ye,r),M(me,n),M(ce,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?J0(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=J0(r),n=W0(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Q(ce),M(ce,n)}function Ge(){Q(ce),Q(me),Q(ye)}function Ot(n){n.memoizedState!==null&&M(Me,n);var r=ce.current,l=W0(r,n.type);r!==l&&(M(me,n),M(ce,l))}function En(n){me.current===n&&(Q(ce),Q(me)),Me.current===n&&(Q(Me),Ns._currentValue=de)}var Ja,Wa;function pe(n){if(Ja===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);Ja=r&&r[1]||"",Wa=-1<l.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+Ja+n+Wa}var un=!1;function _r(n,r){if(!n||un)return"";un=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(r){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Y){var P=Y}Reflect.construct(n,[],ae)}else{try{ae.call()}catch(Y){P=Y}n.call(ae.prototype)}}else{try{throw Error()}catch(Y){P=Y}(ae=n())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Y){if(Y&&P&&typeof Y.stack=="string")return[Y.stack,P.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),k=y[0],A=y[1];if(k&&A){var O=k.split(`
|
|
45
|
-
`),K=A.split(`
|
|
46
|
-
`);for(m=d=0;d<O.length&&!O[d].includes("DetermineComponentFrameRoot");)d++;for(;m<K.length&&!K[m].includes("DetermineComponentFrameRoot");)m++;if(d===O.length||m===K.length)for(d=O.length-1,m=K.length-1;1<=d&&0<=m&&O[d]!==K[m];)m--;for(;1<=d&&0<=m;d--,m--)if(O[d]!==K[m]){if(d!==1||m!==1)do if(d--,m--,0>m||O[d]!==K[m]){var Z=`
|
|
47
|
-
`+O[d].replace(" at new "," at ");return n.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",n.displayName)),Z}while(1<=d&&0<=m);break}}}finally{un=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?pe(l):""}function kl(n,r){switch(n.tag){case 26:case 27:case 5:return pe(n.type);case 16:return pe("Lazy");case 13:return n.child!==r&&r!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return _r(n.type,!1);case 11:return _r(n.type.render,!1);case 1:return _r(n.type,!0);case 31:return pe("Activity");default:return""}}function wl(n){try{var r="",l=null;do r+=kl(n,l),l=n,n=n.return;while(n);return r}catch(d){return`
|
|
48
|
-
Error generating stack: `+d.message+`
|
|
49
|
-
`+d.stack}}var Rr=Object.prototype.hasOwnProperty,Or=e.unstable_scheduleCallback,Ui=e.unstable_cancelCallback,Yc=e.unstable_shouldYield,Qc=e.unstable_requestPaint,Lt=e.unstable_now,Xc=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,Oe=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,Jt=e.log,Jn=e.unstable_setDisableYieldValue,zt=null,bt=null;function Bt(n){if(typeof Jt=="function"&&Jn(n),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(zt,n)}catch{}}var tt=Math.clz32?Math.clz32:Pk,wa=Math.log,Tn=Math.LN2;function Pk(n){return n>>>=0,n===0?32:31-(wa(n)/Tn|0)|0}var Sl=256,jl=262144,Cl=4194304;function er(n){var r=n&42;if(r!==0)return r;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Nl(n,r,l){var d=n.pendingLanes;if(d===0)return 0;var m=0,y=n.suspendedLanes,k=n.pingedLanes;n=n.warmLanes;var A=d&134217727;return A!==0?(d=A&~y,d!==0?m=er(d):(k&=A,k!==0?m=er(k):l||(l=A&~n,l!==0&&(m=er(l))))):(A=d&~y,A!==0?m=er(A):k!==0?m=er(k):l||(l=d&~n,l!==0&&(m=er(l)))),m===0?0:r!==0&&r!==m&&(r&y)===0&&(y=m&-m,l=r&-r,y>=l||y===32&&(l&4194048)!==0)?r:m}function Ii(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Gk(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rg(){var n=Cl;return Cl<<=1,(Cl&62914560)===0&&(Cl=4194304),n}function Zc(n){for(var r=[],l=0;31>l;l++)r.push(n);return r}function Bi(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Vk(n,r,l,d,m,y){var k=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var A=n.entanglements,O=n.expirationTimes,K=n.hiddenUpdates;for(l=k&~l;0<l;){var Z=31-tt(l),ae=1<<Z;A[Z]=0,O[Z]=-1;var P=K[Z];if(P!==null)for(K[Z]=null,Z=0;Z<P.length;Z++){var Y=P[Z];Y!==null&&(Y.lane&=-536870913)}l&=~ae}d!==0&&Og(n,d,0),y!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=y&~(k&~r))}function Og(n,r,l){n.pendingLanes|=r,n.suspendedLanes&=~r;var d=31-tt(r);n.entangledLanes|=r,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function Lg(n,r){var l=n.entangledLanes|=r;for(n=n.entanglements;l;){var d=31-tt(l),m=1<<d;m&r|n[d]&r&&(n[d]|=r),l&=~m}}function zg(n,r){var l=r&-r;return l=(l&42)!==0?1:Jc(l),(l&(n.suspendedLanes|r))!==0?0:l}function Jc(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Wc(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Hg(){var n=ee.p;return n!==0?n:(n=window.event,n===void 0?32:wy(n.type))}function Ug(n,r){var l=ee.p;try{return ee.p=n,r()}finally{ee.p=l}}var Sa=Math.random().toString(36).slice(2),jt="__reactFiber$"+Sa,qt="__reactProps$"+Sa,Lr="__reactContainer$"+Sa,eu="__reactEvents$"+Sa,Yk="__reactListeners$"+Sa,Qk="__reactHandles$"+Sa,Ig="__reactResources$"+Sa,qi="__reactMarker$"+Sa;function tu(n){delete n[jt],delete n[qt],delete n[eu],delete n[Yk],delete n[Qk]}function zr(n){var r=n[jt];if(r)return r;for(var l=n.parentNode;l;){if(r=l[Lr]||l[jt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(n=sy(n);n!==null;){if(l=n[jt])return l;n=sy(n)}return r}n=l,l=n.parentNode}return null}function Hr(n){if(n=n[jt]||n[Lr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function $i(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function Ur(n){var r=n[Ig];return r||(r=n[Ig]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function kt(n){n[qi]=!0}var Bg=new Set,qg={};function tr(n,r){Ir(n,r),Ir(n+"Capture",r)}function Ir(n,r){for(qg[n]=r,n=0;n<r.length;n++)Bg.add(r[n])}var Xk=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$g={},Kg={};function Zk(n){return Rr.call(Kg,n)?!0:Rr.call($g,n)?!1:Xk.test(n)?Kg[n]=!0:($g[n]=!0,!1)}function Al(n,r,l){if(Zk(r))if(l===null)n.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var d=r.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+l)}}function El(n,r,l){if(l===null)n.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+l)}}function Wn(n,r,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(r,l,""+d)}}function dn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Fg(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Jk(n,r,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var m=d.get,y=d.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return m.call(this)},set:function(k){l=""+k,y.call(this,k)}}),Object.defineProperty(n,r,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(k){l=""+k},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function nu(n){if(!n._valueTracker){var r=Fg(n)?"checked":"value";n._valueTracker=Jk(n,r,""+n[r])}}function Pg(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return n&&(d=Fg(n)?n.checked?"true":"false":n.value),n=d,n!==l?(r.setValue(n),!0):!1}function Tl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Wk=/[\n"\\]/g;function fn(n){return n.replace(Wk,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function au(n,r,l,d,m,y,k,A){n.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.type=k:n.removeAttribute("type"),r!=null?k==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+dn(r)):n.value!==""+dn(r)&&(n.value=""+dn(r)):k!=="submit"&&k!=="reset"||n.removeAttribute("value"),r!=null?ru(n,k,dn(r)):l!=null?ru(n,k,dn(l)):d!=null&&n.removeAttribute("value"),m==null&&y!=null&&(n.defaultChecked=!!y),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?n.name=""+dn(A):n.removeAttribute("name")}function Gg(n,r,l,d,m,y,k,A){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),r!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){nu(n);return}l=l!=null?""+dn(l):"",r=r!=null?""+dn(r):l,A||r===n.value||(n.value=r),n.defaultValue=r}d=d??m,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=A?n.checked:!!d,n.defaultChecked=!!d,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(n.name=k),nu(n)}function ru(n,r,l){r==="number"&&Tl(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Br(n,r,l,d){if(n=n.options,r){r={};for(var m=0;m<l.length;m++)r["$"+l[m]]=!0;for(l=0;l<n.length;l++)m=r.hasOwnProperty("$"+n[l].value),n[l].selected!==m&&(n[l].selected=m),m&&d&&(n[l].defaultSelected=!0)}else{for(l=""+dn(l),r=null,m=0;m<n.length;m++){if(n[m].value===l){n[m].selected=!0,d&&(n[m].defaultSelected=!0);return}r!==null||n[m].disabled||(r=n[m])}r!==null&&(r.selected=!0)}}function Vg(n,r,l){if(r!=null&&(r=""+dn(r),r!==n.value&&(n.value=r),l==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=l!=null?""+dn(l):""}function Yg(n,r,l,d){if(r==null){if(d!=null){if(l!=null)throw Error(i(92));if(J(d)){if(1<d.length)throw Error(i(93));d=d[0]}l=d}l==null&&(l=""),r=l}l=dn(r),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),nu(n)}function qr(n,r){if(r){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=r;return}}n.textContent=r}var ew=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Qg(n,r,l){var d=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":d?n.setProperty(r,l):typeof l!="number"||l===0||ew.has(r)?r==="float"?n.cssFloat=l:n[r]=(""+l).trim():n[r]=l+"px"}function Xg(n,r,l){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||r!=null&&r.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var m in r)d=r[m],r.hasOwnProperty(m)&&l[m]!==d&&Qg(n,m,d)}else for(var y in r)r.hasOwnProperty(y)&&Qg(n,y,r[y])}function iu(n){if(n.indexOf("-")===-1)return!1;switch(n){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 tw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ml(n){return nw.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ea(){}var su=null;function lu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var $r=null,Kr=null;function Zg(n){var r=Hr(n);if(r&&(n=r.stateNode)){var l=n[qt]||null;e:switch(n=r.stateNode,r.type){case"input":if(au(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+fn(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==n&&d.form===n.form){var m=d[qt]||null;if(!m)throw Error(i(90));au(d,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<l.length;r++)d=l[r],d.form===n.form&&Pg(d)}break e;case"textarea":Vg(n,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&Br(n,!!l.multiple,r,!1)}}}var ou=!1;function Jg(n,r,l){if(ou)return n(r,l);ou=!0;try{var d=n(r);return d}finally{if(ou=!1,($r!==null||Kr!==null)&&(xo(),$r&&(r=$r,n=Kr,Kr=$r=null,Zg(r),n)))for(r=0;r<n.length;r++)Zg(n[r])}}function Ki(n,r){var l=n.stateNode;if(l===null)return null;var d=l[qt]||null;if(d===null)return null;l=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(i(231,r,typeof l));return l}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cu=!1;if(ta)try{var Fi={};Object.defineProperty(Fi,"passive",{get:function(){cu=!0}}),window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch{cu=!1}var ja=null,uu=null,Dl=null;function Wg(){if(Dl)return Dl;var n,r=uu,l=r.length,d,m="value"in ja?ja.value:ja.textContent,y=m.length;for(n=0;n<l&&r[n]===m[n];n++);var k=l-n;for(d=1;d<=k&&r[l-d]===m[y-d];d++);return Dl=m.slice(n,1<d?1-d:void 0)}function _l(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Rl(){return!0}function em(){return!1}function $t(n){function r(l,d,m,y,k){this._reactName=l,this._targetInst=m,this.type=d,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var A in n)n.hasOwnProperty(A)&&(l=n[A],this[A]=l?l(y):y[A]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Rl:em,this.isPropagationStopped=em,this}return p(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),r}var nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=$t(nr),Pi=p({},nr,{view:0,detail:0}),aw=$t(Pi),du,fu,Gi,Ll=p({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Gi&&(Gi&&n.type==="mousemove"?(du=n.screenX-Gi.screenX,fu=n.screenY-Gi.screenY):fu=du=0,Gi=n),du)},movementY:function(n){return"movementY"in n?n.movementY:fu}}),tm=$t(Ll),rw=p({},Ll,{dataTransfer:0}),iw=$t(rw),sw=p({},Pi,{relatedTarget:0}),hu=$t(sw),lw=p({},nr,{animationName:0,elapsedTime:0,pseudoElement:0}),ow=$t(lw),cw=p({},nr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),uw=$t(cw),dw=p({},nr,{data:0}),nm=$t(dw),fw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hw={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"},gw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mw(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=gw[n])?!!r[n]:!1}function gu(){return mw}var pw=p({},Pi,{key:function(n){if(n.key){var r=fw[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=_l(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?hw[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gu,charCode:function(n){return n.type==="keypress"?_l(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_l(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),yw=$t(pw),xw=p({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),am=$t(xw),bw=p({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gu}),vw=$t(bw),kw=p({},nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ww=$t(kw),Sw=p({},Ll,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),jw=$t(Sw),Cw=p({},nr,{newState:0,oldState:0}),Nw=$t(Cw),Aw=[9,13,27,32],mu=ta&&"CompositionEvent"in window,Vi=null;ta&&"documentMode"in document&&(Vi=document.documentMode);var Ew=ta&&"TextEvent"in window&&!Vi,rm=ta&&(!mu||Vi&&8<Vi&&11>=Vi),im=" ",sm=!1;function lm(n,r){switch(n){case"keyup":return Aw.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function om(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fr=!1;function Tw(n,r){switch(n){case"compositionend":return om(r);case"keypress":return r.which!==32?null:(sm=!0,im);case"textInput":return n=r.data,n===im&&sm?null:n;default:return null}}function Mw(n,r){if(Fr)return n==="compositionend"||!mu&&lm(n,r)?(n=Wg(),Dl=uu=ja=null,Fr=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return rm&&r.locale!=="ko"?null:r.data;default:return null}}var Dw={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 cm(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!Dw[n.type]:r==="textarea"}function um(n,r,l,d){$r?Kr?Kr.push(d):Kr=[d]:$r=d,r=Co(r,"onChange"),0<r.length&&(l=new Ol("onChange","change",null,l,d),n.push({event:l,listeners:r}))}var Yi=null,Qi=null;function _w(n){G0(n,0)}function zl(n){var r=$i(n);if(Pg(r))return n}function dm(n,r){if(n==="change")return r}var fm=!1;if(ta){var pu;if(ta){var yu="oninput"in document;if(!yu){var hm=document.createElement("div");hm.setAttribute("oninput","return;"),yu=typeof hm.oninput=="function"}pu=yu}else pu=!1;fm=pu&&(!document.documentMode||9<document.documentMode)}function gm(){Yi&&(Yi.detachEvent("onpropertychange",mm),Qi=Yi=null)}function mm(n){if(n.propertyName==="value"&&zl(Qi)){var r=[];um(r,Qi,n,lu(n)),Jg(_w,r)}}function Rw(n,r,l){n==="focusin"?(gm(),Yi=r,Qi=l,Yi.attachEvent("onpropertychange",mm)):n==="focusout"&&gm()}function Ow(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return zl(Qi)}function Lw(n,r){if(n==="click")return zl(r)}function zw(n,r){if(n==="input"||n==="change")return zl(r)}function Hw(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Wt=typeof Object.is=="function"?Object.is:Hw;function Xi(n,r){if(Wt(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var l=Object.keys(n),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var m=l[d];if(!Rr.call(r,m)||!Wt(n[m],r[m]))return!1}return!0}function pm(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function ym(n,r){var l=pm(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=r&&d>=r)return{node:l,offset:r-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=pm(l)}}function xm(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?xm(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function bm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Tl(n.document);r instanceof n.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)n=r.contentWindow;else break;r=Tl(n.document)}return r}function xu(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var Uw=ta&&"documentMode"in document&&11>=document.documentMode,Pr=null,bu=null,Zi=null,vu=!1;function vm(n,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;vu||Pr==null||Pr!==Tl(d)||(d=Pr,"selectionStart"in d&&xu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Zi&&Xi(Zi,d)||(Zi=d,d=Co(bu,"onSelect"),0<d.length&&(r=new Ol("onSelect","select",null,r,l),n.push({event:r,listeners:d}),r.target=Pr)))}function ar(n,r){var l={};return l[n.toLowerCase()]=r.toLowerCase(),l["Webkit"+n]="webkit"+r,l["Moz"+n]="moz"+r,l}var Gr={animationend:ar("Animation","AnimationEnd"),animationiteration:ar("Animation","AnimationIteration"),animationstart:ar("Animation","AnimationStart"),transitionrun:ar("Transition","TransitionRun"),transitionstart:ar("Transition","TransitionStart"),transitioncancel:ar("Transition","TransitionCancel"),transitionend:ar("Transition","TransitionEnd")},ku={},km={};ta&&(km=document.createElement("div").style,"AnimationEvent"in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),"TransitionEvent"in window||delete Gr.transitionend.transition);function rr(n){if(ku[n])return ku[n];if(!Gr[n])return n;var r=Gr[n],l;for(l in r)if(r.hasOwnProperty(l)&&l in km)return ku[n]=r[l];return n}var wm=rr("animationend"),Sm=rr("animationiteration"),jm=rr("animationstart"),Iw=rr("transitionrun"),Bw=rr("transitionstart"),qw=rr("transitioncancel"),Cm=rr("transitionend"),Nm=new Map,wu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wu.push("scrollEnd");function Mn(n,r){Nm.set(n,r),tr(r,[n])}var Hl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},hn=[],Vr=0,Su=0;function Ul(){for(var n=Vr,r=Su=Vr=0;r<n;){var l=hn[r];hn[r++]=null;var d=hn[r];hn[r++]=null;var m=hn[r];hn[r++]=null;var y=hn[r];if(hn[r++]=null,d!==null&&m!==null){var k=d.pending;k===null?m.next=m:(m.next=k.next,k.next=m),d.pending=m}y!==0&&Am(l,m,y)}}function Il(n,r,l,d){hn[Vr++]=n,hn[Vr++]=r,hn[Vr++]=l,hn[Vr++]=d,Su|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function ju(n,r,l,d){return Il(n,r,l,d),Bl(n)}function ir(n,r){return Il(n,null,null,r),Bl(n)}function Am(n,r,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var m=!1,y=n.return;y!==null;)y.childLanes|=l,d=y.alternate,d!==null&&(d.childLanes|=l),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(m=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,m&&r!==null&&(m=31-tt(l),n=y.hiddenUpdates,d=n[m],d===null?n[m]=[r]:d.push(r),r.lane=l|536870912),y):null}function Bl(n){if(50<bs)throw bs=0,Rd=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var Yr={};function $w(n,r,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(n,r,l,d){return new $w(n,r,l,d)}function Cu(n){return n=n.prototype,!(!n||!n.isReactComponent)}function na(n,r){var l=n.alternate;return l===null?(l=en(n.tag,r,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=r,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,r=n.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Em(n,r){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,r=l.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function ql(n,r,l,d,m,y){var k=0;if(d=n,typeof n=="function")Cu(n)&&(k=1);else if(typeof n=="string")k=VS(n,l,ce.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case F:return n=en(31,l,r,m),n.elementType=F,n.lanes=y,n;case C:return sr(l.children,m,y,r);case E:k=8,m|=24;break;case S:return n=en(12,l,r,m|2),n.elementType=S,n.lanes=y,n;case z:return n=en(13,l,r,m),n.elementType=z,n.lanes=y,n;case L:return n=en(19,l,r,m),n.elementType=L,n.lanes=y,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case D:k=10;break e;case N:k=9;break e;case U:k=11;break e;case G:k=14;break e;case X:k=16,d=null;break e}k=29,l=Error(i(130,n===null?"null":typeof n,"")),d=null}return r=en(k,l,r,m),r.elementType=n,r.type=d,r.lanes=y,r}function sr(n,r,l,d){return n=en(7,n,d,r),n.lanes=l,n}function Nu(n,r,l){return n=en(6,n,null,r),n.lanes=l,n}function Tm(n){var r=en(18,null,null,0);return r.stateNode=n,r}function Au(n,r,l){return r=en(4,n.children!==null?n.children:[],n.key,r),r.lanes=l,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Mm=new WeakMap;function gn(n,r){if(typeof n=="object"&&n!==null){var l=Mm.get(n);return l!==void 0?l:(r={value:n,source:r,stack:wl(r)},Mm.set(n,r),r)}return{value:n,source:r,stack:wl(r)}}var Qr=[],Xr=0,$l=null,Ji=0,mn=[],pn=0,Ca=null,Bn=1,qn="";function aa(n,r){Qr[Xr++]=Ji,Qr[Xr++]=$l,$l=n,Ji=r}function Dm(n,r,l){mn[pn++]=Bn,mn[pn++]=qn,mn[pn++]=Ca,Ca=n;var d=Bn;n=qn;var m=32-tt(d)-1;d&=~(1<<m),l+=1;var y=32-tt(r)+m;if(30<y){var k=m-m%5;y=(d&(1<<k)-1).toString(32),d>>=k,m-=k,Bn=1<<32-tt(r)+m|l<<m|d,qn=y+n}else Bn=1<<y|l<<m|d,qn=n}function Eu(n){n.return!==null&&(aa(n,1),Dm(n,1,0))}function Tu(n){for(;n===$l;)$l=Qr[--Xr],Qr[Xr]=null,Ji=Qr[--Xr],Qr[Xr]=null;for(;n===Ca;)Ca=mn[--pn],mn[pn]=null,qn=mn[--pn],mn[pn]=null,Bn=mn[--pn],mn[pn]=null}function _m(n,r){mn[pn++]=Bn,mn[pn++]=qn,mn[pn++]=Ca,Bn=r.id,qn=r.overflow,Ca=n}var Ct=null,st=null,Be=!1,Na=null,yn=!1,Mu=Error(i(519));function Aa(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wi(gn(r,n)),Mu}function Rm(n){var r=n.stateNode,l=n.type,d=n.memoizedProps;switch(r[jt]=n,r[qt]=d,l){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(l=0;l<ks.length;l++)ze(ks[l],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":ze("invalid",r),Gg(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ze("invalid",r);break;case"textarea":ze("invalid",r),Yg(r,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||d.suppressHydrationWarning===!0||X0(r.textContent,l)?(d.popover!=null&&(ze("beforetoggle",r),ze("toggle",r)),d.onScroll!=null&&ze("scroll",r),d.onScrollEnd!=null&&ze("scrollend",r),d.onClick!=null&&(r.onclick=ea),r=!0):r=!1,r||Aa(n,!0)}function Om(n){for(Ct=n.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:yn=!1;return;case 27:case 3:yn=!0;return;default:Ct=Ct.return}}function Zr(n){if(n!==Ct)return!1;if(!Be)return Om(n),Be=!0,!1;var r=n.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Yd(n.type,n.memoizedProps)),l=!l),l&&st&&Aa(n),Om(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));st=iy(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));st=iy(n)}else r===27?(r=st,qa(n.type)?(n=Wd,Wd=null,st=n):st=r):st=Ct?bn(n.stateNode.nextSibling):null;return!0}function lr(){st=Ct=null,Be=!1}function Du(){var n=Na;return n!==null&&(Gt===null?Gt=n:Gt.push.apply(Gt,n),Na=null),n}function Wi(n){Na===null?Na=[n]:Na.push(n)}var _u=R(null),or=null,ra=null;function Ea(n,r,l){M(_u,r._currentValue),r._currentValue=l}function ia(n){n._currentValue=_u.current,Q(_u)}function Ru(n,r,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),n===l)break;n=n.return}}function Ou(n,r,l,d){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var y=m.dependencies;if(y!==null){var k=m.child;y=y.firstContext;e:for(;y!==null;){var A=y;y=m;for(var O=0;O<r.length;O++)if(A.context===r[O]){y.lanes|=l,A=y.alternate,A!==null&&(A.lanes|=l),Ru(y.return,l,n),d||(k=null);break e}y=A.next}}else if(m.tag===18){if(k=m.return,k===null)throw Error(i(341));k.lanes|=l,y=k.alternate,y!==null&&(y.lanes|=l),Ru(k,l,n),k=null}else k=m.child;if(k!==null)k.return=m;else for(k=m;k!==null;){if(k===n){k=null;break}if(m=k.sibling,m!==null){m.return=k.return,k=m;break}k=k.return}m=k}}function Jr(n,r,l,d){n=null;for(var m=r,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var k=m.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var A=m.type;Wt(m.pendingProps.value,k.value)||(n!==null?n.push(A):n=[A])}}else if(m===Me.current){if(k=m.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(Ns):n=[Ns])}m=m.return}n!==null&&Ou(r,n,l,d),r.flags|=262144}function Kl(n){for(n=n.firstContext;n!==null;){if(!Wt(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function cr(n){or=n,ra=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Nt(n){return Lm(or,n)}function Fl(n,r){return or===null&&cr(n),Lm(n,r)}function Lm(n,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},ra===null){if(n===null)throw Error(i(308));ra=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else ra=ra.next=r;return l}var Kw=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){r.aborted=!0,n.forEach(function(l){return l()})}},Fw=e.unstable_scheduleCallback,Pw=e.unstable_NormalPriority,gt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lu(){return{controller:new Kw,data:new Map,refCount:0}}function es(n){n.refCount--,n.refCount===0&&Fw(Pw,function(){n.controller.abort()})}var ts=null,zu=0,Wr=0,ei=null;function Gw(n,r){if(ts===null){var l=ts=[];zu=0,Wr=Id(),ei={status:"pending",value:void 0,then:function(d){l.push(d)}}}return zu++,r.then(zm,zm),r}function zm(){if(--zu===0&&ts!==null){ei!==null&&(ei.status="fulfilled");var n=ts;ts=null,Wr=0,ei=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function Vw(n,r){var l=[],d={status:"pending",value:null,reason:null,then:function(m){l.push(m)}};return n.then(function(){d.status="fulfilled",d.value=r;for(var m=0;m<l.length;m++)(0,l[m])(r)},function(m){for(d.status="rejected",d.reason=m,m=0;m<l.length;m++)(0,l[m])(void 0)}),d}var Hm=B.S;B.S=function(n,r){v0=Lt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Gw(n,r),Hm!==null&&Hm(n,r)};var ur=R(null);function Hu(){var n=ur.current;return n!==null?n:nt.pooledCache}function Pl(n,r){r===null?M(ur,ur.current):M(ur,r.pool)}function Um(){var n=Hu();return n===null?null:{parent:gt._currentValue,pool:n}}var ti=Error(i(460)),Uu=Error(i(474)),Gl=Error(i(542)),Vl={then:function(){}};function Im(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Bm(n,r,l){switch(l=n[l],l===void 0?n.push(r):l!==r&&(r.then(ea,ea),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,$m(n),n;default:if(typeof r.status=="string")r.then(ea,ea);else{if(n=nt,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(d){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=d}},function(d){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=d}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,$m(n),n}throw fr=r,ti}}function dr(n){try{var r=n._init;return r(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(fr=l,ti):l}}var fr=null;function qm(){if(fr===null)throw Error(i(459));var n=fr;return fr=null,n}function $m(n){if(n===ti||n===Gl)throw Error(i(483))}var ni=null,ns=0;function Yl(n){var r=ns;return ns+=1,ni===null&&(ni=[]),Bm(ni,n,r)}function as(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Ql(n,r){throw r.$$typeof===b?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function Km(n){function r(I,H){if(n){var $=I.deletions;$===null?(I.deletions=[H],I.flags|=16):$.push(H)}}function l(I,H){if(!n)return null;for(;H!==null;)r(I,H),H=H.sibling;return null}function d(I){for(var H=new Map;I!==null;)I.key!==null?H.set(I.key,I):H.set(I.index,I),I=I.sibling;return H}function m(I,H){return I=na(I,H),I.index=0,I.sibling=null,I}function y(I,H,$){return I.index=$,n?($=I.alternate,$!==null?($=$.index,$<H?(I.flags|=67108866,H):$):(I.flags|=67108866,H)):(I.flags|=1048576,H)}function k(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function A(I,H,$,ne){return H===null||H.tag!==6?(H=Nu($,I.mode,ne),H.return=I,H):(H=m(H,$),H.return=I,H)}function O(I,H,$,ne){var xe=$.type;return xe===C?Z(I,H,$.props.children,ne,$.key):H!==null&&(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===X&&dr(xe)===H.type)?(H=m(H,$.props),as(H,$),H.return=I,H):(H=ql($.type,$.key,$.props,null,I.mode,ne),as(H,$),H.return=I,H)}function K(I,H,$,ne){return H===null||H.tag!==4||H.stateNode.containerInfo!==$.containerInfo||H.stateNode.implementation!==$.implementation?(H=Au($,I.mode,ne),H.return=I,H):(H=m(H,$.children||[]),H.return=I,H)}function Z(I,H,$,ne,xe){return H===null||H.tag!==7?(H=sr($,I.mode,ne,xe),H.return=I,H):(H=m(H,$),H.return=I,H)}function ae(I,H,$){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Nu(""+H,I.mode,$),H.return=I,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case v:return $=ql(H.type,H.key,H.props,null,I.mode,$),as($,H),$.return=I,$;case w:return H=Au(H,I.mode,$),H.return=I,H;case X:return H=dr(H),ae(I,H,$)}if(J(H)||V(H))return H=sr(H,I.mode,$,null),H.return=I,H;if(typeof H.then=="function")return ae(I,Yl(H),$);if(H.$$typeof===D)return ae(I,Fl(I,H),$);Ql(I,H)}return null}function P(I,H,$,ne){var xe=H!==null?H.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return xe!==null?null:A(I,H,""+$,ne);if(typeof $=="object"&&$!==null){switch($.$$typeof){case v:return $.key===xe?O(I,H,$,ne):null;case w:return $.key===xe?K(I,H,$,ne):null;case X:return $=dr($),P(I,H,$,ne)}if(J($)||V($))return xe!==null?null:Z(I,H,$,ne,null);if(typeof $.then=="function")return P(I,H,Yl($),ne);if($.$$typeof===D)return P(I,H,Fl(I,$),ne);Ql(I,$)}return null}function Y(I,H,$,ne,xe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return I=I.get($)||null,A(H,I,""+ne,xe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return I=I.get(ne.key===null?$:ne.key)||null,O(H,I,ne,xe);case w:return I=I.get(ne.key===null?$:ne.key)||null,K(H,I,ne,xe);case X:return ne=dr(ne),Y(I,H,$,ne,xe)}if(J(ne)||V(ne))return I=I.get($)||null,Z(H,I,ne,xe,null);if(typeof ne.then=="function")return Y(I,H,$,Yl(ne),xe);if(ne.$$typeof===D)return Y(I,H,$,Fl(H,ne),xe);Ql(H,ne)}return null}function fe(I,H,$,ne){for(var xe=null,$e=null,ge=H,Ae=H=0,Ie=null;ge!==null&&Ae<$.length;Ae++){ge.index>Ae?(Ie=ge,ge=null):Ie=ge.sibling;var Ke=P(I,ge,$[Ae],ne);if(Ke===null){ge===null&&(ge=Ie);break}n&&ge&&Ke.alternate===null&&r(I,ge),H=y(Ke,H,Ae),$e===null?xe=Ke:$e.sibling=Ke,$e=Ke,ge=Ie}if(Ae===$.length)return l(I,ge),Be&&aa(I,Ae),xe;if(ge===null){for(;Ae<$.length;Ae++)ge=ae(I,$[Ae],ne),ge!==null&&(H=y(ge,H,Ae),$e===null?xe=ge:$e.sibling=ge,$e=ge);return Be&&aa(I,Ae),xe}for(ge=d(ge);Ae<$.length;Ae++)Ie=Y(ge,I,Ae,$[Ae],ne),Ie!==null&&(n&&Ie.alternate!==null&&ge.delete(Ie.key===null?Ae:Ie.key),H=y(Ie,H,Ae),$e===null?xe=Ie:$e.sibling=Ie,$e=Ie);return n&&ge.forEach(function(Ga){return r(I,Ga)}),Be&&aa(I,Ae),xe}function ve(I,H,$,ne){if($==null)throw Error(i(151));for(var xe=null,$e=null,ge=H,Ae=H=0,Ie=null,Ke=$.next();ge!==null&&!Ke.done;Ae++,Ke=$.next()){ge.index>Ae?(Ie=ge,ge=null):Ie=ge.sibling;var Ga=P(I,ge,Ke.value,ne);if(Ga===null){ge===null&&(ge=Ie);break}n&&ge&&Ga.alternate===null&&r(I,ge),H=y(Ga,H,Ae),$e===null?xe=Ga:$e.sibling=Ga,$e=Ga,ge=Ie}if(Ke.done)return l(I,ge),Be&&aa(I,Ae),xe;if(ge===null){for(;!Ke.done;Ae++,Ke=$.next())Ke=ae(I,Ke.value,ne),Ke!==null&&(H=y(Ke,H,Ae),$e===null?xe=Ke:$e.sibling=Ke,$e=Ke);return Be&&aa(I,Ae),xe}for(ge=d(ge);!Ke.done;Ae++,Ke=$.next())Ke=Y(ge,I,Ae,Ke.value,ne),Ke!==null&&(n&&Ke.alternate!==null&&ge.delete(Ke.key===null?Ae:Ke.key),H=y(Ke,H,Ae),$e===null?xe=Ke:$e.sibling=Ke,$e=Ke);return n&&ge.forEach(function(r2){return r(I,r2)}),Be&&aa(I,Ae),xe}function et(I,H,$,ne){if(typeof $=="object"&&$!==null&&$.type===C&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case v:e:{for(var xe=$.key;H!==null;){if(H.key===xe){if(xe=$.type,xe===C){if(H.tag===7){l(I,H.sibling),ne=m(H,$.props.children),ne.return=I,I=ne;break e}}else if(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===X&&dr(xe)===H.type){l(I,H.sibling),ne=m(H,$.props),as(ne,$),ne.return=I,I=ne;break e}l(I,H);break}else r(I,H);H=H.sibling}$.type===C?(ne=sr($.props.children,I.mode,ne,$.key),ne.return=I,I=ne):(ne=ql($.type,$.key,$.props,null,I.mode,ne),as(ne,$),ne.return=I,I=ne)}return k(I);case w:e:{for(xe=$.key;H!==null;){if(H.key===xe)if(H.tag===4&&H.stateNode.containerInfo===$.containerInfo&&H.stateNode.implementation===$.implementation){l(I,H.sibling),ne=m(H,$.children||[]),ne.return=I,I=ne;break e}else{l(I,H);break}else r(I,H);H=H.sibling}ne=Au($,I.mode,ne),ne.return=I,I=ne}return k(I);case X:return $=dr($),et(I,H,$,ne)}if(J($))return fe(I,H,$,ne);if(V($)){if(xe=V($),typeof xe!="function")throw Error(i(150));return $=xe.call($),ve(I,H,$,ne)}if(typeof $.then=="function")return et(I,H,Yl($),ne);if($.$$typeof===D)return et(I,H,Fl(I,$),ne);Ql(I,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,H!==null&&H.tag===6?(l(I,H.sibling),ne=m(H,$),ne.return=I,I=ne):(l(I,H),ne=Nu($,I.mode,ne),ne.return=I,I=ne),k(I)):l(I,H)}return function(I,H,$,ne){try{ns=0;var xe=et(I,H,$,ne);return ni=null,xe}catch(ge){if(ge===ti||ge===Gl)throw ge;var $e=en(29,ge,null,I.mode);return $e.lanes=ne,$e.return=I,$e}finally{}}}var hr=Km(!0),Fm=Km(!1),Ta=!1;function Iu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bu(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ma(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Da(n,r,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(Pe&2)!==0){var m=d.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),d.pending=r,r=Bl(n),Am(n,null,l),r}return Il(n,d,r,l),Bl(n)}function rs(n,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Lg(n,l)}}function qu(n,r){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var m=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var k={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?m=y=k:y=y.next=k,l=l.next}while(l!==null);y===null?m=y=r:y=y.next=r}else m=y=r;l={baseState:d.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=r:n.next=r,l.lastBaseUpdate=r}var $u=!1;function is(){if($u){var n=ei;if(n!==null)throw n}}function ss(n,r,l,d){$u=!1;var m=n.updateQueue;Ta=!1;var y=m.firstBaseUpdate,k=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var O=A,K=O.next;O.next=null,k===null?y=K:k.next=K,k=O;var Z=n.alternate;Z!==null&&(Z=Z.updateQueue,A=Z.lastBaseUpdate,A!==k&&(A===null?Z.firstBaseUpdate=K:A.next=K,Z.lastBaseUpdate=O))}if(y!==null){var ae=m.baseState;k=0,Z=K=O=null,A=y;do{var P=A.lane&-536870913,Y=P!==A.lane;if(Y?(Ue&P)===P:(d&P)===P){P!==0&&P===Wr&&($u=!0),Z!==null&&(Z=Z.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var fe=n,ve=A;P=r;var et=l;switch(ve.tag){case 1:if(fe=ve.payload,typeof fe=="function"){ae=fe.call(et,ae,P);break e}ae=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ve.payload,P=typeof fe=="function"?fe.call(et,ae,P):fe,P==null)break e;ae=p({},ae,P);break e;case 2:Ta=!0}}P=A.callback,P!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=m.callbacks,Y===null?m.callbacks=[P]:Y.push(P))}else Y={lane:P,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Z===null?(K=Z=Y,O=ae):Z=Z.next=Y,k|=P;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;Y=A,A=Y.next,Y.next=null,m.lastBaseUpdate=Y,m.shared.pending=null}}while(!0);Z===null&&(O=ae),m.baseState=O,m.firstBaseUpdate=K,m.lastBaseUpdate=Z,y===null&&(m.shared.lanes=0),za|=k,n.lanes=k,n.memoizedState=ae}}function Pm(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function Gm(n,r){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)Pm(l[n],r)}var ai=R(null),Xl=R(0);function Vm(n,r){n=ga,M(Xl,n),M(ai,r),ga=n|r.baseLanes}function Ku(){M(Xl,ga),M(ai,ai.current)}function Fu(){ga=Xl.current,Q(ai),Q(Xl)}var tn=R(null),xn=null;function _a(n){var r=n.alternate;M(ft,ft.current&1),M(tn,n),xn===null&&(r===null||ai.current!==null||r.memoizedState!==null)&&(xn=n)}function Pu(n){M(ft,ft.current),M(tn,n),xn===null&&(xn=n)}function Ym(n){n.tag===22?(M(ft,ft.current),M(tn,n),xn===null&&(xn=n)):Ra()}function Ra(){M(ft,ft.current),M(tn,tn.current)}function nn(n){Q(tn),xn===n&&(xn=null),Q(ft)}var ft=R(0);function Zl(n){for(var r=n;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Zd(l)||Jd(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var sa=0,Ce=null,Je=null,mt=null,Jl=!1,ri=!1,gr=!1,Wl=0,ls=0,ii=null,Yw=0;function ut(){throw Error(i(321))}function Gu(n,r){if(r===null)return!1;for(var l=0;l<r.length&&l<n.length;l++)if(!Wt(n[l],r[l]))return!1;return!0}function Vu(n,r,l,d,m,y){return sa=y,Ce=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,B.H=n===null||n.memoizedState===null?Dp:od,gr=!1,y=l(d,m),gr=!1,ri&&(y=Xm(r,l,d,m)),Qm(n),y}function Qm(n){B.H=us;var r=Je!==null&&Je.next!==null;if(sa=0,mt=Je=Ce=null,Jl=!1,ls=0,ii=null,r)throw Error(i(300));n===null||pt||(n=n.dependencies,n!==null&&Kl(n)&&(pt=!0))}function Xm(n,r,l,d){Ce=n;var m=0;do{if(ri&&(ii=null),ls=0,ri=!1,25<=m)throw Error(i(301));if(m+=1,mt=Je=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}B.H=_p,y=r(l,d)}while(ri);return y}function Qw(){var n=B.H,r=n.useState()[0];return r=typeof r.then=="function"?os(r):r,n=n.useState()[0],(Je!==null?Je.memoizedState:null)!==n&&(Ce.flags|=1024),r}function Yu(){var n=Wl!==0;return Wl=0,n}function Qu(n,r,l){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~l}function Xu(n){if(Jl){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Jl=!1}sa=0,mt=Je=Ce=null,ri=!1,ls=Wl=0,ii=null}function Ht(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Ce.memoizedState=mt=n:mt=mt.next=n,mt}function ht(){if(Je===null){var n=Ce.alternate;n=n!==null?n.memoizedState:null}else n=Je.next;var r=mt===null?Ce.memoizedState:mt.next;if(r!==null)mt=r,Je=n;else{if(n===null)throw Ce.alternate===null?Error(i(467)):Error(i(310));Je=n,n={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},mt===null?Ce.memoizedState=mt=n:mt=mt.next=n}return mt}function eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(n){var r=ls;return ls+=1,ii===null&&(ii=[]),n=Bm(ii,n,r),r=Ce,(mt===null?r.memoizedState:mt.next)===null&&(r=r.alternate,B.H=r===null||r.memoizedState===null?Dp:od),n}function to(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return os(n);if(n.$$typeof===D)return Nt(n)}throw Error(i(438,String(n)))}function Zu(n){var r=null,l=Ce.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var d=Ce.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(r={data:d.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=eo(),Ce.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(n),d=0;d<n;d++)l[d]=_;return r.index++,l}function la(n,r){return typeof r=="function"?r(n):r}function no(n){var r=ht();return Ju(r,Je,n)}function Ju(n,r,l){var d=n.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=l;var m=n.baseQueue,y=d.pending;if(y!==null){if(m!==null){var k=m.next;m.next=y.next,y.next=k}r.baseQueue=m=y,d.pending=null}if(y=n.baseState,m===null)n.memoizedState=y;else{r=m.next;var A=k=null,O=null,K=r,Z=!1;do{var ae=K.lane&-536870913;if(ae!==K.lane?(Ue&ae)===ae:(sa&ae)===ae){var P=K.revertLane;if(P===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ae===Wr&&(Z=!0);else if((sa&P)===P){K=K.next,P===Wr&&(Z=!0);continue}else ae={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},O===null?(A=O=ae,k=y):O=O.next=ae,Ce.lanes|=P,za|=P;ae=K.action,gr&&l(y,ae),y=K.hasEagerState?K.eagerState:l(y,ae)}else P={lane:ae,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},O===null?(A=O=P,k=y):O=O.next=P,Ce.lanes|=ae,za|=ae;K=K.next}while(K!==null&&K!==r);if(O===null?k=y:O.next=A,!Wt(y,n.memoizedState)&&(pt=!0,Z&&(l=ei,l!==null)))throw l;n.memoizedState=y,n.baseState=k,n.baseQueue=O,d.lastRenderedState=y}return m===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function Wu(n){var r=ht(),l=r.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=n;var d=l.dispatch,m=l.pending,y=r.memoizedState;if(m!==null){l.pending=null;var k=m=m.next;do y=n(y,k.action),k=k.next;while(k!==m);Wt(y,r.memoizedState)||(pt=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),l.lastRenderedState=y}return[y,d]}function Zm(n,r,l){var d=Ce,m=ht(),y=Be;if(y){if(l===void 0)throw Error(i(407));l=l()}else l=r();var k=!Wt((Je||m).memoizedState,l);if(k&&(m.memoizedState=l,pt=!0),m=m.queue,nd(ep.bind(null,d,m,n),[n]),m.getSnapshot!==r||k||mt!==null&&mt.memoizedState.tag&1){if(d.flags|=2048,si(9,{destroy:void 0},Wm.bind(null,d,m,l,r),null),nt===null)throw Error(i(349));y||(sa&127)!==0||Jm(d,r,l)}return l}function Jm(n,r,l){n.flags|=16384,n={getSnapshot:r,value:l},r=Ce.updateQueue,r===null?(r=eo(),Ce.updateQueue=r,r.stores=[n]):(l=r.stores,l===null?r.stores=[n]:l.push(n))}function Wm(n,r,l,d){r.value=l,r.getSnapshot=d,tp(r)&&np(n)}function ep(n,r,l){return l(function(){tp(r)&&np(n)})}function tp(n){var r=n.getSnapshot;n=n.value;try{var l=r();return!Wt(n,l)}catch{return!0}}function np(n){var r=ir(n,2);r!==null&&Vt(r,n,2)}function ed(n){var r=Ht();if(typeof n=="function"){var l=n;if(n=l(),gr){Bt(!0);try{l()}finally{Bt(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:n},r}function ap(n,r,l,d){return n.baseState=l,Ju(n,Je,typeof d=="function"?d:la)}function Xw(n,r,l,d,m){if(io(n))throw Error(i(485));if(n=r.action,n!==null){var y={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};B.T!==null?l(!0):y.isTransition=!1,d(y),l=r.pending,l===null?(y.next=r.pending=y,rp(r,y)):(y.next=l.next,r.pending=l.next=y)}}function rp(n,r){var l=r.action,d=r.payload,m=n.state;if(r.isTransition){var y=B.T,k={};B.T=k;try{var A=l(m,d),O=B.S;O!==null&&O(k,A),ip(n,r,A)}catch(K){td(n,r,K)}finally{y!==null&&k.types!==null&&(y.types=k.types),B.T=y}}else try{y=l(m,d),ip(n,r,y)}catch(K){td(n,r,K)}}function ip(n,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){sp(n,r,d)},function(d){return td(n,r,d)}):sp(n,r,l)}function sp(n,r,l){r.status="fulfilled",r.value=l,lp(r),n.state=l,r=n.pending,r!==null&&(l=r.next,l===r?n.pending=null:(l=l.next,r.next=l,rp(n,l)))}function td(n,r,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=l,lp(r),r=r.next;while(r!==d)}n.action=null}function lp(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function op(n,r){return r}function cp(n,r){if(Be){var l=nt.formState;if(l!==null){e:{var d=Ce;if(Be){if(st){t:{for(var m=st,y=yn;m.nodeType!==8;){if(!y){m=null;break t}if(m=bn(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){st=bn(m.nextSibling),d=m.data==="F!";break e}}Aa(d)}d=!1}d&&(r=l[0])}}return l=Ht(),l.memoizedState=l.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:op,lastRenderedState:r},l.queue=d,l=Ep.bind(null,Ce,d),d.dispatch=l,d=ed(!1),y=ld.bind(null,Ce,!1,d.queue),d=Ht(),m={state:r,dispatch:null,action:n,pending:null},d.queue=m,l=Xw.bind(null,Ce,m,y,l),m.dispatch=l,d.memoizedState=n,[r,l,!1]}function up(n){var r=ht();return dp(r,Je,n)}function dp(n,r,l){if(r=Ju(n,r,op)[0],n=no(la)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=os(r)}catch(k){throw k===ti?Gl:k}else d=r;r=ht();var m=r.queue,y=m.dispatch;return l!==r.memoizedState&&(Ce.flags|=2048,si(9,{destroy:void 0},Zw.bind(null,m,l),null)),[d,y,n]}function Zw(n,r){n.action=r}function fp(n){var r=ht(),l=Je;if(l!==null)return dp(r,l,n);ht(),r=r.memoizedState,l=ht();var d=l.queue.dispatch;return l.memoizedState=n,[r,d,!1]}function si(n,r,l,d){return n={tag:n,create:l,deps:d,inst:r,next:null},r=Ce.updateQueue,r===null&&(r=eo(),Ce.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,r.lastEffect=n),n}function hp(){return ht().memoizedState}function ao(n,r,l,d){var m=Ht();Ce.flags|=n,m.memoizedState=si(1|r,{destroy:void 0},l,d===void 0?null:d)}function ro(n,r,l,d){var m=ht();d=d===void 0?null:d;var y=m.memoizedState.inst;Je!==null&&d!==null&&Gu(d,Je.memoizedState.deps)?m.memoizedState=si(r,y,l,d):(Ce.flags|=n,m.memoizedState=si(1|r,y,l,d))}function gp(n,r){ao(8390656,8,n,r)}function nd(n,r){ro(2048,8,n,r)}function Jw(n){Ce.flags|=4;var r=Ce.updateQueue;if(r===null)r=eo(),Ce.updateQueue=r,r.events=[n];else{var l=r.events;l===null?r.events=[n]:l.push(n)}}function mp(n){var r=ht().memoizedState;return Jw({ref:r,nextImpl:n}),function(){if((Pe&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function pp(n,r){return ro(4,2,n,r)}function yp(n,r){return ro(4,4,n,r)}function xp(n,r){if(typeof r=="function"){n=n();var l=r(n);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function bp(n,r,l){l=l!=null?l.concat([n]):null,ro(4,4,xp.bind(null,r,n),l)}function ad(){}function vp(n,r){var l=ht();r=r===void 0?null:r;var d=l.memoizedState;return r!==null&&Gu(r,d[1])?d[0]:(l.memoizedState=[n,r],n)}function kp(n,r){var l=ht();r=r===void 0?null:r;var d=l.memoizedState;if(r!==null&&Gu(r,d[1]))return d[0];if(d=n(),gr){Bt(!0);try{n()}finally{Bt(!1)}}return l.memoizedState=[d,r],d}function rd(n,r,l){return l===void 0||(sa&1073741824)!==0&&(Ue&261930)===0?n.memoizedState=r:(n.memoizedState=l,n=w0(),Ce.lanes|=n,za|=n,l)}function wp(n,r,l,d){return Wt(l,r)?l:ai.current!==null?(n=rd(n,l,d),Wt(n,r)||(pt=!0),n):(sa&42)===0||(sa&1073741824)!==0&&(Ue&261930)===0?(pt=!0,n.memoizedState=l):(n=w0(),Ce.lanes|=n,za|=n,r)}function Sp(n,r,l,d,m){var y=ee.p;ee.p=y!==0&&8>y?y:8;var k=B.T,A={};B.T=A,ld(n,!1,r,l);try{var O=m(),K=B.S;if(K!==null&&K(A,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Z=Vw(O,d);cs(n,r,Z,sn(n))}else cs(n,r,d,sn(n))}catch(ae){cs(n,r,{then:function(){},status:"rejected",reason:ae},sn())}finally{ee.p=y,k!==null&&A.types!==null&&(k.types=A.types),B.T=k}}function Ww(){}function id(n,r,l,d){if(n.tag!==5)throw Error(i(476));var m=jp(n).queue;Sp(n,m,r,de,l===null?Ww:function(){return Cp(n),l(d)})}function jp(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:de},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:l},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Cp(n){var r=jp(n);r.next===null&&(r=n.alternate.memoizedState),cs(n,r.next.queue,{},sn())}function sd(){return Nt(Ns)}function Np(){return ht().memoizedState}function Ap(){return ht().memoizedState}function eS(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var l=sn();n=Ma(l);var d=Da(r,n,l);d!==null&&(Vt(d,r,l),rs(d,r,l)),r={cache:Lu()},n.payload=r;return}r=r.return}}function tS(n,r,l){var d=sn();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},io(n)?Tp(r,l):(l=ju(n,r,l,d),l!==null&&(Vt(l,n,d),Mp(l,r,d)))}function Ep(n,r,l){var d=sn();cs(n,r,l,d)}function cs(n,r,l,d){var m={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(io(n))Tp(r,m);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var k=r.lastRenderedState,A=y(k,l);if(m.hasEagerState=!0,m.eagerState=A,Wt(A,k))return Il(n,r,m,0),nt===null&&Ul(),!1}catch{}finally{}if(l=ju(n,r,m,d),l!==null)return Vt(l,n,d),Mp(l,r,d),!0}return!1}function ld(n,r,l,d){if(d={lane:2,revertLane:Id(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},io(n)){if(r)throw Error(i(479))}else r=ju(n,l,d,2),r!==null&&Vt(r,n,2)}function io(n){var r=n.alternate;return n===Ce||r!==null&&r===Ce}function Tp(n,r){ri=Jl=!0;var l=n.pending;l===null?r.next=r:(r.next=l.next,l.next=r),n.pending=r}function Mp(n,r,l){if((l&4194048)!==0){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Lg(n,l)}}var us={readContext:Nt,use:to,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};us.useEffectEvent=ut;var Dp={readContext:Nt,use:to,useCallback:function(n,r){return Ht().memoizedState=[n,r===void 0?null:r],n},useContext:Nt,useEffect:gp,useImperativeHandle:function(n,r,l){l=l!=null?l.concat([n]):null,ao(4194308,4,xp.bind(null,r,n),l)},useLayoutEffect:function(n,r){return ao(4194308,4,n,r)},useInsertionEffect:function(n,r){ao(4,2,n,r)},useMemo:function(n,r){var l=Ht();r=r===void 0?null:r;var d=n();if(gr){Bt(!0);try{n()}finally{Bt(!1)}}return l.memoizedState=[d,r],d},useReducer:function(n,r,l){var d=Ht();if(l!==void 0){var m=l(r);if(gr){Bt(!0);try{l(r)}finally{Bt(!1)}}}else m=r;return d.memoizedState=d.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},d.queue=n,n=n.dispatch=tS.bind(null,Ce,n),[d.memoizedState,n]},useRef:function(n){var r=Ht();return n={current:n},r.memoizedState=n},useState:function(n){n=ed(n);var r=n.queue,l=Ep.bind(null,Ce,r);return r.dispatch=l,[n.memoizedState,l]},useDebugValue:ad,useDeferredValue:function(n,r){var l=Ht();return rd(l,n,r)},useTransition:function(){var n=ed(!1);return n=Sp.bind(null,Ce,n.queue,!0,!1),Ht().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,l){var d=Ce,m=Ht();if(Be){if(l===void 0)throw Error(i(407));l=l()}else{if(l=r(),nt===null)throw Error(i(349));(Ue&127)!==0||Jm(d,r,l)}m.memoizedState=l;var y={value:l,getSnapshot:r};return m.queue=y,gp(ep.bind(null,d,y,n),[n]),d.flags|=2048,si(9,{destroy:void 0},Wm.bind(null,d,y,l,r),null),l},useId:function(){var n=Ht(),r=nt.identifierPrefix;if(Be){var l=qn,d=Bn;l=(d&~(1<<32-tt(d)-1)).toString(32)+l,r="_"+r+"R_"+l,l=Wl++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=Yw++,r="_"+r+"r_"+l.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:sd,useFormState:cp,useActionState:cp,useOptimistic:function(n){var r=Ht();r.memoizedState=r.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=ld.bind(null,Ce,!0,l),l.dispatch=r,[n,r]},useMemoCache:Zu,useCacheRefresh:function(){return Ht().memoizedState=eS.bind(null,Ce)},useEffectEvent:function(n){var r=Ht(),l={impl:n};return r.memoizedState=l,function(){if((Pe&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},od={readContext:Nt,use:to,useCallback:vp,useContext:Nt,useEffect:nd,useImperativeHandle:bp,useInsertionEffect:pp,useLayoutEffect:yp,useMemo:kp,useReducer:no,useRef:hp,useState:function(){return no(la)},useDebugValue:ad,useDeferredValue:function(n,r){var l=ht();return wp(l,Je.memoizedState,n,r)},useTransition:function(){var n=no(la)[0],r=ht().memoizedState;return[typeof n=="boolean"?n:os(n),r]},useSyncExternalStore:Zm,useId:Np,useHostTransitionStatus:sd,useFormState:up,useActionState:up,useOptimistic:function(n,r){var l=ht();return ap(l,Je,n,r)},useMemoCache:Zu,useCacheRefresh:Ap};od.useEffectEvent=mp;var _p={readContext:Nt,use:to,useCallback:vp,useContext:Nt,useEffect:nd,useImperativeHandle:bp,useInsertionEffect:pp,useLayoutEffect:yp,useMemo:kp,useReducer:Wu,useRef:hp,useState:function(){return Wu(la)},useDebugValue:ad,useDeferredValue:function(n,r){var l=ht();return Je===null?rd(l,n,r):wp(l,Je.memoizedState,n,r)},useTransition:function(){var n=Wu(la)[0],r=ht().memoizedState;return[typeof n=="boolean"?n:os(n),r]},useSyncExternalStore:Zm,useId:Np,useHostTransitionStatus:sd,useFormState:fp,useActionState:fp,useOptimistic:function(n,r){var l=ht();return Je!==null?ap(l,Je,n,r):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Zu,useCacheRefresh:Ap};_p.useEffectEvent=mp;function cd(n,r,l,d){r=n.memoizedState,l=l(d,r),l=l==null?r:p({},r,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var ud={enqueueSetState:function(n,r,l){n=n._reactInternals;var d=sn(),m=Ma(d);m.payload=r,l!=null&&(m.callback=l),r=Da(n,m,d),r!==null&&(Vt(r,n,d),rs(r,n,d))},enqueueReplaceState:function(n,r,l){n=n._reactInternals;var d=sn(),m=Ma(d);m.tag=1,m.payload=r,l!=null&&(m.callback=l),r=Da(n,m,d),r!==null&&(Vt(r,n,d),rs(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var l=sn(),d=Ma(l);d.tag=2,r!=null&&(d.callback=r),r=Da(n,d,l),r!==null&&(Vt(r,n,l),rs(r,n,l))}};function Rp(n,r,l,d,m,y,k){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,y,k):r.prototype&&r.prototype.isPureReactComponent?!Xi(l,d)||!Xi(m,y):!0}function Op(n,r,l,d){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==n&&ud.enqueueReplaceState(r,r.state,null)}function mr(n,r){var l=r;if("ref"in r){l={};for(var d in r)d!=="ref"&&(l[d]=r[d])}if(n=n.defaultProps){l===r&&(l=p({},l));for(var m in n)l[m]===void 0&&(l[m]=n[m])}return l}function Lp(n){Hl(n)}function zp(n){console.error(n)}function Hp(n){Hl(n)}function so(n,r){try{var l=n.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function Up(n,r,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function dd(n,r,l){return l=Ma(l),l.tag=3,l.payload={element:null},l.callback=function(){so(n,r)},l}function Ip(n){return n=Ma(n),n.tag=3,n}function Bp(n,r,l,d){var m=l.type.getDerivedStateFromError;if(typeof m=="function"){var y=d.value;n.payload=function(){return m(y)},n.callback=function(){Up(r,l,d)}}var k=l.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(n.callback=function(){Up(r,l,d),typeof m!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})})}function nS(n,r,l,d,m){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=l.alternate,r!==null&&Jr(r,l,m,!0),l=tn.current,l!==null){switch(l.tag){case 31:case 13:return xn===null?bo():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=m,d===Vl?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([d]):r.add(d),zd(n,d,m)),!1;case 22:return l.flags|=65536,d===Vl?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([d]):l.add(d)),zd(n,d,m)),!1}throw Error(i(435,l.tag))}return zd(n,d,m),bo(),!1}if(Be)return r=tn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,d!==Mu&&(n=Error(i(422),{cause:d}),Wi(gn(n,l)))):(d!==Mu&&(r=Error(i(423),{cause:d}),Wi(gn(r,l))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,d=gn(d,l),m=dd(n.stateNode,d,m),qu(n,m),dt!==4&&(dt=2)),!1;var y=Error(i(520),{cause:d});if(y=gn(y,l),xs===null?xs=[y]:xs.push(y),dt!==4&&(dt=2),r===null)return!0;d=gn(d,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,n=m&-m,l.lanes|=n,n=dd(l.stateNode,d,n),qu(l,n),!1;case 1:if(r=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ha===null||!Ha.has(y))))return l.flags|=65536,m&=-m,l.lanes|=m,m=Ip(m),Bp(m,n,l,d),qu(l,m),!1}l=l.return}while(l!==null);return!1}var fd=Error(i(461)),pt=!1;function At(n,r,l,d){r.child=n===null?Fm(r,null,l,d):hr(r,n.child,l,d)}function qp(n,r,l,d,m){l=l.render;var y=r.ref;if("ref"in d){var k={};for(var A in d)A!=="ref"&&(k[A]=d[A])}else k=d;return cr(r),d=Vu(n,r,l,k,y,m),A=Yu(),n!==null&&!pt?(Qu(n,r,m),oa(n,r,m)):(Be&&A&&Eu(r),r.flags|=1,At(n,r,d,m),r.child)}function $p(n,r,l,d,m){if(n===null){var y=l.type;return typeof y=="function"&&!Cu(y)&&y.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=y,Kp(n,r,y,d,m)):(n=ql(l.type,null,d,r,r.mode,m),n.ref=r.ref,n.return=r,r.child=n)}if(y=n.child,!vd(n,m)){var k=y.memoizedProps;if(l=l.compare,l=l!==null?l:Xi,l(k,d)&&n.ref===r.ref)return oa(n,r,m)}return r.flags|=1,n=na(y,d),n.ref=r.ref,n.return=r,r.child=n}function Kp(n,r,l,d,m){if(n!==null){var y=n.memoizedProps;if(Xi(y,d)&&n.ref===r.ref)if(pt=!1,r.pendingProps=d=y,vd(n,m))(n.flags&131072)!==0&&(pt=!0);else return r.lanes=n.lanes,oa(n,r,m)}return hd(n,r,l,d,m)}function Fp(n,r,l,d){var m=d.children,y=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|l:l,n!==null){for(d=r.child=n.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;d=m&~y}else d=0,r.child=null;return Pp(n,r,y,l,d)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Pl(r,y!==null?y.cachePool:null),y!==null?Vm(r,y):Ku(),Ym(r);else return d=r.lanes=536870912,Pp(n,r,y!==null?y.baseLanes|l:l,l,d)}else y!==null?(Pl(r,y.cachePool),Vm(r,y),Ra(),r.memoizedState=null):(n!==null&&Pl(r,null),Ku(),Ra());return At(n,r,m,l),r.child}function ds(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Pp(n,r,l,d,m){var y=Hu();return y=y===null?null:{parent:gt._currentValue,pool:y},r.memoizedState={baseLanes:l,cachePool:y},n!==null&&Pl(r,null),Ku(),Ym(r),n!==null&&Jr(n,r,d,!0),r.childLanes=m,null}function lo(n,r){return r=co({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function Gp(n,r,l){return hr(r,n.child,null,l),n=lo(r,r.pendingProps),n.flags|=2,nn(r),r.memoizedState=null,n}function aS(n,r,l){var d=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Be){if(d.mode==="hidden")return n=lo(r,d),r.lanes=536870912,ds(null,n);if(Pu(r),(n=st)?(n=ry(n,yn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ca!==null?{id:Bn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},l=Tm(n),l.return=r,r.child=l,Ct=r,st=null)):n=null,n===null)throw Aa(r);return r.lanes=536870912,null}return lo(r,d)}var y=n.memoizedState;if(y!==null){var k=y.dehydrated;if(Pu(r),m)if(r.flags&256)r.flags&=-257,r=Gp(n,r,l);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(pt||Jr(n,r,l,!1),m=(l&n.childLanes)!==0,pt||m){if(d=nt,d!==null&&(k=zg(d,l),k!==0&&k!==y.retryLane))throw y.retryLane=k,ir(n,k),Vt(d,n,k),fd;bo(),r=Gp(n,r,l)}else n=y.treeContext,st=bn(k.nextSibling),Ct=r,Be=!0,Na=null,yn=!1,n!==null&&_m(r,n),r=lo(r,d),r.flags|=4096;return r}return n=na(n.child,{mode:d.mode,children:d.children}),n.ref=r.ref,r.child=n,n.return=r,n}function oo(n,r){var l=r.ref;if(l===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(n===null||n.ref!==l)&&(r.flags|=4194816)}}function hd(n,r,l,d,m){return cr(r),l=Vu(n,r,l,d,void 0,m),d=Yu(),n!==null&&!pt?(Qu(n,r,m),oa(n,r,m)):(Be&&d&&Eu(r),r.flags|=1,At(n,r,l,m),r.child)}function Vp(n,r,l,d,m,y){return cr(r),r.updateQueue=null,l=Xm(r,d,l,m),Qm(n),d=Yu(),n!==null&&!pt?(Qu(n,r,y),oa(n,r,y)):(Be&&d&&Eu(r),r.flags|=1,At(n,r,l,y),r.child)}function Yp(n,r,l,d,m){if(cr(r),r.stateNode===null){var y=Yr,k=l.contextType;typeof k=="object"&&k!==null&&(y=Nt(k)),y=new l(d,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=ud,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=d,y.state=r.memoizedState,y.refs={},Iu(r),k=l.contextType,y.context=typeof k=="object"&&k!==null?Nt(k):Yr,y.state=r.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(cd(r,l,k,d),y.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&ud.enqueueReplaceState(y,y.state,null),ss(r,d,y,m),is(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){y=r.stateNode;var A=r.memoizedProps,O=mr(l,A);y.props=O;var K=y.context,Z=l.contextType;k=Yr,typeof Z=="object"&&Z!==null&&(k=Nt(Z));var ae=l.getDerivedStateFromProps;Z=typeof ae=="function"||typeof y.getSnapshotBeforeUpdate=="function",A=r.pendingProps!==A,Z||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A||K!==k)&&Op(r,y,d,k),Ta=!1;var P=r.memoizedState;y.state=P,ss(r,d,y,m),is(),K=r.memoizedState,A||P!==K||Ta?(typeof ae=="function"&&(cd(r,l,ae,d),K=r.memoizedState),(O=Ta||Rp(r,l,O,d,P,K,k))?(Z||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=K),y.props=d,y.state=K,y.context=k,d=O):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{y=r.stateNode,Bu(n,r),k=r.memoizedProps,Z=mr(l,k),y.props=Z,ae=r.pendingProps,P=y.context,K=l.contextType,O=Yr,typeof K=="object"&&K!==null&&(O=Nt(K)),A=l.getDerivedStateFromProps,(K=typeof A=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==ae||P!==O)&&Op(r,y,d,O),Ta=!1,P=r.memoizedState,y.state=P,ss(r,d,y,m),is();var Y=r.memoizedState;k!==ae||P!==Y||Ta||n!==null&&n.dependencies!==null&&Kl(n.dependencies)?(typeof A=="function"&&(cd(r,l,A,d),Y=r.memoizedState),(Z=Ta||Rp(r,l,Z,d,P,Y,O)||n!==null&&n.dependencies!==null&&Kl(n.dependencies))?(K||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,Y,O),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,Y,O)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===n.memoizedProps&&P===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&P===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=Y),y.props=d,y.state=Y,y.context=O,d=Z):(typeof y.componentDidUpdate!="function"||k===n.memoizedProps&&P===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&P===n.memoizedState||(r.flags|=1024),d=!1)}return y=d,oo(n,r),d=(r.flags&128)!==0,y||d?(y=r.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,n!==null&&d?(r.child=hr(r,n.child,null,m),r.child=hr(r,null,l,m)):At(n,r,l,m),r.memoizedState=y.state,n=r.child):n=oa(n,r,m),n}function Qp(n,r,l,d){return lr(),r.flags|=256,At(n,r,l,d),r.child}var gd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function md(n){return{baseLanes:n,cachePool:Um()}}function pd(n,r,l){return n=n!==null?n.childLanes&~l:0,r&&(n|=rn),n}function Xp(n,r,l){var d=r.pendingProps,m=!1,y=(r.flags&128)!==0,k;if((k=y)||(k=n!==null&&n.memoizedState===null?!1:(ft.current&2)!==0),k&&(m=!0,r.flags&=-129),k=(r.flags&32)!==0,r.flags&=-33,n===null){if(Be){if(m?_a(r):Ra(),(n=st)?(n=ry(n,yn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ca!==null?{id:Bn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},l=Tm(n),l.return=r,r.child=l,Ct=r,st=null)):n=null,n===null)throw Aa(r);return Jd(n)?r.lanes=32:r.lanes=536870912,null}var A=d.children;return d=d.fallback,m?(Ra(),m=r.mode,A=co({mode:"hidden",children:A},m),d=sr(d,m,l,null),A.return=r,d.return=r,A.sibling=d,r.child=A,d=r.child,d.memoizedState=md(l),d.childLanes=pd(n,k,l),r.memoizedState=gd,ds(null,d)):(_a(r),yd(r,A))}var O=n.memoizedState;if(O!==null&&(A=O.dehydrated,A!==null)){if(y)r.flags&256?(_a(r),r.flags&=-257,r=xd(n,r,l)):r.memoizedState!==null?(Ra(),r.child=n.child,r.flags|=128,r=null):(Ra(),A=d.fallback,m=r.mode,d=co({mode:"visible",children:d.children},m),A=sr(A,m,l,null),A.flags|=2,d.return=r,A.return=r,d.sibling=A,r.child=d,hr(r,n.child,null,l),d=r.child,d.memoizedState=md(l),d.childLanes=pd(n,k,l),r.memoizedState=gd,r=ds(null,d));else if(_a(r),Jd(A)){if(k=A.nextSibling&&A.nextSibling.dataset,k)var K=k.dgst;k=K,d=Error(i(419)),d.stack="",d.digest=k,Wi({value:d,source:null,stack:null}),r=xd(n,r,l)}else if(pt||Jr(n,r,l,!1),k=(l&n.childLanes)!==0,pt||k){if(k=nt,k!==null&&(d=zg(k,l),d!==0&&d!==O.retryLane))throw O.retryLane=d,ir(n,d),Vt(k,n,d),fd;Zd(A)||bo(),r=xd(n,r,l)}else Zd(A)?(r.flags|=192,r.child=n.child,r=null):(n=O.treeContext,st=bn(A.nextSibling),Ct=r,Be=!0,Na=null,yn=!1,n!==null&&_m(r,n),r=yd(r,d.children),r.flags|=4096);return r}return m?(Ra(),A=d.fallback,m=r.mode,O=n.child,K=O.sibling,d=na(O,{mode:"hidden",children:d.children}),d.subtreeFlags=O.subtreeFlags&65011712,K!==null?A=na(K,A):(A=sr(A,m,l,null),A.flags|=2),A.return=r,d.return=r,d.sibling=A,r.child=d,ds(null,d),d=r.child,A=n.child.memoizedState,A===null?A=md(l):(m=A.cachePool,m!==null?(O=gt._currentValue,m=m.parent!==O?{parent:O,pool:O}:m):m=Um(),A={baseLanes:A.baseLanes|l,cachePool:m}),d.memoizedState=A,d.childLanes=pd(n,k,l),r.memoizedState=gd,ds(n.child,d)):(_a(r),l=n.child,n=l.sibling,l=na(l,{mode:"visible",children:d.children}),l.return=r,l.sibling=null,n!==null&&(k=r.deletions,k===null?(r.deletions=[n],r.flags|=16):k.push(n)),r.child=l,r.memoizedState=null,l)}function yd(n,r){return r=co({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function co(n,r){return n=en(22,n,null,r),n.lanes=0,n}function xd(n,r,l){return hr(r,n.child,null,l),n=yd(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function Zp(n,r,l){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r),Ru(n.return,r,l)}function bd(n,r,l,d,m,y){var k=n.memoizedState;k===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:m,treeForkCount:y}:(k.isBackwards=r,k.rendering=null,k.renderingStartTime=0,k.last=d,k.tail=l,k.tailMode=m,k.treeForkCount=y)}function Jp(n,r,l){var d=r.pendingProps,m=d.revealOrder,y=d.tail;d=d.children;var k=ft.current,A=(k&2)!==0;if(A?(k=k&1|2,r.flags|=128):k&=1,M(ft,k),At(n,r,d,l),d=Be?Ji:0,!A&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Zp(n,l,r);else if(n.tag===19)Zp(n,l,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"forwards":for(l=r.child,m=null;l!==null;)n=l.alternate,n!==null&&Zl(n)===null&&(m=l),l=l.sibling;l=m,l===null?(m=r.child,r.child=null):(m=l.sibling,l.sibling=null),bd(r,!1,m,l,y,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,m=r.child,r.child=null;m!==null;){if(n=m.alternate,n!==null&&Zl(n)===null){r.child=m;break}n=m.sibling,m.sibling=l,l=m,m=n}bd(r,!0,l,null,y,d);break;case"together":bd(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function oa(n,r,l){if(n!==null&&(r.dependencies=n.dependencies),za|=r.lanes,(l&r.childLanes)===0)if(n!==null){if(Jr(n,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,l=na(n,n.pendingProps),r.child=l,l.return=r;n.sibling!==null;)n=n.sibling,l=l.sibling=na(n,n.pendingProps),l.return=r;l.sibling=null}return r.child}function vd(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Kl(n)))}function rS(n,r,l){switch(r.tag){case 3:rt(r,r.stateNode.containerInfo),Ea(r,gt,n.memoizedState.cache),lr();break;case 27:case 5:Ot(r);break;case 4:rt(r,r.stateNode.containerInfo);break;case 10:Ea(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Pu(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(_a(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Xp(n,r,l):(_a(r),n=oa(n,r,l),n!==null?n.sibling:null);_a(r);break;case 19:var m=(n.flags&128)!==0;if(d=(l&r.childLanes)!==0,d||(Jr(n,r,l,!1),d=(l&r.childLanes)!==0),m){if(d)return Jp(n,r,l);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),M(ft,ft.current),d)break;return null;case 22:return r.lanes=0,Fp(n,r,l,r.pendingProps);case 24:Ea(r,gt,n.memoizedState.cache)}return oa(n,r,l)}function Wp(n,r,l){if(n!==null)if(n.memoizedProps!==r.pendingProps)pt=!0;else{if(!vd(n,l)&&(r.flags&128)===0)return pt=!1,rS(n,r,l);pt=(n.flags&131072)!==0}else pt=!1,Be&&(r.flags&1048576)!==0&&Dm(r,Ji,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=dr(r.elementType),r.type=n,typeof n=="function")Cu(n)?(d=mr(n,d),r.tag=1,r=Yp(null,r,n,d,l)):(r.tag=0,r=hd(null,r,n,d,l));else{if(n!=null){var m=n.$$typeof;if(m===U){r.tag=11,r=qp(null,r,n,d,l);break e}else if(m===G){r.tag=14,r=$p(null,r,n,d,l);break e}}throw r=W(n)||n,Error(i(306,r,""))}}return r;case 0:return hd(n,r,r.type,r.pendingProps,l);case 1:return d=r.type,m=mr(d,r.pendingProps),Yp(n,r,d,m,l);case 3:e:{if(rt(r,r.stateNode.containerInfo),n===null)throw Error(i(387));d=r.pendingProps;var y=r.memoizedState;m=y.element,Bu(n,r),ss(r,d,null,l);var k=r.memoizedState;if(d=k.cache,Ea(r,gt,d),d!==y.cache&&Ou(r,[gt],l,!0),is(),d=k.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:k.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=Qp(n,r,d,l);break e}else if(d!==m){m=gn(Error(i(424)),r),Wi(m),r=Qp(n,r,d,l);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(st=bn(n.firstChild),Ct=r,Be=!0,Na=null,yn=!0,l=Fm(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(lr(),d===m){r=oa(n,r,l);break e}At(n,r,d,l)}r=r.child}return r;case 26:return oo(n,r),n===null?(l=uy(r.type,null,r.pendingProps,null))?r.memoizedState=l:Be||(l=r.type,n=r.pendingProps,d=No(ye.current).createElement(l),d[jt]=r,d[qt]=n,Et(d,l,n),kt(d),r.stateNode=d):r.memoizedState=uy(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Ot(r),n===null&&Be&&(d=r.stateNode=ly(r.type,r.pendingProps,ye.current),Ct=r,yn=!0,m=st,qa(r.type)?(Wd=m,st=bn(d.firstChild)):st=m),At(n,r,r.pendingProps.children,l),oo(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Be&&((m=d=st)&&(d=OS(d,r.type,r.pendingProps,yn),d!==null?(r.stateNode=d,Ct=r,st=bn(d.firstChild),yn=!1,m=!0):m=!1),m||Aa(r)),Ot(r),m=r.type,y=r.pendingProps,k=n!==null?n.memoizedProps:null,d=y.children,Yd(m,y)?d=null:k!==null&&Yd(m,k)&&(r.flags|=32),r.memoizedState!==null&&(m=Vu(n,r,Qw,null,null,l),Ns._currentValue=m),oo(n,r),At(n,r,d,l),r.child;case 6:return n===null&&Be&&((n=l=st)&&(l=LS(l,r.pendingProps,yn),l!==null?(r.stateNode=l,Ct=r,st=null,n=!0):n=!1),n||Aa(r)),null;case 13:return Xp(n,r,l);case 4:return rt(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=hr(r,null,d,l):At(n,r,d,l),r.child;case 11:return qp(n,r,r.type,r.pendingProps,l);case 7:return At(n,r,r.pendingProps,l),r.child;case 8:return At(n,r,r.pendingProps.children,l),r.child;case 12:return At(n,r,r.pendingProps.children,l),r.child;case 10:return d=r.pendingProps,Ea(r,r.type,d.value),At(n,r,d.children,l),r.child;case 9:return m=r.type._context,d=r.pendingProps.children,cr(r),m=Nt(m),d=d(m),r.flags|=1,At(n,r,d,l),r.child;case 14:return $p(n,r,r.type,r.pendingProps,l);case 15:return Kp(n,r,r.type,r.pendingProps,l);case 19:return Jp(n,r,l);case 31:return aS(n,r,l);case 22:return Fp(n,r,l,r.pendingProps);case 24:return cr(r),d=Nt(gt),n===null?(m=Hu(),m===null&&(m=nt,y=Lu(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=l),m=y),r.memoizedState={parent:d,cache:m},Iu(r),Ea(r,gt,m)):((n.lanes&l)!==0&&(Bu(n,r),ss(r,null,null,l),is()),m=n.memoizedState,y=r.memoizedState,m.parent!==d?(m={parent:d,cache:d},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),Ea(r,gt,d)):(d=y.cache,Ea(r,gt,d),d!==m.cache&&Ou(r,[gt],l,!0))),At(n,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function ca(n){n.flags|=4}function kd(n,r,l,d,m){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(N0())n.flags|=8192;else throw fr=Vl,Uu}else n.flags&=-16777217}function e0(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!my(r))if(N0())n.flags|=8192;else throw fr=Vl,Uu}function uo(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Rg():536870912,n.lanes|=r,ui|=r)}function fs(n,r){if(!Be)switch(n.tailMode){case"hidden":r=n.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function lt(n){var r=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(r)for(var m=n.child;m!==null;)l|=m.lanes|m.childLanes,d|=m.subtreeFlags&65011712,d|=m.flags&65011712,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)l|=m.lanes|m.childLanes,d|=m.subtreeFlags,d|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=d,n.childLanes=l,r}function iS(n,r,l){var d=r.pendingProps;switch(Tu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(r),null;case 1:return lt(r),null;case 3:return l=r.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),ia(gt),Ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Zr(r)?ca(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Du())),lt(r),null;case 26:var m=r.type,y=r.memoizedState;return n===null?(ca(r),y!==null?(lt(r),e0(r,y)):(lt(r),kd(r,m,null,d,l))):y?y!==n.memoizedState?(ca(r),lt(r),e0(r,y)):(lt(r),r.flags&=-16777217):(n=n.memoizedProps,n!==d&&ca(r),lt(r),kd(r,m,n,d,l)),null;case 27:if(En(r),l=ye.current,m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&ca(r);else{if(!d){if(r.stateNode===null)throw Error(i(166));return lt(r),null}n=ce.current,Zr(r)?Rm(r):(n=ly(m,d,l),r.stateNode=n,ca(r))}return lt(r),null;case 5:if(En(r),m=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&ca(r);else{if(!d){if(r.stateNode===null)throw Error(i(166));return lt(r),null}if(y=ce.current,Zr(r))Rm(r);else{var k=No(ye.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?k.createElement("select",{is:d.is}):k.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?k.createElement(m,{is:d.is}):k.createElement(m)}}y[jt]=r,y[qt]=d;e:for(k=r.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===r)break e;for(;k.sibling===null;){if(k.return===null||k.return===r)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}r.stateNode=y;e:switch(Et(y,m,d),m){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ca(r)}}return lt(r),kd(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,l),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==d&&ca(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(i(166));if(n=ye.current,Zr(r)){if(n=r.stateNode,l=r.memoizedProps,d=null,m=Ct,m!==null)switch(m.tag){case 27:case 5:d=m.memoizedProps}n[jt]=r,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||X0(n.nodeValue,l)),n||Aa(r,!0)}else n=No(n).createTextNode(d),n[jt]=r,r.stateNode=n}return lt(r),null;case 31:if(l=r.memoizedState,n===null||n.memoizedState!==null){if(d=Zr(r),l!==null){if(n===null){if(!d)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[jt]=r}else lr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;lt(r),n=!1}else l=Du(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return r.flags&256?(nn(r),r):(nn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return lt(r),null;case 13:if(d=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=Zr(r),d!==null&&d.dehydrated!==null){if(n===null){if(!m)throw Error(i(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[jt]=r}else lr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;lt(r),m=!1}else m=Du(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(nn(r),r):(nn(r),null)}return nn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=r.child,m=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(m=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==m&&(d.flags|=2048)),l!==n&&l&&(r.child.flags|=8192),uo(r,r.updateQueue),lt(r),null);case 4:return Ge(),n===null&&Kd(r.stateNode.containerInfo),lt(r),null;case 10:return ia(r.type),lt(r),null;case 19:if(Q(ft),d=r.memoizedState,d===null)return lt(r),null;if(m=(r.flags&128)!==0,y=d.rendering,y===null)if(m)fs(d,!1);else{if(dt!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(y=Zl(n),y!==null){for(r.flags|=128,fs(d,!1),n=y.updateQueue,r.updateQueue=n,uo(r,n),r.subtreeFlags=0,n=l,l=r.child;l!==null;)Em(l,n),l=l.sibling;return M(ft,ft.current&1|2),Be&&aa(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Lt()>po&&(r.flags|=128,m=!0,fs(d,!1),r.lanes=4194304)}else{if(!m)if(n=Zl(y),n!==null){if(r.flags|=128,m=!0,n=n.updateQueue,r.updateQueue=n,uo(r,n),fs(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!Be)return lt(r),null}else 2*Lt()-d.renderingStartTime>po&&l!==536870912&&(r.flags|=128,m=!0,fs(d,!1),r.lanes=4194304);d.isBackwards?(y.sibling=r.child,r.child=y):(n=d.last,n!==null?n.sibling=y:r.child=y,d.last=y)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Lt(),n.sibling=null,l=ft.current,M(ft,m?l&1|2:l&1),Be&&aa(r,d.treeForkCount),n):(lt(r),null);case 22:case 23:return nn(r),Fu(),d=r.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(l&536870912)!==0&&(r.flags&128)===0&&(lt(r),r.subtreeFlags&6&&(r.flags|=8192)):lt(r),l=r.updateQueue,l!==null&&uo(r,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==l&&(r.flags|=2048),n!==null&&Q(ur),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),ia(gt),lt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function sS(n,r){switch(Tu(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return ia(gt),Ge(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return En(r),null;case 31:if(r.memoizedState!==null){if(nn(r),r.alternate===null)throw Error(i(340));lr()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(nn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));lr()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return Q(ft),null;case 4:return Ge(),null;case 10:return ia(r.type),null;case 22:case 23:return nn(r),Fu(),n!==null&&Q(ur),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return ia(gt),null;case 25:return null;default:return null}}function t0(n,r){switch(Tu(r),r.tag){case 3:ia(gt),Ge();break;case 26:case 27:case 5:En(r);break;case 4:Ge();break;case 31:r.memoizedState!==null&&nn(r);break;case 13:nn(r);break;case 19:Q(ft);break;case 10:ia(r.type);break;case 22:case 23:nn(r),Fu(),n!==null&&Q(ur);break;case 24:ia(gt)}}function hs(n,r){try{var l=r.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var m=d.next;l=m;do{if((l.tag&n)===n){d=void 0;var y=l.create,k=l.inst;d=y(),k.destroy=d}l=l.next}while(l!==m)}}catch(A){Ze(r,r.return,A)}}function Oa(n,r,l){try{var d=r.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var y=m.next;d=y;do{if((d.tag&n)===n){var k=d.inst,A=k.destroy;if(A!==void 0){k.destroy=void 0,m=r;var O=l,K=A;try{K()}catch(Z){Ze(m,O,Z)}}}d=d.next}while(d!==y)}}catch(Z){Ze(r,r.return,Z)}}function n0(n){var r=n.updateQueue;if(r!==null){var l=n.stateNode;try{Gm(r,l)}catch(d){Ze(n,n.return,d)}}}function a0(n,r,l){l.props=mr(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){Ze(n,r,d)}}function gs(n,r){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(m){Ze(n,r,m)}}function $n(n,r){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(m){Ze(n,r,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(m){Ze(n,r,m)}else l.current=null}function r0(n){var r=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(m){Ze(n,n.return,m)}}function wd(n,r,l){try{var d=n.stateNode;ES(d,n.type,l,r),d[qt]=r}catch(m){Ze(n,n.return,m)}}function i0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&qa(n.type)||n.tag===4}function Sd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||i0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&qa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function jd(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(n),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=ea));else if(d!==4&&(d===27&&qa(n.type)&&(l=n.stateNode,r=null),n=n.child,n!==null))for(jd(n,r,l),n=n.sibling;n!==null;)jd(n,r,l),n=n.sibling}function fo(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?l.insertBefore(n,r):l.appendChild(n);else if(d!==4&&(d===27&&qa(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(fo(n,r,l),n=n.sibling;n!==null;)fo(n,r,l),n=n.sibling}function s0(n){var r=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);Et(r,d,l),r[jt]=n,r[qt]=l}catch(y){Ze(n,n.return,y)}}var ua=!1,yt=!1,Cd=!1,l0=typeof WeakSet=="function"?WeakSet:Set,wt=null;function lS(n,r){if(n=n.containerInfo,Gd=Ro,n=bm(n),xu(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var m=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var k=0,A=-1,O=-1,K=0,Z=0,ae=n,P=null;t:for(;;){for(var Y;ae!==l||m!==0&&ae.nodeType!==3||(A=k+m),ae!==y||d!==0&&ae.nodeType!==3||(O=k+d),ae.nodeType===3&&(k+=ae.nodeValue.length),(Y=ae.firstChild)!==null;)P=ae,ae=Y;for(;;){if(ae===n)break t;if(P===l&&++K===m&&(A=k),P===y&&++Z===d&&(O=k),(Y=ae.nextSibling)!==null)break;ae=P,P=ae.parentNode}ae=Y}l=A===-1||O===-1?null:{start:A,end:O}}else l=null}l=l||{start:0,end:0}}else l=null;for(Vd={focusedElem:n,selectionRange:l},Ro=!1,wt=r;wt!==null;)if(r=wt,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,wt=n;else for(;wt!==null;){switch(r=wt,y=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)m=n[l],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&y!==null){n=void 0,l=r,m=y.memoizedProps,y=y.memoizedState,d=l.stateNode;try{var fe=mr(l.type,m);n=d.getSnapshotBeforeUpdate(fe,y),d.__reactInternalSnapshotBeforeUpdate=n}catch(ve){Ze(l,l.return,ve)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,l=n.nodeType,l===9)Xd(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Xd(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=r.sibling,n!==null){n.return=r.return,wt=n;break}wt=r.return}}function o0(n,r,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:fa(n,l),d&4&&hs(5,l);break;case 1:if(fa(n,l),d&4)if(n=l.stateNode,r===null)try{n.componentDidMount()}catch(k){Ze(l,l.return,k)}else{var m=mr(l.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(m,r,n.__reactInternalSnapshotBeforeUpdate)}catch(k){Ze(l,l.return,k)}}d&64&&n0(l),d&512&&gs(l,l.return);break;case 3:if(fa(n,l),d&64&&(n=l.updateQueue,n!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Gm(n,r)}catch(k){Ze(l,l.return,k)}}break;case 27:r===null&&d&4&&s0(l);case 26:case 5:fa(n,l),r===null&&d&4&&r0(l),d&512&&gs(l,l.return);break;case 12:fa(n,l);break;case 31:fa(n,l),d&4&&d0(n,l);break;case 13:fa(n,l),d&4&&f0(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=pS.bind(null,l),zS(n,l))));break;case 22:if(d=l.memoizedState!==null||ua,!d){r=r!==null&&r.memoizedState!==null||yt,m=ua;var y=yt;ua=d,(yt=r)&&!y?ha(n,l,(l.subtreeFlags&8772)!==0):fa(n,l),ua=m,yt=y}break;case 30:break;default:fa(n,l)}}function c0(n){var r=n.alternate;r!==null&&(n.alternate=null,c0(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&tu(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ot=null,Kt=!1;function da(n,r,l){for(l=l.child;l!==null;)u0(n,r,l),l=l.sibling}function u0(n,r,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(zt,l)}catch{}switch(l.tag){case 26:yt||$n(l,r),da(n,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:yt||$n(l,r);var d=ot,m=Kt;qa(l.type)&&(ot=l.stateNode,Kt=!1),da(n,r,l),Ss(l.stateNode),ot=d,Kt=m;break;case 5:yt||$n(l,r);case 6:if(d=ot,m=Kt,ot=null,da(n,r,l),ot=d,Kt=m,ot!==null)if(Kt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(l.stateNode)}catch(y){Ze(l,r,y)}else try{ot.removeChild(l.stateNode)}catch(y){Ze(l,r,y)}break;case 18:ot!==null&&(Kt?(n=ot,ny(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),xi(n)):ny(ot,l.stateNode));break;case 4:d=ot,m=Kt,ot=l.stateNode.containerInfo,Kt=!0,da(n,r,l),ot=d,Kt=m;break;case 0:case 11:case 14:case 15:Oa(2,l,r),yt||Oa(4,l,r),da(n,r,l);break;case 1:yt||($n(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"&&a0(l,r,d)),da(n,r,l);break;case 21:da(n,r,l);break;case 22:yt=(d=yt)||l.memoizedState!==null,da(n,r,l),yt=d;break;default:da(n,r,l)}}function d0(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{xi(n)}catch(l){Ze(r,r.return,l)}}}function f0(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{xi(n)}catch(l){Ze(r,r.return,l)}}function oS(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new l0),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new l0),r;default:throw Error(i(435,n.tag))}}function ho(n,r){var l=oS(n);r.forEach(function(d){if(!l.has(d)){l.add(d);var m=yS.bind(null,n,d);d.then(m,m)}})}function Ft(n,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var m=l[d],y=n,k=r,A=k;e:for(;A!==null;){switch(A.tag){case 27:if(qa(A.type)){ot=A.stateNode,Kt=!1;break e}break;case 5:ot=A.stateNode,Kt=!1;break e;case 3:case 4:ot=A.stateNode.containerInfo,Kt=!0;break e}A=A.return}if(ot===null)throw Error(i(160));u0(y,k,m),ot=null,Kt=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)h0(r,n),r=r.sibling}var Dn=null;function h0(n,r){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Ft(r,n),Pt(n),d&4&&(Oa(3,n,n.return),hs(3,n),Oa(5,n,n.return));break;case 1:Ft(r,n),Pt(n),d&512&&(yt||l===null||$n(l,l.return)),d&64&&ua&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var m=Dn;if(Ft(r,n),Pt(n),d&512&&(yt||l===null||$n(l,l.return)),d&4){var y=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,m=m.ownerDocument||m;t:switch(d){case"title":y=m.getElementsByTagName("title")[0],(!y||y[qi]||y[jt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(d),m.head.insertBefore(y,m.querySelector("head > title"))),Et(y,d,l),y[jt]=n,kt(y),d=y;break e;case"link":var k=hy("link","href",m).get(d+(l.href||""));if(k){for(var A=0;A<k.length;A++)if(y=k[A],y.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&y.getAttribute("rel")===(l.rel==null?null:l.rel)&&y.getAttribute("title")===(l.title==null?null:l.title)&&y.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){k.splice(A,1);break t}}y=m.createElement(d),Et(y,d,l),m.head.appendChild(y);break;case"meta":if(k=hy("meta","content",m).get(d+(l.content||""))){for(A=0;A<k.length;A++)if(y=k[A],y.getAttribute("content")===(l.content==null?null:""+l.content)&&y.getAttribute("name")===(l.name==null?null:l.name)&&y.getAttribute("property")===(l.property==null?null:l.property)&&y.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&y.getAttribute("charset")===(l.charSet==null?null:l.charSet)){k.splice(A,1);break t}}y=m.createElement(d),Et(y,d,l),m.head.appendChild(y);break;default:throw Error(i(468,d))}y[jt]=n,kt(y),d=y}n.stateNode=d}else gy(m,n.type,n.stateNode);else n.stateNode=fy(m,d,n.memoizedProps);else y!==d?(y===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):y.count--,d===null?gy(m,n.type,n.stateNode):fy(m,d,n.memoizedProps)):d===null&&n.stateNode!==null&&wd(n,n.memoizedProps,l.memoizedProps)}break;case 27:Ft(r,n),Pt(n),d&512&&(yt||l===null||$n(l,l.return)),l!==null&&d&4&&wd(n,n.memoizedProps,l.memoizedProps);break;case 5:if(Ft(r,n),Pt(n),d&512&&(yt||l===null||$n(l,l.return)),n.flags&32){m=n.stateNode;try{qr(m,"")}catch(fe){Ze(n,n.return,fe)}}d&4&&n.stateNode!=null&&(m=n.memoizedProps,wd(n,m,l!==null?l.memoizedProps:m)),d&1024&&(Cd=!0);break;case 6:if(Ft(r,n),Pt(n),d&4){if(n.stateNode===null)throw Error(i(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(fe){Ze(n,n.return,fe)}}break;case 3:if(To=null,m=Dn,Dn=Ao(r.containerInfo),Ft(r,n),Dn=m,Pt(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{xi(r.containerInfo)}catch(fe){Ze(n,n.return,fe)}Cd&&(Cd=!1,g0(n));break;case 4:d=Dn,Dn=Ao(n.stateNode.containerInfo),Ft(r,n),Pt(n),Dn=d;break;case 12:Ft(r,n),Pt(n);break;case 31:Ft(r,n),Pt(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,ho(n,d)));break;case 13:Ft(r,n),Pt(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(mo=Lt()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,ho(n,d)));break;case 22:m=n.memoizedState!==null;var O=l!==null&&l.memoizedState!==null,K=ua,Z=yt;if(ua=K||m,yt=Z||O,Ft(r,n),yt=Z,ua=K,Pt(n),d&8192)e:for(r=n.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,m&&(l===null||O||ua||yt||pr(n)),l=null,r=n;;){if(r.tag===5||r.tag===26){if(l===null){O=l=r;try{if(y=O.stateNode,m)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{A=O.stateNode;var ae=O.memoizedProps.style,P=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;A.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(fe){Ze(O,O.return,fe)}}}else if(r.tag===6){if(l===null){O=r;try{O.stateNode.nodeValue=m?"":O.memoizedProps}catch(fe){Ze(O,O.return,fe)}}}else if(r.tag===18){if(l===null){O=r;try{var Y=O.stateNode;m?ay(Y,!0):ay(O.stateNode,!1)}catch(fe){Ze(O,O.return,fe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,ho(n,l))));break;case 19:Ft(r,n),Pt(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,ho(n,d)));break;case 30:break;case 21:break;default:Ft(r,n),Pt(n)}}function Pt(n){var r=n.flags;if(r&2){try{for(var l,d=n.return;d!==null;){if(i0(d)){l=d;break}d=d.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var m=l.stateNode,y=Sd(n);fo(n,y,m);break;case 5:var k=l.stateNode;l.flags&32&&(qr(k,""),l.flags&=-33);var A=Sd(n);fo(n,A,k);break;case 3:case 4:var O=l.stateNode.containerInfo,K=Sd(n);jd(n,K,O);break;default:throw Error(i(161))}}catch(Z){Ze(n,n.return,Z)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function g0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;g0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function fa(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)o0(n,r.alternate,r),r=r.sibling}function pr(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Oa(4,r,r.return),pr(r);break;case 1:$n(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&a0(r,r.return,l),pr(r);break;case 27:Ss(r.stateNode);case 26:case 5:$n(r,r.return),pr(r);break;case 22:r.memoizedState===null&&pr(r);break;case 30:pr(r);break;default:pr(r)}n=n.sibling}}function ha(n,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,m=n,y=r,k=y.flags;switch(y.tag){case 0:case 11:case 15:ha(m,y,l),hs(4,y);break;case 1:if(ha(m,y,l),d=y,m=d.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(K){Ze(d,d.return,K)}if(d=y,m=d.updateQueue,m!==null){var A=d.stateNode;try{var O=m.shared.hiddenCallbacks;if(O!==null)for(m.shared.hiddenCallbacks=null,m=0;m<O.length;m++)Pm(O[m],A)}catch(K){Ze(d,d.return,K)}}l&&k&64&&n0(y),gs(y,y.return);break;case 27:s0(y);case 26:case 5:ha(m,y,l),l&&d===null&&k&4&&r0(y),gs(y,y.return);break;case 12:ha(m,y,l);break;case 31:ha(m,y,l),l&&k&4&&d0(m,y);break;case 13:ha(m,y,l),l&&k&4&&f0(m,y);break;case 22:y.memoizedState===null&&ha(m,y,l),gs(y,y.return);break;case 30:break;default:ha(m,y,l)}r=r.sibling}}function Nd(n,r){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&es(l))}function Ad(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&es(n))}function _n(n,r,l,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)m0(n,r,l,d),r=r.sibling}function m0(n,r,l,d){var m=r.flags;switch(r.tag){case 0:case 11:case 15:_n(n,r,l,d),m&2048&&hs(9,r);break;case 1:_n(n,r,l,d);break;case 3:_n(n,r,l,d),m&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&es(n)));break;case 12:if(m&2048){_n(n,r,l,d),n=r.stateNode;try{var y=r.memoizedProps,k=y.id,A=y.onPostCommit;typeof A=="function"&&A(k,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(O){Ze(r,r.return,O)}}else _n(n,r,l,d);break;case 31:_n(n,r,l,d);break;case 13:_n(n,r,l,d);break;case 23:break;case 22:y=r.stateNode,k=r.alternate,r.memoizedState!==null?y._visibility&2?_n(n,r,l,d):ms(n,r):y._visibility&2?_n(n,r,l,d):(y._visibility|=2,li(n,r,l,d,(r.subtreeFlags&10256)!==0||!1)),m&2048&&Nd(k,r);break;case 24:_n(n,r,l,d),m&2048&&Ad(r.alternate,r);break;default:_n(n,r,l,d)}}function li(n,r,l,d,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=n,k=r,A=l,O=d,K=k.flags;switch(k.tag){case 0:case 11:case 15:li(y,k,A,O,m),hs(8,k);break;case 23:break;case 22:var Z=k.stateNode;k.memoizedState!==null?Z._visibility&2?li(y,k,A,O,m):ms(y,k):(Z._visibility|=2,li(y,k,A,O,m)),m&&K&2048&&Nd(k.alternate,k);break;case 24:li(y,k,A,O,m),m&&K&2048&&Ad(k.alternate,k);break;default:li(y,k,A,O,m)}r=r.sibling}}function ms(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=n,d=r,m=d.flags;switch(d.tag){case 22:ms(l,d),m&2048&&Nd(d.alternate,d);break;case 24:ms(l,d),m&2048&&Ad(d.alternate,d);break;default:ms(l,d)}r=r.sibling}}var ps=8192;function oi(n,r,l){if(n.subtreeFlags&ps)for(n=n.child;n!==null;)p0(n,r,l),n=n.sibling}function p0(n,r,l){switch(n.tag){case 26:oi(n,r,l),n.flags&ps&&n.memoizedState!==null&&YS(l,Dn,n.memoizedState,n.memoizedProps);break;case 5:oi(n,r,l);break;case 3:case 4:var d=Dn;Dn=Ao(n.stateNode.containerInfo),oi(n,r,l),Dn=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ps,ps=16777216,oi(n,r,l),ps=d):oi(n,r,l));break;default:oi(n,r,l)}}function y0(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function ys(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];wt=d,b0(d,n)}y0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)x0(n),n=n.sibling}function x0(n){switch(n.tag){case 0:case 11:case 15:ys(n),n.flags&2048&&Oa(9,n,n.return);break;case 3:ys(n);break;case 12:ys(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,go(n)):ys(n);break;default:ys(n)}}function go(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];wt=d,b0(d,n)}y0(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Oa(8,r,r.return),go(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,go(r));break;default:go(r)}n=n.sibling}}function b0(n,r){for(;wt!==null;){var l=wt;switch(l.tag){case 0:case 11:case 15:Oa(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:es(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,wt=d;else e:for(l=n;wt!==null;){d=wt;var m=d.sibling,y=d.return;if(c0(d),d===l){wt=null;break e}if(m!==null){m.return=y,wt=m;break e}wt=y}}}var cS={getCacheForType:function(n){var r=Nt(gt),l=r.data.get(n);return l===void 0&&(l=n(),r.data.set(n,l)),l},cacheSignal:function(){return Nt(gt).controller.signal}},uS=typeof WeakMap=="function"?WeakMap:Map,Pe=0,nt=null,Le=null,Ue=0,Xe=0,an=null,La=!1,ci=!1,Ed=!1,ga=0,dt=0,za=0,yr=0,Td=0,rn=0,ui=0,xs=null,Gt=null,Md=!1,mo=0,v0=0,po=1/0,yo=null,Ha=null,vt=0,Ua=null,di=null,ma=0,Dd=0,_d=null,k0=null,bs=0,Rd=null;function sn(){return(Pe&2)!==0&&Ue!==0?Ue&-Ue:B.T!==null?Id():Hg()}function w0(){if(rn===0)if((Ue&536870912)===0||Be){var n=jl;jl<<=1,(jl&3932160)===0&&(jl=262144),rn=n}else rn=536870912;return n=tn.current,n!==null&&(n.flags|=32),rn}function Vt(n,r,l){(n===nt&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)&&(fi(n,0),Ia(n,Ue,rn,!1)),Bi(n,l),((Pe&2)===0||n!==nt)&&(n===nt&&((Pe&2)===0&&(yr|=l),dt===4&&Ia(n,Ue,rn,!1)),Kn(n))}function S0(n,r,l){if((Pe&6)!==0)throw Error(i(327));var d=!l&&(r&127)===0&&(r&n.expiredLanes)===0||Ii(n,r),m=d?hS(n,r):Ld(n,r,!0),y=d;do{if(m===0){ci&&!d&&Ia(n,r,0,!1);break}else{if(l=n.current.alternate,y&&!dS(l)){m=Ld(n,r,!1),y=!1;continue}if(m===2){if(y=r,n.errorRecoveryDisabledLanes&y)var k=0;else k=n.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){r=k;e:{var A=n;m=xs;var O=A.current.memoizedState.isDehydrated;if(O&&(fi(A,k).flags|=256),k=Ld(A,k,!1),k!==2){if(Ed&&!O){A.errorRecoveryDisabledLanes|=y,yr|=y,m=4;break e}y=Gt,Gt=m,y!==null&&(Gt===null?Gt=y:Gt.push.apply(Gt,y))}m=k}if(y=!1,m!==2)continue}}if(m===1){fi(n,0),Ia(n,r,0,!0);break}e:{switch(d=n,y=m,y){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Ia(d,r,rn,!La);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(m=mo+300-Lt(),10<m)){if(Ia(d,r,rn,!La),Nl(d,0,!0)!==0)break e;ma=r,d.timeoutHandle=ey(j0.bind(null,d,l,Gt,yo,Md,r,rn,yr,ui,La,y,"Throttled",-0,0),m);break e}j0(d,l,Gt,yo,Md,r,rn,yr,ui,La,y,null,-0,0)}}break}while(!0);Kn(n)}function j0(n,r,l,d,m,y,k,A,O,K,Z,ae,P,Y){if(n.timeoutHandle=-1,ae=r.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},p0(r,y,ae);var fe=(y&62914560)===y?mo-Lt():(y&4194048)===y?v0-Lt():0;if(fe=QS(ae,fe),fe!==null){ma=y,n.cancelPendingCommit=fe(_0.bind(null,n,r,y,l,d,m,k,A,O,Z,ae,null,P,Y)),Ia(n,y,k,!K);return}}_0(n,r,y,l,d,m,k,A,O)}function dS(n){for(var r=n;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var m=l[d],y=m.getSnapshot;m=m.value;try{if(!Wt(y(),m))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ia(n,r,l,d){r&=~Td,r&=~yr,n.suspendedLanes|=r,n.pingedLanes&=~r,d&&(n.warmLanes|=r),d=n.expirationTimes;for(var m=r;0<m;){var y=31-tt(m),k=1<<y;d[y]=-1,m&=~k}l!==0&&Og(n,l,r)}function xo(){return(Pe&6)===0?(vs(0),!1):!0}function Od(){if(Le!==null){if(Xe===0)var n=Le.return;else n=Le,ra=or=null,Xu(n),ni=null,ns=0,n=Le;for(;n!==null;)t0(n.alternate,n),n=n.return;Le=null}}function fi(n,r){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,DS(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),ma=0,Od(),nt=n,Le=l=na(n.current,null),Ue=r,Xe=0,an=null,La=!1,ci=Ii(n,r),Ed=!1,ui=rn=Td=yr=za=dt=0,Gt=xs=null,Md=!1,(r&8)!==0&&(r|=r&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=r;0<d;){var m=31-tt(d),y=1<<m;r|=n[m],d&=~y}return ga=r,Ul(),l}function C0(n,r){Ce=null,B.H=us,r===ti||r===Gl?(r=qm(),Xe=3):r===Uu?(r=qm(),Xe=4):Xe=r===fd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,an=r,Le===null&&(dt=1,so(n,gn(r,n.current)))}function N0(){var n=tn.current;return n===null?!0:(Ue&4194048)===Ue?xn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?n===xn:!1}function A0(){var n=B.H;return B.H=us,n===null?us:n}function E0(){var n=B.A;return B.A=cS,n}function bo(){dt=4,La||(Ue&4194048)!==Ue&&tn.current!==null||(ci=!0),(za&134217727)===0&&(yr&134217727)===0||nt===null||Ia(nt,Ue,rn,!1)}function Ld(n,r,l){var d=Pe;Pe|=2;var m=A0(),y=E0();(nt!==n||Ue!==r)&&(yo=null,fi(n,r)),r=!1;var k=dt;e:do try{if(Xe!==0&&Le!==null){var A=Le,O=an;switch(Xe){case 8:Od(),k=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(r=!0);var K=Xe;if(Xe=0,an=null,hi(n,A,O,K),l&&ci){k=0;break e}break;default:K=Xe,Xe=0,an=null,hi(n,A,O,K)}}fS(),k=dt;break}catch(Z){C0(n,Z)}while(!0);return r&&n.shellSuspendCounter++,ra=or=null,Pe=d,B.H=m,B.A=y,Le===null&&(nt=null,Ue=0,Ul()),k}function fS(){for(;Le!==null;)T0(Le)}function hS(n,r){var l=Pe;Pe|=2;var d=A0(),m=E0();nt!==n||Ue!==r?(yo=null,po=Lt()+500,fi(n,r)):ci=Ii(n,r);e:do try{if(Xe!==0&&Le!==null){r=Le;var y=an;t:switch(Xe){case 1:Xe=0,an=null,hi(n,r,y,1);break;case 2:case 9:if(Im(y)){Xe=0,an=null,M0(r);break}r=function(){Xe!==2&&Xe!==9||nt!==n||(Xe=7),Kn(n)},y.then(r,r);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Im(y)?(Xe=0,an=null,M0(r)):(Xe=0,an=null,hi(n,r,y,7));break;case 5:var k=null;switch(Le.tag){case 26:k=Le.memoizedState;case 5:case 27:var A=Le;if(k?my(k):A.stateNode.complete){Xe=0,an=null;var O=A.sibling;if(O!==null)Le=O;else{var K=A.return;K!==null?(Le=K,vo(K)):Le=null}break t}}Xe=0,an=null,hi(n,r,y,5);break;case 6:Xe=0,an=null,hi(n,r,y,6);break;case 8:Od(),dt=6;break e;default:throw Error(i(462))}}gS();break}catch(Z){C0(n,Z)}while(!0);return ra=or=null,B.H=d,B.A=m,Pe=l,Le!==null?0:(nt=null,Ue=0,Ul(),dt)}function gS(){for(;Le!==null&&!Yc();)T0(Le)}function T0(n){var r=Wp(n.alternate,n,ga);n.memoizedProps=n.pendingProps,r===null?vo(n):Le=r}function M0(n){var r=n,l=r.alternate;switch(r.tag){case 15:case 0:r=Vp(l,r,r.pendingProps,r.type,void 0,Ue);break;case 11:r=Vp(l,r,r.pendingProps,r.type.render,r.ref,Ue);break;case 5:Xu(r);default:t0(l,r),r=Le=Em(r,ga),r=Wp(l,r,ga)}n.memoizedProps=n.pendingProps,r===null?vo(n):Le=r}function hi(n,r,l,d){ra=or=null,Xu(r),ni=null,ns=0;var m=r.return;try{if(nS(n,m,r,l,Ue)){dt=1,so(n,gn(l,n.current)),Le=null;return}}catch(y){if(m!==null)throw Le=m,y;dt=1,so(n,gn(l,n.current)),Le=null;return}r.flags&32768?(Be||d===1?n=!0:ci||(Ue&536870912)!==0?n=!1:(La=n=!0,(d===2||d===9||d===3||d===6)&&(d=tn.current,d!==null&&d.tag===13&&(d.flags|=16384))),D0(r,n)):vo(r)}function vo(n){var r=n;do{if((r.flags&32768)!==0){D0(r,La);return}n=r.return;var l=iS(r.alternate,r,ga);if(l!==null){Le=l;return}if(r=r.sibling,r!==null){Le=r;return}Le=r=n}while(r!==null);dt===0&&(dt=5)}function D0(n,r){do{var l=sS(n.alternate,n);if(l!==null){l.flags&=32767,Le=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(n=n.sibling,n!==null)){Le=n;return}Le=n=l}while(n!==null);dt=6,Le=null}function _0(n,r,l,d,m,y,k,A,O){n.cancelPendingCommit=null;do ko();while(vt!==0);if((Pe&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));if(y=r.lanes|r.childLanes,y|=Su,Vk(n,l,y,k,A,O),n===nt&&(Le=nt=null,Ue=0),di=r,Ua=n,ma=l,Dd=y,_d=m,k0=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,xS(we,function(){return H0(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=B.T,B.T=null,m=ee.p,ee.p=2,k=Pe,Pe|=4;try{lS(n,r,l)}finally{Pe=k,ee.p=m,B.T=d}}vt=1,R0(),O0(),L0()}}function R0(){if(vt===1){vt=0;var n=Ua,r=di,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var d=ee.p;ee.p=2;var m=Pe;Pe|=4;try{h0(r,n);var y=Vd,k=bm(n.containerInfo),A=y.focusedElem,O=y.selectionRange;if(k!==A&&A&&A.ownerDocument&&xm(A.ownerDocument.documentElement,A)){if(O!==null&&xu(A)){var K=O.start,Z=O.end;if(Z===void 0&&(Z=K),"selectionStart"in A)A.selectionStart=K,A.selectionEnd=Math.min(Z,A.value.length);else{var ae=A.ownerDocument||document,P=ae&&ae.defaultView||window;if(P.getSelection){var Y=P.getSelection(),fe=A.textContent.length,ve=Math.min(O.start,fe),et=O.end===void 0?ve:Math.min(O.end,fe);!Y.extend&&ve>et&&(k=et,et=ve,ve=k);var I=ym(A,ve),H=ym(A,et);if(I&&H&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var $=ae.createRange();$.setStart(I.node,I.offset),Y.removeAllRanges(),ve>et?(Y.addRange($),Y.extend(H.node,H.offset)):($.setEnd(H.node,H.offset),Y.addRange($))}}}}for(ae=[],Y=A;Y=Y.parentNode;)Y.nodeType===1&&ae.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ae.length;A++){var ne=ae[A];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Ro=!!Gd,Vd=Gd=null}finally{Pe=m,ee.p=d,B.T=l}}n.current=r,vt=2}}function O0(){if(vt===2){vt=0;var n=Ua,r=di,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var d=ee.p;ee.p=2;var m=Pe;Pe|=4;try{o0(n,r.alternate,r)}finally{Pe=m,ee.p=d,B.T=l}}vt=3}}function L0(){if(vt===4||vt===3){vt=0,Qc();var n=Ua,r=di,l=ma,d=k0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?vt=5:(vt=0,di=Ua=null,z0(n,n.pendingLanes));var m=n.pendingLanes;if(m===0&&(Ha=null),Wc(l),r=r.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(zt,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=B.T,m=ee.p,ee.p=2,B.T=null;try{for(var y=n.onRecoverableError,k=0;k<d.length;k++){var A=d[k];y(A.value,{componentStack:A.stack})}}finally{B.T=r,ee.p=m}}(ma&3)!==0&&ko(),Kn(n),m=n.pendingLanes,(l&261930)!==0&&(m&42)!==0?n===Rd?bs++:(bs=0,Rd=n):bs=0,vs(0)}}function z0(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,es(r)))}function ko(){return R0(),O0(),L0(),H0()}function H0(){if(vt!==5)return!1;var n=Ua,r=Dd;Dd=0;var l=Wc(ma),d=B.T,m=ee.p;try{ee.p=32>l?32:l,B.T=null,l=_d,_d=null;var y=Ua,k=ma;if(vt=0,di=Ua=null,ma=0,(Pe&6)!==0)throw Error(i(331));var A=Pe;if(Pe|=4,x0(y.current),m0(y,y.current,k,l),Pe=A,vs(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(zt,y)}catch{}return!0}finally{ee.p=m,B.T=d,z0(n,r)}}function U0(n,r,l){r=gn(l,r),r=dd(n.stateNode,r,2),n=Da(n,r,2),n!==null&&(Bi(n,2),Kn(n))}function Ze(n,r,l){if(n.tag===3)U0(n,n,l);else for(;r!==null;){if(r.tag===3){U0(r,n,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ha===null||!Ha.has(d))){n=gn(l,n),l=Ip(2),d=Da(r,l,2),d!==null&&(Bp(l,d,r,n),Bi(d,2),Kn(d));break}}r=r.return}}function zd(n,r,l){var d=n.pingCache;if(d===null){d=n.pingCache=new uS;var m=new Set;d.set(r,m)}else m=d.get(r),m===void 0&&(m=new Set,d.set(r,m));m.has(l)||(Ed=!0,m.add(l),n=mS.bind(null,n,r,l),r.then(n,n))}function mS(n,r,l){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,nt===n&&(Ue&l)===l&&(dt===4||dt===3&&(Ue&62914560)===Ue&&300>Lt()-mo?(Pe&2)===0&&fi(n,0):Td|=l,ui===Ue&&(ui=0)),Kn(n)}function I0(n,r){r===0&&(r=Rg()),n=ir(n,r),n!==null&&(Bi(n,r),Kn(n))}function pS(n){var r=n.memoizedState,l=0;r!==null&&(l=r.retryLane),I0(n,l)}function yS(n,r){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,m=n.memoizedState;m!==null&&(l=m.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(i(314))}d!==null&&d.delete(r),I0(n,l)}function xS(n,r){return Or(n,r)}var wo=null,gi=null,Hd=!1,So=!1,Ud=!1,Ba=0;function Kn(n){n!==gi&&n.next===null&&(gi===null?wo=gi=n:gi=gi.next=n),So=!0,Hd||(Hd=!0,vS())}function vs(n,r){if(!Ud&&So){Ud=!0;do for(var l=!1,d=wo;d!==null;){if(n!==0){var m=d.pendingLanes;if(m===0)var y=0;else{var k=d.suspendedLanes,A=d.pingedLanes;y=(1<<31-tt(42|n)+1)-1,y&=m&~(k&~A),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,K0(d,y))}else y=Ue,y=Nl(d,d===nt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Ii(d,y)||(l=!0,K0(d,y));d=d.next}while(l);Ud=!1}}function bS(){B0()}function B0(){So=Hd=!1;var n=0;Ba!==0&&MS()&&(n=Ba);for(var r=Lt(),l=null,d=wo;d!==null;){var m=d.next,y=q0(d,r);y===0?(d.next=null,l===null?wo=m:l.next=m,m===null&&(gi=l)):(l=d,(n!==0||(y&3)!==0)&&(So=!0)),d=m}vt!==0&&vt!==5||vs(n),Ba!==0&&(Ba=0)}function q0(n,r){for(var l=n.suspendedLanes,d=n.pingedLanes,m=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var k=31-tt(y),A=1<<k,O=m[k];O===-1?((A&l)===0||(A&d)!==0)&&(m[k]=Gk(A,r)):O<=r&&(n.expiredLanes|=A),y&=~A}if(r=nt,l=Ue,l=Nl(n,n===r?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===r&&(Xe===2||Xe===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Ui(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Ii(n,l)){if(r=l&-l,r===n.callbackPriority)return r;switch(d!==null&&Ui(d),Wc(l)){case 2:case 8:l=oe;break;case 32:l=we;break;case 268435456:l=Ve;break;default:l=we}return d=$0.bind(null,n),l=Or(l,d),n.callbackPriority=r,n.callbackNode=l,r}return d!==null&&d!==null&&Ui(d),n.callbackPriority=2,n.callbackNode=null,2}function $0(n,r){if(vt!==0&&vt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(ko()&&n.callbackNode!==l)return null;var d=Ue;return d=Nl(n,n===nt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(S0(n,d,r),q0(n,Lt()),n.callbackNode!=null&&n.callbackNode===l?$0.bind(null,n):null)}function K0(n,r){if(ko())return null;S0(n,r,!0)}function vS(){_S(function(){(Pe&6)!==0?Or(te,bS):B0()})}function Id(){if(Ba===0){var n=Wr;n===0&&(n=Sl,Sl<<=1,(Sl&261888)===0&&(Sl=256)),Ba=n}return Ba}function F0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ml(""+n)}function P0(n,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,n.id&&l.setAttribute("form",n.id),r.parentNode.insertBefore(l,r),n=new FormData(n),l.parentNode.removeChild(l),n}function kS(n,r,l,d,m){if(r==="submit"&&l&&l.stateNode===m){var y=F0((m[qt]||null).action),k=d.submitter;k&&(r=(r=k[qt]||null)?F0(r.formAction):k.getAttribute("formAction"),r!==null&&(y=r,k=null));var A=new Ol("action","action",null,d,m);n.push({event:A,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Ba!==0){var O=k?P0(m,k):new FormData(m);id(l,{pending:!0,data:O,method:m.method,action:y},null,O)}}else typeof y=="function"&&(A.preventDefault(),O=k?P0(m,k):new FormData(m),id(l,{pending:!0,data:O,method:m.method,action:y},y,O))},currentTarget:m}]})}}for(var Bd=0;Bd<wu.length;Bd++){var qd=wu[Bd],wS=qd.toLowerCase(),SS=qd[0].toUpperCase()+qd.slice(1);Mn(wS,"on"+SS)}Mn(wm,"onAnimationEnd"),Mn(Sm,"onAnimationIteration"),Mn(jm,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(Iw,"onTransitionRun"),Mn(Bw,"onTransitionStart"),Mn(qw,"onTransitionCancel"),Mn(Cm,"onTransitionEnd"),Ir("onMouseEnter",["mouseout","mouseover"]),Ir("onMouseLeave",["mouseout","mouseover"]),Ir("onPointerEnter",["pointerout","pointerover"]),Ir("onPointerLeave",["pointerout","pointerover"]),tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ks="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(" "),jS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ks));function G0(n,r){r=(r&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],m=d.event;d=d.listeners;e:{var y=void 0;if(r)for(var k=d.length-1;0<=k;k--){var A=d[k],O=A.instance,K=A.currentTarget;if(A=A.listener,O!==y&&m.isPropagationStopped())break e;y=A,m.currentTarget=K;try{y(m)}catch(Z){Hl(Z)}m.currentTarget=null,y=O}else for(k=0;k<d.length;k++){if(A=d[k],O=A.instance,K=A.currentTarget,A=A.listener,O!==y&&m.isPropagationStopped())break e;y=A,m.currentTarget=K;try{y(m)}catch(Z){Hl(Z)}m.currentTarget=null,y=O}}}}function ze(n,r){var l=r[eu];l===void 0&&(l=r[eu]=new Set);var d=n+"__bubble";l.has(d)||(V0(r,n,2,!1),l.add(d))}function $d(n,r,l){var d=0;r&&(d|=4),V0(l,n,d,r)}var jo="_reactListening"+Math.random().toString(36).slice(2);function Kd(n){if(!n[jo]){n[jo]=!0,Bg.forEach(function(l){l!=="selectionchange"&&(jS.has(l)||$d(l,!1,n),$d(l,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[jo]||(r[jo]=!0,$d("selectionchange",!1,r))}}function V0(n,r,l,d){switch(wy(r)){case 2:var m=JS;break;case 8:m=WS;break;default:m=rf}l=m.bind(null,r,l,n),m=void 0,!cu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),d?m!==void 0?n.addEventListener(r,l,{capture:!0,passive:m}):n.addEventListener(r,l,!0):m!==void 0?n.addEventListener(r,l,{passive:m}):n.addEventListener(r,l,!1)}function Fd(n,r,l,d,m){var y=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var k=d.tag;if(k===3||k===4){var A=d.stateNode.containerInfo;if(A===m)break;if(k===4)for(k=d.return;k!==null;){var O=k.tag;if((O===3||O===4)&&k.stateNode.containerInfo===m)return;k=k.return}for(;A!==null;){if(k=zr(A),k===null)return;if(O=k.tag,O===5||O===6||O===26||O===27){d=y=k;continue e}A=A.parentNode}}d=d.return}Jg(function(){var K=y,Z=lu(l),ae=[];e:{var P=Nm.get(n);if(P!==void 0){var Y=Ol,fe=n;switch(n){case"keypress":if(_l(l)===0)break e;case"keydown":case"keyup":Y=yw;break;case"focusin":fe="focus",Y=hu;break;case"focusout":fe="blur",Y=hu;break;case"beforeblur":case"afterblur":Y=hu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=tm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=iw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=vw;break;case wm:case Sm:case jm:Y=ow;break;case Cm:Y=ww;break;case"scroll":case"scrollend":Y=aw;break;case"wheel":Y=jw;break;case"copy":case"cut":case"paste":Y=uw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=am;break;case"toggle":case"beforetoggle":Y=Nw}var ve=(r&4)!==0,et=!ve&&(n==="scroll"||n==="scrollend"),I=ve?P!==null?P+"Capture":null:P;ve=[];for(var H=K,$;H!==null;){var ne=H;if($=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||$===null||I===null||(ne=Ki(H,I),ne!=null&&ve.push(ws(H,ne,$))),et)break;H=H.return}0<ve.length&&(P=new Y(P,fe,null,l,Z),ae.push({event:P,listeners:ve}))}}if((r&7)===0){e:{if(P=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",P&&l!==su&&(fe=l.relatedTarget||l.fromElement)&&(zr(fe)||fe[Lr]))break e;if((Y||P)&&(P=Z.window===Z?Z:(P=Z.ownerDocument)?P.defaultView||P.parentWindow:window,Y?(fe=l.relatedTarget||l.toElement,Y=K,fe=fe?zr(fe):null,fe!==null&&(et=o(fe),ve=fe.tag,fe!==et||ve!==5&&ve!==27&&ve!==6)&&(fe=null)):(Y=null,fe=K),Y!==fe)){if(ve=tm,ne="onMouseLeave",I="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(ve=am,ne="onPointerLeave",I="onPointerEnter",H="pointer"),et=Y==null?P:$i(Y),$=fe==null?P:$i(fe),P=new ve(ne,H+"leave",Y,l,Z),P.target=et,P.relatedTarget=$,ne=null,zr(Z)===K&&(ve=new ve(I,H+"enter",fe,l,Z),ve.target=$,ve.relatedTarget=et,ne=ve),et=ne,Y&&fe)t:{for(ve=CS,I=Y,H=fe,$=0,ne=I;ne;ne=ve(ne))$++;ne=0;for(var xe=H;xe;xe=ve(xe))ne++;for(;0<$-ne;)I=ve(I),$--;for(;0<ne-$;)H=ve(H),ne--;for(;$--;){if(I===H||H!==null&&I===H.alternate){ve=I;break t}I=ve(I),H=ve(H)}ve=null}else ve=null;Y!==null&&Y0(ae,P,Y,ve,!1),fe!==null&&et!==null&&Y0(ae,et,fe,ve,!0)}}e:{if(P=K?$i(K):window,Y=P.nodeName&&P.nodeName.toLowerCase(),Y==="select"||Y==="input"&&P.type==="file")var $e=dm;else if(cm(P))if(fm)$e=zw;else{$e=Ow;var ge=Rw}else Y=P.nodeName,!Y||Y.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?K&&iu(K.elementType)&&($e=dm):$e=Lw;if($e&&($e=$e(n,K))){um(ae,$e,l,Z);break e}ge&&ge(n,P,K),n==="focusout"&&K&&P.type==="number"&&K.memoizedProps.value!=null&&ru(P,"number",P.value)}switch(ge=K?$i(K):window,n){case"focusin":(cm(ge)||ge.contentEditable==="true")&&(Pr=ge,bu=K,Zi=null);break;case"focusout":Zi=bu=Pr=null;break;case"mousedown":vu=!0;break;case"contextmenu":case"mouseup":case"dragend":vu=!1,vm(ae,l,Z);break;case"selectionchange":if(Uw)break;case"keydown":case"keyup":vm(ae,l,Z)}var Ae;if(mu)e:{switch(n){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Fr?lm(n,l)&&(Ie="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Ie="onCompositionStart");Ie&&(rm&&l.locale!=="ko"&&(Fr||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Fr&&(Ae=Wg()):(ja=Z,uu="value"in ja?ja.value:ja.textContent,Fr=!0)),ge=Co(K,Ie),0<ge.length&&(Ie=new nm(Ie,n,null,l,Z),ae.push({event:Ie,listeners:ge}),Ae?Ie.data=Ae:(Ae=om(l),Ae!==null&&(Ie.data=Ae)))),(Ae=Ew?Tw(n,l):Mw(n,l))&&(Ie=Co(K,"onBeforeInput"),0<Ie.length&&(ge=new nm("onBeforeInput","beforeinput",null,l,Z),ae.push({event:ge,listeners:Ie}),ge.data=Ae)),kS(ae,n,K,l,Z)}G0(ae,r)})}function ws(n,r,l){return{instance:n,listener:r,currentTarget:l}}function Co(n,r){for(var l=r+"Capture",d=[];n!==null;){var m=n,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Ki(n,l),m!=null&&d.unshift(ws(n,m,y)),m=Ki(n,r),m!=null&&d.push(ws(n,m,y))),n.tag===3)return d;n=n.return}return[]}function CS(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Y0(n,r,l,d,m){for(var y=r._reactName,k=[];l!==null&&l!==d;){var A=l,O=A.alternate,K=A.stateNode;if(A=A.tag,O!==null&&O===d)break;A!==5&&A!==26&&A!==27||K===null||(O=K,m?(K=Ki(l,y),K!=null&&k.unshift(ws(l,K,O))):m||(K=Ki(l,y),K!=null&&k.push(ws(l,K,O)))),l=l.return}k.length!==0&&n.push({event:r,listeners:k})}var NS=/\r\n?/g,AS=/\u0000|\uFFFD/g;function Q0(n){return(typeof n=="string"?n:""+n).replace(NS,`
|
|
50
|
-
`).replace(AS,"")}function X0(n,r){return r=Q0(r),Q0(n)===r}function We(n,r,l,d,m,y){switch(l){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||qr(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&qr(n,""+d);break;case"className":El(n,"class",d);break;case"tabIndex":El(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":El(n,l,d);break;case"style":Xg(n,d,y);break;case"data":if(r!=="object"){El(n,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ml(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(r!=="input"&&We(n,r,"name",m.name,m,null),We(n,r,"formEncType",m.formEncType,m,null),We(n,r,"formMethod",m.formMethod,m,null),We(n,r,"formTarget",m.formTarget,m,null)):(We(n,r,"encType",m.encType,m,null),We(n,r,"method",m.method,m,null),We(n,r,"target",m.target,m,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Ml(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=ea);break;case"onScroll":d!=null&&ze("scroll",n);break;case"onScrollEnd":d!=null&&ze("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(l=d.__html,l!=null){if(m.children!=null)throw Error(i(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=Ml(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":ze("beforetoggle",n),ze("toggle",n),Al(n,"popover",d);break;case"xlinkActuate":Wn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Wn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Wn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Wn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Wn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Wn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Wn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Al(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=tw.get(l)||l,Al(n,l,d))}}function Pd(n,r,l,d,m,y){switch(l){case"style":Xg(n,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(l=d.__html,l!=null){if(m.children!=null)throw Error(i(60));n.innerHTML=l}}break;case"children":typeof d=="string"?qr(n,d):(typeof d=="number"||typeof d=="bigint")&&qr(n,""+d);break;case"onScroll":d!=null&&ze("scroll",n);break;case"onScrollEnd":d!=null&&ze("scrollend",n);break;case"onClick":d!=null&&(n.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qg.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(m=l.endsWith("Capture"),r=l.slice(2,m?l.length-7:void 0),y=n[qt]||null,y=y!=null?y[l]:null,typeof y=="function"&&n.removeEventListener(r,y,m),typeof d=="function")){typeof y!="function"&&y!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(r,d,m);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):Al(n,l,d)}}}function Et(n,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",n),ze("load",n);var d=!1,m=!1,y;for(y in l)if(l.hasOwnProperty(y)){var k=l[y];if(k!=null)switch(y){case"src":d=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:We(n,r,y,k,l,null)}}m&&We(n,r,"srcSet",l.srcSet,l,null),d&&We(n,r,"src",l.src,l,null);return;case"input":ze("invalid",n);var A=y=k=m=null,O=null,K=null;for(d in l)if(l.hasOwnProperty(d)){var Z=l[d];if(Z!=null)switch(d){case"name":m=Z;break;case"type":k=Z;break;case"checked":O=Z;break;case"defaultChecked":K=Z;break;case"value":y=Z;break;case"defaultValue":A=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,r));break;default:We(n,r,d,Z,l,null)}}Gg(n,y,A,O,K,k,m,!1);return;case"select":ze("invalid",n),d=k=y=null;for(m in l)if(l.hasOwnProperty(m)&&(A=l[m],A!=null))switch(m){case"value":y=A;break;case"defaultValue":k=A;break;case"multiple":d=A;default:We(n,r,m,A,l,null)}r=y,l=k,n.multiple=!!d,r!=null?Br(n,!!d,r,!1):l!=null&&Br(n,!!d,l,!0);return;case"textarea":ze("invalid",n),y=m=d=null;for(k in l)if(l.hasOwnProperty(k)&&(A=l[k],A!=null))switch(k){case"value":d=A;break;case"defaultValue":m=A;break;case"children":y=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(91));break;default:We(n,r,k,A,l,null)}Yg(n,d,m,y);return;case"option":for(O in l)if(l.hasOwnProperty(O)&&(d=l[O],d!=null))switch(O){case"selected":n.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:We(n,r,O,d,l,null)}return;case"dialog":ze("beforetoggle",n),ze("toggle",n),ze("cancel",n),ze("close",n);break;case"iframe":case"object":ze("load",n);break;case"video":case"audio":for(d=0;d<ks.length;d++)ze(ks[d],n);break;case"image":ze("error",n),ze("load",n);break;case"details":ze("toggle",n);break;case"embed":case"source":case"link":ze("error",n),ze("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in l)if(l.hasOwnProperty(K)&&(d=l[K],d!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:We(n,r,K,d,l,null)}return;default:if(iu(r)){for(Z in l)l.hasOwnProperty(Z)&&(d=l[Z],d!==void 0&&Pd(n,r,Z,d,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(d=l[A],d!=null&&We(n,r,A,d,l,null))}function ES(n,r,l,d){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,k=null,A=null,O=null,K=null,Z=null;for(Y in l){var ae=l[Y];if(l.hasOwnProperty(Y)&&ae!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":O=ae;default:d.hasOwnProperty(Y)||We(n,r,Y,null,d,ae)}}for(var P in d){var Y=d[P];if(ae=l[P],d.hasOwnProperty(P)&&(Y!=null||ae!=null))switch(P){case"type":y=Y;break;case"name":m=Y;break;case"checked":K=Y;break;case"defaultChecked":Z=Y;break;case"value":k=Y;break;case"defaultValue":A=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,r));break;default:Y!==ae&&We(n,r,P,Y,d,ae)}}au(n,k,A,O,K,Z,y,m);return;case"select":Y=k=A=P=null;for(y in l)if(O=l[y],l.hasOwnProperty(y)&&O!=null)switch(y){case"value":break;case"multiple":Y=O;default:d.hasOwnProperty(y)||We(n,r,y,null,d,O)}for(m in d)if(y=d[m],O=l[m],d.hasOwnProperty(m)&&(y!=null||O!=null))switch(m){case"value":P=y;break;case"defaultValue":A=y;break;case"multiple":k=y;default:y!==O&&We(n,r,m,y,d,O)}r=A,l=k,d=Y,P!=null?Br(n,!!l,P,!1):!!d!=!!l&&(r!=null?Br(n,!!l,r,!0):Br(n,!!l,l?[]:"",!1));return;case"textarea":Y=P=null;for(A in l)if(m=l[A],l.hasOwnProperty(A)&&m!=null&&!d.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:We(n,r,A,null,d,m)}for(k in d)if(m=d[k],y=l[k],d.hasOwnProperty(k)&&(m!=null||y!=null))switch(k){case"value":P=m;break;case"defaultValue":Y=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==y&&We(n,r,k,m,d,y)}Vg(n,P,Y);return;case"option":for(var fe in l)if(P=l[fe],l.hasOwnProperty(fe)&&P!=null&&!d.hasOwnProperty(fe))switch(fe){case"selected":n.selected=!1;break;default:We(n,r,fe,null,d,P)}for(O in d)if(P=d[O],Y=l[O],d.hasOwnProperty(O)&&P!==Y&&(P!=null||Y!=null))switch(O){case"selected":n.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:We(n,r,O,P,d,Y)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in l)P=l[ve],l.hasOwnProperty(ve)&&P!=null&&!d.hasOwnProperty(ve)&&We(n,r,ve,null,d,P);for(K in d)if(P=d[K],Y=l[K],d.hasOwnProperty(K)&&P!==Y&&(P!=null||Y!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,r));break;default:We(n,r,K,P,d,Y)}return;default:if(iu(r)){for(var et in l)P=l[et],l.hasOwnProperty(et)&&P!==void 0&&!d.hasOwnProperty(et)&&Pd(n,r,et,void 0,d,P);for(Z in d)P=d[Z],Y=l[Z],!d.hasOwnProperty(Z)||P===Y||P===void 0&&Y===void 0||Pd(n,r,Z,P,d,Y);return}}for(var I in l)P=l[I],l.hasOwnProperty(I)&&P!=null&&!d.hasOwnProperty(I)&&We(n,r,I,null,d,P);for(ae in d)P=d[ae],Y=l[ae],!d.hasOwnProperty(ae)||P===Y||P==null&&Y==null||We(n,r,ae,P,d,Y)}function Z0(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TS(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var m=l[d],y=m.transferSize,k=m.initiatorType,A=m.duration;if(y&&A&&Z0(k)){for(k=0,A=m.responseEnd,d+=1;d<l.length;d++){var O=l[d],K=O.startTime;if(K>A)break;var Z=O.transferSize,ae=O.initiatorType;Z&&Z0(ae)&&(O=O.responseEnd,k+=Z*(O<A?1:(A-K)/(O-K)))}if(--d,r+=8*(y+k)/(m.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Gd=null,Vd=null;function No(n){return n.nodeType===9?n:n.ownerDocument}function J0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function W0(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Yd(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Qd=null;function MS(){var n=window.event;return n&&n.type==="popstate"?n===Qd?!1:(Qd=n,!0):(Qd=null,!1)}var ey=typeof setTimeout=="function"?setTimeout:void 0,DS=typeof clearTimeout=="function"?clearTimeout:void 0,ty=typeof Promise=="function"?Promise:void 0,_S=typeof queueMicrotask=="function"?queueMicrotask:typeof ty<"u"?function(n){return ty.resolve(null).then(n).catch(RS)}:ey;function RS(n){setTimeout(function(){throw n})}function qa(n){return n==="head"}function ny(n,r){var l=r,d=0;do{var m=l.nextSibling;if(n.removeChild(l),m&&m.nodeType===8)if(l=m.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(m),xi(r);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Ss(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,Ss(l);for(var y=l.firstChild;y;){var k=y.nextSibling,A=y.nodeName;y[qi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=k}}else l==="body"&&Ss(n.ownerDocument.body);l=m}while(l);xi(r)}function ay(n,r){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function Xd(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Xd(l),tu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function OS(n,r,l,d){for(;n.nodeType===1;){var m=l;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[qi])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=bn(n.nextSibling),n===null)break}return null}function LS(n,r,l){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=bn(n.nextSibling),n===null))return null;return n}function ry(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=bn(n.nextSibling),n===null))return null;return n}function Zd(n){return n.data==="$?"||n.data==="$~"}function Jd(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function zS(n,r){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||l.readyState!=="loading")r();else{var d=function(){r(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function bn(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Wd=null;function iy(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(r===0)return bn(n.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}n=n.nextSibling}return null}function sy(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return n;r--}else l!=="/$"&&l!=="/&"||r++}n=n.previousSibling}return null}function ly(n,r,l){switch(r=No(l),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Ss(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);tu(n)}var vn=new Map,oy=new Set;function Ao(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var pa=ee.d;ee.d={f:HS,r:US,D:IS,C:BS,L:qS,m:$S,X:FS,S:KS,M:PS};function HS(){var n=pa.f(),r=xo();return n||r}function US(n){var r=Hr(n);r!==null&&r.tag===5&&r.type==="form"?Cp(r):pa.r(n)}var mi=typeof document>"u"?null:document;function cy(n,r,l){var d=mi;if(d&&typeof r=="string"&&r){var m=fn(r);m='link[rel="'+n+'"][href="'+m+'"]',typeof l=="string"&&(m+='[crossorigin="'+l+'"]'),oy.has(m)||(oy.add(m),n={rel:n,crossOrigin:l,href:r},d.querySelector(m)===null&&(r=d.createElement("link"),Et(r,"link",n),kt(r),d.head.appendChild(r)))}}function IS(n){pa.D(n),cy("dns-prefetch",n,null)}function BS(n,r){pa.C(n,r),cy("preconnect",n,r)}function qS(n,r,l){pa.L(n,r,l);var d=mi;if(d&&n&&r){var m='link[rel="preload"][as="'+fn(r)+'"]';r==="image"&&l&&l.imageSrcSet?(m+='[imagesrcset="'+fn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(m+='[imagesizes="'+fn(l.imageSizes)+'"]')):m+='[href="'+fn(n)+'"]';var y=m;switch(r){case"style":y=pi(n);break;case"script":y=yi(n)}vn.has(y)||(n=p({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:n,as:r},l),vn.set(y,n),d.querySelector(m)!==null||r==="style"&&d.querySelector(js(y))||r==="script"&&d.querySelector(Cs(y))||(r=d.createElement("link"),Et(r,"link",n),kt(r),d.head.appendChild(r)))}}function $S(n,r){pa.m(n,r);var l=mi;if(l&&n){var d=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+fn(d)+'"][href="'+fn(n)+'"]',y=m;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yi(n)}if(!vn.has(y)&&(n=p({rel:"modulepreload",href:n},r),vn.set(y,n),l.querySelector(m)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Cs(y)))return}d=l.createElement("link"),Et(d,"link",n),kt(d),l.head.appendChild(d)}}}function KS(n,r,l){pa.S(n,r,l);var d=mi;if(d&&n){var m=Ur(d).hoistableStyles,y=pi(n);r=r||"default";var k=m.get(y);if(!k){var A={loading:0,preload:null};if(k=d.querySelector(js(y)))A.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":r},l),(l=vn.get(y))&&ef(n,l);var O=k=d.createElement("link");kt(O),Et(O,"link",n),O._p=new Promise(function(K,Z){O.onload=K,O.onerror=Z}),O.addEventListener("load",function(){A.loading|=1}),O.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Eo(k,r,d)}k={type:"stylesheet",instance:k,count:1,state:A},m.set(y,k)}}}function FS(n,r){pa.X(n,r);var l=mi;if(l&&n){var d=Ur(l).hoistableScripts,m=yi(n),y=d.get(m);y||(y=l.querySelector(Cs(m)),y||(n=p({src:n,async:!0},r),(r=vn.get(m))&&tf(n,r),y=l.createElement("script"),kt(y),Et(y,"link",n),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(m,y))}}function PS(n,r){pa.M(n,r);var l=mi;if(l&&n){var d=Ur(l).hoistableScripts,m=yi(n),y=d.get(m);y||(y=l.querySelector(Cs(m)),y||(n=p({src:n,async:!0,type:"module"},r),(r=vn.get(m))&&tf(n,r),y=l.createElement("script"),kt(y),Et(y,"link",n),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(m,y))}}function uy(n,r,l,d){var m=(m=ye.current)?Ao(m):null;if(!m)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=pi(l.href),l=Ur(m).hoistableStyles,d=l.get(r),d||(d={type:"style",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=pi(l.href);var y=Ur(m).hoistableStyles,k=y.get(n);if(k||(m=m.ownerDocument||m,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,k),(y=m.querySelector(js(n)))&&!y._p&&(k.instance=y,k.state.loading=5),vn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},vn.set(n,l),y||GS(m,n,l,k.state))),r&&d===null)throw Error(i(528,""));return k}if(r&&d!==null)throw Error(i(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=yi(l),l=Ur(m).hoistableScripts,d=l.get(r),d||(d={type:"script",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function pi(n){return'href="'+fn(n)+'"'}function js(n){return'link[rel="stylesheet"]['+n+"]"}function dy(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function GS(n,r,l,d){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?d.loading=1:(r=n.createElement("link"),d.preload=r,r.addEventListener("load",function(){return d.loading|=1}),r.addEventListener("error",function(){return d.loading|=2}),Et(r,"link",l),kt(r),n.head.appendChild(r))}function yi(n){return'[src="'+fn(n)+'"]'}function Cs(n){return"script[async]"+n}function fy(n,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var d=n.querySelector('style[data-href~="'+fn(l.href)+'"]');if(d)return r.instance=d,kt(d),d;var m=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),kt(d),Et(d,"style",m),Eo(d,l.precedence,n),r.instance=d;case"stylesheet":m=pi(l.href);var y=n.querySelector(js(m));if(y)return r.state.loading|=4,r.instance=y,kt(y),y;d=dy(l),(m=vn.get(m))&&ef(d,m),y=(n.ownerDocument||n).createElement("link"),kt(y);var k=y;return k._p=new Promise(function(A,O){k.onload=A,k.onerror=O}),Et(y,"link",d),r.state.loading|=4,Eo(y,l.precedence,n),r.instance=y;case"script":return y=yi(l.src),(m=n.querySelector(Cs(y)))?(r.instance=m,kt(m),m):(d=l,(m=vn.get(y))&&(d=p({},l),tf(d,m)),n=n.ownerDocument||n,m=n.createElement("script"),kt(m),Et(m,"link",d),n.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(d=r.instance,r.state.loading|=4,Eo(d,l.precedence,n));return r.instance}function Eo(n,r,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=d.length?d[d.length-1]:null,y=m,k=0;k<d.length;k++){var A=d[k];if(A.dataset.precedence===r)y=A;else if(y!==m)break}y?y.parentNode.insertBefore(n,y.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(n,r.firstChild))}function ef(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function tf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var To=null;function hy(n,r,l){if(To===null){var d=new Map,m=To=new Map;m.set(l,d)}else m=To,d=m.get(l),d||(d=new Map,m.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),m=0;m<l.length;m++){var y=l[m];if(!(y[qi]||y[jt]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(r)||"";k=n+k;var A=d.get(k);A?A.push(y):d.set(k,[y])}}return d}function gy(n,r,l){n=n.ownerDocument||n,n.head.insertBefore(l,r==="title"?n.querySelector("head > title"):null)}function VS(n,r,l){if(l===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function my(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function YS(n,r,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var m=pi(d.href),y=r.querySelector(js(m));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=Mo.bind(n),r.then(n,n)),l.state.loading|=4,l.instance=y,kt(y);return}y=r.ownerDocument||r,d=dy(d),(m=vn.get(m))&&ef(d,m),y=y.createElement("link"),kt(y);var k=y;k._p=new Promise(function(A,O){k.onload=A,k.onerror=O}),Et(y,"link",d),l.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Mo.bind(n),r.addEventListener("load",l),r.addEventListener("error",l))}}var nf=0;function QS(n,r){return n.stylesheets&&n.count===0&&_o(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&_o(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+r);0<n.imgBytes&&nf===0&&(nf=62500*TS());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&_o(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>nf?50:800)+r);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(m)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_o(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Do=null;function _o(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Do=new Map,r.forEach(XS,n),Do=null,Mo.call(n))}function XS(n,r){if(!(r.state.loading&4)){var l=Do.get(n);if(l)var d=l.get(null);else{l=new Map,Do.set(n,l);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var k=m[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(l.set(k.dataset.precedence,k),d=k)}d&&l.set(null,d)}m=r.instance,k=m.getAttribute("data-precedence"),y=l.get(k)||d,y===d&&l.set(null,m),l.set(k,m),this.count++,d=Mo.bind(this),m.addEventListener("load",d),m.addEventListener("error",d),y?y.parentNode.insertBefore(m,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),r.state.loading|=4}}var Ns={$$typeof:D,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function ZS(n,r,l,d,m,y,k,A,O){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Zc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zc(0),this.hiddenUpdates=Zc(null),this.identifierPrefix=d,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function py(n,r,l,d,m,y,k,A,O,K,Z,ae){return n=new ZS(n,r,l,k,O,K,Z,ae,A),r=1,y===!0&&(r|=24),y=en(3,null,null,r),n.current=y,y.stateNode=n,r=Lu(),r.refCount++,n.pooledCache=r,r.refCount++,y.memoizedState={element:d,isDehydrated:l,cache:r},Iu(y),n}function yy(n){return n?(n=Yr,n):Yr}function xy(n,r,l,d,m,y){m=yy(m),d.context===null?d.context=m:d.pendingContext=m,d=Ma(r),d.payload={element:l},y=y===void 0?null:y,y!==null&&(d.callback=y),l=Da(n,d,r),l!==null&&(Vt(l,n,r),rs(l,n,r))}function by(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<r?l:r}}function af(n,r){by(n,r),(n=n.alternate)&&by(n,r)}function vy(n){if(n.tag===13||n.tag===31){var r=ir(n,67108864);r!==null&&Vt(r,n,67108864),af(n,67108864)}}function ky(n){if(n.tag===13||n.tag===31){var r=sn();r=Jc(r);var l=ir(n,r);l!==null&&Vt(l,n,r),af(n,r)}}var Ro=!0;function JS(n,r,l,d){var m=B.T;B.T=null;var y=ee.p;try{ee.p=2,rf(n,r,l,d)}finally{ee.p=y,B.T=m}}function WS(n,r,l,d){var m=B.T;B.T=null;var y=ee.p;try{ee.p=8,rf(n,r,l,d)}finally{ee.p=y,B.T=m}}function rf(n,r,l,d){if(Ro){var m=sf(d);if(m===null)Fd(n,r,d,Oo,l),Sy(n,d);else if(t2(m,n,r,l,d))d.stopPropagation();else if(Sy(n,d),r&4&&-1<e2.indexOf(n)){for(;m!==null;){var y=Hr(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=er(y.pendingLanes);if(k!==0){var A=y;for(A.pendingLanes|=2,A.entangledLanes|=2;k;){var O=1<<31-tt(k);A.entanglements[1]|=O,k&=~O}Kn(y),(Pe&6)===0&&(po=Lt()+500,vs(0))}}break;case 31:case 13:A=ir(y,2),A!==null&&Vt(A,y,2),xo(),af(y,2)}if(y=sf(d),y===null&&Fd(n,r,d,Oo,l),y===m)break;m=y}m!==null&&d.stopPropagation()}else Fd(n,r,d,null,l)}}function sf(n){return n=lu(n),lf(n)}var Oo=null;function lf(n){if(Oo=null,n=zr(n),n!==null){var r=o(n);if(r===null)n=null;else{var l=r.tag;if(l===13){if(n=u(r),n!==null)return n;n=null}else if(l===31){if(n=f(r),n!==null)return n;n=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Oo=n,null}function wy(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xc()){case te:return 2;case oe:return 8;case we:case Oe:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var of=!1,$a=null,Ka=null,Fa=null,As=new Map,Es=new Map,Pa=[],e2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sy(n,r){switch(n){case"focusin":case"focusout":$a=null;break;case"dragenter":case"dragleave":Ka=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":As.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Es.delete(r.pointerId)}}function Ts(n,r,l,d,m,y){return n===null||n.nativeEvent!==y?(n={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:y,targetContainers:[m]},r!==null&&(r=Hr(r),r!==null&&vy(r)),n):(n.eventSystemFlags|=d,r=n.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),n)}function t2(n,r,l,d,m){switch(r){case"focusin":return $a=Ts($a,n,r,l,d,m),!0;case"dragenter":return Ka=Ts(Ka,n,r,l,d,m),!0;case"mouseover":return Fa=Ts(Fa,n,r,l,d,m),!0;case"pointerover":var y=m.pointerId;return As.set(y,Ts(As.get(y)||null,n,r,l,d,m)),!0;case"gotpointercapture":return y=m.pointerId,Es.set(y,Ts(Es.get(y)||null,n,r,l,d,m)),!0}return!1}function jy(n){var r=zr(n.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){n.blockedOn=r,Ug(n.priority,function(){ky(l)});return}}else if(r===31){if(r=f(l),r!==null){n.blockedOn=r,Ug(n.priority,function(){ky(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lo(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var l=sf(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);su=d,l.target.dispatchEvent(d),su=null}else return r=Hr(l),r!==null&&vy(r),n.blockedOn=l,!1;r.shift()}return!0}function Cy(n,r,l){Lo(n)&&l.delete(r)}function n2(){of=!1,$a!==null&&Lo($a)&&($a=null),Ka!==null&&Lo(Ka)&&(Ka=null),Fa!==null&&Lo(Fa)&&(Fa=null),As.forEach(Cy),Es.forEach(Cy)}function zo(n,r){n.blockedOn===r&&(n.blockedOn=null,of||(of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,n2)))}var Ho=null;function Ny(n){Ho!==n&&(Ho=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ho===n&&(Ho=null);for(var r=0;r<n.length;r+=3){var l=n[r],d=n[r+1],m=n[r+2];if(typeof d!="function"){if(lf(d||l)===null)continue;break}var y=Hr(l);y!==null&&(n.splice(r,3),r-=3,id(y,{pending:!0,data:m,method:l.method,action:d},d,m))}}))}function xi(n){function r(O){return zo(O,n)}$a!==null&&zo($a,n),Ka!==null&&zo(Ka,n),Fa!==null&&zo(Fa,n),As.forEach(r),Es.forEach(r);for(var l=0;l<Pa.length;l++){var d=Pa[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Pa.length&&(l=Pa[0],l.blockedOn===null);)jy(l),l.blockedOn===null&&Pa.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var m=l[d],y=l[d+1],k=m[qt]||null;if(typeof y=="function")k||Ny(l);else if(k){var A=null;if(y&&y.hasAttribute("formAction")){if(m=y,k=y[qt]||null)A=k.formAction;else if(lf(m)!==null)continue}else A=k.action;typeof A=="function"?l[d+1]=A:(l.splice(d,3),d-=3),Ny(l)}}}function Ay(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return m=k})},focusReset:"manual",scroll:"manual"})}function r(){m!==null&&(m(),m=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function cf(n){this._internalRoot=n}Uo.prototype.render=cf.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var l=r.current,d=sn();xy(l,d,n,r,null,null)},Uo.prototype.unmount=cf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;xy(n.current,2,null,n,null,null),xo(),r[Lr]=null}};function Uo(n){this._internalRoot=n}Uo.prototype.unstable_scheduleHydration=function(n){if(n){var r=Hg();n={blockedOn:null,target:n,priority:r};for(var l=0;l<Pa.length&&r!==0&&r<Pa[l].priority;l++);Pa.splice(l,0,n),l===0&&jy(n)}};var Ey=t.version;if(Ey!=="19.2.4")throw Error(i(527,Ey,"19.2.4"));ee.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=g(r),n=n!==null?x(n):null,n=n===null?null:n.stateNode,n};var a2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Io=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Io.isDisabled&&Io.supportsFiber)try{zt=Io.inject(a2),bt=Io}catch{}}return Ds.createRoot=function(n,r){if(!s(n))throw Error(i(299));var l=!1,d="",m=Lp,y=zp,k=Hp;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(k=r.onRecoverableError)),r=py(n,1,!1,null,null,l,d,null,m,y,k,Ay),n[Lr]=r.current,Kd(n),new cf(r)},Ds.hydrateRoot=function(n,r,l){if(!s(n))throw Error(i(299));var d=!1,m="",y=Lp,k=zp,A=Hp,O=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(k=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(O=l.formState)),r=py(n,1,!0,r,l??null,d,m,O,y,k,A,Ay),r.context=yy(null),l=r.current,d=sn(),d=Jc(d),m=Ma(d),m.callback=null,Da(l,m,d),l=d,r.current.lanes=l,Bi(r,l),Kn(r),n[Lr]=r.current,Kd(n),new Uo(r)},Ds.version="19.2.4",Ds}var Uy;function m2(){if(Uy)return ff.exports;Uy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ff.exports=g2(),ff.exports}var p2=m2();/**
|
|
51
|
-
* react-router v7.13.1
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Remix Software Inc.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
-
*
|
|
58
|
-
* @license MIT
|
|
59
|
-
*/var Iy="popstate";function By(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function y2(e={}){function t(s,o){let{pathname:u="/",search:f="",hash:h=""}=Mr(s.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),uh("",{pathname:u,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function a(s,o){let u=s.document.querySelector("base"),f="";if(u&&u.getAttribute("href")){let h=s.location.href,g=h.indexOf("#");f=g===-1?h:h.slice(0,g)}return f+"#"+(typeof o=="string"?o:Zs(o))}function i(s,o){Cn(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return b2(t,a,i,e)}function ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function x2(){return Math.random().toString(36).substring(2,10)}function qy(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function uh(e,t,a=null,i,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Mr(t):t,state:a,key:t&&t.key||i||x2(),unstable_mask:s}}function Zs({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Mr(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function b2(e,t,a,i={}){let{window:s=document.defaultView,v5Compat:o=!1}=i,u=s.history,f="POP",h=null,g=x();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function x(){return(u.state||{idx:null}).idx}function p(){f="POP";let E=x(),S=E==null?null:E-g;g=E,h&&h({action:f,location:C.location,delta:S})}function b(E,S){f="PUSH";let N=By(E)?E:uh(C.location,E,S);a&&a(N,E),g=x()+1;let D=qy(N,g),U=C.createHref(N.unstable_mask||N);try{u.pushState(D,"",U)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;s.location.assign(U)}o&&h&&h({action:f,location:C.location,delta:1})}function v(E,S){f="REPLACE";let N=By(E)?E:uh(C.location,E,S);a&&a(N,E),g=x();let D=qy(N,g),U=C.createHref(N.unstable_mask||N);u.replaceState(D,"",U),o&&h&&h({action:f,location:C.location,delta:0})}function w(E){return v2(E)}let C={get action(){return f},get location(){return e(s,u)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Iy,p),h=E,()=>{s.removeEventListener(Iy,p),h=null}},createHref(E){return t(s,E)},createURL:w,encodeLocation(E){let S=w(E);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:b,replace:v,go(E){return u.go(E)}};return C}function v2(e,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ct(a,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Zs(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=a+i),new URL(i,a)}function uv(e,t,a="/"){return k2(e,t,a,!1)}function k2(e,t,a,i){let s=typeof t=="string"?Mr(t):t,o=ba(s.pathname||"/",a);if(o==null)return null;let u=dv(e);w2(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let g=R2(o);f=D2(u[h],g,i)}return f}function dv(e,t=[],a=[],i="",s=!1){let o=(u,f,h=s,g)=>{let x={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&h)return;ct(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let p=Xn([i,x.relativePath]),b=a.concat(x);u.children&&u.children.length>0&&(ct(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),dv(u.children,t,b,p,h)),!(u.path==null&&!u.index)&&t.push({path:p,score:T2(p,u.index),routesMeta:b})};return e.forEach((u,f)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))o(u,f);else for(let g of fv(u.path))o(u,f,!0,g)}),t}function fv(e){let t=e.split("/");if(t.length===0)return[];let[a,...i]=t,s=a.endsWith("?"),o=a.replace(/\?$/,"");if(i.length===0)return s?[o,""]:[o];let u=fv(i.join("/")),f=[];return f.push(...u.map(h=>h===""?o:[o,h].join("/"))),s&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function w2(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:M2(t.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}var S2=/^:[\w-]+$/,j2=3,C2=2,N2=1,A2=10,E2=-2,$y=e=>e==="*";function T2(e,t){let a=e.split("/"),i=a.length;return a.some($y)&&(i+=E2),t&&(i+=C2),a.filter(s=>!$y(s)).reduce((s,o)=>s+(S2.test(o)?j2:o===""?N2:A2),i)}function M2(e,t){return e.length===t.length&&e.slice(0,-1).every((i,s)=>i===t[s])?e[e.length-1]-t[t.length-1]:0}function D2(e,t,a=!1){let{routesMeta:i}=e,s={},o="/",u=[];for(let f=0;f<i.length;++f){let h=i[f],g=f===i.length-1,x=o==="/"?t:t.slice(o.length)||"/",p=lc({path:h.relativePath,caseSensitive:h.caseSensitive,end:g},x),b=h.route;if(!p&&g&&a&&!i[i.length-1].route.index&&(p=lc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},x)),!p)return null;Object.assign(s,p.params),u.push({params:s,pathname:Xn([o,p.pathname]),pathnameBase:H2(Xn([o,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(o=Xn([o,p.pathnameBase]))}return u}function lc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,i]=_2(e.path,e.caseSensitive,e.end),s=t.match(a);if(!s)return null;let o=s[0],u=o.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:i.reduce((g,{paramName:x,isOptional:p},b)=>{if(x==="*"){let w=f[b]||"";u=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[b];return p&&!v?g[x]=void 0:g[x]=(v||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:u,pattern:e}}function _2(e,t=!1,a=!0){Cn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h,g,x)=>{if(i.push({paramName:f,isOptional:h!=null}),h){let p=x.charAt(g+u.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),i]}function R2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ba(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,i=e.charAt(a);return i&&i!=="/"?null:e.slice(a)||"/"}var O2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function L2(e,t="/"){let{pathname:a,search:i="",hash:s=""}=typeof e=="string"?Mr(e):e,o;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?o=Ky(a.substring(1),"/"):o=Ky(a,t)):o=t,{pathname:o,search:U2(i),hash:I2(s)}}function Ky(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?a.length>1&&a.pop():s!=="."&&a.push(s)}),a.length>1?a.join("/"):"/"}function pf(e,t,a,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function z2(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Kh(e){let t=z2(e);return t.map((a,i)=>i===t.length-1?a.pathname:a.pathnameBase)}function Nc(e,t,a,i=!1){let s;typeof e=="string"?s=Mr(e):(s={...e},ct(!s.pathname||!s.pathname.includes("?"),pf("?","pathname","search",s)),ct(!s.pathname||!s.pathname.includes("#"),pf("#","pathname","hash",s)),ct(!s.search||!s.search.includes("#"),pf("#","search","hash",s)));let o=e===""||s.pathname==="",u=o?"/":s.pathname,f;if(u==null)f=a;else{let p=t.length-1;if(!i&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),p-=1;s.pathname=b.join("/")}f=p>=0?t[p]:"/"}let h=L2(s,f),g=u&&u!=="/"&&u.endsWith("/"),x=(o||u===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(g||x)&&(h.pathname+="/"),h}var Xn=e=>e.join("/").replace(/\/\/+/g,"/"),H2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),U2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,I2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,B2=class{constructor(e,t,a,i=!1){this.status=e,this.statusText=t||"",this.internal=i,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function q2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gv(e,t){let a=e;if(typeof a!="string"||!O2.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let i=a,s=!1;if(hv)try{let o=new URL(window.location.href),u=a.startsWith("//")?new URL(o.protocol+a):new URL(a),f=ba(u.pathname,t);u.origin===o.origin&&f!=null?a=f+u.search+u.hash:s=!0}catch{Cn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:s,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mv=["POST","PUT","PATCH","DELETE"];new Set(mv);var K2=["GET",...mv];new Set(K2);var Di=j.createContext(null);Di.displayName="DataRouter";var Ac=j.createContext(null);Ac.displayName="DataRouterState";var F2=j.createContext(!1),pv=j.createContext({isTransitioning:!1});pv.displayName="ViewTransition";var P2=j.createContext(new Map);P2.displayName="Fetchers";var G2=j.createContext(null);G2.displayName="Await";var cn=j.createContext(null);cn.displayName="Navigation";var cl=j.createContext(null);cl.displayName="Location";var zn=j.createContext({outlet:null,matches:[],isDataRoute:!1});zn.displayName="Route";var Fh=j.createContext(null);Fh.displayName="RouteError";var yv="REACT_ROUTER_ERROR",V2="REDIRECT",Y2="ROUTE_ERROR_RESPONSE";function Q2(e){if(e.startsWith(`${yv}:${V2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function X2(e){if(e.startsWith(`${yv}:${Y2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new B2(t.status,t.statusText,t.data)}catch{}}function Z2(e,{relative:t}={}){ct(_i(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:i}=j.useContext(cn),{hash:s,pathname:o,search:u}=dl(e,{relative:t}),f=o;return a!=="/"&&(f=o==="/"?a:Xn([a,o])),i.createHref({pathname:f,search:u,hash:s})}function _i(){return j.useContext(cl)!=null}function Hn(){return ct(_i(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(cl).location}var xv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function bv(e){j.useContext(cn).static||j.useLayoutEffect(e)}function ul(){let{isDataRoute:e}=j.useContext(zn);return e?fj():J2()}function J2(){ct(_i(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Di),{basename:t,navigator:a}=j.useContext(cn),{matches:i}=j.useContext(zn),{pathname:s}=Hn(),o=JSON.stringify(Kh(i)),u=j.useRef(!1);return bv(()=>{u.current=!0}),j.useCallback((h,g={})=>{if(Cn(u.current,xv),!u.current)return;if(typeof h=="number"){a.go(h);return}let x=Nc(h,JSON.parse(o),s,g.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Xn([t,x.pathname])),(g.replace?a.replace:a.push)(x,g.state,g)},[t,a,o,s,e])}var W2=j.createContext(null);function ej(e){let t=j.useContext(zn).outlet;return j.useMemo(()=>t&&j.createElement(W2.Provider,{value:e},t),[t,e])}function dl(e,{relative:t}={}){let{matches:a}=j.useContext(zn),{pathname:i}=Hn(),s=JSON.stringify(Kh(a));return j.useMemo(()=>Nc(e,JSON.parse(s),i,t==="path"),[e,s,i,t])}function tj(e,t){return vv(e,t)}function vv(e,t,a){var E;ct(_i(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=j.useContext(cn),{matches:s}=j.useContext(zn),o=s[s.length-1],u=o?o.params:{},f=o?o.pathname:"/",h=o?o.pathnameBase:"/",g=o&&o.route;{let S=g&&g.path||"";wv(f,!g||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let x=Hn(),p;if(t){let S=typeof t=="string"?Mr(t):t;ct(h==="/"||((E=S.pathname)==null?void 0:E.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${S.pathname}" was given in the \`location\` prop.`),p=S}else p=x;let b=p.pathname||"/",v=b;if(h!=="/"){let S=h.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=uv(e,{pathname:v});Cn(g||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Cn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=sj(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},u,S.params),pathname:Xn([h,i.encodeLocation?i.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:Xn([h,i.encodeLocation?i.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),s,a);return t&&C?j.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},C):C}function nj(){let e=dj(),t=q2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:o},"ErrorBoundary")," or"," ",j.createElement("code",{style:o},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),a?j.createElement("pre",{style:s},a):null,u)}var aj=j.createElement(nj,null),kv=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=X2(e.digest);a&&(e=a)}let t=e!==void 0?j.createElement(zn.Provider,{value:this.props.routeContext},j.createElement(Fh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(rj,{error:e},t):t}};kv.contextType=F2;var yf=new WeakMap;function rj({children:e,error:t}){let{basename:a}=j.useContext(cn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=Q2(t.digest);if(i){let s=yf.get(t);if(s)throw s;let o=gv(i.location,a);if(hv&&!yf.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw yf.set(t,u),u}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function ij({routeContext:e,match:t,children:a}){let i=j.useContext(Di);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(zn.Provider,{value:e},a)}function sj(e,t=[],a){let i=a==null?void 0:a.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let s=e,o=i==null?void 0:i.errors;if(o!=null){let x=s.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);ct(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,x+1))}let u=!1,f=-1;if(a&&i){u=i.renderFallback;for(let x=0;x<s.length;x++){let p=s[x];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=x),p.route.id){let{loaderData:b,errors:v}=i,w=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||w){a.isStatic&&(u=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let h=a==null?void 0:a.onError,g=i&&h?(x,p)=>{var b,v;h(x,{location:i.location,params:((v=(b=i.matches)==null?void 0:b[0])==null?void 0:v.params)??{},unstable_pattern:$2(i.matches),errorInfo:p})}:void 0;return s.reduceRight((x,p,b)=>{let v,w=!1,C=null,E=null;i&&(v=o&&p.route.id?o[p.route.id]:void 0,C=p.route.errorElement||aj,u&&(f<0&&b===0?(wv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,E=null):f===b&&(w=!0,E=p.route.hydrateFallbackElement||null)));let S=t.concat(s.slice(0,b+1)),N=()=>{let D;return v?D=C:w?D=E:p.route.Component?D=j.createElement(p.route.Component,null):p.route.element?D=p.route.element:D=x,j.createElement(ij,{match:p,routeContext:{outlet:x,matches:S,isDataRoute:i!=null},children:D})};return i&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?j.createElement(kv,{location:i.location,revalidation:i.revalidation,component:C,error:v,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:g}):N()},null)}function Ph(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lj(e){let t=j.useContext(Di);return ct(t,Ph(e)),t}function oj(e){let t=j.useContext(Ac);return ct(t,Ph(e)),t}function cj(e){let t=j.useContext(zn);return ct(t,Ph(e)),t}function Gh(e){let t=cj(e),a=t.matches[t.matches.length-1];return ct(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function uj(){return Gh("useRouteId")}function dj(){var i;let e=j.useContext(Fh),t=oj("useRouteError"),a=Gh("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[a]}function fj(){let{router:e}=lj("useNavigate"),t=Gh("useNavigate"),a=j.useRef(!1);return bv(()=>{a.current=!0}),j.useCallback(async(s,o={})=>{Cn(a.current,xv),a.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Fy={};function wv(e,t,a){!t&&!Fy[e]&&(Fy[e]=!0,Cn(!1,a))}j.memo(hj);function hj({routes:e,future:t,state:a,isStatic:i,onError:s}){return vv(e,void 0,{state:a,isStatic:i,onError:s})}function gj({to:e,replace:t,state:a,relative:i}){ct(_i(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=j.useContext(cn);Cn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=j.useContext(zn),{pathname:u}=Hn(),f=ul(),h=Nc(e,Kh(o),u,i==="path"),g=JSON.stringify(h);return j.useEffect(()=>{f(JSON.parse(g),{replace:t,state:a,relative:i})},[f,g,i,t,a]),null}function Sv(e){return ej(e.context)}function Rn(e){ct(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function mj({basename:e="/",children:t=null,location:a,navigationType:i="POP",navigator:s,static:o=!1,unstable_useTransitions:u}){ct(!_i(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=j.useMemo(()=>({basename:f,navigator:s,static:o,unstable_useTransitions:u,future:{}}),[f,s,o,u]);typeof a=="string"&&(a=Mr(a));let{pathname:g="/",search:x="",hash:p="",state:b=null,key:v="default",unstable_mask:w}=a,C=j.useMemo(()=>{let E=ba(g,f);return E==null?null:{location:{pathname:E,search:x,hash:p,state:b,key:v,unstable_mask:w},navigationType:i}},[f,g,x,p,b,v,i,w]);return Cn(C!=null,`<Router basename="${f}"> is not able to match the URL "${g}${x}${p}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:j.createElement(cn.Provider,{value:h},j.createElement(cl.Provider,{children:t,value:C}))}function pj({children:e,location:t}){return tj(dh(e),t)}function dh(e,t=[]){let a=[];return j.Children.forEach(e,(i,s)=>{if(!j.isValidElement(i))return;let o=[...t,s];if(i.type===j.Fragment){a.push.apply(a,dh(i.props.children,o));return}ct(i.type===Rn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!i.props.index||!i.props.children,"An index route cannot have child routes.");let u={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(u.children=dh(i.props.children,o)),a.push(u)}),a}var ac="get",rc="application/x-www-form-urlencoded";function Ec(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function yj(e){return Ec(e)&&e.tagName.toLowerCase()==="button"}function xj(e){return Ec(e)&&e.tagName.toLowerCase()==="form"}function bj(e){return Ec(e)&&e.tagName.toLowerCase()==="input"}function vj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kj(e,t){return e.button===0&&(!t||t==="_self")&&!vj(e)}var Bo=null;function wj(){if(Bo===null)try{new FormData(document.createElement("form"),0),Bo=!1}catch{Bo=!0}return Bo}var Sj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xf(e){return e!=null&&!Sj.has(e)?(Cn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rc}"`),null):e}function jj(e,t){let a,i,s,o,u;if(xj(e)){let f=e.getAttribute("action");i=f?ba(f,t):null,a=e.getAttribute("method")||ac,s=xf(e.getAttribute("enctype"))||rc,o=new FormData(e)}else if(yj(e)||bj(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(i=h?ba(h,t):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||ac,s=xf(e.getAttribute("formenctype"))||xf(f.getAttribute("enctype"))||rc,o=new FormData(f,e),!wj()){let{name:g,type:x,value:p}=e;if(x==="image"){let b=g?`${g}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else g&&o.append(g,p)}}else{if(Ec(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ac,i=null,s=rc,u=e}return o&&s==="text/plain"&&(u=o,o=void 0),{action:i,method:a.toLowerCase(),encType:s,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cj(e,t,a,i){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${i}`:s.pathname=`${s.pathname}.${i}`:s.pathname==="/"?s.pathname=`_root.${i}`:t&&ba(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function Nj(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Aj(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ej(e,t,a){let i=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let u=await Nj(o,a);return u.links?u.links():[]}return[]}));return _j(i.flat(1).filter(Aj).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Py(e,t,a,i,s,o){let u=(h,g)=>a[g]?h.route.id!==a[g].route.id:!0,f=(h,g)=>{var x;return a[g].pathname!==h.pathname||((x=a[g].route.path)==null?void 0:x.endsWith("*"))&&a[g].params["*"]!==h.params["*"]};return o==="assets"?t.filter((h,g)=>u(h,g)||f(h,g)):o==="data"?t.filter((h,g)=>{var p;let x=i.routes[h.route.id];if(!x||!x.hasLoader)return!1;if(u(h,g)||f(h,g))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Tj(e,t,{includeHydrateFallback:a}={}){return Mj(e.map(i=>{let s=t.routes[i.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),a&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function Mj(e){return[...new Set(e)]}function Dj(e){let t={},a=Object.keys(e).sort();for(let i of a)t[i]=e[i];return t}function _j(e,t){let a=new Set;return new Set(t),e.reduce((i,s)=>{let o=JSON.stringify(Dj(s));return a.has(o)||(a.add(o),i.push({key:o,link:s})),i},[])}function jv(){let e=j.useContext(Di);return Vh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Rj(){let e=j.useContext(Ac);return Vh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yh=j.createContext(void 0);Yh.displayName="FrameworkContext";function Cv(){let e=j.useContext(Yh);return Vh(e,"You must render this element inside a <HydratedRouter> element"),e}function Oj(e,t){let a=j.useContext(Yh),[i,s]=j.useState(!1),[o,u]=j.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:g,onMouseLeave:x,onTouchStart:p}=t,b=j.useRef(null);j.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let C=S=>{S.forEach(N=>{u(N.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),j.useEffect(()=>{if(i){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[i]);let v=()=>{s(!0)},w=()=>{s(!1),u(!1)};return a?e!=="intent"?[o,b,{}]:[o,b,{onFocus:_s(f,v),onBlur:_s(h,w),onMouseEnter:_s(g,v),onMouseLeave:_s(x,w),onTouchStart:_s(p,v)}]:[!1,b,{}]}function _s(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function Lj({page:e,...t}){let{router:a}=jv(),i=j.useMemo(()=>uv(a.routes,e,a.basename),[a.routes,e,a.basename]);return i?j.createElement(Hj,{page:e,matches:i,...t}):null}function zj(e){let{manifest:t,routeModules:a}=Cv(),[i,s]=j.useState([]);return j.useEffect(()=>{let o=!1;return Ej(e,t,a).then(u=>{o||s(u)}),()=>{o=!0}},[e,t,a]),i}function Hj({page:e,matches:t,...a}){let i=Hn(),{future:s,manifest:o,routeModules:u}=Cv(),{basename:f}=jv(),{loaderData:h,matches:g}=Rj(),x=j.useMemo(()=>Py(e,t,g,o,i,"data"),[e,t,g,o,i]),p=j.useMemo(()=>Py(e,t,g,o,i,"assets"),[e,t,g,o,i]),b=j.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let C=new Set,E=!1;if(t.forEach(N=>{var U;let D=o.routes[N.route.id];!D||!D.hasLoader||(!x.some(z=>z.route.id===N.route.id)&&N.route.id in h&&((U=u[N.route.id])!=null&&U.shouldRevalidate)||D.hasClientLoader?E=!0:C.add(N.route.id))}),C.size===0)return[];let S=Cj(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return E&&C.size>0&&S.searchParams.set("_routes",t.filter(N=>C.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,i,o,x,t,e,u]),v=j.useMemo(()=>Tj(p,o),[p,o]),w=zj(p);return j.createElement(j.Fragment,null,b.map(C=>j.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),v.map(C=>j.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),w.map(({key:C,link:E})=>j.createElement("link",{key:C,nonce:a.nonce,...E,crossOrigin:E.crossOrigin??a.crossOrigin})))}function Uj(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var Ij=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ij&&(window.__reactRouterVersion="7.13.1")}catch{}function Bj({basename:e,children:t,unstable_useTransitions:a,window:i}){let s=j.useRef();s.current==null&&(s.current=y2({window:i,v5Compat:!0}));let o=s.current,[u,f]=j.useState({action:o.action,location:o.location}),h=j.useCallback(g=>{a===!1?f(g):j.startTransition(()=>f(g))},[a]);return j.useLayoutEffect(()=>o.listen(h),[o,h]),j.createElement(mj,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:a})}var Nv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Av=j.forwardRef(function({onClick:t,discover:a="render",prefetch:i="none",relative:s,reloadDocument:o,replace:u,unstable_mask:f,state:h,target:g,to:x,preventScrollReset:p,viewTransition:b,unstable_defaultShouldRevalidate:v,...w},C){let{basename:E,navigator:S,unstable_useTransitions:N}=j.useContext(cn),D=typeof x=="string"&&Nv.test(x),U=gv(x,E);x=U.to;let z=Z2(x,{relative:s}),L=Hn(),G=null;if(f){let J=Nc(f,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);E!=="/"&&(J.pathname=J.pathname==="/"?E:Xn([E,J.pathname])),G=S.createHref(J)}let[X,F,_]=Oj(i,w),q=Fj(x,{replace:u,unstable_mask:f,state:h,target:g,preventScrollReset:p,relative:s,viewTransition:b,unstable_defaultShouldRevalidate:v,unstable_useTransitions:N});function V(J){t&&t(J),J.defaultPrevented||q(J)}let re=!(U.isExternal||o),W=j.createElement("a",{...w,..._,href:(re?G:void 0)||U.absoluteURL||z,onClick:re?V:t,ref:Uj(C,F),target:g,"data-discover":!D&&a==="render"?"true":void 0});return X&&!D?j.createElement(j.Fragment,null,W,j.createElement(Lj,{page:z})):W});Av.displayName="Link";var qj=j.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:i="",end:s=!1,style:o,to:u,viewTransition:f,children:h,...g},x){let p=dl(u,{relative:g.relative}),b=Hn(),v=j.useContext(Ac),{navigator:w,basename:C}=j.useContext(cn),E=v!=null&&Qj(p)&&f===!0,S=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,N=b.pathname,D=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(N=N.toLowerCase(),D=D?D.toLowerCase():null,S=S.toLowerCase()),D&&C&&(D=ba(D,C)||D);const U=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let z=N===S||!s&&N.startsWith(S)&&N.charAt(U)==="/",L=D!=null&&(D===S||!s&&D.startsWith(S)&&D.charAt(S.length)==="/"),G={isActive:z,isPending:L,isTransitioning:E},X=z?t:void 0,F;typeof i=="function"?F=i(G):F=[i,z?"active":null,L?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let _=typeof o=="function"?o(G):o;return j.createElement(Av,{...g,"aria-current":X,className:F,ref:x,style:_,to:u,viewTransition:f},typeof h=="function"?h(G):h)});qj.displayName="NavLink";var $j=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:i,replace:s,state:o,method:u=ac,action:f,onSubmit:h,relative:g,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},w)=>{let{unstable_useTransitions:C}=j.useContext(cn),E=Vj(),S=Yj(f,{relative:g}),N=u.toLowerCase()==="get"?"get":"post",D=typeof f=="string"&&Nv.test(f),U=z=>{if(h&&h(z),z.defaultPrevented)return;z.preventDefault();let L=z.nativeEvent.submitter,G=(L==null?void 0:L.getAttribute("formmethod"))||u,X=()=>E(L||z.currentTarget,{fetcherKey:t,method:G,navigate:a,replace:s,state:o,relative:g,preventScrollReset:x,viewTransition:p,unstable_defaultShouldRevalidate:b});C&&a!==!1?j.startTransition(()=>X()):X()};return j.createElement("form",{ref:w,method:N,action:S,onSubmit:i?h:U,...v,"data-discover":!D&&e==="render"?"true":void 0})});$j.displayName="Form";function Kj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ev(e){let t=j.useContext(Di);return ct(t,Kj(e)),t}function Fj(e,{target:t,replace:a,unstable_mask:i,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}={}){let x=ul(),p=Hn(),b=dl(e,{relative:u});return j.useCallback(v=>{if(kj(v,t)){v.preventDefault();let w=a!==void 0?a:Zs(p)===Zs(b),C=()=>x(e,{replace:w,unstable_mask:i,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});g?j.startTransition(()=>C()):C()}},[p,x,b,a,i,s,t,e,o,u,f,h,g])}var Pj=0,Gj=()=>`__${String(++Pj)}__`;function Vj(){let{router:e}=Ev("useSubmit"),{basename:t}=j.useContext(cn),a=uj(),i=e.fetch,s=e.navigate;return j.useCallback(async(o,u={})=>{let{action:f,method:h,encType:g,formData:x,body:p}=jj(o,t);if(u.navigate===!1){let b=u.fetcherKey||Gj();await i(b,a,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:p,formMethod:u.method||h,formEncType:u.encType||g,flushSync:u.flushSync})}else await s(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:p,formMethod:u.method||h,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,s,t,a])}function Yj(e,{relative:t}={}){let{basename:a}=j.useContext(cn),i=j.useContext(zn);ct(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),o={...dl(e||".",{relative:t})},u=Hn();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),h=f.getAll("index");if(h.some(x=>x==="")){f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let x=f.toString();o.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(o.pathname=o.pathname==="/"?a:Xn([a,o.pathname])),Zs(o)}function Qj(e,{relative:t}={}){let a=j.useContext(pv);ct(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Ev("useViewTransitionState"),s=dl(e,{relative:t});if(!a.isTransitioning)return!1;let o=ba(a.currentLocation.pathname,i)||a.currentLocation.pathname,u=ba(a.nextLocation.pathname,i)||a.nextLocation.pathname;return lc(s.pathname,u)!=null||lc(s.pathname,o)!=null}const Se=e=>typeof e=="string",Rs=()=>{let e,t;const a=new Promise((i,s)=>{e=i,t=s});return a.resolve=e,a.reject=t,a},Gy=e=>e==null?"":""+e,Xj=(e,t,a)=>{e.forEach(i=>{t[i]&&(a[i]=t[i])})},Zj=/###/g,Vy=e=>e&&e.indexOf("###")>-1?e.replace(Zj,"."):e,Yy=e=>!e||Se(e),Gs=(e,t,a)=>{const i=Se(t)?t.split("."):t;let s=0;for(;s<i.length-1;){if(Yy(e))return{};const o=Vy(i[s]);!e[o]&&a&&(e[o]=new a),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return Yy(e)?{}:{obj:e,k:Vy(i[s])}},Qy=(e,t,a)=>{const{obj:i,k:s}=Gs(e,t,Object);if(i!==void 0||t.length===1){i[s]=a;return}let o=t[t.length-1],u=t.slice(0,t.length-1),f=Gs(e,u,Object);for(;f.obj===void 0&&u.length;)o=`${u[u.length-1]}.${o}`,u=u.slice(0,u.length-1),f=Gs(e,u,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=a},Jj=(e,t,a,i)=>{const{obj:s,k:o}=Gs(e,t,Object);s[o]=s[o]||[],s[o].push(a)},oc=(e,t)=>{const{obj:a,k:i}=Gs(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,i))return a[i]},Wj=(e,t,a)=>{const i=oc(e,a);return i!==void 0?i:oc(t,a)},Tv=(e,t,a)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(i in e?Se(e[i])||e[i]instanceof String||Se(t[i])||t[i]instanceof String?a&&(e[i]=t[i]):Tv(e[i],t[i],a):e[i]=t[i]);return e},xr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var eC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const tC=e=>Se(e)?e.replace(/[&<>"'\/]/g,t=>eC[t]):e;class nC{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const aC=[" ",",","?","!",";"],rC=new nC(20),iC=(e,t,a)=>{t=t||"",a=a||"";const i=aC.filter(u=>t.indexOf(u)<0&&a.indexOf(u)<0);if(i.length===0)return!0;const s=rC.getRegExp(`(${i.map(u=>u==="?"?"\\?":u).join("|")})`);let o=!s.test(e);if(!o){const u=e.indexOf(a);u>0&&!s.test(e.substring(0,u))&&(o=!0)}return o},fh=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(a);let s=e;for(let o=0;o<i.length;){if(!s||typeof s!="object")return;let u,f="";for(let h=o;h<i.length;++h)if(h!==o&&(f+=a),f+=i[h],u=s[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&h<i.length-1)continue;o+=h-o+1;break}s=u}return s},Js=e=>e==null?void 0:e.replace(/_/g,"-"),sC={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var a,i;(i=(a=console==null?void 0:console[e])==null?void 0:a.apply)==null||i.call(a,console,t)}};class cc{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||sC,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,i,s){return s&&!this.debug?null:(Se(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new cc(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new cc(this.logger,t)}}var Qn=new cc;class Tc{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(a)||0;this.observers[i].set(a,s+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,o])=>{for(let u=0;u<o;u++)s(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,o])=>{for(let u=0;u<o;u++)s.apply(s,[t,...a])})}}class Xy extends Tc{constructor(t,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const a=this.options.ns.indexOf(t);a>-1&&this.options.ns.splice(a,1)}getResource(t,a,i,s={}){var g,x;const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,a],i&&(Array.isArray(i)?f.push(...i):Se(i)&&o?f.push(...i.split(o)):f.push(i)));const h=oc(this.data,f);return!h&&!a&&!i&&t.indexOf(".")>-1&&(t=f[0],a=f[1],i=f.slice(2).join(".")),h||!u||!Se(i)?h:fh((x=(g=this.data)==null?void 0:g[t])==null?void 0:x[a],i,o)}addResource(t,a,i,s,o={silent:!1}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=[t,a];i&&(f=f.concat(u?i.split(u):i)),t.indexOf(".")>-1&&(f=t.split("."),s=a,a=f[1]),this.addNamespaces(a),Qy(this.data,f,s),o.silent||this.emit("added",t,a,i,s)}addResources(t,a,i,s={silent:!1}){for(const o in i)(Se(i[o])||Array.isArray(i[o]))&&this.addResource(t,a,o,i[o],{silent:!0});s.silent||this.emit("added",t,a,i)}addResourceBundle(t,a,i,s,o,u={silent:!1,skipCopy:!1}){let f=[t,a];t.indexOf(".")>-1&&(f=t.split("."),s=i,i=a,a=f[1]),this.addNamespaces(a);let h=oc(this.data,f)||{};u.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?Tv(h,i,o):h={...h,...i},Qy(this.data,f,h),u.silent||this.emit("added",t,a,i)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(s=>a[s]&&Object.keys(a[s]).length>0)}toJSON(){return this.data}}var Mv={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,i,s){return e.forEach(o=>{var u;t=((u=this.processors[o])==null?void 0:u.process(t,a,i,s))??t}),t}};const Dv=Symbol("i18next/PATH_KEY");function lC(){const e=[],t=Object.create(null);let a;return t.get=(i,s)=>{var o;return(o=a==null?void 0:a.revoke)==null||o.call(a),s===Dv?e:(e.push(s),a=Proxy.revocable(i,t),a.proxy)},Proxy.revocable(Object.create(null),t).proxy}function hh(e,t){const{[Dv]:a}=e(lC());return a.join((t==null?void 0:t.keySeparator)??".")}const Zy={},bf=e=>!Se(e)&&typeof e!="boolean"&&typeof e!="number";class uc extends Tc{constructor(t,a={}){super(),Xj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Qn.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const i={...a};if(t==null)return!1;const s=this.resolve(t,i);if((s==null?void 0:s.res)===void 0)return!1;const o=bf(s.res);return!(i.returnObjects===!1&&o)}extractFromKey(t,a){let i=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=a.ns||this.options.defaultNS||[];const u=i&&t.indexOf(i)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!iC(t,i,s);if(u&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Se(o)?[o]:o};const g=t.split(i);(i!==s||i===s&&this.options.ns.indexOf(g[0])>-1)&&(o=g.shift()),t=g.join(s)}return{key:t,namespaces:Se(o)?[o]:o}}translate(t,a,i){let s=typeof a=="object"?{...a}:a;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=hh(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const o=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],s),g=h[h.length-1];let x=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const p=s.lng||this.language,b=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return b?o?{res:`${g}${x}${f}`,usedKey:f,exactUsedKey:f,usedLng:p,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:`${g}${x}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:p,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:f;const v=this.resolve(t,s);let w=v==null?void 0:v.res;const C=(v==null?void 0:v.usedKey)||f,E=(v==null?void 0:v.exactUsedKey)||f,S=["[object Number]","[object Function]","[object RegExp]"],N=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,U=s.count!==void 0&&!Se(s.count),z=uc.hasDefaultValue(s),L=U?this.pluralResolver.getSuffix(p,s.count,s):"",G=s.ordinal&&U?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",X=U&&!s.ordinal&&s.count===0,F=X&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${L}`]||s[`defaultValue${G}`]||s.defaultValue;let _=w;D&&!w&&z&&(_=F);const q=bf(_),V=Object.prototype.toString.apply(_);if(D&&_&&q&&S.indexOf(V)<0&&!(Se(N)&&Array.isArray(_))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const re=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,_,{...s,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(v.res=re,v.usedParams=this.getUsedParamsDetails(s),v):re}if(u){const re=Array.isArray(_),W=re?[]:{},J=re?E:C;for(const B in _)if(Object.prototype.hasOwnProperty.call(_,B)){const ee=`${J}${u}${B}`;z&&!w?W[B]=this.translate(ee,{...s,defaultValue:bf(F)?F[B]:void 0,joinArrays:!1,ns:h}):W[B]=this.translate(ee,{...s,joinArrays:!1,ns:h}),W[B]===ee&&(W[B]=_[B])}w=W}}else if(D&&Se(N)&&Array.isArray(w))w=w.join(N),w&&(w=this.extendTranslation(w,t,s,i));else{let re=!1,W=!1;!this.isValidLookup(w)&&z&&(re=!0,w=F),this.isValidLookup(w)||(W=!0,w=f);const B=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&W?void 0:w,ee=z&&F!==w&&this.options.updateMissing;if(W||re||ee){if(this.logger.log(ee?"updateKey":"missingKey",p,g,f,ee?F:w),u){const R=this.resolve(f,{...s,keySeparator:!1});R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let de=[];const ke=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ke&&ke[0])for(let R=0;R<ke.length;R++)de.push(ke[R]);else this.options.saveMissingTo==="all"?de=this.languageUtils.toResolveHierarchy(s.lng||this.language):de.push(s.lng||this.language);const T=(R,Q,M)=>{var me;const ce=z&&M!==w?M:B;this.options.missingKeyHandler?this.options.missingKeyHandler(R,g,Q,ce,ee,s):(me=this.backendConnector)!=null&&me.saveMissing&&this.backendConnector.saveMissing(R,g,Q,ce,ee,s),this.emit("missingKey",R,g,Q,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&U?de.forEach(R=>{const Q=this.pluralResolver.getSuffixes(R,s);X&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(M=>{T([R],f+M,s[`defaultValue${M}`]||F)})}):T(de,f,F))}w=this.extendTranslation(w,t,s,v,i),W&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${g}${x}${f}`),(W||re)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${x}${f}`:f,re?w:void 0,s))}return o?(v.res=w,v.usedParams=this.getUsedParamsDetails(s),v):w}extendTranslation(t,a,i,s,o){var h,g;if((h=this.i18nFormat)!=null&&h.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const x=Se(t)&&(((g=i==null?void 0:i.interpolation)==null?void 0:g.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(x){const v=t.match(this.interpolator.nestingRegexp);p=v&&v.length}let b=i.replace&&!Se(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),t=this.interpolator.interpolate(t,b,i.lng||this.language||s.usedLng,i),x){const v=t.match(this.interpolator.nestingRegexp),w=v&&v.length;p<w&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...v)=>(o==null?void 0:o[0])===v[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${a[0]}`),null):this.translate(...v,a),i)),i.interpolation&&this.interpolator.reset()}const u=i.postProcess||this.options.postProcess,f=Se(u)?[u]:u;return t!=null&&(f!=null&&f.length)&&i.applyPostProcessor!==!1&&(t=Mv.handle(f,t,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,a={}){let i,s,o,u,f;return Se(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(i))return;const g=this.extractFromKey(h,a),x=g.key;s=x;let p=g.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const b=a.count!==void 0&&!Se(a.count),v=b&&!a.ordinal&&a.count===0,w=a.context!==void 0&&(Se(a.context)||typeof a.context=="number")&&a.context!=="",C=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);p.forEach(E=>{var S,N;this.isValidLookup(i)||(f=E,!Zy[`${C[0]}-${E}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((N=this.utils)!=null&&N.hasLoadedNamespace(f))&&(Zy[`${C[0]}-${E}`]=!0,this.logger.warn(`key "${s}" for languages "${C.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(D=>{var L;if(this.isValidLookup(i))return;u=D;const U=[x];if((L=this.i18nFormat)!=null&&L.addLookupKeys)this.i18nFormat.addLookupKeys(U,x,D,E,a);else{let G;b&&(G=this.pluralResolver.getSuffix(D,a.count,a));const X=`${this.options.pluralSeparator}zero`,F=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(a.ordinal&&G.indexOf(F)===0&&U.push(x+G.replace(F,this.options.pluralSeparator)),U.push(x+G),v&&U.push(x+X)),w){const _=`${x}${this.options.contextSeparator||"_"}${a.context}`;U.push(_),b&&(a.ordinal&&G.indexOf(F)===0&&U.push(_+G.replace(F,this.options.pluralSeparator)),U.push(_+G),v&&U.push(_+X))}}let z;for(;z=U.pop();)this.isValidLookup(i)||(o=z,i=this.getResource(D,E,z,a))}))})}),{res:i,usedKey:s,exactUsedKey:o,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,i,s={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,a,i,s):this.resourceStore.getResource(t,a,i,s)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Se(t.replace);let s=i?t.replace:t;if(i&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const o of a)delete s[o]}return s}static hasDefaultValue(t){const a="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&a===i.substring(0,a.length)&&t[i]!==void 0)return!0;return!1}}class Jy{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Qn.create("languageUtils")}getScriptPartFromCode(t){if(t=Js(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Js(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(Se(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let a;return t.forEach(i=>{if(a)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(a=s)}),!a&&this.options.supportedLngs&&t.forEach(i=>{if(a)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return a=s;const o=this.getLanguagePartFromCode(i);if(this.isSupportedCode(o))return a=o;a=this.options.supportedLngs.find(u=>{if(u===o)return u;if(!(u.indexOf("-")<0&&o.indexOf("-")<0)&&(u.indexOf("-")>0&&o.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===o||u.indexOf(o)===0&&o.length>1))return u})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),Se(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let i=t[a];return i||(i=t[this.getScriptPartFromCode(a)]),i||(i=t[this.formatLanguageCode(a)]),i||(i=t[this.getLanguagePartFromCode(a)]),i||(i=t.default),i||[]}toResolveHierarchy(t,a){const i=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),s=[],o=u=>{u&&(this.isSupportedCode(u)?s.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Se(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Se(t)&&o(this.formatLanguageCode(t)),i.forEach(u=>{s.indexOf(u)<0&&o(this.formatLanguageCode(u))}),s}}const Wy={zero:0,one:1,two:2,few:3,many:4,other:5},ex={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class oC{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Qn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const i=Js(t==="dev"?"en":t),s=a.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:i,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let u;try{u=new Intl.PluralRules(i,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),ex;if(!t.match(/-|_/))return ex;const h=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(h,a)}return this.pluralRulesCache[o]=u,u}needsPlural(t,a={}){let i=this.getRule(t,a);return i||(i=this.getRule("dev",a)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,a,i={}){return this.getSuffixes(t,i).map(s=>`${a}${s}`)}getSuffixes(t,a={}){let i=this.getRule(t,a);return i||(i=this.getRule("dev",a)),i?i.resolvedOptions().pluralCategories.sort((s,o)=>Wy[s]-Wy[o]).map(s=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,a,i={}){const s=this.getRule(t,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,i))}}const tx=(e,t,a,i=".",s=!0)=>{let o=Wj(e,t,a);return!o&&s&&Se(a)&&(o=fh(e,a,i),o===void 0&&(o=fh(t,a,i))),o},vf=e=>e.replace(/\$/g,"$$$$");class nx{constructor(t={}){var a;this.logger=Qn.create("interpolator"),this.options=t,this.format=((a=t==null?void 0:t.interpolation)==null?void 0:a.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:i,useRawValueToEscape:s,prefix:o,prefixEscaped:u,suffix:f,suffixEscaped:h,formatSeparator:g,unescapeSuffix:x,unescapePrefix:p,nestingPrefix:b,nestingPrefixEscaped:v,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:E,maxReplaces:S,alwaysFormat:N}=t.interpolation;this.escape=a!==void 0?a:tC,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?xr(o):u||"{{",this.suffix=f?xr(f):h||"}}",this.formatSeparator=g||",",this.unescapePrefix=x?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=b?xr(b):v||xr("$t("),this.nestingSuffix=w?xr(w):C||xr(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=S||1e3,this.alwaysFormat=N!==void 0?N:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,i)=>(a==null?void 0:a.source)===i?(a.lastIndex=0,a):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,a,i,s){var v;let o,u,f;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=w=>{if(w.indexOf(this.formatSeparator)<0){const N=tx(a,h,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,i,{...s,...a,interpolationkey:w}):N}const C=w.split(this.formatSeparator),E=C.shift().trim(),S=C.join(this.formatSeparator).trim();return this.format(tx(a,h,E,this.options.keySeparator,this.options.ignoreJSONStructure),S,i,{...s,...a,interpolationkey:E})};this.resetRegExp();const x=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((v=s==null?void 0:s.interpolation)==null?void 0:v.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>vf(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?vf(this.escape(w)):vf(w)}].forEach(w=>{for(f=0;o=w.regex.exec(t);){const C=o[1].trim();if(u=g(C),u===void 0)if(typeof x=="function"){const S=x(t,o,s);u=Se(S)?S:""}else if(s&&Object.prototype.hasOwnProperty.call(s,C))u="";else if(p){u=o[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),u="";else!Se(u)&&!this.useRawValueToEscape&&(u=Gy(u));const E=w.safeValue(u);if(t=t.replace(o[0],E),p?(w.regex.lastIndex+=u.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,a,i={}){let s,o,u;const f=(h,g)=>{const x=this.nestingOptionsSeparator;if(h.indexOf(x)<0)return h;const p=h.split(new RegExp(`${xr(x)}[ ]*{`));let b=`{${p[1]}`;h=p[0],b=this.interpolate(b,u);const v=b.match(/'/g),w=b.match(/"/g);(((v==null?void 0:v.length)??0)%2===0&&!w||((w==null?void 0:w.length)??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),g&&(u={...g,...u})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,C),`${h}${x}${b}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,h};for(;s=this.nestingRegexp.exec(t);){let h=[];u={...i},u=u.replace&&!Se(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const g=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(g!==-1&&(h=s[1].slice(g).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),s[1]=s[1].slice(0,g)),o=a(f.call(this,s[1].trim(),u),u),o&&s[0]===t&&!Se(o))return o;Se(o)||(o=Gy(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),h.length&&(o=h.reduce((x,p)=>this.format(x,p,i.lng,{...i,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const cC=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);t==="currency"&&s.indexOf(":")<0?a.currency||(a.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?a.range||(a.range=s.trim()):s.split(";").forEach(u=>{if(u){const[f,...h]=u.split(":"),g=h.join(":").trim().replace(/^'+|'+$/g,""),x=f.trim();a[x]||(a[x]=g),g==="false"&&(a[x]=!1),g==="true"&&(a[x]=!0),isNaN(g)||(a[x]=parseInt(g,10))}})}return{formatName:t,formatOptions:a}},ax=e=>{const t={};return(a,i,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const u=i+JSON.stringify(o);let f=t[u];return f||(f=e(Js(i),s),t[u]=f),f(a)}},uC=e=>(t,a,i)=>e(Js(a),i)(t);class dC{constructor(t={}){this.logger=Qn.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const i=a.cacheInBuiltFormats?ax:uC;this.formats={number:i((s,o)=>{const u=new Intl.NumberFormat(s,{...o});return f=>u.format(f)}),currency:i((s,o)=>{const u=new Intl.NumberFormat(s,{...o,style:"currency"});return f=>u.format(f)}),datetime:i((s,o)=>{const u=new Intl.DateTimeFormat(s,{...o});return f=>u.format(f)}),relativetime:i((s,o)=>{const u=new Intl.RelativeTimeFormat(s,{...o});return f=>u.format(f,o.range||"day")}),list:i((s,o)=>{const u=new Intl.ListFormat(s,{...o});return f=>u.format(f)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=ax(a)}format(t,a,i,s={}){const o=a.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(f=>f.indexOf(")")>-1)){const f=o.findIndex(h=>h.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,h)=>{var p;const{formatName:g,formatOptions:x}=cC(h);if(this.formats[g]){let b=f;try{const v=((p=s==null?void 0:s.formatParams)==null?void 0:p[s.interpolationkey])||{},w=v.locale||v.lng||s.locale||s.lng||i;b=this.formats[g](f,w,{...x,...s,...v})}catch(v){this.logger.warn(v)}return b}else this.logger.warn(`there was no format function for ${g}`);return f},t)}}const fC=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class hC extends Tc{constructor(t,a,i,s={}){var o,u;super(),this.backend=t,this.store=a,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=Qn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(u=(o=this.backend)==null?void 0:o.init)==null||u.call(o,i,s.backend,s)}queueLoad(t,a,i,s){const o={},u={},f={},h={};return t.forEach(g=>{let x=!0;a.forEach(p=>{const b=`${g}|${p}`;!i.reload&&this.store.hasResourceBundle(g,p)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?u[b]===void 0&&(u[b]=!0):(this.state[b]=1,x=!1,u[b]===void 0&&(u[b]=!0),o[b]===void 0&&(o[b]=!0),h[p]===void 0&&(h[p]=!0)))}),x||(f[g]=!0)}),(Object.keys(o).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}loaded(t,a,i){const s=t.split("|"),o=s[0],u=s[1];a&&this.emit("failedLoading",o,u,a),!a&&i&&this.store.addResourceBundle(o,u,i,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&i&&(this.state[t]=0);const f={};this.queue.forEach(h=>{Jj(h.loaded,[o],u),fC(h,t),a&&h.errors.push(a),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(g=>{f[g]||(f[g]={});const x=h.loaded[g];x.length&&x.forEach(p=>{f[g][p]===void 0&&(f[g][p]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(h=>!h.done)}read(t,a,i,s=0,o=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:i,tried:s,wait:o,callback:u});return}this.readingCalls++;const f=(g,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(g&&x&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,a,i,s+1,o*2,u)},o);return}u(g,x)},h=this.backend[i].bind(this.backend);if(h.length===2){try{const g=h(t,a);g&&typeof g.then=="function"?g.then(x=>f(null,x)).catch(f):f(null,g)}catch(g){f(g)}return}return h(t,a,f)}prepareLoading(t,a,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Se(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Se(a)&&(a=[a]);const o=this.queueLoad(t,a,i,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(u=>{this.loadOne(u)})}load(t,a,i){this.prepareLoading(t,a,{},i)}reload(t,a,i){this.prepareLoading(t,a,{reload:!0},i)}loadOne(t,a=""){const i=t.split("|"),s=i[0],o=i[1];this.read(s,o,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${a}loading namespace ${o} for language ${s} failed`,u),!u&&f&&this.logger.log(`${a}loaded namespace ${o} for language ${s}`,f),this.loaded(t,u,f)})}saveMissing(t,a,i,s,o,u={},f=()=>{}){var h,g,x,p,b;if((g=(h=this.services)==null?void 0:h.utils)!=null&&g.hasLoadedNamespace&&!((p=(x=this.services)==null?void 0:x.utils)!=null&&p.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${i}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((b=this.backend)!=null&&b.create){const v={...u,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let C;w.length===5?C=w(t,a,i,s,v):C=w(t,a,i,s),C&&typeof C.then=="function"?C.then(E=>f(null,E)).catch(f):f(null,C)}catch(C){f(C)}else w(t,a,i,s,f,v)}!t||!t[0]||this.store.addResource(t[0],a,i,s)}}}const kf=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Se(e[1])&&(t.defaultValue=e[1]),Se(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(i=>{t[i]=a[i]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),rx=e=>{var t,a;return Se(e.ns)&&(e.ns=[e.ns]),Se(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Se(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((a=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:a.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},qo=()=>{},gC=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})},_v="__i18next_supportNoticeShown",mC=()=>typeof globalThis<"u"&&!!globalThis[_v],pC=()=>{typeof globalThis<"u"&&(globalThis[_v]=!0)},yC=e=>{var t,a,i,s,o,u,f,h,g,x,p,b,v;return!!(((i=(a=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:a.name)==null?void 0:i.indexOf("Locize"))>0||((f=(u=(o=(s=e==null?void 0:e.modules)==null?void 0:s.backend)==null?void 0:o.constructor)==null?void 0:u.name)==null?void 0:f.indexOf("Locize"))>0||(g=(h=e==null?void 0:e.options)==null?void 0:h.backend)!=null&&g.backends&&e.options.backend.backends.some(w=>{var C,E,S;return((C=w==null?void 0:w.name)==null?void 0:C.indexOf("Locize"))>0||((S=(E=w==null?void 0:w.constructor)==null?void 0:E.name)==null?void 0:S.indexOf("Locize"))>0})||(p=(x=e==null?void 0:e.options)==null?void 0:x.backend)!=null&&p.projectId||(v=(b=e==null?void 0:e.options)==null?void 0:b.backend)!=null&&v.backendOptions&&e.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class Vs extends Tc{constructor(t={},a){if(super(),this.options=rx(t),this.services={},this.logger=Qn,this.modules={external:[]},gC(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(Se(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=kf();this.options={...i,...this.options,...rx(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!yC(this)&&!mC()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),pC());const s=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?Qn.init(s(this.modules.logger),this.options):Qn.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=dC;const x=new Jy(this.options);this.store=new Xy(this.options.resources,this.options);const p=this.services;p.logger=Qn,p.resourceStore=this.store,p.languageUtils=x,p.pluralResolver=new oC(x,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),g&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=s(g),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new nx(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new hC(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(v,...w)=>{this.emit(v,...w)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new uc(this.services,this.options),this.translator.on("*",(v,...w)=>{this.emit(v,...w)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,a||(a=qo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(g=>{this[g]=(...x)=>this.store[g](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...x)=>(this.store[g](...x),this)});const f=Rs(),h=()=>{const g=(x,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(p),a(x,p)};if(this.languages&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),f}loadResources(t,a=qo){var o,u;let i=a;const s=Se(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const f=[],h=g=>{if(!g||g==="cimode")return;this.services.languageUtils.toResolveHierarchy(g).forEach(p=>{p!=="cimode"&&f.indexOf(p)<0&&f.push(p)})};s?h(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(x=>h(x)),(u=(o=this.options.preload)==null?void 0:o.forEach)==null||u.call(o,g=>h(g)),this.services.backendConnector.load(f,this.options.ns,g=>{!g&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(g)})}else i(null)}reloadResources(t,a,i){const s=Rs();return typeof t=="function"&&(i=t,t=void 0),typeof a=="function"&&(i=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),i||(i=qo),this.services.backendConnector.reload(t,a,o=>{s.resolve(),i(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Mv.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a<this.languages.length;a++){const i=this.languages[a];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const i=Rs();this.emit("languageChanging",t);const s=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},o=(f,h)=>{h?this.isLanguageChangingTo===t&&(s(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,i.resolve((...g)=>this.t(...g)),a&&a(f,(...g)=>this.t(...g))},u=f=>{var x,p;!t&&!f&&this.services.languageDetector&&(f=[]);const h=Se(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Se(f)?[f]:f);g&&(this.language||s(g),this.translator.language||this.translator.changeLanguage(g),(p=(x=this.services.languageDetector)==null?void 0:x.cacheUserLanguage)==null||p.call(x,g)),this.loadResources(g,b=>{o(b,g)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),i}getFixedT(t,a,i){const s=(o,u,...f)=>{let h;typeof u!="object"?h=this.options.overloadTranslationOptionHandler([o,u].concat(f)):h={...u},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs,h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||i||s.keyPrefix);const g=this.options.keySeparator||".";let x;return h.keyPrefix&&Array.isArray(o)?x=o.map(p=>(typeof p=="function"&&(p=hh(p,{...this.options,...u})),`${h.keyPrefix}${g}${p}`)):(typeof o=="function"&&(o=hh(o,{...this.options,...u})),x=h.keyPrefix?`${h.keyPrefix}${g}${o}`:o),this.t(x,h)};return Se(t)?s.lng=t:s.lngs=t,s.ns=a,s.keyPrefix=i,s}t(...t){var a;return(a=this.translator)==null?void 0:a.translate(...t)}exists(...t){var a;return(a=this.translator)==null?void 0:a.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=a.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const u=(f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2};if(a.precheck){const f=a.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(i,t)&&(!s||u(o,t)))}loadNamespaces(t,a){const i=Rs();return this.options.ns?(Se(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),a&&a(s)}),i):(a&&a(),Promise.resolve())}loadLanguages(t,a){const i=Rs();Se(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(u=>s.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return o.length?(this.options.preload=s.concat(o),this.loadResources(u=>{i.resolve(),a&&a(u)}),i):(a&&a(),Promise.resolve())}dir(t){var s,o;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const u=new Intl.Locale(t);if(u&&u.getTextInfo){const f=u.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((o=this.services)==null?void 0:o.languageUtils)||new Jy(kf());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){const i=new Vs(t,a);return i.createInstance=Vs.createInstance,i}cloneInstance(t={},a=qo){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Vs(s);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(f=>{o[f]=this[f]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},i){const f=Object.keys(this.store.data).reduce((h,g)=>(h[g]={...this.store.data[g]},h[g]=Object.keys(h[g]).reduce((x,p)=>(x[p]={...h[g][p]},x),h[g]),h),{});o.store=new Xy(f,s),o.services.resourceStore=o.store}if(t.interpolation){const h={...kf().interpolation,...this.options.interpolation,...t.interpolation},g={...s,interpolation:h};o.services.interpolator=new nx(g)}return o.translator=new uc(o.services,s),o.translator.on("*",(f,...h)=>{o.emit(f,...h)}),o.init(s,a),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Te=Vs.createInstance();Te.createInstance;Te.dir;Te.init;Te.loadResources;Te.reloadResources;Te.use;Te.changeLanguage;Te.getFixedT;Te.t;Te.exists;Te.setDefaultNamespace;Te.hasLoadedNamespace;Te.loadNamespaces;Te.loadLanguages;const{slice:xC,forEach:bC}=[];function vC(e){return bC.call(xC.call(arguments,1),t=>{if(t)for(const a in t)e[a]===void 0&&(e[a]=t[a])}),e}function kC(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(a=>a.test(e))}const ix=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wC=function(e,t){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let o=`${e}=${s}`;if(i.maxAge>0){const u=i.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(u)}`}if(i.domain){if(!ix.test(i.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${i.domain}`}if(i.path){if(!ix.test(i.path))throw new TypeError("option path is invalid");o+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(o+="; Partitioned"),o},sx={create(e,t,a,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+a*60*1e3)),i&&(s.domain=i),document.cookie=wC(e,t,s)},read(e){const t=`${e}=`,a=document.cookie.split(";");for(let i=0;i<a.length;i++){let s=a[i];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var SC={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return sx.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:a,cookieMinutes:i,cookieDomain:s,cookieOptions:o}=t;a&&typeof document<"u"&&sx.create(a,e,i,s,o)}},jC={name:"querystring",lookup(e){var i;let{lookupQuerystring:t}=e,a;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const u=s.substring(1).split("&");for(let f=0;f<u.length;f++){const h=u[f].indexOf("=");h>0&&u[f].substring(0,h)===t&&(a=u[f].substring(h+1))}}return a}},CC={name:"hash",lookup(e){var s;let{lookupHash:t,lookupFromHashIndex:a}=e,i;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(t){const f=u.split("&");for(let h=0;h<f.length;h++){const g=f[h].indexOf("=");g>0&&f[h].substring(0,g)===t&&(i=f[h].substring(g+1))}}if(i)return i;if(!i&&a>-1){const f=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(s=f[typeof a=="number"?a:0])==null?void 0:s.replace("/",""):void 0}}}return i}};let bi=null;const lx=()=>{if(bi!==null)return bi;try{if(bi=typeof window<"u"&&window.localStorage!==null,!bi)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{bi=!1}return bi};var NC={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&lx())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:a}=t;a&&lx()&&window.localStorage.setItem(a,e)}};let vi=null;const ox=()=>{if(vi!==null)return vi;try{if(vi=typeof window<"u"&&window.sessionStorage!==null,!vi)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{vi=!1}return vi};var AC={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&ox())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:a}=t;a&&ox()&&window.sessionStorage.setItem(a,e)}},EC={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:a,userLanguage:i,language:s}=navigator;if(a)for(let o=0;o<a.length;o++)t.push(a[o]);i&&t.push(i),s&&t.push(s)}return t.length>0?t:void 0}},TC={name:"htmlTag",lookup(e){let{htmlTag:t}=e,a;const i=t||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(a=i.getAttribute("lang")),a}},MC={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(s=a[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},DC={name:"subdomain",lookup(e){var s,o;let{lookupFromSubdomainIndex:t}=e;const a=typeof t=="number"?t+1:1,i=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[a]}};let Rv=!1;try{document.cookie,Rv=!0}catch{}const Ov=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Rv||Ov.splice(1,1);const _C=()=>({order:Ov,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Lv{constructor(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,a)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=vC(a,this.options||{},_C()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(SC),this.addDetector(jC),this.addDetector(NC),this.addDetector(AC),this.addDetector(EC),this.addDetector(TC),this.addDetector(MC),this.addDetector(DC),this.addDetector(CC)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return t.forEach(i=>{if(this.detectors[i]){let s=this.detectors[i].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(a=a.concat(s))}}),a=a.filter(i=>i!=null&&!kC(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||a.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)}))}}Lv.type="languageDetector";const RC=(e,t,a,i)=>{var o,u,f,h;const s=[a,{code:t,...i||{}}];if((u=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&u.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);Ar(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(h=(f=e==null?void 0:e.services)==null?void 0:f.logger)!=null&&h.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},cx={},zv=(e,t,a,i)=>{Ar(a)&&cx[a]||(Ar(a)&&(cx[a]=new Date),RC(e,t,a,i))},Hv=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},gh=(e,t,a)=>{e.loadNamespaces(t,Hv(e,a))},ux=(e,t,a,i)=>{if(Ar(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return gh(e,a,i);a.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,Hv(e,i))},OC=(e,t,a={})=>!t.languages||!t.languages.length?(zv(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(i,s)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),Ar=e=>typeof e=="string",LC=e=>typeof e=="object"&&e!==null,zC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,HC={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},UC=e=>HC[e],IC=e=>e.replace(zC,UC);let mh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:IC,transDefaultProps:void 0};const BC=(e={})=>{mh={...mh,...e}},qC=()=>mh;let Uv;const $C=e=>{Uv=e},KC=()=>Uv,FC={type:"3rdParty",init(e){BC(e.options.react),$C(e)}},PC=j.createContext();class GC{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var wf={exports:{}},Sf={};/**
|
|
62
|
-
* @license React
|
|
63
|
-
* use-sync-external-store-shim.production.js
|
|
64
|
-
*
|
|
65
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the MIT license found in the
|
|
68
|
-
* LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/var dx;function VC(){if(dx)return Sf;dx=1;var e=Cc();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var a=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(p,b){var v=b(),w=i({inst:{value:v,getSnapshot:b}}),C=w[0].inst,E=w[1];return o(function(){C.value=v,C.getSnapshot=b,h(C)&&E({inst:C})},[p,v,b]),s(function(){return h(C)&&E({inst:C}),p(function(){h(C)&&E({inst:C})})},[p]),u(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!a(p,v)}catch{return!0}}function g(p,b){return b()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return Sf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,Sf}var fx;function YC(){return fx||(fx=1,wf.exports=VC()),wf.exports}var QC=YC();const XC=(e,t)=>Ar(t)?t:LC(t)&&Ar(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,ZC={t:XC,ready:!1},JC=()=>()=>{},le=(e,t={})=>{var F,_,q;const{i18n:a}=t,{i18n:i,defaultNS:s}=j.useContext(PC)||{},o=a||i||KC();o&&!o.reportNamespaces&&(o.reportNamespaces=new GC),o||zv(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=j.useMemo(()=>{var V;return{...qC(),...(V=o==null?void 0:o.options)==null?void 0:V.react,...t}},[o,t]),{useSuspense:f,keyPrefix:h}=u,g=e||s||((F=o==null?void 0:o.options)==null?void 0:F.defaultNS),x=Ar(g)?[g]:g||["translation"],p=j.useMemo(()=>x,x);(q=(_=o==null?void 0:o.reportNamespaces)==null?void 0:_.addUsedNamespaces)==null||q.call(_,p);const b=j.useRef(0),v=j.useCallback(V=>{if(!o)return JC;const{bindI18n:re,bindI18nStore:W}=u,J=()=>{b.current+=1,V()};return re&&o.on(re,J),W&&o.store.on(W,J),()=>{re&&re.split(" ").forEach(B=>o.off(B,J)),W&&W.split(" ").forEach(B=>o.store.off(B,J))}},[o,u]),w=j.useRef(),C=j.useCallback(()=>{if(!o)return ZC;const V=!!(o.isInitialized||o.initializedStoreOnce)&&p.every(de=>OC(de,o,u)),re=t.lng||o.language,W=b.current,J=w.current;if(J&&J.ready===V&&J.lng===re&&J.keyPrefix===h&&J.revision===W)return J;const ee={t:o.getFixedT(re,u.nsMode==="fallback"?p:p[0],h),ready:V,lng:re,keyPrefix:h,revision:W};return w.current=ee,ee},[o,p,h,u,t.lng]),[E,S]=j.useState(0),{t:N,ready:D}=QC.useSyncExternalStore(v,C,C);j.useEffect(()=>{if(o&&!D&&!f){const V=()=>S(re=>re+1);t.lng?ux(o,t.lng,p,V):gh(o,p,V)}},[o,t.lng,p,D,f,E]);const U=o||{},z=j.useRef(null),L=j.useRef(),G=V=>{const re=Object.getOwnPropertyDescriptors(V);re.__original&&delete re.__original;const W=Object.create(Object.getPrototypeOf(V),re);if(!Object.prototype.hasOwnProperty.call(W,"__original"))try{Object.defineProperty(W,"__original",{value:V,writable:!1,enumerable:!1,configurable:!1})}catch{}return W},X=j.useMemo(()=>{const V=U,re=V==null?void 0:V.language;let W=V;V&&(z.current&&z.current.__original===V?L.current!==re?(W=G(V),z.current=W,L.current=re):W=z.current:(W=G(V),z.current=W,L.current=re));const J=[N,W,D];return J.t=N,J.i18n=W,J.ready=D,J},[N,U,D,U.resolvedLanguage,U.language,U.languages]);if(o&&f&&!D)throw new Promise(V=>{const re=()=>V();t.lng?ux(o,t.lng,p,re):gh(o,p,re)});return X},WC={collapseDock:"Collapse chat",expandDock:"Expand chat",attachmentWip:"Attachments (coming soon)",placeholder:"Type a message... (Enter to send, Shift+Enter for new line)",startNewChat:"Start a new conversation",thinkingStatus:"Thinking..."},eN={defaultLabel:"Agent"},tN={sendMessage:"Send Message",killConfirm:"Kill Confirmation",inputPlaceholder:"Enter command...",killWarning:"Are you sure you want to kill <strong>{{name}}</strong>'s current run? This cannot be undone.",kill:"Kill"},nN={loadingHistory:"Loading history...",scrollToBottom:"Scroll to bottom"},aN={noSessions:"No other sessions",newSession:"New session",newSessionWith:"New session with {{agent}}",newSessionTooltip:"New chat"},rN={pause:"Pause",resume:"Resume",notSupported:"Not supported yet",kill:"Kill",sendMessage:"Send Message",viewDetail:"View Detail",operatorRequired:"Operator permission required"},iN={dock:WC,agentSelector:eN,dialog:tN,chatDialog:nN,sessionSwitcher:aN,contextMenu:rN},sN={connecting:"Connecting...",connected:"Connected",reconnecting:"Reconnecting",disconnected:"Disconnected",error:"Connection Error",active:"Active",paused:"Paused",ok:"OK",failed:"Failed",running:"Running",pending:"Pending",disabled:"Disabled"},lN={send:"Send",cancel:"Cancel",close:"Close",confirm:"Confirm",stop:"Stop",retry:"Retry",save:"Save",delete:"Delete",refresh:"Refresh",create:"Create",edit:"Edit"},oN={justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",running:"running {{seconds}}s",runningMinutes:"running {{minutes}}m {{seconds}}s"},cN={noData:"No data",noCostData:"No cost data yet",noActivityData:"No activity data yet",noRelationData:"No agent relation data yet",noEvents:"No events yet",noMatchingAgents:"No matching agents",noSubAgents:"No sub-agents",waitingUsageData:"No data, waiting for usage data..."},uN={statusLabels:{idle:"Idle",thinking:"Thinking",tool_calling:"Tool Call",speaking:"Speaking",spawning:"Spawning",error:"Error",offline:"Offline"}},dN={desk:"Desk Zone",meeting:"Meeting Zone",hotDesk:"Hot Desk Zone",lounge:"Lounge Zone"},fN={notConnected:"Not connected to Gateway",operationFailed:"Operation failed",operationTimeout:"Operation timed out, Gateway may not support this action",adapterNotInitialized:"Gateway Adapter not initialized",unknownError:"Unknown error",errorOccurred:"An error occurred"},hN={startRunning:"Started running",thinking:"Thinking",runEnded:"Run ended",fallback:"Fallback",toolCall:"Tool call: {{name}}",toolDone:"Tool done: {{name}}",errorPrefix:"Error: {{message}}",unknownStream:"unknown stream: {{stream}}",lifecycleUnknown:"lifecycle: {{phase}}"},gN={eyebrow:"Connection Setup",title:"Choose the OpenClaw connection mode",description:"On first launch, choose which Gateway the local Node proxy should forward to. The browser still connects only through /gateway-ws.",syncing:"Applying connection settings and preparing the proxy...",footer:"Local mode resets to the Office Server default Gateway. Remote mode accepts a full access link and can auto-extract the token.",actions:{continue:"Continue",connecting:"Applying..."},local:{title:"Local Gateway",description:"Use the Office Server default local Gateway and keep the original startup behavior."},remote:{title:"Remote Gateway",description:"Forward through the local Node proxy to a remote Gateway, including Aliyun-hosted services.",gatewayUrlLabel:"Gateway Access URL",gatewayUrlHint:"You can paste a full access link such as http(s)://host/path?token=...",gatewayUrlPlaceholder:"http://47.84.23.204:17202/c0957192?token=...",gatewayTokenLabel:"Gateway Token",gatewayTokenHint:"If the URL does not include a token, enter it here.",gatewayTokenExtracted:"Token detected from the access link. You can still override it manually.",gatewayTokenPlaceholder:"Enter the remote Gateway token"},validation:{gatewayUrlRequired:"Enter the remote Gateway access URL.",gatewayTokenRequired:"Enter the remote Gateway token."}},mN={status:sN,actions:lN,time:oN,empty:cN,agent:uN,zones:dN,errors:fN,events:hN,connectionSetup:gN},pN={title:"Dashboard",description:"System overview: Gateway status, channel connections, skill status",loading:"Loading dashboard data...",stats:{channels:"Channels",skills:"Skills",usage:"Provider Usage",uptime:"Uptime",uptimeOnline:"Online"},alerts:{gatewayDisconnected:"Gateway disconnected, data may not be up to date",channelErrors:"{{count}} channel(s) with errors"},connectionGuide:{title:"Cannot connect to Gateway",subtitle:"Please check the following",reconnecting:"Attempting to reconnect...",step1:"Make sure OpenClaw Gateway is running (default port 18789)",step2:"Verify the Gateway token is configured (use --token flag or install openclaw CLI for auto-detection)",step3:"If Gateway is on another host, use --gateway ws://host:port",cmdComment:"Example: start with token"},quickNav:{title:"Quick Navigation"},channelOverview:{title:"Connected Channels",empty:"No connected channels"},skillOverview:{title:"Active Skills",empty:"No enabled skills"}},yN={title:"Channels",description:"Manage messaging channels: Telegram, Discord, WhatsApp, etc.",stats:{total:"Total",connected:"Connected",errors:"Errors"},card:{lastConnected:"Last connected: {{time}}",details:"Details",logout:"Logout"},empty:{title:"No channels configured",description:"Select a channel type below to get started"},available:{title:"Available Channel Types",configured:"Configured",add:"Add"},types:{telegram:"Telegram",discord:"Discord",whatsapp:"WhatsApp",signal:"Signal",feishu:"Feishu",imessage:"iMessage",matrix:"Matrix",line:"LINE",msteams:"MS Teams",googlechat:"Google Chat",mattermost:"Mattermost"},fields:{botToken:"Bot Token",applicationId:"Application ID",phoneNumber:"Phone Number",appId:"App ID",appSecret:"App Secret",homeserver:"Homeserver URL",accessToken:"Access Token",channelAccessToken:"Channel Access Token",channelSecret:"Channel Secret",appPassword:"App Password",serviceAccount:"Service Account JSON",serverUrl:"Server URL"},placeholders:{botToken:"Enter Bot Token",applicationId:"Enter Application ID",phoneNumber:"+1...",appId:"Enter App ID",appSecret:"Enter App Secret",homeserver:"https://matrix.org",accessToken:"Enter Access Token",channelAccessToken:"Enter Channel Access Token",channelSecret:"Enter Channel Secret",appPassword:"Enter App Password",serviceAccount:"Paste Service Account JSON",serverUrl:"https://mattermost.example.com"},configDialog:{required:"This field is required",cancel:"Cancel",save:"Save"},qr:{description:"Scan the QR code with your WhatsApp mobile app to pair",startPairing:"Start Pairing",loading:"Generating QR code...",scanPrompt:"Scan QR code with your phone",waitingScan:"Waiting for scan...",success:"Paired successfully!",error:"Pairing failed"},logout:{title:"Logout Channel",description:'Are you sure you want to logout "{{name}}"? You will need to re-pair.'}},xN={title:"Skills",description:"Manage skills and plugins: install, enable/disable, configure",tabs:{installed:"Installed",marketplace:"Marketplace"},installed:{searchPlaceholder:"Search installed skills..."},filters:{all:"All ({{count}})","built-in":"Built-in ({{count}})",marketplace:"Marketplace ({{count}})"},source:{builtIn:"Built-in",marketplace:"Marketplace"},card:{configure:"Configure",install:"Install",installing:"Installing...",missingDeps:"Missing dependencies",coreProtected:"Core skill cannot be disabled"},detail:{info:"Info",source:"Source",version:"Version",author:"Author",primaryEnv:"Primary environment variable",homepage:"Homepage",requirements:"Requirements",config:"Configuration",configChecks:"Config Checks",noConfig:"This skill requires no configuration",apiKeyPlaceholder:"Enter API Key",envVars:"Environment Variables",addVariable:"Add Variable",noEnvVars:"No environment variables configured",keyPlaceholder:"Key",valuePlaceholder:"Value",enabled:"Enabled",disabled:"Disabled",saving:"Saving..."},install:{title:"Install {{name}}"},marketplace:{securityNote:"Review the skill source, homepage, and dependency requirements before installing. This web marketplace view is built from the installable skills returned by the Gateway.",searchPlaceholder:"Search marketplace skills...",searchButton:"Search",emptyTitle:"No marketplace skills",emptyDescription:"The current Gateway did not return any marketplace-ready skills",noResults:"No marketplace skills match your search",installed:"Installed",version:"Version {{version}}",author:"Author {{author}}",learnMore:"Details"},toast:{enabled:"{{name}} enabled",disabled:"{{name}} disabled",toggleFailed:"Failed to toggle skill",installSuccess:"{{name}} installed successfully",installFailed:"Failed to install {{name}}",installWarning:"Install warning"},empty:{title:"No skills found",description:"Try switching tabs or adjusting filters"}},bN={searchPlaceholder:"Search skills on ClawHub...",offlineNotice:"Cannot connect to ClawHub, showing locally installed skills",noSearchResults:"No matching skills found",tryDifferentQuery:"Try different search keywords",noSkills:"No skills available",noSkillsDescription:"ClawHub has no skills at the moment",loadMore:"Load More",downloads:"downloads",stars:"stars",viewOnClawHub:"View on ClawHub",notFound:"Skill not found",installTitle:"Install {{name}}",securityWarning:"Please review the skill source code and permissions before installing. Third-party skills may access your system.",installCommand:"Run this command in your terminal:",cancel:"Cancel",installDone:"I've installed it"},vN={showDetail:"Show details",hideDetail:"Hide details"},kN={exitCode:"Exit code",copyAll:"Copy all"},wN={pending:"Gateway restarting in {{seconds}}s...",disconnected:"Gateway disconnected, waiting for restart...",reconnecting:"Reconnecting...",complete:"Gateway is back online"},SN={effectiveNow:"Changes are active now.",savedHotReload:"Configuration saved. Gateway will apply its built-in reload handling automatically.",savedRestartRequired:"Configuration saved. Some changes require a Gateway restart to be fully applied.",savedCliRestartRequired:"Configuration saved. Run the command below to restart Gateway and apply the changes.",applyRestarting:"Configuration saved. Gateway will restart in {{seconds}}s.",disconnected:"Gateway disconnected while restart is in progress.",reconnecting:"Reconnecting to Gateway.",complete:"Gateway is back online and the latest configuration is active.",copyCommand:"Copy command",copiedCommand:"Copied",runtimeAgentModel:"Default model updated. New requests use the new model; current runs keep their existing model.",runtimeAgentModelSessionsReset:"Default model updated. Existing external channel sessions were cleared, so the next message on Feishu and similar channels will rebuild the session with the new model.",runtimeSkill:"Skill configuration updated and active immediately.",runtimeCron:"Scheduled task changes are active immediately."},jN={title:"Cron Tasks",description:"Manage cron tasks: create, edit, enable/disable, run immediately",stats:{total:"Total",active:"Active",paused:"Paused",failed:"Failed"},card:{lastRun:"Last run",nextRun:"Next run",runNow:"Run now"},presets:{everyHour:"Every hour",daily9am:"Daily 9 AM",daily6pm:"Daily 6 PM",weeklyMon:"Weekly Monday 9 AM",monthlyFirst:"Monthly 1st",every30min:"Every 30 min"},dialog:{createTitle:"Create Cron Task",editTitle:"Edit Cron Task",name:"Task Name",namePlaceholder:"Enter task name",description:"Description",descriptionPlaceholder:"Optional task description",schedule:"Schedule",cronHelp:"Standard cron expression: min hour day month weekday",message:"Message",messagePlaceholder:"Enter message to send to the agent",required:"This field is required"},empty:{title:"No cron tasks",createFirst:"Create your first task"},delete:{title:"Delete Cron Task",description:"Are you sure you want to delete this cron task? This cannot be undone."},run:{title:"Run Now",description:"Are you sure you want to run this cron task immediately?"}},CN={title:"Settings",description:"App settings: theme, provider, gateway, updates",appearance:{title:"Appearance",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeSystem:"System",language:"Language",langZh:"中文",langEn:"English"},providers:{title:"AI Providers",description:"Manage AI model provider configurations",add:"Add Provider",empty:"No AI Providers configured",emptyHint:"Click the button above to add your first provider",apiKeyConfigured:"Configured",apiKeyNotConfigured:"Not configured",systemDiscovered:"System",modelCount:"{{count}} model(s)",deleteTitle:"Delete Provider",deleteDescription:'Are you sure you want to delete provider "{{name}}"? You will need to reconfigure it.',addDialog:{title:"Add Provider",selectType:"Select Provider Type",backToSelect:"Back to type selection",providerId:"Provider ID",providerIdHint:"Unique identifier in the config file",baseUrl:"Base URL",apiKey:"API Key",apiType:"API Type",idConflict:"This Provider ID already exists",cancel:"Cancel",save:"Save",saveAndRestart:"Save and Restart"},editDialog:{title:"Edit Provider",apiKeyPlaceholder:"Leave empty to keep unchanged",cancel:"Cancel",save:"Save",saveAndRestart:"Save and Restart"},models:{title:"Models",add:"Add Model",remove:"Remove Model",empty:"No models configured. Click above to add one.",untitled:"Untitled Model",id:"Model ID",name:"Display Name",reasoning:"Reasoning",inputTypes:"Input Types",input_text:"Text",input_image:"Image",yes:"Yes",no:"No",apiOverride:"API Override",inheritProvider:"Inherit from provider",contextWindow:"Context Window",maxTokens:"Max Output Tokens",cost:"Cost ($/M tokens)",costHint:"In USD per million tokens. 0 means free.",cost_input:"Input",cost_output:"Output",cost_cacheRead:"Cache Read",cost_cacheWrite:"Cache Write",showAdvanced:"Advanced compatibility options",hideAdvanced:"Hide advanced options",default:"Default",thinkingFormat:"Thinking Format",maxTokensField:"maxTokens Field Name",compat_supportsStore:"Supports store/memory",compat_supportsDeveloperRole:"Supports developer role",compat_supportsReasoningEffort:"Supports reasoning effort",compat_supportsUsageInStreaming:"Usage in streaming",compat_supportsStrictMode:"Supports strict mode",compat_requiresToolResultName:"Requires tool result name",compat_requiresAssistantAfterToolResult:"Requires assistant after tool result",compat_requiresThinkingAsText:"Thinking as text",compat_requiresMistralToolIds:"Mistral tool IDs"}},gateway:{title:"Gateway",description:"Gateway runtime status",version:"Version",port:"Port",uptime:"Uptime",mode:"Mode",nodeVersion:"Node.js",platform:"Platform",refresh:"Refresh",notConnected:"Gateway not connected",notConnectedHint:"Make sure OpenClaw Gateway is running",uptimeFormat:"{{hours}}h {{minutes}}m"},update:{title:"Updates",currentVersion:"Current Version",channel:"Update Channel",checkUpdate:"Check for Updates",updating:"Updating...",confirmTitle:"Confirm Update",confirmDescription:"The Gateway will restart during the update and the connection will be briefly interrupted. Continue?",resultOk:"Update successful, version upgraded from {{before}} to {{after}}, Gateway is restarting",resultNoop:"Already up to date",resultError:"Update failed: {{reason}}"},advanced:{title:"Advanced",devMode:"Developer Mode",devModeHint:"Enable to show developer tools"},developer:{title:"Developer Tools",gatewayToken:"Gateway Token",tokenConfigured:"Configured",tokenHint:"Use CLI `openclaw config get gateway.auth.token` to view the full token",configPath:"Config File Path",rawConfig:"Raw Configuration",showConfig:"Show",hideConfig:"Hide",wsUrl:"WebSocket URL",connectionStatus:"Connection Status",copied:"Copied"},about:{title:"About",appName:"OpenClaw Office",tagline:"Multi-Agent collaboration visual monitoring",version:"Version",docs:"Documentation",github:"GitHub"},restartWarning:"Gateway will automatically restart after saving configuration, connection will be briefly interrupted",configConflict:"Configuration was modified by another client, automatically reloaded"},NN={statusLabels:{connected:"Connected",disconnected:"Disconnected",connecting:"Connecting",error:"Error"},taskStatus:{active:"Active",paused:"Paused"},schedule:{daily:"Daily at {{time}}",weekly:"Weekly {{day}} at {{time}}",every:"every {{minutes}}m",at:"at {{time}}",unknown:"unknown"},skillSource:{builtIn:"built-in",marketplace:"marketplace"}},AN={title:"Agent Management",description:"Manage agent configuration, core files, and model settings",panelTitle:"Agents",detailDescription:"Workspace and routing for agent {{id}}",configured:"{{count}} configured.",refresh:"Refresh",searchPlaceholder:"Search agents...",noAgents:"No agents",noAgentsDesc:"No agents configured yet",selectAgent:"Select an agent",selectAgentDesc:"Select an agent from the list to view details",defaultBadge:"DEFAULT",addAgent:"Add Agent",tabs:{overview:"Overview",files:"Files",tools:"Tools",skills:"Skills",channels:"Channels",cronJobs:"Cron Jobs"},overview:{title:"Basic Info",agentId:"Agent ID",name:"Name",workspace:"Workspace",isDefault:"Default Agent",yes:"Yes",no:"No",modelConfig:"Model Configuration",primaryModel:"Primary Model",primaryModelPlaceholder:"Select primary model...",fallbackModels:"Fallback Models",fallbackPlaceholder:"Select fallback model...",addFallback:"Add Fallback",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Failed to save",runtimeHint:"Only affects new requests; in-progress runs keep their current model.",deleteAgent:"Delete Agent",cannotDeleteDefault:"Cannot delete default agent"},files:{title:"Core Files",description:"Bootstrap persona, identity, and tool guidance.",workspace:"Workspace",noFiles:"No files",selectFile:"Select a file to view its content",content:"Content",reset:"Reset",save:"Save",saving:"Saving...",saveSuccess:"File saved",saveError:"Failed to save",unsavedChanges:"Unsaved changes",justNow:"just now",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},tools:{title:"Tool Policy",noConfig:"No tool policy configured for this agent",profile:"Policy Profile",profileDefault:"Default (full)",profileFull:"Full",profileMinimal:"Minimal",profileCustom:"Custom",alsoAllow:"Also Allow",deny:"Deny",addTool:"Add Tool",removeTool:"Remove",enabledCount:"{{enabled}}/{{total}} enabled",catalogTitle:"Tool Catalog",sourceBuiltIn:"Built-in",sourcePlugin:"Plugin",sourceWorkspace:"Workspace",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Save failed",saveConflict:"Config changed, please reload and retry",refresh:"Refresh",noTools:"No tools available",allowList:"Allow List",denyList:"Deny List",all:"All"},skills:{title:"Skill Configuration",noRestriction:"Using default skill configuration",defaultConfig:"Using default skill configuration",allowedSkills:"Allowed Skills",total:"Total",enabled:"Enabled",blocked:"Blocked",modeAll:"Use all skills",modeSelected:"Use selected skills only",modeAllDesc:"No restriction, all available skills can be used",modeSelectedDesc:"Only selected skills are allowed",coreProtected:"Core skill, cannot be deselected",blockedByAllowlist:"Blocked by allowlist",missingDeps:"Missing dependencies",sourceBuiltIn:"Built-in",sourceMarketplace:"Marketplace",selectAll:"Select All",deselectAll:"Deselect All",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Save failed",refresh:"Refresh"},restart:{required:"Configuration saved. A Gateway restart is required for changes to take effect.",restartNow:"Restart Now",restarting:"Restarting...",done:"Gateway restarted. Configuration is now active."},channels:{title:"Channel Status",noBindings:"No channels configured",gatewayInfo:"Showing Gateway-level channel status. Channel-agent bindings are managed in the config file.",connected:"Connected",disconnected:"Disconnected",connecting:"Connecting",error:"Error",configured:"Configured",notConfigured:"Not configured",refresh:"Refresh"},cronJobs:{title:"Scheduled Tasks",noCronJobs:"No scheduled tasks for this agent",addTask:"New Scheduled Task",total:"Total",enabled:"Enabled",errors:"Errors",refresh:"Refresh",confirmDelete:"Are you sure you want to delete this task?"},createDialog:{title:"Add New Agent",name:"Name",namePlaceholder:"Enter agent name",nameRequired:"Name is required",workspace:"Workspace Path",workspacePlaceholder:"e.g. ~/.openclaw/workspace-myagent",workspaceRequired:"Workspace path is required",emoji:"Emoji",emojiPlaceholder:"e.g. 🤖",cancel:"Cancel",create:"Create",creating:"Creating..."},deleteDialog:{title:"Delete Agent",confirm:'Are you sure you want to delete agent "{{name}}"? This action cannot be undone.',deleteFiles:"Also delete workspace files",cancel:"Cancel",delete:"Delete",deleting:"Deleting..."}},EN={dashboard:pN,channels:yN,skills:xN,clawhub:bN,toast:vN,commandResult:kN,restart:wN,configLifecycle:SN,cron:jN,settings:CN,viewModels:NN,agents:AN},TN={activeCount:"Active <strong>{{active}}/{{total}}</strong>",tokens:"Tokens <strong>{{count}}</strong>",activeCountText:"Active",tokensLabel:"Tokens",console:"Console",office:"Office",pageTitles:{dashboard:"Dashboard",channels:"Channels",skills:"Skills",cron:"Cron Tasks",agents:"Agents",settings:"Settings",fallback:"Console"},viewMode:{switchTo:"Switch to {{mode}} view",mobileNotSupported:"3D mode not supported on small screens",webglNotSupported:"3D rendering not supported in this browser"},theme:{switchToDark:"Switch to dark mode",switchToLight:"Switch to light mode"},language:{switchToEn:"Switch to English",switchToZh:"Switch to Chinese"}},MN={agents:"Agents",expand:"Expand sidebar",collapse:"Collapse sidebar",closeSidebar:"Close sidebar",expandSidebar:"Expand sidebar",collapseSidebar:"Collapse sidebar",metricsTitle:"Overview / Trends",agentList:"Agent List",subAgents:"Sub-Agents",agentDetail:"Agent Detail",eventTimeline:"Event Timeline",searchPlaceholder:"Search agents...",filters:{all:"All",active:"Active",idle:"Idle",error:"Error"}},DN={dashboard:"Dashboard",agents:"Agents",channels:"Channels",skills:"Skills",cron:"Cron Tasks",settings:"Settings"},_N={topbar:TN,sidebar:MN,consoleNav:DN},RN="Loading 3D scene...",ON={desk:"Desk Zone",meeting:"Meeting Zone",hotDesk:"Hot Desk Zone",lounge:"Lounge Zone"},LN={loading3D:RN,zones:ON},zN={activeAgents:"Active Agents",totalTokens:"Total Tokens",collaboration:"Collaboration",tokenRate:"Token Rate",tokenRateUnit:"/min",tabs:{overview:"Overview",trend:"Trend",topology:"Topology",activity:"Activity"}},HN={deselect:"Deselect",toolCallHistory:"Tool Call History"},UN={newEvents:"New events ↓"},IN={total:"Total:",totalLine:"Total"},BN={eventsUnit:"events"},qN={metrics:zN,agentDetail:HN,eventTimeline:UN,tokenChart:IN,activityHeatmap:BN},$N={collapseDock:"收起对话",expandDock:"展开对话",attachmentWip:"附件(开发中)",placeholder:"输入消息... (Enter 发送, Shift+Enter 换行)",startNewChat:"开始一段新的对话",thinkingStatus:"思考中..."},KN={defaultLabel:"Agent"},FN={sendMessage:"发送消息",killConfirm:"终止确认",inputPlaceholder:"输入指令...",killWarning:"确定要终止 <strong>{{name}}</strong> 的当前运行吗?此操作不可撤销。",kill:"终止"},PN={loadingHistory:"加载历史消息...",scrollToBottom:"滚动到底部"},GN={noSessions:"暂无其他会话",newSession:"新建会话",newSessionWith:"与 {{agent}} 新建会话",newSessionTooltip:"新建对话"},VN={pause:"暂停",resume:"恢复",notSupported:"暂不支持",kill:"终止",sendMessage:"发送消息",viewDetail:"查看详情",operatorRequired:"需要 operator 权限"},YN={dock:$N,agentSelector:KN,dialog:FN,chatDialog:PN,sessionSwitcher:GN,contextMenu:VN},QN={connecting:"连接中...",connected:"已连接",reconnecting:"重连中",disconnected:"未连接",error:"连接错误",active:"活跃",paused:"已暂停",ok:"正常",failed:"失败",running:"运行中",pending:"等待中",disabled:"已禁用"},XN={send:"发送",cancel:"取消",close:"关闭",confirm:"确定",stop:"停止",retry:"重试",save:"保存",delete:"删除",refresh:"刷新",create:"创建",edit:"编辑"},ZN={justNow:"刚刚",secondsAgo:"{{count}}秒前",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}时前",running:"运行 {{seconds}}s",runningMinutes:"运行 {{minutes}}m {{seconds}}s"},JN={noData:"暂无数据",noCostData:"暂无成本数据",noActivityData:"暂无活跃数据",noRelationData:"暂无 Agent 关系数据",noEvents:"暂无事件",noMatchingAgents:"无匹配 Agent",noSubAgents:"无 Sub-Agent",waitingUsageData:"暂无数据,等待 usage 数据..."},WN={statusLabels:{idle:"空闲",thinking:"思考中",tool_calling:"工具调用",speaking:"回复中",spawning:"创建中",error:"错误",offline:"离线"}},e4={desk:"固定工位区",meeting:"会议区",hotDesk:"热工位区",lounge:"休息区"},t4={notConnected:"未连接到 Gateway",operationFailed:"操作失败",operationTimeout:"操作超时,Gateway 可能暂不支持此操作",adapterNotInitialized:"Gateway Adapter 未初始化",unknownError:"未知错误",errorOccurred:"发生错误"},n4={startRunning:"开始运行",thinking:"思考中",runEnded:"运行结束",fallback:"降级处理",toolCall:"调用工具: {{name}}",toolDone:"工具完成: {{name}}",errorPrefix:"错误: {{message}}",unknownStream:"未知流: {{stream}}",lifecycleUnknown:"生命周期: {{phase}}"},a4={eyebrow:"连接引导",title:"选择 OpenClaw 连接方式",description:"首次启动时请选择要通过本地 Node 代理连接的 Gateway 类型。后续浏览器仍统一连接 /gateway-ws,由本地代理转发到对应目标。",syncing:"正在应用连接配置并准备代理...",footer:"本地模式会回到当前 Office Server 的默认 Gateway。远程模式支持粘贴完整访问链接,并自动提取其中的 token。",actions:{continue:"继续连接",connecting:"应用中..."},local:{title:"本地 Gateway",description:"使用当前 Office Server 默认的本地 Gateway 配置,保持原有启动模式。"},remote:{title:"远程 Gateway",description:"通过本地 Node 代理转发到远程 Gateway,适用于阿里云或其他托管服务。",gatewayUrlLabel:"Gateway 访问地址",gatewayUrlHint:"可直接粘贴完整访问链接,例如 http(s)://host/path?token=...",gatewayUrlPlaceholder:"http://47.84.23.204:17202/c0957192?token=...",gatewayTokenLabel:"Gateway Token",gatewayTokenHint:"如果链接里没有 token,请在这里单独填写。",gatewayTokenExtracted:"已从访问链接中自动提取 token,你也可以手动覆盖。",gatewayTokenPlaceholder:"输入远程 Gateway token"},validation:{gatewayUrlRequired:"请先填写远程 Gateway 访问地址。",gatewayTokenRequired:"请填写远程 Gateway token。"}},r4={status:QN,actions:XN,time:ZN,empty:JN,agent:WN,zones:e4,errors:t4,events:n4,connectionSetup:a4},i4={title:"仪表盘",description:"系统概览:Gateway 状态、渠道连接、技能启用情况",loading:"加载仪表盘数据...",stats:{channels:"渠道连接",skills:"启用技能",usage:"Provider 用量",uptime:"运行时间",uptimeOnline:"在线"},alerts:{gatewayDisconnected:"Gateway 未连接,数据可能不是最新",channelErrors:"{{count}} 个渠道连接异常"},connectionGuide:{title:"无法连接 Gateway",subtitle:"请检查以下配置",reconnecting:"正在尝试重新连接...",step1:"确保 OpenClaw Gateway 已启动并运行(默认端口 18789)",step2:"确认 Gateway Token 已正确配置(可通过 --token 参数或安装 openclaw CLI 自动检测)",step3:"如 Gateway 在其他主机,使用 --gateway ws://host:port 指定地址",cmdComment:"示例:指定 Token 启动"},quickNav:{title:"快捷导航"},channelOverview:{title:"已连接渠道",empty:"暂无已连接渠道"},skillOverview:{title:"活跃技能",empty:"暂无已启用技能"}},s4={title:"渠道",description:"管理消息渠道:Telegram、Discord、飞书 等",stats:{total:"总计",connected:"已连接",errors:"错误"},card:{lastConnected:"最后连接:{{time}}",details:"详情",logout:"登出"},empty:{title:"暂无已配置渠道",description:"点击下方渠道类型开始配置"},available:{title:"可用渠道类型",configured:"已配置",add:"添加"},types:{telegram:"Telegram",discord:"Discord",whatsapp:"WhatsApp",signal:"Signal",feishu:"飞书",imessage:"iMessage",matrix:"Matrix",line:"LINE",msteams:"MS Teams",googlechat:"Google Chat",mattermost:"Mattermost"},fields:{botToken:"Bot Token",applicationId:"Application ID",phoneNumber:"手机号",appId:"App ID",appSecret:"App Secret",homeserver:"Homeserver URL",accessToken:"Access Token",channelAccessToken:"Channel Access Token",channelSecret:"Channel Secret",appPassword:"App Password",serviceAccount:"Service Account JSON",serverUrl:"Server URL"},placeholders:{botToken:"输入 Bot Token",applicationId:"输入 Application ID",phoneNumber:"+86...",appId:"输入 App ID",appSecret:"输入 App Secret",homeserver:"https://matrix.org",accessToken:"输入 Access Token",channelAccessToken:"输入 Channel Access Token",channelSecret:"输入 Channel Secret",appPassword:"输入 App Password",serviceAccount:"粘贴 Service Account JSON",serverUrl:"https://mattermost.example.com"},configDialog:{required:"此字段为必填项",cancel:"取消",save:"保存"},qr:{description:"使用 WhatsApp 手机应用扫描 QR 码以配对",startPairing:"开始配对",loading:"正在获取 QR 码...",scanPrompt:"请用手机扫描 QR 码",waitingScan:"等待扫码...",success:"配对成功!",error:"配对失败"},logout:{title:"登出渠道",description:"确认要登出「{{name}}」吗?登出后需要重新配对。"}},l4={title:"技能",description:"管理技能与插件:安装、启停、配置",tabs:{installed:"已安装",marketplace:"市场"},installed:{searchPlaceholder:"搜索已安装技能..."},filters:{all:"全部 ({{count}})","built-in":"内置 ({{count}})",marketplace:"市场 ({{count}})"},source:{builtIn:"内置",marketplace:"市场"},card:{configure:"配置",install:"安装",installing:"安装中...",missingDeps:"缺少依赖",coreProtected:"核心技能不可禁用"},detail:{info:"信息",source:"来源",version:"版本",author:"作者",primaryEnv:"主环境变量",homepage:"主页",requirements:"依赖项",config:"配置",configChecks:"配置检查",noConfig:"此技能无需配置",apiKeyPlaceholder:"输入 API Key",envVars:"环境变量",addVariable:"添加变量",noEnvVars:"暂未配置环境变量",keyPlaceholder:"键名",valuePlaceholder:"值",enabled:"已启用",disabled:"已禁用",saving:"保存中..."},install:{title:"安装 {{name}}"},marketplace:{securityNote:"安装前请先审查技能来源、主页说明和依赖要求。当前 Web 端市场基于 Gateway 返回的可安装技能列表展示。",searchPlaceholder:"搜索市场技能...",searchButton:"搜索",emptyTitle:"市场暂无技能",emptyDescription:"当前 Gateway 未返回可展示的市场技能",noResults:"没有匹配的市场技能",installed:"已安装",version:"版本 {{version}}",author:"作者 {{author}}",learnMore:"详情"},toast:{enabled:"{{name}} 已启用",disabled:"{{name}} 已禁用",toggleFailed:"切换技能失败",installSuccess:"{{name}} 安装成功",installFailed:"{{name}} 安装失败",installWarning:"安装警告"},empty:{title:"暂无技能",description:"切换 Tab 或修改筛选条件"}},o4={searchPlaceholder:"在 ClawHub 上搜索技能...",offlineNotice:"无法连接 ClawHub,显示本地已安装技能",noSearchResults:"未找到匹配的技能",tryDifferentQuery:"试试不同的搜索关键词",noSkills:"暂无可用技能",noSkillsDescription:"ClawHub 当前暂无技能",loadMore:"加载更多",downloads:"次下载",stars:"个星标",viewOnClawHub:"在 ClawHub 上查看",notFound:"技能未找到",installTitle:"安装 {{name}}",securityWarning:"安装前请审查技能源代码和权限要求。第三方技能可能会访问您的系统。",installCommand:"在终端中运行以下命令:",cancel:"取消",installDone:"我已完成安装"},c4={showDetail:"查看详情",hideDetail:"收起详情"},u4={exitCode:"退出码",copyAll:"复制全部"},d4={pending:"Gateway 将在 {{seconds}} 秒后重启...",disconnected:"Gateway 已断开,等待重启...",reconnecting:"正在重新连接...",complete:"Gateway 已恢复"},f4={effectiveNow:"修改已生效。",savedHotReload:"配置已保存,Gateway 将按内置重载策略自动生效。",savedRestartRequired:"配置已保存,部分变更需要重启 Gateway 后才能完全生效。",savedCliRestartRequired:"配置已保存,请执行下方命令重启 Gateway 后生效。",applyRestarting:"配置已保存,Gateway 将在 {{seconds}} 秒后重启。",disconnected:"Gateway 已断开,等待重启恢复。",reconnecting:"Gateway 正在重新连接。",complete:"Gateway 已恢复,最新配置已生效。",copyCommand:"复制命令",copiedCommand:"已复制",runtimeAgentModel:"默认模型已更新。新请求会使用新模型,进行中的运行不会切换。",runtimeAgentModelSessionsReset:"默认模型已更新。已清理该智能体的外部渠道会话缓存,飞书等渠道的下一条消息会以新模型重建会话。",runtimeSkill:"技能配置已更新,并已立即生效。",runtimeCron:"定时任务配置已更新,并已立即生效。"},h4={title:"定时任务",description:"管理定时任务:创建、编辑、启停、立即执行",stats:{total:"总计",active:"运行中",paused:"已暂停",failed:"失败"},card:{lastRun:"上次运行",nextRun:"下次运行",runNow:"立即执行"},presets:{everyHour:"每小时",daily9am:"每天 9:00",daily6pm:"每天 18:00",weeklyMon:"每周一 9:00",monthlyFirst:"每月 1 日",every30min:"每 30 分钟"},dialog:{createTitle:"创建定时任务",editTitle:"编辑定时任务",name:"任务名称",namePlaceholder:"输入任务名称",description:"描述",descriptionPlaceholder:"可选的任务描述",schedule:"执行计划",cronHelp:"标准 cron 表达式:分 时 日 月 周",message:"消息内容",messagePlaceholder:"输入发送给 Agent 的消息",required:"此字段为必填项"},empty:{title:"暂无定时任务",createFirst:"创建第一个任务"},delete:{title:"删除定时任务",description:"确认要删除此定时任务吗?此操作不可撤销。"},run:{title:"立即执行",description:"确认要立即执行此定时任务吗?"}},g4={title:"设置",description:"应用设置:主题、Provider、Gateway、更新",appearance:{title:"外观",theme:"主题",themeLight:"浅色",themeDark:"深色",themeSystem:"跟随系统",language:"语言",langZh:"中文",langEn:"英文"},providers:{title:"AI 提供方",description:"管理 AI 模型供应商配置",add:"添加提供方",empty:"尚未配置 AI 提供方",emptyHint:"点击上方按钮添加第一个 AI 提供方",apiKeyConfigured:"已配置",apiKeyNotConfigured:"未配置",systemDiscovered:"系统发现",modelCount:"{{count}} 个模型",deleteTitle:"删除提供方",deleteDescription:"确认要删除提供方「{{name}}」吗?删除后需要重新配置。",addDialog:{title:"添加提供方",selectType:"选择提供方类型",backToSelect:"返回选择类型",providerId:"提供方 ID",providerIdHint:"配置文件中的唯一标识",baseUrl:"基础 URL",apiKey:"API Key",apiType:"API 类型",idConflict:"该提供方 ID 已存在",cancel:"取消",save:"保存",saveAndRestart:"保存并重启"},editDialog:{title:"编辑提供方",apiKeyPlaceholder:"留空保持不变",cancel:"取消",save:"保存",saveAndRestart:"保存并重启"},models:{title:"模型列表",add:"添加模型",remove:"删除模型",empty:"暂未配置模型,点击上方按钮添加",untitled:"未命名模型",id:"模型 ID",name:"显示名称",reasoning:"推理能力",inputTypes:"输入类型",input_text:"文本",input_image:"图片",yes:"支持",no:"不支持",apiOverride:"API 覆盖",inheritProvider:"继承提供方",contextWindow:"上下文窗口",maxTokens:"最大输出 Token",cost:"计费($/百万 Token)",costHint:"单位为美元/百万 Token,0 表示免费",cost_input:"输入",cost_output:"输出",cost_cacheRead:"缓存读取",cost_cacheWrite:"缓存写入",showAdvanced:"高级兼容性选项",hideAdvanced:"收起高级选项",default:"默认",thinkingFormat:"思考格式",maxTokensField:"maxTokens 字段名",compat_supportsStore:"支持存储/记忆",compat_supportsDeveloperRole:"支持开发者角色",compat_supportsReasoningEffort:"支持推理强度",compat_supportsUsageInStreaming:"流式返回用量",compat_supportsStrictMode:"支持严格模式",compat_requiresToolResultName:"工具结果需含名称",compat_requiresAssistantAfterToolResult:"工具结果后需 assistant",compat_requiresThinkingAsText:"思考以文本返回",compat_requiresMistralToolIds:"Mistral 工具 ID"}},gateway:{title:"Gateway",description:"Gateway 运行状态",version:"版本",port:"端口",uptime:"运行时间",mode:"运行模式",nodeVersion:"Node.js",platform:"平台",refresh:"刷新",notConnected:"Gateway 未连接",notConnectedHint:"请确保 OpenClaw Gateway 正在运行",uptimeFormat:"{{hours}}h {{minutes}}m"},update:{title:"更新",currentVersion:"当前版本",channel:"更新通道",checkUpdate:"检查更新",updating:"正在更新...",confirmTitle:"确认更新",confirmDescription:"更新过程中 Gateway 将重启,连接将短暂中断。确定继续?",resultOk:"更新成功,版本从 {{before}} 升级到 {{after}},Gateway 正在重启",resultNoop:"已是最新版本",resultError:"更新失败:{{reason}}"},advanced:{title:"高级",devMode:"开发者模式",devModeHint:"启用后将显示开发者工具选项"},developer:{title:"开发者工具",gatewayToken:"Gateway Token",tokenConfigured:"已配置",tokenHint:"使用 CLI `openclaw config get gateway.auth.token` 查看完整 Token",configPath:"配置文件路径",rawConfig:"原始配置",showConfig:"展开",hideConfig:"收起",wsUrl:"WebSocket URL",connectionStatus:"连接状态",copied:"已复制"},about:{title:"关于",appName:"OpenClaw Office",tagline:"多 Agent 协作可视化监控",version:"版本",docs:"文档",github:"GitHub"},restartWarning:"保存配置后 Gateway 将自动重启,连接将短暂中断",configConflict:"配置已被其他客户端修改,已自动重新加载"},m4={statusLabels:{connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误"},taskStatus:{active:"活跃",paused:"已暂停"},schedule:{daily:"每天 {{time}}",weekly:"每周 {{day}} {{time}}",every:"每 {{minutes}}m",at:"于 {{time}}",unknown:"未知"},skillSource:{builtIn:"内置",marketplace:"市场"}},p4={title:"智能体管理",description:"管理智能体配置、核心文件和模型设置",panelTitle:"智能体",detailDescription:"智能体 {{id}} 的工作空间与路由配置",configured:"已配置 {{count}} 个",refresh:"刷新",searchPlaceholder:"搜索智能体...",noAgents:"暂无智能体",noAgentsDesc:"尚未配置任何智能体",selectAgent:"选择一个智能体",selectAgentDesc:"从左侧列表中选择一个智能体查看详情",defaultBadge:"默认",addAgent:"添加智能体",tabs:{overview:"概览",files:"文件",tools:"工具",skills:"技能",channels:"渠道",cronJobs:"定时任务"},overview:{title:"基本信息",agentId:"智能体 ID",name:"名称",workspace:"工作空间",isDefault:"默认智能体",yes:"是",no:"否",modelConfig:"模型配置",primaryModel:"主模型",primaryModelPlaceholder:"选择主模型...",fallbackModels:"备选模型",fallbackPlaceholder:"选择备用模型...",addFallback:"添加备选模型",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",runtimeHint:"仅影响后续新请求;当前正在运行的会话会继续使用已有模型。",deleteAgent:"删除智能体",cannotDeleteDefault:"无法删除默认智能体"},files:{title:"核心文件",description:"引导式角色设定、身份信息与工具使用说明。",workspace:"工作空间",noFiles:"暂无文件",selectFile:"选择一个文件查看内容",content:"内容",reset:"重置",save:"保存",saving:"保存中...",saveSuccess:"文件已保存",saveError:"保存失败",unsavedChanges:"有未保存的更改",justNow:"刚刚",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前"},tools:{title:"工具策略",noConfig:"该智能体未配置工具策略",profile:"策略 Profile",profileDefault:"默认(full)",profileFull:"完整",profileMinimal:"最小化",profileCustom:"自定义",alsoAllow:"额外允许",deny:"禁止",addTool:"添加工具",removeTool:"移除",enabledCount:"已启用 {{enabled}}/{{total}}",catalogTitle:"工具目录",sourceBuiltIn:"内置",sourcePlugin:"插件",sourceWorkspace:"工作区",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",saveConflict:"配置已被修改,请重新加载后再试",refresh:"刷新",noTools:"暂无工具",allowList:"允许列表",denyList:"禁止列表",all:"全部"},skills:{title:"技能配置",noRestriction:"使用默认技能配置",defaultConfig:"使用默认技能配置",allowedSkills:"允许的技能",total:"总数",enabled:"已启用",blocked:"被限制",modeAll:"使用全部技能",modeSelected:"仅使用选中的技能",modeAllDesc:"不限制,所有可用技能均可使用",modeSelectedDesc:"仅允许选中的技能被使用",coreProtected:"核心技能,无法取消",blockedByAllowlist:"被白名单限制",missingDeps:"缺少依赖",sourceBuiltIn:"内置",sourceMarketplace:"市场",selectAll:"全选",deselectAll:"全不选",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",refresh:"刷新"},restart:{required:"配置已保存,需要重启 Gateway 才能生效。",restartNow:"立即重启",restarting:"重启中...",done:"Gateway 已重启,配置已生效。"},channels:{title:"渠道状态",noBindings:"未配置渠道",gatewayInfo:"此处展示 Gateway 级渠道状态。渠道与智能体的绑定关系请在配置文件中管理。",connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误",configured:"已配置",notConfigured:"未配置",refresh:"刷新"},cronJobs:{title:"定时任务",noCronJobs:"该智能体无定时任务",addTask:"新建定时任务",total:"总数",enabled:"已启用",errors:"错误",refresh:"刷新",confirmDelete:"确定要删除此定时任务吗?"},createDialog:{title:"添加新智能体",name:"名称",namePlaceholder:"输入智能体名称",nameRequired:"请输入名称",workspace:"工作空间路径",workspacePlaceholder:"例如: ~/.openclaw/workspace-myagent",workspaceRequired:"请输入工作空间路径",emoji:"表情",emojiPlaceholder:"例如: 🤖",cancel:"取消",create:"创建",creating:"创建中..."},deleteDialog:{title:"删除智能体",confirm:"确认要删除智能体「{{name}}」吗?此操作不可逆。",deleteFiles:"同时删除工作空间文件",cancel:"取消",delete:"删除",deleting:"删除中..."}},y4={dashboard:i4,channels:s4,skills:l4,clawhub:o4,toast:c4,commandResult:u4,restart:d4,configLifecycle:f4,cron:h4,settings:g4,viewModels:m4,agents:p4},x4={activeCount:"活跃 <strong>{{active}}/{{total}}</strong>",tokens:"Tokens <strong>{{count}}</strong>",activeCountText:"活跃",tokensLabel:"Tokens",console:"控制台",office:"办公室",pageTitles:{dashboard:"仪表盘",channels:"渠道",skills:"技能",cron:"定时任务",agents:"智能体管理",settings:"设置",fallback:"控制台"},viewMode:{switchTo:"切换到 {{mode}} 视图",mobileNotSupported:"小屏幕不支持 3D 模式",webglNotSupported:"当前浏览器不支持 3D 渲染"},theme:{switchToDark:"切换到暗色模式",switchToLight:"切换到亮色模式"},language:{switchToEn:"切换到英文",switchToZh:"切换到中文"}},b4={agents:"智能体",expand:"展开侧栏",collapse:"折叠侧栏",closeSidebar:"关闭侧栏",expandSidebar:"展开侧栏",collapseSidebar:"收起侧栏",metricsTitle:"概览 / 趋势",agentList:"智能体 列表",subAgents:"子智能体",agentDetail:"智能体 详情",eventTimeline:"事件时间轴",searchPlaceholder:"搜索 Agent...",filters:{all:"全部",active:"活跃",idle:"空闲",error:"错误"}},v4={dashboard:"仪表盘",agents:"智能体",channels:"渠道",skills:"技能",cron:"定时任务",settings:"设置"},k4={topbar:x4,sidebar:b4,consoleNav:v4},w4="加载 3D 场景...",S4={desk:"固定工位区",meeting:"会议区",hotDesk:"热工位区",lounge:"休息区"},j4={loading3D:w4,zones:S4},C4={activeAgents:"活跃 Agent",totalTokens:"总 Tokens",collaboration:"协作度",tokenRate:"Token 速率",tokenRateUnit:"/min",tabs:{overview:"概览",trend:"趋势",topology:"拓扑",activity:"活跃"}},N4={deselect:"取消选择",toolCallHistory:"工具调用历史"},A4={newEvents:"新事件 ↓"},E4={total:"总:",totalLine:"总量"},T4={eventsUnit:"events"},M4={metrics:C4,agentDetail:N4,eventTimeline:A4,tokenChart:E4,activityHeatmap:T4},D4=["zh","en"],_4=["common","layout","office","panels","chat","console"];Te.use(Lv).use(FC).init({resources:{zh:{common:r4,layout:k4,office:j4,panels:M4,chat:YN,console:y4},en:{common:mN,layout:_N,office:LN,panels:qN,chat:iN,console:EN}},supportedLngs:[...D4],fallbackLng:"zh",defaultNS:"common",ns:[..._4],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"i18nextLng"}});const R4="modulepreload",O4=function(e){return"/"+e},hx={},fl=function(t,a,i){let s=Promise.resolve();if(a&&a.length>0){let u=function(g){return Promise.all(g.map(x=>Promise.resolve(x).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=u(a.map(g=>{if(g=O4(g),g in hx)return;hx[g]=!0;const x=g.endsWith(".css"),p=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${p}`))return;const b=document.createElement("link");if(b.rel=x?"stylesheet":R4,x||(b.as="script"),b.crossOrigin="",b.href=g,h&&b.setAttribute("nonce",h),document.head.appendChild(b),x)return new Promise((v,w)=>{b.addEventListener("load",v),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return s.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})};/**
|
|
70
|
-
* @license lucide-react v0.575.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const Iv=(...e)=>e.filter((t,a,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===a).join(" ").trim();/**
|
|
75
|
-
* @license lucide-react v0.575.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const L4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
80
|
-
* @license lucide-react v0.575.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const z4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,i)=>i?i.toUpperCase():a.toLowerCase());/**
|
|
85
|
-
* @license lucide-react v0.575.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const gx=e=>{const t=z4(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
90
|
-
* @license lucide-react v0.575.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/var H4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
95
|
-
* @license lucide-react v0.575.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const U4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
100
|
-
* @license lucide-react v0.575.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const I4=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:u,...f},h)=>j.createElement("svg",{ref:h,...H4,width:t,height:t,stroke:e,strokeWidth:i?Number(a)*24/Number(t):a,className:Iv("lucide",s),...!o&&!U4(f)&&{"aria-hidden":"true"},...f},[...u.map(([g,x])=>j.createElement(g,x)),...Array.isArray(o)?o:[o]]));/**
|
|
105
|
-
* @license lucide-react v0.575.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const he=(e,t)=>{const a=j.forwardRef(({className:i,...s},o)=>j.createElement(I4,{ref:o,iconNode:t,className:Iv(`lucide-${L4(gx(e))}`,`lucide-${e}`,i),...s}));return a.displayName=gx(e),a};/**
|
|
110
|
-
* @license lucide-react v0.575.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const B4=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],q4=he("arrow-down",B4);/**
|
|
115
|
-
* @license lucide-react v0.575.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const $4=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Bv=he("arrow-left",$4);/**
|
|
120
|
-
* @license lucide-react v0.575.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const K4=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],qv=he("bot",K4);/**
|
|
125
|
-
* @license lucide-react v0.575.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const F4=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],P4=he("brain-circuit",F4);/**
|
|
130
|
-
* @license lucide-react v0.575.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const G4=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],dc=he("brain",G4);/**
|
|
135
|
-
* @license lucide-react v0.575.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const V4=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jr=he("check",V4);/**
|
|
140
|
-
* @license lucide-react v0.575.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Y4=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Un=he("chevron-down",Y4);/**
|
|
145
|
-
* @license lucide-react v0.575.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const Q4=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],X4=he("chevron-right",Q4);/**
|
|
150
|
-
* @license lucide-react v0.575.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const Z4=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Qh=he("chevron-up",Z4);/**
|
|
155
|
-
* @license lucide-react v0.575.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const J4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Xh=he("circle-alert",J4);/**
|
|
160
|
-
* @license lucide-react v0.575.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const W4=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ri=he("circle-check-big",W4);/**
|
|
165
|
-
* @license lucide-react v0.575.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const e5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Mc=he("circle-x",e5);/**
|
|
170
|
-
* @license lucide-react v0.575.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const t5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Oi=he("clock",t5);/**
|
|
175
|
-
* @license lucide-react v0.575.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const n5=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Zh=he("copy",n5);/**
|
|
180
|
-
* @license lucide-react v0.575.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const a5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ws=he("download",a5);/**
|
|
185
|
-
* @license lucide-react v0.575.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const r5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],fc=he("external-link",r5);/**
|
|
190
|
-
* @license lucide-react v0.575.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const i5=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Dc=he("eye-off",i5);/**
|
|
195
|
-
* @license lucide-react v0.575.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const s5=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_c=he("eye",s5);/**
|
|
200
|
-
* @license lucide-react v0.575.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const l5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],o5=he("globe",l5);/**
|
|
205
|
-
* @license lucide-react v0.575.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const c5=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],u5=he("house",c5);/**
|
|
210
|
-
* @license lucide-react v0.575.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const d5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],hc=he("image",d5);/**
|
|
215
|
-
* @license lucide-react v0.575.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const f5=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],h5=he("inbox",f5);/**
|
|
220
|
-
* @license lucide-react v0.575.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const g5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Rc=he("info",g5);/**
|
|
225
|
-
* @license lucide-react v0.575.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const m5=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],p5=he("layout-dashboard",m5);/**
|
|
230
|
-
* @license lucide-react v0.575.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const y5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Dt=he("loader-circle",y5);/**
|
|
235
|
-
* @license lucide-react v0.575.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const x5=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],$v=he("lock",x5);/**
|
|
240
|
-
* @license lucide-react v0.575.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const b5=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],v5=he("log-out",b5);/**
|
|
245
|
-
* @license lucide-react v0.575.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const k5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],w5=he("maximize-2",k5);/**
|
|
250
|
-
* @license lucide-react v0.575.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const S5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],j5=he("message-square",S5);/**
|
|
255
|
-
* @license lucide-react v0.575.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const C5=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],N5=he("minimize-2",C5);/**
|
|
260
|
-
* @license lucide-react v0.575.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const A5=[["path",{d:"M5 12h14",key:"1ays0h"}]],E5=he("minus",A5);/**
|
|
265
|
-
* @license lucide-react v0.575.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const T5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],M5=he("monitor",T5);/**
|
|
270
|
-
* @license lucide-react v0.575.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const D5=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],_5=he("moon",D5);/**
|
|
275
|
-
* @license lucide-react v0.575.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const R5=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],$o=he("package",R5);/**
|
|
280
|
-
* @license lucide-react v0.575.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const O5=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Kv=he("paperclip",O5);/**
|
|
285
|
-
* @license lucide-react v0.575.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const L5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Fv=he("pencil",L5);/**
|
|
290
|
-
* @license lucide-react v0.575.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const z5=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],H5=he("play",z5);/**
|
|
295
|
-
* @license lucide-react v0.575.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const U5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jn=he("plus",U5);/**
|
|
300
|
-
* @license lucide-react v0.575.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const I5=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Pv=he("puzzle",I5);/**
|
|
305
|
-
* @license lucide-react v0.575.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const B5=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],hl=he("radio",B5);/**
|
|
310
|
-
* @license lucide-react v0.575.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const q5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Nn=he("refresh-cw",q5);/**
|
|
315
|
-
* @license lucide-react v0.575.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const $5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ph=he("search",$5);/**
|
|
320
|
-
* @license lucide-react v0.575.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const K5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Gv=he("send",K5);/**
|
|
325
|
-
* @license lucide-react v0.575.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const F5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Jh=he("settings",F5);/**
|
|
330
|
-
* @license lucide-react v0.575.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const P5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],G5=he("shield-alert",P5);/**
|
|
335
|
-
* @license lucide-react v0.575.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const V5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Y5=he("shield-check",V5);/**
|
|
340
|
-
* @license lucide-react v0.575.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const Q5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],X5=he("shield",Q5);/**
|
|
345
|
-
* @license lucide-react v0.575.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const Z5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],J5=he("sparkles",Z5);/**
|
|
350
|
-
* @license lucide-react v0.575.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const W5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],e3=he("square-check-big",W5);/**
|
|
355
|
-
* @license lucide-react v0.575.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const t3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Wh=he("square",t3);/**
|
|
360
|
-
* @license lucide-react v0.575.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const n3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Vv=he("star",n3);/**
|
|
365
|
-
* @license lucide-react v0.575.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const a3=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],r3=he("sun",a3);/**
|
|
370
|
-
* @license lucide-react v0.575.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const i3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Yv=he("terminal",i3);/**
|
|
375
|
-
* @license lucide-react v0.575.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const s3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],gl=he("trash-2",s3);/**
|
|
380
|
-
* @license lucide-react v0.575.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const l3=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],o3=he("trending-up",l3);/**
|
|
385
|
-
* @license lucide-react v0.575.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const c3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Li=he("triangle-alert",c3);/**
|
|
390
|
-
* @license lucide-react v0.575.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const u3=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],d3=he("type",u3);/**
|
|
395
|
-
* @license lucide-react v0.575.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const f3=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],h3=he("user",f3);/**
|
|
400
|
-
* @license lucide-react v0.575.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const g3=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],eg=he("wifi-off",g3);/**
|
|
405
|
-
* @license lucide-react v0.575.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const m3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Oc=he("wrench",m3);/**
|
|
410
|
-
* @license lucide-react v0.575.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const p3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sn=he("x",p3);/**
|
|
415
|
-
* @license lucide-react v0.575.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const y3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qv=he("zap",y3);function yh(){return yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)({}).hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},yh.apply(null,arguments)}function x3(e,t){if(e==null)return{};var a={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;a[i]=e[i]}return a}var b3=j.useLayoutEffect,v3=function(t){var a=wr.useRef(t);return b3(function(){a.current=t}),a},mx=function(t,a){if(typeof t=="function"){t(a);return}t.current=a},k3=function(t,a){var i=wr.useRef();return wr.useCallback(function(s){t.current=s,i.current&&mx(i.current,null),i.current=a,a&&mx(a,s)},[a])},px={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},w3=function(t){Object.keys(px).forEach(function(a){t.style.setProperty(a,px[a],"important")})},yx=w3,Ut=null,xx=function(t,a){var i=t.scrollHeight;return a.sizingStyle.boxSizing==="border-box"?i+a.borderSize:i-a.paddingSize};function S3(e,t,a,i){a===void 0&&(a=1),i===void 0&&(i=1/0),Ut||(Ut=document.createElement("textarea"),Ut.setAttribute("tabindex","-1"),Ut.setAttribute("aria-hidden","true"),yx(Ut)),Ut.parentNode===null&&document.body.appendChild(Ut);var s=e.paddingSize,o=e.borderSize,u=e.sizingStyle,f=u.boxSizing;Object.keys(u).forEach(function(b){var v=b;Ut.style[v]=u[v]}),yx(Ut),Ut.value=t;var h=xx(Ut,e);Ut.value=t,h=xx(Ut,e),Ut.value="x";var g=Ut.scrollHeight-s,x=g*a;f==="border-box"&&(x=x+s+o),h=Math.max(x,h);var p=g*i;return f==="border-box"&&(p=p+s+o),h=Math.min(p,h),[h,g]}var bx=function(){},j3=function(t,a){return t.reduce(function(i,s){return i[s]=a[s],i},{})},C3=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],N3=!!document.documentElement.currentStyle,A3=function(t){var a=window.getComputedStyle(t);if(a===null)return null;var i=j3(C3,a),s=i.boxSizing;if(s==="")return null;N3&&s==="border-box"&&(i.width=parseFloat(i.width)+parseFloat(i.borderRightWidth)+parseFloat(i.borderLeftWidth)+parseFloat(i.paddingRight)+parseFloat(i.paddingLeft)+"px");var o=parseFloat(i.paddingBottom)+parseFloat(i.paddingTop),u=parseFloat(i.borderBottomWidth)+parseFloat(i.borderTopWidth);return{sizingStyle:i,paddingSize:o,borderSize:u}},E3=A3;function tg(e,t,a){var i=v3(a);j.useLayoutEffect(function(){var s=function(u){return i.current(u)};if(e)return e.addEventListener(t,s),function(){return e.removeEventListener(t,s)}},[])}var T3=function(t,a){tg(document.body,"reset",function(i){t.current.form===i.target&&a(i)})},M3=function(t){tg(window,"resize",t)},D3=function(t){tg(document.fonts,"loadingdone",t)},_3=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],R3=function(t,a){var i=t.cacheMeasurements,s=t.maxRows,o=t.minRows,u=t.onChange,f=u===void 0?bx:u,h=t.onHeightChange,g=h===void 0?bx:h,x=x3(t,_3),p=x.value!==void 0,b=j.useRef(null),v=k3(b,a),w=j.useRef(0),C=j.useRef(),E=function(){var D=b.current,U=i&&C.current?C.current:E3(D);if(U){C.current=U;var z=S3(U,D.value||D.placeholder||"x",o,s),L=z[0],G=z[1];w.current!==L&&(w.current=L,D.style.setProperty("height",L+"px","important"),g(L,{rowHeight:G}))}},S=function(D){p||E(),f(D)};return j.useLayoutEffect(E),T3(b,function(){if(!p){var N=b.current.value;requestAnimationFrame(function(){var D=b.current;D&&N!==D.value&&E()})}}),M3(E),D3(E),j.createElement("textarea",yh({},x,{onChange:S,ref:v}))},Xv=j.forwardRef(R3);const vx=e=>{let t;const a=new Set,i=(g,x)=>{const p=typeof g=="function"?g(t):g;if(!Object.is(p,t)){const b=t;t=x??(typeof p!="object"||p===null)?p:Object.assign({},t,p),a.forEach(v=>v(t,b))}},s=()=>t,f={setState:i,getState:s,getInitialState:()=>h,subscribe:g=>(a.add(g),()=>a.delete(g))},h=t=e(i,s,f);return f},O3=(e=>e?vx(e):vx),L3=e=>e;function z3(e,t=L3){const a=wr.useSyncExternalStore(e.subscribe,wr.useCallback(()=>t(e.getState()),[e,t]),wr.useCallback(()=>t(e.getInitialState()),[e,t]));return wr.useDebugValue(a),a}const kx=e=>{const t=O3(e),a=i=>z3(t,i);return Object.assign(a,t),a},In=(e=>e?kx(e):kx),H3=[{id:"telegram:bot1",type:"telegram",name:"MyBot",status:"connected",accountId:"bot1",configured:!0,linked:!0,running:!0,lastConnectedAt:Date.now()-6e4},{id:"discord:srv1",type:"discord",name:"Dev Server",status:"connected",accountId:"srv1",configured:!0,linked:!0,running:!0,lastConnectedAt:Date.now()-12e4},{id:"whatsapp:wa1",type:"whatsapp",name:"WhatsApp",status:"disconnected",accountId:"wa1",configured:!0,linked:!1,running:!1},{id:"signal:sig1",type:"signal",name:"Signal",status:"error",accountId:"sig1",configured:!0,linked:!1,running:!1,error:"Session expired"}],U3=[{id:"web-search",slug:"web-search",name:"Web Search",description:"搜索互联网获取实时信息",enabled:!0,icon:"🔍",version:"1.0.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0,requirements:{bins:["curl"]},missing:{bins:[]},configChecks:[{path:"SEARCH_API_KEY",satisfied:!0}],primaryEnv:"SEARCH_API_KEY"},{id:"code-interpreter",slug:"code-interpreter",name:"Code Interpreter",description:"执行代码并返回结果",enabled:!0,icon:"💻",version:"1.2.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0},{id:"file-editor",slug:"file-editor",name:"File Editor",description:"读写本地文件",enabled:!0,icon:"📝",version:"1.0.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0},{id:"image-gen",slug:"image-gen",name:"Image Generation",description:"使用 AI 生成图片",enabled:!0,icon:"🎨",version:"0.9.0",isBundled:!1,source:"marketplace",eligible:!0,installOptions:[{id:"node",kind:"npm",label:"npm install"}],homepage:"https://github.com/openclaw/image-gen"},{id:"playwright",slug:"playwright",name:"Playwright",description:"浏览器自动化与测试",enabled:!0,icon:"🎭",version:"1.1.0",isBundled:!1,source:"marketplace",eligible:!0,installOptions:[{id:"brew",kind:"brew",label:"Homebrew"},{id:"npm",kind:"npm",label:"npm install"}],requirements:{bins:["playwright"]},missing:{bins:[]}},{id:"voice-call",slug:"voice-call",name:"Voice Call",description:"语音通话技能",enabled:!1,icon:"📞",version:"0.5.0",isBundled:!1,source:"marketplace",eligible:!1,blockedByAllowlist:!0}],wx=[{id:"cron-1",name:"每日摘要",description:"每天下午6点生成工作摘要",schedule:{kind:"cron",expr:"0 18 * * *"},enabled:!0,createdAtMs:Date.now()-7*864e5,updatedAtMs:Date.now()-864e5,sessionTarget:"main",wakeMode:"now",payload:{kind:"agentTurn",message:"生成今日工作摘要"},delivery:{mode:"notify",channel:"telegram",target:"bot1"},state:{lastRunAtMs:Date.now()-864e5,lastRunStatus:"ok",nextRunAtMs:Date.now()+36e5}},{id:"cron-2",name:"周报提醒",description:"每周一早上9点发送周报提醒",schedule:{kind:"cron",expr:"0 9 * * 1"},enabled:!1,createdAtMs:Date.now()-14*864e5,updatedAtMs:Date.now()-3*864e5,sessionTarget:"isolated",wakeMode:"next-heartbeat",payload:{kind:"agentTurn",message:"请提交本周周报"},state:{lastRunAtMs:Date.now()-7*864e5,lastRunStatus:"ok"}},{id:"cron-3",name:"健康检查",schedule:{kind:"every",everyMs:18e5},enabled:!0,createdAtMs:Date.now()-30*864e5,updatedAtMs:Date.now(),sessionTarget:"main",wakeMode:"now",payload:{kind:"agentTurn",message:"执行系统健康检查"},state:{lastRunAtMs:Date.now()-12e5,lastRunStatus:"error",lastError:"Agent timeout",nextRunAtMs:Date.now()+6e5}}],jf="__OPENCLAW_REDACTED__";function I3(){return{models:{providers:{anthropic:{baseUrl:"https://api.anthropic.com",apiKey:jf,api:"anthropic-messages",models:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:16384},{id:"claude-opus-4-20250514",name:"Claude Opus 4",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:32768},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",reasoning:!1,input:["text","image"],contextWindow:2e5,maxTokens:8192}]},openai:{baseUrl:"https://api.openai.com/v1",apiKey:jf,api:"openai-responses",models:[{id:"gpt-4o",name:"GPT-4o",reasoning:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384},{id:"o3",name:"o3",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:1e5},{id:"gpt-4o-mini",name:"GPT-4o Mini",reasoning:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384}]}}},agents:{defaults:{subagents:{maxConcurrent:12,maxSpawnDepth:2}},list:[{id:"main",model:"anthropic/claude-sonnet-4-20250514"},{id:"ai-researcher",model:"anthropic/claude-opus-4-20250514"},{id:"coder",model:"anthropic/claude-sonnet-4-20250514"},{id:"ecommerce",model:"openai/gpt-4o"}]},tools:{agentToAgent:{enabled:!0,allow:["main","coder","ai-researcher","ecommerce"]}},update:{channel:"stable"},gateway:{auth:{token:jf}}}}function Zv(e,t){const a={...e};for(const[i,s]of Object.entries(t))s===null?delete a[i]:typeof s=="object"&&!Array.isArray(s)&&typeof a[i]=="object"&&!Array.isArray(a[i])&&a[i]!==null?a[i]=Zv(a[i],s):a[i]=s;return a}function br(e,t){return e+Math.random()*(t-e)}class B3{constructor(t,a=3){_e(this,"timers",[]);_e(this,"activeSubAgents",new Set);_e(this,"subCounter",0);_e(this,"running",!1);this.emit=t,this.maxConcurrent=a}start(){this.running||(this.running=!0,this.scheduleNextSpawn(5e3),this.scheduleAgentToAgentComm(2e4))}stop(){this.running=!1;for(const t of this.timers)clearTimeout(t);this.timers=[],this.activeSubAgents.clear()}schedule(t,a){const i=setTimeout(t,a);this.timers.push(i)}scheduleNextSpawn(t){this.schedule(()=>{this.running&&(this.activeSubAgents.size<this.maxConcurrent&&this.spawnSubAgent(),this.scheduleNextSpawn(br(3e3,8e3)))},t)}spawnSubAgent(){this.subCounter++;const t=`mock-sub-${this.subCounter}`,a=`mock-run-sub-${this.subCounter}`,i=`mock-session-sub-${this.subCounter}`;this.activeSubAgents.add(t),this.emit("agent",{runId:a,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:t,parentAgentId:"main"},sessionKey:i}),this.schedule(()=>{this.running&&this.emit("agent",{runId:a,seq:2,stream:"assistant",ts:Date.now(),data:{text:`Sub-agent ${t} 正在分析任务...`},sessionKey:i})},br(1e3,2e3)),this.schedule(()=>{if(!this.running)return;const o=["web_search","code_exec","file_read","analyze_data"],u=o[Math.floor(Math.random()*o.length)];this.emit("agent",{runId:a,seq:3,stream:"tool",ts:Date.now(),data:{name:u,phase:"start"},sessionKey:i})},br(3e3,5e3)),this.schedule(()=>{this.running&&this.emit("agent",{runId:a,seq:4,stream:"assistant",ts:Date.now(),data:{text:`Sub-agent ${t} 已完成任务分析。`},sessionKey:i})},br(6e3,9e3));const s=br(8e3,15e3);this.schedule(()=>{this.running&&(this.emit("agent",{runId:a,seq:5,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:t},sessionKey:i}),this.activeSubAgents.delete(t))},s)}scheduleAgentToAgentComm(t){this.schedule(()=>{if(!this.running)return;const a=["main","coder","ai-researcher","ecommerce"],i=a[Math.floor(Math.random()*a.length)];let s=i;for(;s===i;)s=a[Math.floor(Math.random()*a.length)];const o=`a2a-${Date.now()}`,u=`a2a-run-${i}-${Date.now()}`,f=`a2a-run-${s}-${Date.now()}`;this.emit("agent",{runId:u,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:i},sessionKey:o}),this.emit("agent",{runId:f,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:s},sessionKey:o});const h=br(1e4,2e4);this.schedule(()=>{this.running&&(this.emit("agent",{runId:u,seq:2,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:i},sessionKey:o}),this.emit("agent",{runId:f,seq:2,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:s},sessionKey:o}))},h),this.scheduleAgentToAgentComm(br(15e3,3e4))},t)}}class q3{constructor(){_e(this,"handlers",new Set);_e(this,"heartbeatTimer",null);_e(this,"pendingTimers",[]);_e(this,"mockConfig",I3());_e(this,"mockHash",Date.now().toString(36));_e(this,"subAgentSimulator",null)}async connect(){this.heartbeatTimer=setInterval(()=>{for(const t of this.handlers)t("heartbeat",{ts:Date.now()})},3e4),this.subAgentSimulator=new B3((t,a)=>this.emit(t,a),3),this.subAgentSimulator.start()}disconnect(){var t;this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),(t=this.subAgentSimulator)==null||t.stop(),this.subAgentSimulator=null,this.cancelPendingTimers(),this.handlers.clear()}onEvent(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}emit(t,a){for(const i of this.handlers)i(t,a)}cancelPendingTimers(){for(const t of this.pendingTimers)clearTimeout(t);this.pendingTimers=[]}scheduleTimer(t,a){const i=setTimeout(t,a);this.pendingTimers.push(i)}async chatHistory(){return[{id:"msg-hist-1",role:"user",content:"你好,请介绍一下 OpenClaw",timestamp:Date.now()-12e4},{id:"msg-hist-2",role:"assistant",content:`**OpenClaw** 是一个多 Agent 协作系统,支持:
|
|
420
|
-
|
|
421
|
-
- 多渠道消息接入(Telegram、Discord、WhatsApp 等)
|
|
422
|
-
- 工具调用和技能扩展
|
|
423
|
-
- 定时任务调度
|
|
424
|
-
- 实时可视化监控
|
|
425
|
-
|
|
426
|
-
你可以通过 OpenClaw Office 观察 Agent 的协作行为。`,timestamp:Date.now()-11e4}]}async chatSend(t){const a=`mock-run-${Date.now()}`,i=`收到你的消息:「${t.text}」
|
|
427
|
-
|
|
428
|
-
这是 Mock 模式下的模拟回复。在连接真实 Gateway 后,这里将显示 Agent 的实际响应。`;this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:a,state:"delta",message:{role:"assistant",content:i.slice(0,Math.floor(i.length/2))}}})},300),this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:a,state:"delta",message:{role:"assistant",content:i}}})},800),this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:a,state:"final",message:{role:"assistant",content:i,id:`mock-msg-${Date.now()}`,stopReason:"end_turn"}}})},1200)}async chatAbort(t){this.cancelPendingTimers(),this.emit("chat",{type:"event",event:"chat",payload:{state:"aborted"}})}async sessionsList(){return[{key:"agent:main:main",agentId:"main",label:"默认会话",createdAt:Date.now()-36e5,lastActiveAt:Date.now(),messageCount:12},{key:"agent:main:feishu:direct:test-user",agentId:"main",label:"飞书会话",createdAt:Date.now()-18e5,lastActiveAt:Date.now()-6e4,messageCount:8}]}async sessionsPreview(t){return{key:t,messages:await this.chatHistory()}}async sessionsDelete(t,a){}async channelsStatus(){return[...H3]}async skillsStatus(t){return[...U3]}async cronList(){return[...wx]}async channelsLogout(t,a){return{cleared:!0}}async webLoginStart(t){return{qrDataUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",message:"Scan QR code with WhatsApp"}}async webLoginWait(){return await new Promise(t=>setTimeout(t,2e3)),{connected:!0,message:"WhatsApp connected successfully"}}async skillsInstall(t,a){return{ok:!0,message:"Mock install completed",stdout:"mock: skill installed successfully",code:0}}async skillsUpdate(t,a){return{ok:!0}}async cronAdd(t){const a=Date.now();return{id:`cron-${a}`,name:t.name,description:t.description,schedule:t.schedule,enabled:t.enabled??!0,createdAtMs:a,updatedAtMs:a,sessionTarget:t.sessionTarget,wakeMode:t.wakeMode,payload:t.payload,delivery:t.delivery,agentId:t.agentId,sessionKey:t.sessionKey,state:{}}}async cronUpdate(t,a){const i=wx.find(s=>s.id===t);if(!i)throw new Error(`Cron task not found: ${t}`);return{...i,...a,updatedAtMs:Date.now()}}async cronRemove(t){}async cronRun(t){}async agentsList(){return{defaultId:"main",mainKey:"agent:main:main",scope:"global",agents:[{id:"main",name:"main",default:!0,identity:{name:"main",emoji:"m"}},{id:"ai-researcher",name:"ResearchClaw",identity:{name:"ResearchClaw",emoji:"🔬"}},{id:"coder",name:"CodeClaw",identity:{name:"CodeClaw",emoji:"💻"}},{id:"ecommerce",name:"TradeClaw",identity:{name:"TradeClaw",emoji:"🛒"}}]}}async agentsCreate(t){return{ok:!0,agentId:`agent-${Date.now()}`,name:t.name,workspace:t.workspace}}async agentsUpdate(t){return{ok:!0,agentId:t.agentId}}async agentsDelete(t){return{ok:!0,agentId:t.agentId,removedBindings:0}}async agentsFilesList(t){const a=new Date().toISOString();return{agentId:t,workspace:"~/.openclaw/workspace",files:[{name:"AGENTS.md",size:7900,modifiedAt:a},{name:"SOUL.md",size:2048,modifiedAt:a},{name:"TOOLS.md",size:860,modifiedAt:a},{name:"IDENTITY.md",size:759,modifiedAt:a},{name:"USER.md",size:1800,modifiedAt:a},{name:"HEARTBEAT.md",size:512,modifiedAt:a}]}}async agentsFilesGet(t,a){return{agentId:t,workspace:"~/.openclaw/workspace",file:{name:a,content:`# ${a}
|
|
429
|
-
|
|
430
|
-
Mock content for ${a}`,size:128,modifiedAt:new Date().toISOString()}}}async agentsFilesSet(t,a,i){return{ok:!0,agentId:t,workspace:"~/.openclaw/workspace",file:{name:a,size:i.length,modifiedAt:new Date().toISOString()}}}async toolsCatalog(t){return{tools:[{name:"web_search",description:"搜索互联网",source:"built-in",group:"core",enabled:!0},{name:"code_exec",description:"执行代码",source:"built-in",group:"core",enabled:!0},{name:"file_read",description:"读取文件内容",source:"built-in",group:"fs",enabled:!0},{name:"file_write",description:"写入文件",source:"built-in",group:"fs",enabled:!0},{name:"bash",description:"执行 Bash 命令",source:"built-in",group:"exec",enabled:!0,optional:!0},{name:"mcp_client",description:"MCP 协议客户端",source:"plugin",group:"integrations",enabled:!1,optional:!0}]}}async usageStatus(){return{updatedAt:Date.now(),providers:[{provider:"anthropic",displayName:"Anthropic",plan:"pro",windows:[{label:"daily",usedPercent:45,resetAt:Date.now()+12*36e5},{label:"monthly",usedPercent:22}]},{provider:"openai",displayName:"OpenAI",plan:"tier-3",windows:[{label:"daily",usedPercent:12}]}]}}async modelsList(){return[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",provider:"anthropic",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"claude-opus-4-20250514",name:"Claude Opus 4",provider:"anthropic",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"gpt-4o",name:"GPT-4o",provider:"openai",reasoning:!1,input:["text","image"],contextWindow:128e3},{id:"o3",name:"o3",provider:"openai",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"gpt-5.3-codex",name:"gpt-5.3-codex",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:1048576},{id:"gpt-5.3-codex-spark",name:"gpt-5.3-codex-spark",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:1048576},{id:"gpt-5.1-codex",name:"gpt-5.1-codex",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:2e5}]}async configGet(){return{config:this.mockConfig,hash:this.mockHash,raw:JSON.stringify(this.mockConfig,null,2),valid:!0,path:"~/.openclaw/openclaw.json"}}async configSet(t,a){return a&&a!==this.mockHash?{ok:!1,path:"~/.openclaw/openclaw.json",config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"}:(this.mockConfig=JSON.parse(t),this.mockHash=Date.now().toString(36),{ok:!0,path:"~/.openclaw/openclaw.json",config:this.mockConfig})}async configApply(t,a,i){return a&&a!==this.mockHash?{ok:!1,path:"~/.openclaw/openclaw.json",config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"}:(this.mockConfig=JSON.parse(t),this.mockHash=Date.now().toString(36),{ok:!0,path:"~/.openclaw/openclaw.json",config:this.mockConfig,restart:{scheduled:!0,delayMs:2e3}})}async configPatch(t,a){if(a&&a!==this.mockHash)return{ok:!1,config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"};const i=JSON.parse(t);return this.mockConfig=Zv(this.mockConfig,i),this.mockHash=Date.now().toString(36),{ok:!0,config:this.mockConfig,restart:{scheduled:!0,delayMs:2e3}}}async configSchema(){return{schema:{},uiHints:{"models.providers.*.apiKey":{sensitive:!0,label:"API Key"},"gateway.auth.token":{sensitive:!0,label:"Gateway Token"}},version:"mock"}}async statusSummary(){return{version:"2026.2.27-mock",port:18789,uptime:86400,mode:"local",pid:12345,nodeVersion:"v22.0.0",platform:"darwin"}}async updateRun(t){return{ok:!0,result:{status:"noop",mode:"npm",reason:"already up to date",steps:[],durationMs:1200},restart:null}}}function ng(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,a=>a.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const $3=1e4;class Cf extends Error{constructor(t,a){super(a),this.code=t,this.name="RpcError"}}class Jv{constructor(t){this.wsClient=t}request(t,a={},i=$3){return new Promise((s,o)=>{if(!this.wsClient.isConnected()){o(new Cf("NOT_CONNECTED","WebSocket is not connected"));return}const u=ng();let f=null;const h=()=>{f&&(clearTimeout(f),f=null)};this.wsClient.onResponse(u,g=>{h(),g.ok?s(g.payload):o(new Cf(g.error.code,g.error.message))}),f=setTimeout(()=>{o(new Cf("TIMEOUT",`RPC request timed out: ${t}`))},i),this.wsClient.send({type:"req",id:u,method:t,params:a})})}}const jc=class jc{constructor(t,a){_e(this,"handlers",new Set);_e(this,"unsubscribers",[]);this.wsClient=t,this.rpcClient=a}async connect(){for(const t of jc.WATCHED_EVENTS){const a=this.wsClient.onEvent(t,i=>{for(const s of this.handlers)s(t,i)});this.unsubscribers.push(a)}}disconnect(){for(const t of this.unsubscribers)t();this.unsubscribers=[],this.handlers.clear()}onEvent(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}async chatHistory(t){return this.rpcClient.request("chat.history",t?{sessionKey:t}:{})}async chatSend(t){await this.rpcClient.request("chat.send",{sessionKey:t.sessionKey,message:t.text,deliver:!1,idempotencyKey:ng()})}async chatAbort(t){await this.rpcClient.request("chat.abort",{sessionKey:t})}async sessionsList(){const t=await this.rpcClient.request("sessions.list");return Array.isArray(t)?t:(t==null?void 0:t.sessions)??[]}async sessionsPreview(t){return this.rpcClient.request("sessions.preview",{sessionKey:t})}async sessionsDelete(t,a){await this.rpcClient.request("sessions.delete",{key:t,...(a==null?void 0:a.deleteTranscript)!=null?{deleteTranscript:a.deleteTranscript}:{}})}async channelsStatus(){const t=await this.rpcClient.request("channels.status",{probe:!0});return G3(t)}async channelsLogout(t,a){return this.rpcClient.request("channels.logout",{channel:t,accountId:a})}async webLoginStart(t){return this.rpcClient.request("web.login.start",{force:t})}async webLoginWait(){return this.rpcClient.request("web.login.wait")}async skillsStatus(t){const a=t?{agentId:t}:void 0,i=await this.rpcClient.request("skills.status",a);return V3(i.skills??[])}async skillsInstall(t,a){return this.rpcClient.request("skills.install",{name:t,installId:a})}async skillsUpdate(t,a){return this.rpcClient.request("skills.update",{skillKey:t,...a})}async cronList(){return(await this.rpcClient.request("cron.list")).jobs??[]}async cronAdd(t){return this.rpcClient.request("cron.add",t)}async cronUpdate(t,a){return this.rpcClient.request("cron.update",{id:t,patch:a})}async cronRemove(t){await this.rpcClient.request("cron.remove",{id:t})}async cronRun(t){await this.rpcClient.request("cron.run",{id:t})}async agentsList(){return this.rpcClient.request("agents.list")}async agentsCreate(t){return this.rpcClient.request("agents.create",t)}async agentsUpdate(t){return this.rpcClient.request("agents.update",t)}async agentsDelete(t){return this.rpcClient.request("agents.delete",t)}async agentsFilesList(t){return this.rpcClient.request("agents.files.list",{agentId:t})}async agentsFilesGet(t,a){return this.rpcClient.request("agents.files.get",{agentId:t,name:a})}async agentsFilesSet(t,a,i){return this.rpcClient.request("agents.files.set",{agentId:t,name:a,content:i})}async toolsCatalog(t){const a=t?{agentId:t}:void 0;return this.rpcClient.request("tools.catalog",a)}async usageStatus(){return this.rpcClient.request("usage.status")}async modelsList(){return(await this.rpcClient.request("models.list")).models??[]}async configGet(){return this.rpcClient.request("config.get")}async configSet(t,a){const i=await this.rpcClient.request("config.set",{raw:t,...a?{baseHash:a}:{}});return Sx(i)}async configApply(t,a,i){const s=await this.rpcClient.request("config.apply",{raw:t,...a?{baseHash:a}:{},...i!=null&&i.sessionKey?{sessionKey:i.sessionKey}:{},...i!=null&&i.note?{note:i.note}:{},...(i==null?void 0:i.restartDelayMs)!=null?{restartDelayMs:i.restartDelayMs}:{}});return Sx(s)}async configPatch(t,a){const i=await this.rpcClient.request("config.patch",{raw:t,...a?{baseHash:a}:{}});return K3(i)}async configSchema(){return this.rpcClient.request("config.schema")}async statusSummary(){const t=this.wsClient.getSnapshot(),a=this.wsClient.getServerInfo();return{version:a==null?void 0:a.version,port:18789,uptime:(t==null?void 0:t.uptimeMs)!=null?Math.floor(t.uptimeMs/1e3):void 0,mode:"local",configPath:t==null?void 0:t.configPath}}async updateRun(t){const a=await this.rpcClient.request("update.run",t??{});return F3(a)}};_e(jc,"WATCHED_EVENTS",["agent","chat","presence","health","heartbeat","cron","shutdown"]);let xh=jc;function ag(e){if(!e.restart)return e;const t=e.restart;return{...e,restart:{scheduled:t.ok!==!1,delayMs:t.delayMs??0,...t.coalesced!=null?{coalesced:t.coalesced}:{}}}}function Sx(e){return ag(e)}function K3(e){return ag(e)}function F3(e){return ag(e)}function P3(e){return e.error??e.lastError??void 0?"error":e.connected===!0?"connected":e.connected===!1?e.running?"connecting":"disconnected":e.running&&e.linked!==!1&&e.configured!==!1?"connected":e.running?"connecting":"disconnected"}function G3(e){const t=e.channelAccounts??{},a=e.channelLabels??{},i=[];for(const[s,o]of Object.entries(t))for(const u of o)!u.accountId&&o.length===0||i.push({id:u.accountId?`${s}:${u.accountId}`:s,type:s,name:u.name??a[s]??s,status:P3(u),accountId:u.accountId,error:u.error??u.lastError??void 0,configured:u.configured,linked:u.linked,running:u.running,lastConnectedAt:u.lastConnectedAt,lastMessageAt:u.lastMessageAt,reconnectAttempts:u.reconnectAttempts,mode:u.mode});return i}function V3(e){return e.map(t=>({id:t.skillKey??"",slug:t.skillKey??"",name:t.name??t.skillKey??"",description:t.description??"",enabled:!t.disabled,icon:t.emoji??"📦",version:t.version??"",author:t.author,isCore:t.core,isBundled:t.bundled,config:t.config,source:t.source,homepage:t.homepage,primaryEnv:t.primaryEnv,always:t.always,eligible:t.eligible,blockedByAllowlist:t.blockedByAllowlist,requirements:t.requirements,missing:t.missing,installOptions:t.install,configChecks:t.configChecks}))}const Y3=20,Q3=1e3,X3=3e4,Z3=1e3;class Wv{constructor(){_e(this,"ws",null);_e(this,"url","");_e(this,"token","");_e(this,"status","disconnected");_e(this,"reconnectAttempt",0);_e(this,"reconnectTimer",null);_e(this,"shutdownReceived",!1);_e(this,"eventHandlers",new Map);_e(this,"statusHandlers",new Set);_e(this,"responseHandlers",new Map);_e(this,"snapshot",null);_e(this,"serverInfo",null);_e(this,"handleClose",()=>{})}getStatus(){return this.status}getSnapshot(){return this.snapshot}getServerInfo(){return this.serverInfo}isConnected(){var t;return this.status==="connected"&&((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN}connect(t,a){this.url=t,this.token=a,this.shutdownReceived=!1,this.reconnectAttempt=0,this.doConnect()}disconnect(){this.shutdownReceived=!0,this.clearReconnectTimer(),this.ws&&(this.ws.removeEventListener("close",this.handleClose),this.ws.close(),this.ws=null),this.setStatus("disconnected")}onEvent(t,a){let i=this.eventHandlers.get(t);return i||(i=new Set,this.eventHandlers.set(t,i)),i.add(a),()=>i.delete(a)}onStatusChange(t){return this.statusHandlers.add(t),()=>this.statusHandlers.delete(t)}onResponse(t,a){this.responseHandlers.set(t,a)}send(t){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}doConnect(){this.setStatus(this.reconnectAttempt>0?"reconnecting":"connecting");try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.handleClose=()=>{this.shutdownReceived||this.scheduleReconnect()},this.ws.addEventListener("open",()=>{}),this.ws.addEventListener("message",t=>{this.handleMessage(t)}),this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("error",()=>{})}handleMessage(t){let a;try{a=JSON.parse(t.data)}catch{return}if(a.type==="event"){const i=a;this.handleEvent(i)}else if(a.type==="res"){const i=a;this.handleResponse(i)}}handleEvent(t){if(t.event==="connect.challenge"){this.sendConnect();return}t.event==="shutdown"&&(this.shutdownReceived=!0,this.clearReconnectTimer(),this.setStatus("disconnected"));const a=this.eventHandlers.get(t.event);if(a)for(const s of a)s(t);const i=this.eventHandlers.get("*");if(i)for(const s of i)s(t)}handleResponse(t){var i;const a=this.responseHandlers.get(t.id);if(a){this.responseHandlers.delete(t.id),a(t);return}t.ok&&((i=t.payload)==null?void 0:i.type)==="hello-ok"?this.handleConnectSuccess(t.payload):t.ok||this.setStatus("error",t.error.message)}sendConnect(){const t={minProtocol:1,maxProtocol:3,client:{id:"openclaw-control-ui",version:"0.1.0",platform:"web",mode:"ui"},caps:["tool-events"],scopes:["operator.admin"]};this.token&&(t.auth={token:this.token}),this.send({type:"req",id:ng(),method:"connect",params:t})}handleConnectSuccess(t){this.snapshot=t.snapshot??null,this.serverInfo=t.server??null,this.reconnectAttempt=0,this.setStatus("connected")}scheduleReconnect(){if(this.shutdownReceived)return;if(this.reconnectAttempt>=Y3){this.setStatus("disconnected");return}this.setStatus("reconnecting");const t=Math.min(Q3*Math.pow(2,this.reconnectAttempt),X3)+Math.random()*Z3;this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.doConnect()},t)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}setStatus(t,a){this.status=t;for(const i of this.statusHandlers)i(t,a)}}let Cr=null,Os=null,gc=null,Nr=[];function Re(){if(Cr)return Cr;throw new Error("GatewayAdapter not initialized. Call initAdapter() first.")}function Fe(e=15e3){return Cr?Promise.resolve(Cr):gc?Promise.reject(gc):new Promise((t,a)=>{const i=setTimeout(()=>{Nr=Nr.filter(u=>u.resolve!==s),a(new Error("Adapter initialization timed out"))},e),s=u=>{clearTimeout(i),t(u)},o=u=>{clearTimeout(i),a(u)};Nr.push({resolve:s,reject:o})})}async function J3(e,t){if(Cr)return Cr;if(Os)return Os;gc=null;const a=(async()=>{try{const i=e==="mock"?new q3:W3(t);return await i.connect(),Cr=i,eA(i),i}catch(i){const s=nA(i);throw gc=s,tA(s),s}})();Os=a;try{return await a}finally{Os===a&&(Os=null)}}function W3(e){if(!e)throw new Error("WsAdapter requires wsClient and rpcClient");if(!(e.wsClient instanceof Wv))throw new Error("Invalid wsClient");if(!(e.rpcClient instanceof Jv))throw new Error("Invalid rpcClient");return new xh(e.wsClient,e.rpcClient)}function eA(e){for(const t of Nr)t.resolve(e);Nr=[]}function tA(e){for(const t of Nr)t.reject(e);Nr=[]}function nA(e){return e instanceof Error?e:new Error(String(e))}const aA="openclaw-office-cache",rA=1,iA=500,sA=1e3,lA=30,oA=7,jx=.8,Mt="chat_messages",Yt="event_history";class cA{constructor(t){_e(this,"db",null);_e(this,"available",!0);_e(this,"dbName");_e(this,"version");_e(this,"maxMessagesPerSession");_e(this,"maxEvents");_e(this,"messageExpireDays");_e(this,"eventExpireDays");this.dbName=(t==null?void 0:t.dbName)??aA,this.version=(t==null?void 0:t.version)??rA,this.maxMessagesPerSession=(t==null?void 0:t.maxMessagesPerSession)??iA,this.maxEvents=(t==null?void 0:t.maxEvents)??sA,this.messageExpireDays=(t==null?void 0:t.messageExpireDays)??lA,this.eventExpireDays=(t==null?void 0:t.eventExpireDays)??oA}async open(){if(!this.db)try{if(typeof indexedDB>"u"){this.available=!1;return}this.db=await new Promise((t,a)=>{const i=indexedDB.open(this.dbName,this.version);i.onupgradeneeded=()=>{const s=i.result;if(!s.objectStoreNames.contains(Mt)){const o=s.createObjectStore(Mt,{keyPath:"id"});o.createIndex("sessionKey","sessionKey",{unique:!1}),o.createIndex("timestamp","timestamp",{unique:!1}),o.createIndex("session_time",["sessionKey","timestamp"],{unique:!1})}s.objectStoreNames.contains(Yt)||s.createObjectStore(Yt,{autoIncrement:!0}).createIndex("timestamp","timestamp",{unique:!1})},i.onsuccess=()=>t(i.result),i.onerror=()=>a(i.error)})}catch{this.available=!1}}close(){this.db&&(this.db.close(),this.db=null)}async getMessages(t){if(!this.canOperate())return[];try{const s=this.db.transaction(Mt,"readonly").objectStore(Mt).index("session_time"),o=IDBKeyRange.bound([t,0],[t,Number.MAX_SAFE_INTEGER]);return(await Va(s.getAll(o))).map(({sessionKey:f,...h})=>h)}catch{return[]}}async saveMessage(t,a){if(this.canOperate())try{if(await this.isQuotaExceeded())return;const i={...a,sessionKey:t},s=this.db.transaction(Mt,"readwrite");s.objectStore(Mt).put(i),await Fn(s),await this.enforceMessageLimit(t)}catch{}}async saveMessages(t,a){if(!(!this.canOperate()||a.length===0))try{if(await this.isQuotaExceeded())return;const i=this.db.transaction(Mt,"readwrite"),s=i.objectStore(Mt),o=s.index("sessionKey"),u=await Va(o.getAllKeys(t));for(const x of u)s.delete(x);await Fn(i);const f=this.db.transaction(Mt,"readwrite"),h=f.objectStore(Mt),g=a.slice(-this.maxMessagesPerSession);for(const x of g)h.put({...x,sessionKey:t});await Fn(f)}catch{}}async clearMessages(t){if(this.canOperate())try{const a=this.db.transaction(Mt,"readwrite"),i=a.objectStore(Mt),s=i.index("sessionKey"),o=await Va(s.getAllKeys(t));for(const u of o)i.delete(u);await Fn(a)}catch{}}async getEvents(t){if(!this.canOperate())return[];try{const i=this.db.transaction(Yt,"readonly").objectStore(Yt),s=await Va(i.getAll());return s.sort((o,u)=>o.timestamp-u.timestamp),t&&s.length>t?s.slice(-t):s}catch{return[]}}async saveEvent(t){if(this.canOperate())try{if(await this.isQuotaExceeded())return;const a=this.db.transaction(Yt,"readwrite");a.objectStore(Yt).add(t),await Fn(a),await this.enforceEventLimit()}catch{}}async saveEvents(t){if(!(!this.canOperate()||t.length===0))try{if(await this.isQuotaExceeded())return;const a=this.db.transaction(Yt,"readwrite"),i=a.objectStore(Yt);for(const s of t)i.add(s);await Fn(a),await this.enforceEventLimit()}catch{}}async clearEvents(){if(this.canOperate())try{const t=this.db.transaction(Yt,"readwrite");t.objectStore(Yt).clear(),await Fn(t)}catch{}}async cleanup(){if(this.canOperate())try{const t=Date.now(),a=this.messageExpireDays*24*60*60*1e3,i=this.eventExpireDays*24*60*60*1e3,s=this.db.transaction(Mt,"readwrite"),o=s.objectStore(Mt),u=o.index("timestamp"),f=IDBKeyRange.upperBound(t-a),h=await Va(u.getAllKeys(f));for(const w of h)o.delete(w);await Fn(s);const g=this.db.transaction(Yt,"readwrite"),x=g.objectStore(Yt),p=x.index("timestamp"),b=IDBKeyRange.upperBound(t-i),v=await Va(p.getAllKeys(b));for(const w of v)x.delete(w);await Fn(g)}catch{}}async getStorageEstimate(){var t;try{if((t=navigator.storage)!=null&&t.estimate){const a=await navigator.storage.estimate();return{usage:a.usage??0,quota:a.quota??0}}}catch{}return{usage:0,quota:0}}canOperate(){return this.available&&this.db!==null}async isQuotaExceeded(){try{const{usage:t,quota:a}=await this.getStorageEstimate();if(a>0&&t/a>jx){await this.cleanup();const i=await this.getStorageEstimate();return i.quota>0&&i.usage/i.quota>jx}}catch{}return!1}async enforceMessageLimit(t){try{const a=this.db.transaction(Mt,"readwrite"),i=a.objectStore(Mt),s=i.index("session_time"),o=IDBKeyRange.bound([t,0],[t,Number.MAX_SAFE_INTEGER]),u=await Va(s.getAllKeys(o));if(u.length>this.maxMessagesPerSession){const f=u.slice(0,u.length-this.maxMessagesPerSession);for(const h of f)i.delete(h);await Fn(a)}}catch{}}async enforceEventLimit(){try{const a=this.db.transaction(Yt,"readwrite").objectStore(Yt),i=await Va(a.count());if(i>this.maxEvents){const s=i-this.maxEvents,o=a.openCursor();let u=0;await new Promise((f,h)=>{o.onsuccess=()=>{const g=o.result;g&&u<s?(g.delete(),u++,g.continue()):f()},o.onerror=()=>h(o.error)})}}catch{}}}function Va(e){return new Promise((t,a)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}function Fn(e){return new Promise((t,a)=>{e.oncomplete=()=>t(),e.onerror=()=>a(e.error)})}const Yn=new cA;function Cx(){const e=Date.now(),t=Math.random().toString(36).slice(2,8);return`msg-${e}-${t}`}var e1=Symbol.for("immer-nothing"),Nx=Symbol.for("immer-draftable"),Ye=Symbol.for("immer-state");function wn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var el=Object.getPrototypeOf;function Ei(e){return!!e&&!!e[Ye]}function va(e){var t;return e?t1(e)||Array.isArray(e)||!!e[Nx]||!!((t=e.constructor)!=null&&t[Nx])||ml(e)||zc(e):!1}var uA=Object.prototype.constructor.toString(),Ax=new WeakMap;function t1(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const a=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(a===Object)return!0;if(typeof a!="function")return!1;let i=Ax.get(a);return i===void 0&&(i=Function.toString.call(a),Ax.set(a,i)),i===uA}function tl(e,t,a=!0){Lc(e)===0?(a?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((i,s)=>t(s,i,e))}function Lc(e){const t=e[Ye];return t?t.type_:Array.isArray(e)?1:ml(e)?2:zc(e)?3:0}function bh(e,t){return Lc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function n1(e,t,a){const i=Lc(e);i===2?e.set(t,a):i===3?e.add(a):e[t]=a}function dA(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ml(e){return e instanceof Map}function zc(e){return e instanceof Set}function St(e){return e.copy_||e.base_}function vh(e,t){if(ml(e))return new Map(e);if(zc(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const a=t1(e);if(t===!0||t==="class_only"&&!a){const i=Object.getOwnPropertyDescriptors(e);delete i[Ye];let s=Reflect.ownKeys(i);for(let o=0;o<s.length;o++){const u=s[o],f=i[u];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(i[u]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[u]})}return Object.create(el(e),i)}else{const i=el(e);if(i!==null&&a)return{...e};const s=Object.create(i);return Object.assign(s,e)}}function rg(e,t=!1){return Hc(e)||Ei(e)||!va(e)||(Lc(e)>1&&Object.defineProperties(e,{set:Ko,add:Ko,clear:Ko,delete:Ko}),Object.freeze(e),t&&Object.values(e).forEach(a=>rg(a,!0))),e}function fA(){wn(2)}var Ko={value:fA};function Hc(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var kh={};function Er(e){const t=kh[e];return t||wn(0,e),t}function hA(e,t){kh[e]||(kh[e]=t)}var nl;function mc(){return nl}function gA(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ex(e,t){t&&(Er("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wh(e){Sh(e),e.drafts_.forEach(mA),e.drafts_=null}function Sh(e){e===nl&&(nl=e.parent_)}function Tx(e){return nl=gA(nl,e)}function mA(e){const t=e[Ye];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Mx(e,t){t.unfinalizedDrafts_=t.drafts_.length;const a=t.drafts_[0];return e!==void 0&&e!==a?(a[Ye].modified_&&(wh(t),wn(4)),va(e)&&(e=pc(t,e),t.parent_||yc(t,e)),t.patches_&&Er("Patches").generateReplacementPatches_(a[Ye].base_,e,t.patches_,t.inversePatches_)):e=pc(t,a,[]),wh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==e1?e:void 0}function pc(e,t,a){if(Hc(t))return t;const i=e.immer_.shouldUseStrictIteration(),s=t[Ye];if(!s)return tl(t,(o,u)=>Dx(e,s,t,o,u,a),i),t;if(s.scope_!==e)return t;if(!s.modified_)return yc(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const o=s.copy_;let u=o,f=!1;s.type_===3&&(u=new Set(o),o.clear(),f=!0),tl(u,(h,g)=>Dx(e,s,o,h,g,a,f),i),yc(e,o,!1),a&&e.patches_&&Er("Patches").generatePatches_(s,a,e.patches_,e.inversePatches_)}return s.copy_}function Dx(e,t,a,i,s,o,u){if(s==null||typeof s!="object"&&!u)return;const f=Hc(s);if(!(f&&!u)){if(Ei(s)){const h=o&&t&&t.type_!==3&&!bh(t.assigned_,i)?o.concat(i):void 0,g=pc(e,s,h);if(n1(a,i,g),Ei(g))e.canAutoFreeze_=!1;else return}else u&&a.add(s);if(va(s)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[i]===s&&f)return;pc(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&(ml(a)?a.has(i):Object.prototype.propertyIsEnumerable.call(a,i))&&yc(e,s)}}}function yc(e,t,a=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rg(t,a)}function pA(e,t){const a=Array.isArray(e),i={type_:a?1:0,scope_:t?t.scope_:mc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=i,o=ig;a&&(s=[i],o=al);const{revoke:u,proxy:f}=Proxy.revocable(s,o);return i.draft_=f,i.revoke_=u,f}var ig={get(e,t){if(t===Ye)return e;const a=St(e);if(!bh(a,t))return yA(e,a,t);const i=a[t];return e.finalized_||!va(i)?i:i===Nf(e.base_,t)?(Af(e),e.copy_[t]=rl(i,e)):i},has(e,t){return t in St(e)},ownKeys(e){return Reflect.ownKeys(St(e))},set(e,t,a){const i=a1(St(e),t);if(i!=null&&i.set)return i.set.call(e.draft_,a),!0;if(!e.modified_){const s=Nf(St(e),t),o=s==null?void 0:s[Ye];if(o&&o.base_===a)return e.copy_[t]=a,e.assigned_[t]=!1,!0;if(dA(a,s)&&(a!==void 0||bh(e.base_,t)))return!0;Af(e),xa(e)}return e.copy_[t]===a&&(a!==void 0||t in e.copy_)||Number.isNaN(a)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=a,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Nf(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Af(e),xa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const a=St(e),i=Reflect.getOwnPropertyDescriptor(a,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:a[t]}},defineProperty(){wn(11)},getPrototypeOf(e){return el(e.base_)},setPrototypeOf(){wn(12)}},al={};tl(ig,(e,t)=>{al[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});al.deleteProperty=function(e,t){return al.set.call(this,e,t,void 0)};al.set=function(e,t,a){return ig.set.call(this,e[0],t,a,e[0])};function Nf(e,t){const a=e[Ye];return(a?St(a):e)[t]}function yA(e,t,a){var s;const i=a1(t,a);return i?"value"in i?i.value:(s=i.get)==null?void 0:s.call(e.draft_):void 0}function a1(e,t){if(!(t in e))return;let a=el(e);for(;a;){const i=Object.getOwnPropertyDescriptor(a,t);if(i)return i;a=el(a)}}function xa(e){e.modified_||(e.modified_=!0,e.parent_&&xa(e.parent_))}function Af(e){e.copy_||(e.copy_=vh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xA=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,a,i)=>{if(typeof t=="function"&&typeof a!="function"){const o=a;a=t;const u=this;return function(h=o,...g){return u.produce(h,x=>a.call(this,x,...g))}}typeof a!="function"&&wn(6),i!==void 0&&typeof i!="function"&&wn(7);let s;if(va(t)){const o=Tx(this),u=rl(t,void 0);let f=!0;try{s=a(u),f=!1}finally{f?wh(o):Sh(o)}return Ex(o,i),Mx(s,o)}else if(!t||typeof t!="object"){if(s=a(t),s===void 0&&(s=t),s===e1&&(s=void 0),this.autoFreeze_&&rg(s,!0),i){const o=[],u=[];Er("Patches").generateReplacementPatches_(t,s,o,u),i(o,u)}return s}else wn(1,t)},this.produceWithPatches=(t,a)=>{if(typeof t=="function")return(u,...f)=>this.produceWithPatches(u,h=>t(h,...f));let i,s;return[this.produce(t,a,(u,f)=>{i=u,s=f}),i,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){va(e)||wn(8),Ei(e)&&(e=bA(e));const t=Tx(this),a=rl(e,void 0);return a[Ye].isManual_=!0,Sh(t),a}finishDraft(e,t){const a=e&&e[Ye];(!a||!a.isManual_)&&wn(9);const{scope_:i}=a;return Ex(i,t),Mx(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let a;for(a=t.length-1;a>=0;a--){const s=t[a];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}a>-1&&(t=t.slice(a+1));const i=Er("Patches").applyPatches_;return Ei(e)?i(e,t):this.produce(e,s=>i(s,t))}};function rl(e,t){const a=ml(e)?Er("MapSet").proxyMap_(e,t):zc(e)?Er("MapSet").proxySet_(e,t):pA(e,t);return(t?t.scope_:mc()).drafts_.push(a),a}function bA(e){return Ei(e)||wn(10,e),r1(e)}function r1(e){if(!va(e)||Hc(e))return e;const t=e[Ye];let a,i=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,a=vh(e,t.scope_.immer_.useStrictShallowCopy_),i=t.scope_.immer_.shouldUseStrictIteration()}else a=vh(e,!0);return tl(a,(s,o)=>{n1(a,s,r1(o))},i),t&&(t.finalized_=!1),a}function vA(){class e extends Map{constructor(h,g){super(),this[Ye]={type_:2,parent_:g,scope_:g?g.scope_:mc(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:h,draft_:this,isManual_:!1,revoked_:!1}}get size(){return St(this[Ye]).size}has(h){return St(this[Ye]).has(h)}set(h,g){const x=this[Ye];return u(x),(!St(x).has(h)||St(x).get(h)!==g)&&(a(x),xa(x),x.assigned_.set(h,!0),x.copy_.set(h,g),x.assigned_.set(h,!0)),this}delete(h){if(!this.has(h))return!1;const g=this[Ye];return u(g),a(g),xa(g),g.base_.has(h)?g.assigned_.set(h,!1):g.assigned_.delete(h),g.copy_.delete(h),!0}clear(){const h=this[Ye];u(h),St(h).size&&(a(h),xa(h),h.assigned_=new Map,tl(h.base_,g=>{h.assigned_.set(g,!1)}),h.copy_.clear())}forEach(h,g){const x=this[Ye];St(x).forEach((p,b,v)=>{h.call(g,this.get(b),b,this)})}get(h){const g=this[Ye];u(g);const x=St(g).get(h);if(g.finalized_||!va(x)||x!==g.base_.get(h))return x;const p=rl(x,g);return a(g),g.copy_.set(h,p),p}keys(){return St(this[Ye]).keys()}values(){const h=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const g=h.next();return g.done?g:{done:!1,value:this.get(g.value)}}}}entries(){const h=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const g=h.next();if(g.done)return g;const x=this.get(g.value);return{done:!1,value:[g.value,x]}}}}[Symbol.iterator](){return this.entries()}}function t(f,h){return new e(f,h)}function a(f){f.copy_||(f.assigned_=new Map,f.copy_=new Map(f.base_))}class i extends Set{constructor(h,g){super(),this[Ye]={type_:3,parent_:g,scope_:g?g.scope_:mc(),modified_:!1,finalized_:!1,copy_:void 0,base_:h,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return St(this[Ye]).size}has(h){const g=this[Ye];return u(g),g.copy_?!!(g.copy_.has(h)||g.drafts_.has(h)&&g.copy_.has(g.drafts_.get(h))):g.base_.has(h)}add(h){const g=this[Ye];return u(g),this.has(h)||(o(g),xa(g),g.copy_.add(h)),this}delete(h){if(!this.has(h))return!1;const g=this[Ye];return u(g),o(g),xa(g),g.copy_.delete(h)||(g.drafts_.has(h)?g.copy_.delete(g.drafts_.get(h)):!1)}clear(){const h=this[Ye];u(h),St(h).size&&(o(h),xa(h),h.copy_.clear())}values(){const h=this[Ye];return u(h),o(h),h.copy_.values()}entries(){const h=this[Ye];return u(h),o(h),h.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(h,g){const x=this.values();let p=x.next();for(;!p.done;)h.call(g,p.value,p.value,this),p=x.next()}}function s(f,h){return new i(f,h)}function o(f){f.copy_||(f.copy_=new Set,f.base_.forEach(h=>{if(va(h)){const g=rl(h,f);f.drafts_.set(h,g),f.copy_.add(g)}else f.copy_.add(h)}))}function u(f){f.revoked_&&wn(3,JSON.stringify(St(f)))}hA("MapSet",{proxyMap_:t,proxySet_:s})}var kA=new xA,wA=kA.produce;const SA=e=>(t,a,i)=>(i.setState=(s,o,...u)=>{const f=typeof s=="function"?wA(s):s;return t(f,o,...u)},e(i.setState,a,i)),jA=SA;function CA(e){const t={runId:e.runId,sessionKey:e.sessionKey,status:"idle",currentTool:null,speechBubble:null,clearTool:!1,clearSpeech:!1,incrementToolCount:!1,toolRecord:null,summary:""};switch(e.stream){case"lifecycle":return NA(t,e);case"tool":return AA(t,e);case"assistant":return EA(t,e);case"error":return TA(t,e);default:return t.summary=Te.t("common:events.unknownStream",{stream:e.stream}),t}}function NA(e,t){const a=t.data.phase;switch(a){case"start":case"thinking":e.status="thinking",e.summary=a==="start"?Te.t("common:events.startRunning"):Te.t("common:events.thinking");break;case"end":e.status="idle",e.clearTool=!0,e.clearSpeech=!0,e.summary=Te.t("common:events.runEnded");break;case"fallback":e.status="error",e.summary=Te.t("common:events.fallback");break;default:e.status="thinking",e.summary=Te.t("common:events.lifecycleUnknown",{phase:a??"unknown"})}return e}function AA(e,t){const a=t.data.phase,i=t.data.name??"unknown";return a==="start"?(e.status="tool_calling",e.currentTool={name:i,args:t.data.args,startedAt:t.ts},e.incrementToolCount=!0,e.toolRecord={name:i,timestamp:t.ts},e.summary=Te.t("common:events.toolCall",{name:i})):(e.status="thinking",e.clearTool=!0,e.summary=Te.t("common:events.toolDone",{name:i})),e}function EA(e,t){const a=t.data.text??"";return e.status="speaking",e.speechBubble={text:a,timestamp:t.ts},e.summary=a.length>40?`${a.slice(0,40)}...`:a,e}function TA(e,t){const a=t.data.message??Te.t("common:errors.unknownError");return e.status="error",e.summary=Te.t("common:events.errorPrefix",{message:a}),e}const Uc=1200,Ic=700,ue={x:30,y:20,width:Uc-60,height:Ic-40,wallThickness:6,cornerRadius:18,corridorWidth:28},qs=(ue.width-ue.corridorWidth)/2,$s=(ue.height-ue.corridorWidth)/2,_x=ue.x+qs+ue.corridorWidth,Rx=ue.y+$s+ue.corridorWidth,De={desk:{x:ue.x,y:ue.y,width:qs,height:$s,label:"固定工位区"},meeting:{x:_x,y:ue.y,width:qs,height:$s,label:"会议区"},hotDesk:{x:ue.x,y:Rx,width:qs,height:$s,label:"热工位区"},lounge:{x:_x,y:Rx,width:qs,height:$s,label:"休息区"}},jh={x:De.lounge.x+De.lounge.width/2,y:ue.y+ue.height-30},sg={desk:"#f4f6f9",meeting:"#eef3fa",hotDesk:"#f1f3f7",lounge:"#f3f1f7",corridor:"#e8ecf1",wall:"#8b9bb0"},lg={desk:"#1e293b",meeting:"#1a2744",hotDesk:"#1e2433",lounge:"#231e33",corridor:"#0f172a",wall:"#475569"},pl={idle:"#22c55e",thinking:"#3b82f6",tool_calling:"#f97316",speaking:"#a855f7",spawning:"#06b6d4",error:"#ef4444",offline:"#6b7280"},i1=4,s1=3,Ef=i1*s1,MA=4,DA=3,_A=100,Ox={width:140,height:110},Ks={radius:20,selectedRadius:24,strokeWidth:3,nameLabelMaxChars:12},l1=16/Uc,o1=12/Ic,Lx=1.7;function Tf(e){let t=0;for(let a=0;a<e.length;a++){const i=e.charCodeAt(a);t=(t<<5)-t+i|0}return Math.abs(t)}function c1(e,t,a){const i=[],s=e.width/(t+1),o=e.height/(a+1);for(let u=0;u<a;u++)for(let f=0;f<t;f++)i.push({x:Math.round(e.x+s*(f+1)),y:Math.round(e.y+o*(u+1))});return i}const RA=c1(De.desk,i1,s1),OA=c1(De.hotDesk,MA,DA);function zx(e){return`${e.x},${e.y}`}function og(e,t,a){if(!t){const o=Tf(e)%Ef;for(let u=0;u<Ef;u++){const f=(o+u)%Ef,h=RA[f];if(!a.has(zx(h)))return h}}for(const s of OA)if(!a.has(zx(s)))return s;const i=t?De.hotDesk:De.desk;return{x:i.x+30+Tf(e)%(i.width-60),y:i.y+30+Tf(e)%(i.height-60)}}function Uz(e){return[e.x*l1,0,e.y*o1]}function LA(e,t){const a=e.length;return a===0?[]:e.map((i,s)=>{const o=2*Math.PI*s/a-Math.PI/2;return{x:Math.round(t.x+Math.cos(o)*Lx/l1),y:Math.round(t.y+Math.sin(o)*Lx/o1)}})}function zA(e,t,a=40){const i=e-a*2,s=Math.max(1,Math.floor(i/_A));return Math.min(s,Math.max(t,4))}function Hx(e,t,a){const i=a??t;if(i===0)return[];const s=40,o=50,u=zA(e.width,i,s),f=Math.ceil(i/u),h=e.width-s*2,g=e.height-o*2,x=Math.min(Ox.width,h/u),p=Math.min(Ox.height,g/Math.max(f,1)),b=[];for(let v=0;v<i;v++){const w=v%u,C=Math.floor(v/u);b.push({unitX:Math.round(e.x+s+x*(w+.5)),unitY:Math.round(e.y+o+p*(C+.5))})}return b}function xc(e){const t=De.lounge,a=[{x:t.x+60,y:t.y+40},{x:t.x+160,y:t.y+40},{x:t.x+260,y:t.y+40},{x:t.x+360,y:t.y+40},{x:t.x+60,y:t.y+120},{x:t.x+160,y:t.y+120},{x:t.x+260,y:t.y+120},{x:t.x+360,y:t.y+120},{x:t.x+440,y:t.y+60},{x:t.x+440,y:t.y+130},{x:t.x+100,y:t.y+180},{x:t.x+280,y:t.y+180}];return a.slice(0,Math.min(e,a.length))}function HA(e,t,a){return e===0?[]:Array.from({length:e},(i,s)=>{const o=2*Math.PI*s/e-Math.PI/2;return{x:Math.round(t.x+Math.cos(o)*a),y:Math.round(t.y+Math.sin(o)*a)}})}const UA=120,IA=1.5,Qa=ue.corridorWidth,BA=(ue.width-Qa)/2,qA=(ue.height-Qa)/2,$A={x:ue.x+BA+Qa/2,y:ue.y+qA+Qa/2};function Ux(e){if(e==="corridor")return{...jh};const t=De[e];switch(e){case"desk":return{x:t.x+t.width/2,y:t.y+t.height+Qa/2};case"meeting":return{x:t.x+t.width/2,y:t.y+t.height+Qa/2};case"hotDesk":return{x:t.x+t.width/2,y:t.y-Qa/2};case"lounge":return{x:t.x+t.width/2,y:t.y-Qa/2};default:return{...jh}}}function KA(e,t){if(e==="corridor"||t==="corridor")return!1;const a=["desk","hotDesk"],i=["meeting","lounge"],s=["desk","meeting"],o=["hotDesk","lounge"];return!!(a.includes(e)&&a.includes(t)||i.includes(e)&&i.includes(t)||s.includes(e)&&s.includes(t)||o.includes(e)&&o.includes(t))}function FA(e,t,a,i){if(a===i)return[{...e},{...t}];const s=Ux(a),o=Ux(i);return KA(a,i)?[{...e},s,o,{...t}]:[{...e},s,{...$A},o,{...t}]}function u1(e,t){const a=t.x-e.x,i=t.y-e.y;return Math.sqrt(a*a+i*i)}function d1(e){let t=0;for(let a=1;a<e.length;a++)t+=u1(e[a-1],e[a]);return t}function PA(e){const a=d1(e)/UA;return Math.max(a,IA)}function GA(e,t){if(e.length===0)return{x:0,y:0};if(t<=0)return{...e[0]};if(t>=1)return{...e[e.length-1]};const a=d1(e);if(a===0)return{...e[0]};const i=t*a;let s=0;for(let o=1;o<e.length;o++){const u=u1(e[o-1],e[o]);if(s+u>=i){const f=u>0?(i-s)/u:0;return{x:e[o-1].x+(e[o].x-e[o-1].x)*f,y:e[o-1].y+(e[o].y-e[o-1].y)*f}}s+=u}return{...e[e.length-1]}}function VA(e,t){e.status=t.status,e.lastActiveAt=Date.now(),t.currentTool&&(e.currentTool=t.currentTool),t.clearTool&&(e.currentTool=null),t.speechBubble&&(e.speechBubble=t.speechBubble),t.clearSpeech&&(e.speechBubble=null),t.incrementToolCount&&e.toolCallCount++,t.toolRecord&&(e.toolCallHistory=[t.toolRecord,...e.toolCallHistory.slice(0,9)]),t.runId&&!e.runId&&(e.runId=t.runId)}const YA=.3,QA=3,Ix=[{x:De.meeting.x+De.meeting.width/2,y:De.meeting.y+De.meeting.height/2},{x:De.meeting.x+De.meeting.width*.25,y:De.meeting.y+De.meeting.height*.3},{x:De.meeting.x+De.meeting.width*.75,y:De.meeting.y+De.meeting.height*.7}];function XA(e,t,a){const i=a&&a.length>0?new Set(a):null,s=new Map;for(const u of e){if(u.strength<YA||!t.has(u.sourceId)||!t.has(u.targetId)||i&&(!i.has(u.sourceId)||!i.has(u.targetId)))continue;let f=s.get(u.sessionKey);f||(f=new Set,s.set(u.sessionKey,f)),f.add(u.sourceId),f.add(u.targetId)}const o=[];for(const[u,f]of s)if(f.size>=2&&o.push({sessionKey:u,agentIds:Array.from(f)}),o.length>=QA)break;return o}function ZA(e,t){const a=Ix[t%Ix.length],i=LA(e.agentIds,a),s=new Map;return e.agentIds.forEach((o,u)=>{s.set(o,i[u])}),s}function JA(e,t,a,i){const s=new Set;t.forEach((o,u)=>{var h;const f=ZA(o,u);for(const[g,x]of f){const p=e.get(g);p&&p.zone!=="meeting"&&((h=p.movement)==null?void 0:h.toZone)!=="meeting"&&a(g,x),s.add(g)}});for(const o of e.values())o.zone==="meeting"&&!s.has(o.id)&&i(o.id)}function Gn(e,t){let a=0,i=0;for(const o of e.values())o.isPlaceholder||!o.confirmed||(i++,o.status!=="idle"&&o.status!=="offline"&&a++);const s=i>0?Math.min(a/i*100,100):0;return{activeAgents:a,totalAgents:i,totalTokens:t.totalTokens,tokenRate:t.tokenRate,collaborationHeat:s}}vA();const Mf=200,WA=6e4,f1="openclaw-theme",h1="openclaw-chat-dock-height",Bx=300,eE=500,tE=3e4,ki=new Map,wi=new Map,kr=new Set,Ch=3e4,nE=5e3;let Df=null,qx="";const aE=500;function Nh(e){return e==="thinking"||e==="tool_calling"||e==="speaking"||e==="spawning"}function rE(){if(typeof window>"u")return Bx;const e=localStorage.getItem(h1);if(e){const t=parseInt(e,10);if(!Number.isNaN(t)&&t>=150&&t<=800)return t}return Bx}function iE(){if(typeof window>"u")return"dark";const e=localStorage.getItem(f1);return e==="light"||e==="dark"?e:"dark"}function sE(){return typeof window>"u"?!0:window.devicePixelRatio>=1.5}function Fo(e,t,a,i,s=!0){if(!s)return{id:e,name:t,status:"idle",position:{...jh},currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!1,isPlaceholder:!1,parentAgentId:null,childAgentIds:[],zone:"corridor",originalPosition:null,movement:null,confirmed:!1};const o=og(e,a,i);return{id:e,name:t,status:"idle",position:o,currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:a,isPlaceholder:!1,parentAgentId:null,childAgentIds:[],zone:a?"hotDesk":"desk",originalPosition:null,movement:null,confirmed:!0}}function On(e){return`${e.x},${e.y}`}function g1(e){return!!(e&&e.confirmed&&!e.isSubAgent&&!e.isPlaceholder)}function Ah(e){kr.add(e),setTimeout(()=>kr.delete(e),Ch)}function m1(e,t){const a=t.find(s=>g1(e.agents.get(s)));if(a)return a;const i=t.find(s=>{const o=e.agents.get(s);return o&&o.confirmed&&!o.isPlaceholder});return i||t[0]}function lE(e,t,a){if(t===a)return;const i=e.agents.get(t),s=e.agents.get(a);!i||!s||i.confirmed||(s.status=i.status,s.currentTool=i.currentTool,s.speechBubble=i.speechBubble,s.lastActiveAt=Math.max(s.lastActiveAt,i.lastActiveAt),s.toolCallCount=Math.max(s.toolCallCount,i.toolCallCount),i.toolCallHistory.length>0&&(s.toolCallHistory=[...i.toolCallHistory]),s.runId=i.runId??s.runId,e.agents.delete(t),e.selectedAgentId===t&&(e.selectedAgentId=a))}function oE(e){let t=-1;for(const a of e.values())if(a.id.startsWith("placeholder-")){const i=parseInt(a.id.slice(12),10);!Number.isNaN(i)&&i>t&&(t=i)}return t+1}function cE(e,t,a){if(t==="lounge"){const s=xc(a),o=new Set;for(const f of e.values())f.zone==="lounge"&&o.add(On(f.position));const u=s.find(f=>!o.has(On(f)));return u||(s[0]??{x:De.lounge.x+60,y:De.lounge.y+40})}const i=new Set;for(const s of e.values())s.zone===t&&i.add(On(s.position));return og("temp-"+Date.now(),t==="hotDesk",i)}function _f(e,t){let a;for(const i of e.agents.values())if(i.isPlaceholder&&i.zone==="lounge"){a=i;break}if(a)t.position={...a.position},t.zone="lounge",e.agents.delete(a.id);else{const i=xc(e.maxSubAgents),s=new Set;for(const u of e.agents.values())u.zone==="lounge"&&s.add(On(u.position));const o=i.find(u=>!s.has(On(u)));t.position=o??i[0]??{x:De.lounge.x+60,y:De.lounge.y+40},t.zone="lounge"}}const se=In()(jA(e=>({agents:new Map,links:[],globalMetrics:{activeAgents:0,totalAgents:0,totalTokens:0,tokenRate:0,collaborationHeat:0},connectionStatus:"disconnected",connectionError:null,selectedAgentId:null,viewMode:"2d",eventHistory:[],sidebarCollapsed:!1,lastSessionsSnapshot:null,theme:iE(),bloomEnabled:sE(),operatorScopes:[],tokenHistory:[],agentCosts:{},currentPage:"office",chatDockHeight:rE(),maxSubAgents:8,agentToAgentConfig:{enabled:!1,allow:[]},runIdMap:new Map,sessionKeyMap:new Map,addAgent:t=>{e(a=>{a.agents.set(t.id,t),a.globalMetrics=Gn(a.agents,a.globalMetrics)})},updateAgent:(t,a)=>{e(i=>{const s=i.agents.get(t);s&&(Object.assign(s,a),i.globalMetrics=Gn(i.agents,i.globalMetrics))})},removeAgent:t=>{e(a=>{a.agents.delete(t),a.selectedAgentId===t&&(a.selectedAgentId=null),a.globalMetrics=Gn(a.agents,a.globalMetrics)})},addSubAgent:(t,a)=>{e(s=>{const o=s.agents.get(a.agentId);if(o&&!o.confirmed){const f=wi.get(a.agentId);f&&(clearTimeout(f),wi.delete(a.agentId)),o.confirmed=!0,o.isSubAgent=!0,o.parentAgentId=t,o.name=a.label||o.name,_f(s,o)}else if(o&&o.confirmed){const f=!o.isSubAgent;o.isSubAgent=!0,o.parentAgentId=t,o.name=a.label||o.name,f&&(o.movement=null,_f(s,o))}else{let f;for(const h of s.agents.values())if(h.isPlaceholder&&h.zone==="lounge"){f=h;break}if(f){const h=f.id,g={...f.position};s.agents.delete(h),f.id=a.agentId,f.name=a.label||`Sub-${a.agentId.slice(0,6)}`,f.isPlaceholder=!1,f.isSubAgent=!0,f.parentAgentId=t,f.runId=a.sessionKey,f.status="idle",f.position=g,f.confirmed=!0,s.agents.set(a.agentId,f)}else{const h=new Set;for(const x of s.agents.values())h.add(On(x.position));const g=Fo(a.agentId,a.label||`Sub-${a.agentId.slice(0,6)}`,!0,h);g.parentAgentId=t,g.runId=a.sessionKey,g.zone="hotDesk",s.agents.set(a.agentId,g)}}const u=s.agents.get(t);if(u&&!u.childAgentIds.includes(a.agentId)&&u.childAgentIds.push(a.agentId),a.sessionKey){const f=s.sessionKeyMap.get(a.sessionKey)??[];f.includes(a.agentId)||(f.push(a.agentId),s.sessionKeyMap.set(a.sessionKey,f))}s.globalMetrics=Gn(s.agents,s.globalMetrics)});const i=se.getState().agents.get(a.agentId);i&&i.zone!=="hotDesk"&&i.zone!=="meeting"&&se.getState().startMovement(a.agentId,"hotDesk")},removeSubAgent:t=>{e(a=>{const i=a.agents.get(t);if(i!=null&&i.parentAgentId){const f=a.agents.get(i.parentAgentId);f&&(f.childAgentIds=f.childAgentIds.filter(h=>h!==t))}kr.add(t),setTimeout(()=>kr.delete(t),Ch);for(const[f,h]of a.runIdMap)h===t&&(a.runIdMap.delete(f),kr.add(f),setTimeout(()=>kr.delete(f),Ch));for(const[f,h]of a.sessionKeyMap){const g=h.filter(x=>x!==t);g.length===0?a.sessionKeyMap.delete(f):a.sessionKeyMap.set(f,g)}const s=xc(a.maxSubAgents),o=new Set;for(const f of a.agents.values())f.zone==="lounge"&&f.id!==t&&o.add(On(f.position));const u=s.find(f=>!o.has(On(f)));if(a.agents.delete(t),a.selectedAgentId===t&&(a.selectedAgentId=null),u){const f=oE(a.agents),h=`placeholder-${f}`,g={id:h,name:`待命-${f}`,status:"idle",position:u,currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!0,isPlaceholder:!0,parentAgentId:null,childAgentIds:[],zone:"lounge",originalPosition:null,movement:null,confirmed:!0};a.agents.set(h,g)}a.globalMetrics=Gn(a.agents,a.globalMetrics)})},moveToMeeting:(t,a)=>{e(i=>{const s=i.agents.get(t);s&&(s.originalPosition||(s.originalPosition={...s.position}))}),se.getState().startMovement(t,"meeting",a)},returnFromMeeting:t=>{const a=se.getState().agents.get(t);if(!(a!=null&&a.originalPosition))return;const i=a.isSubAgent?"hotDesk":"desk",s={...a.originalPosition};e(o=>{const u=o.agents.get(t);u&&(u.originalPosition=null)}),se.getState().startMovement(t,i,s)},startMovement:(t,a,i)=>{e(s=>{const o=s.agents.get(t);if(!o||o.movement&&o.movement.toZone===a)return;const u=o.zone,f=i??cE(s.agents,a,s.maxSubAgents),h=FA(o.position,f,u,a),g=PA(h);o.movement={path:h,progress:0,duration:g,startTime:Date.now(),fromZone:u,toZone:a}})},tickMovement:(t,a)=>{e(i=>{const s=i.agents.get(t);if(!(s!=null&&s.movement))return;const o=a/s.movement.duration;s.movement.progress=Math.min(s.movement.progress+o,1);const u=GA(s.movement.path,s.movement.progress);if(s.position=u,s.movement.progress>=1){const f=s.movement.toZone,h=s.movement.path[s.movement.path.length-1];s.movement=null,s.zone=f,s.position={...h}}})},completeMovement:t=>{e(a=>{const i=a.agents.get(t);if(!(i!=null&&i.movement))return;const s=i.movement.toZone,o=i.movement.path[i.movement.path.length-1];i.movement=null,i.zone=s,i.position={...o}})},prefillLoungePlaceholders:t=>{e(a=>{const i=xc(t);for(let s=0;s<Math.min(t,i.length);s++){const o=`placeholder-${s}`;if(a.agents.has(o))continue;const u={id:o,name:`待命-${s}`,status:"idle",position:{...i[s]},currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!0,isPlaceholder:!0,parentAgentId:null,childAgentIds:[],zone:"lounge",originalPosition:null,movement:null,confirmed:!0};a.agents.set(o,u)}})},confirmAgent:(t,a,i)=>{e(o=>{const u=o.agents.get(t);if(!u||u.confirmed)return;u.confirmed=!0;const f=wi.get(t);if(f&&(clearTimeout(f),wi.delete(t)),a==="sub")u.isSubAgent=!0,i&&(u.parentAgentId=i),_f(o,u);else{const h=new Set;for(const g of o.agents.values())g.zone==="desk"&&g.id!==t&&h.add(On(g.position));u.position=og(t,!1,h),u.zone="desk"}o.globalMetrics=Gn(o.agents,o.globalMetrics)});const s=se.getState().agents.get(t);s&&!s.movement&&(a==="sub"?se.getState().startMovement(t,"hotDesk"):se.getState().startMovement(t,"desk"))},setSessionsSnapshot:t=>{e(a=>{a.lastSessionsSnapshot=t})},initAgents:t=>{e(a=>{var s;a.agents.clear(),a.runIdMap.clear(),a.sessionKeyMap.clear();const i=new Set;for(const o of t){const u=((s=o.identity)==null?void 0:s.name)??o.name??o.id,f=Fo(o.id,u,!1,i);i.add(On(f.position)),a.agents.set(o.id,f)}a.globalMetrics=Gn(a.agents,a.globalMetrics)}),se.getState().prefillLoungePlaceholders(se.getState().maxSubAgents)},processAgentEvent:t=>{const a={value:null};let i=null;e(o=>{const u=CA(t),f=t.data.agentId,h=t.data.parentAgentId,g=!!f&&!!h&&t.stream==="lifecycle"&&t.data.phase==="start",x=t.sessionKey??"",p=x.includes(":subagent:")&&!x.startsWith("announce:");let b;if(p){if(b=o.runIdMap.get(t.runId),!b){const S=o.sessionKeyMap.get(x);S&&S.length>0&&(b=S[0])}if(!b){const S=":subagent:",N=x.indexOf(S);N>=0&&(b=x.slice(N+S.length))}b||(b=t.runId)}else{if(f&&(b=f),b||(b=o.runIdMap.get(t.runId)),!b&&t.sessionKey){const S=o.sessionKeyMap.get(t.sessionKey);S&&S.length>0&&(b=m1(o,S))}if(!b&&t.sessionKey){const S=t.sessionKey.match(/^agent:([^:]+):/);if(S){const N=S[1];for(const[D,U]of o.agents)if(!U.isSubAgent&&!U.isPlaceholder&&(U.id===N||U.name===N)){b=D;break}}}b||(b=t.runId)}if(kr.has(b)||t.runId.startsWith("announce:"))return;const v=p?dE(o,x):null;if(g&&f&&h&&!o.agents.has(f))a.value={parentId:h,info:{sessionKey:t.sessionKey??t.runId,agentId:f,label:`Sub-${f.slice(0,8)}`,task:"",requesterSessionKey:t.sessionKey??"",startedAt:t.ts}};else if(!o.agents.has(b)&&p&&v)a.value={parentId:v,info:{sessionKey:x,agentId:b,label:`Sub-${b.slice(0,8)}`,task:"",requesterSessionKey:x,startedAt:t.ts}};else if(!o.agents.has(b))if(uE(o,b,t.sessionKey)||f){const N=new Set;for(const U of o.agents.values())N.add(On(U.position));const D=Fo(b,`Agent-${b.slice(0,6)}`,!1,N,!0);D.runId=t.runId,o.agents.set(b,D)}else{const N=Fo(b,`Agent-${b.slice(0,6)}`,!1,new Set,!1);N.runId=t.runId,o.agents.set(b,N),i=b}const w=o.runIdMap.get(t.runId);if(w&&w!==b&&o.agents.has(w)&&(lE(o,w,b),Ah(w)),o.runIdMap.set(t.runId,b),t.sessionKey){const S=o.sessionKeyMap.get(t.sessionKey)??[];if(w&&w!==b){const N=S.filter(D=>D!==w);S.length=0,S.push(...N)}S.includes(b)||(S.push(b),o.sessionKeyMap.set(t.sessionKey,S)),hE(o,t.sessionKey,b),gE()}const C=o.agents.get(b);if(C){const S=C.status;VA(C,u),C.isSubAgent&&C.confirmed&&C.zone!=="meeting"&&mE(C.id,S,C.status)}const E={timestamp:t.ts,agentId:b,agentName:(C==null?void 0:C.name)??b,stream:t.stream,summary:u.summary};o.eventHistory.push(E),o.eventHistory.length>Mf&&(o.eventHistory=o.eventHistory.slice(-Mf)),queueMicrotask(()=>{Yn.saveEvent(E).catch(()=>{})}),o.globalMetrics=Gn(o.agents,o.globalMetrics)});const s=a.value;if(s&&se.getState().addSubAgent(s.parentId,s.info),i){const o=i,u=setTimeout(()=>{wi.delete(o);const h=se.getState().agents.get(o);h&&!h.confirmed&&fE(o)},nE);wi.set(o,u)}if(t.stream==="lifecycle"&&t.data.phase==="end"){if(t.data.agentId){const u=t.data.agentId,f=se.getState().agents.get(u);f!=null&&f.isSubAgent&&!f.isPlaceholder&&se.getState().removeSubAgent(u)}const o=t.sessionKey??"";if(o.includes(":subagent:")){const u=":subagent:",f=o.indexOf(u);if(f>=0){const h=o.slice(f+u.length),g=se.getState().agents.get(h);g!=null&&g.isSubAgent&&!g.isPlaceholder&&se.getState().removeSubAgent(h)}}}},selectAgent:t=>{e(a=>{a.selectedAgentId=a.selectedAgentId===t?null:t})},setViewMode:t=>{e(a=>{a.viewMode=t})},setConnectionStatus:(t,a)=>{e(i=>{i.connectionStatus=t,i.connectionError=a??null})},setSidebarCollapsed:t=>{e(a=>{a.sidebarCollapsed=t})},setTheme:t=>{e(a=>{a.theme=t});try{localStorage.setItem(f1,t)}catch{}},setBloomEnabled:t=>{e(a=>{a.bloomEnabled=t})},setOperatorScopes:t=>{e(a=>{a.operatorScopes=t})},pushTokenSnapshot:t=>{e(a=>{const i=a.tokenHistory[a.tokenHistory.length-1];a.tokenHistory.push(t),a.tokenHistory.length>30&&(a.tokenHistory=a.tokenHistory.slice(-30));const s=Math.max(0,Math.round(t.total||0));let o=a.globalMetrics.tokenRate;if(i){const f=Math.max(1,t.timestamp-i.timestamp)/6e4,h=t.total-i.total,g=h>0?h/f:0;o=Number.isFinite(g)?g:0}a.globalMetrics={...a.globalMetrics,totalTokens:s,tokenRate:o}})},setAgentCosts:t=>{e(a=>{a.agentCosts=t})},setCurrentPage:t=>{e(a=>{a.currentPage=t})},setChatDockHeight:t=>{e(a=>{a.chatDockHeight=t});try{localStorage.setItem(h1,String(t))}catch{}},setMaxSubAgents:t=>{e(a=>{t>=1&&t<=50&&(a.maxSubAgents=t)})},setAgentToAgentConfig:t=>{e(a=>{a.agentToAgentConfig=t})},initEventHistory:async()=>{try{await Yn.open();const t=await Yn.getEvents(Mf);t.length>0&&e(a=>{a.eventHistory=t}),Yn.cleanup().catch(()=>{})}catch{}},updateMetrics:()=>{e(t=>{t.globalMetrics=Gn(t.agents,t.globalMetrics)})}})));function uE(e,t,a){for(const i of e.agents.values())if(!i.isSubAgent&&!i.isPlaceholder&&i.confirmed&&i.id===t)return!0;if(a){const i=e.sessionKeyMap.get(a);if(i)for(const s of i){const o=e.agents.get(s);if(g1(o))return!1}}return!1}function dE(e,t){const a=t.split(":"),i=a.indexOf("subagent");if(i>=2){const s=a.slice(1,i).join(":");for(const[o,u]of e.sessionKeyMap)if(o.startsWith(`agent:${s}:`)&&!o.includes(":subagent:")&&u.length>0)return m1(e,u)??null;for(const[o,u]of e.agents)if(!u.isSubAgent&&!u.isPlaceholder&&(u.id===s||u.name===s))return o}for(const[s,o]of e.agents)if(!o.isSubAgent&&!o.isPlaceholder&&o.confirmed)return s;return null}function fE(e){se.setState(t=>{const a=t.agents.get(e);if(!(!a||a.confirmed)){t.agents.delete(e),t.selectedAgentId===e&&(t.selectedAgentId=null);for(const[i,s]of t.runIdMap)s===e&&(t.runIdMap.delete(i),Ah(i));for(const[i,s]of t.sessionKeyMap){const o=s.filter(u=>u!==e);o.length===0?t.sessionKeyMap.delete(i):t.sessionKeyMap.set(i,o)}Ah(e),t.globalMetrics=Gn(t.agents,t.globalMetrics)}})}function hE(e,t,a){const i=e.sessionKeyMap.get(t);if(!i||i.length<2)return;const s=Date.now();for(const o of i){if(o===a)continue;const u=e.links.findIndex(f=>f.sessionKey===t&&(f.sourceId===a&&f.targetId===o||f.sourceId===o&&f.targetId===a));if(u>=0){const f=e.links[u];f.lastActivityAt=s,f.strength=Math.min(f.strength+.1,1)}else e.links.push({sourceId:a,targetId:o,sessionKey:t,strength:.3,lastActivityAt:s})}e.links=e.links.filter(o=>s-o.lastActivityAt<WA)}function gE(){Df||(Df=setTimeout(()=>{Df=null;const e=se.getState(),t=e.agentToAgentConfig.enabled?e.agentToAgentConfig.allow:void 0,a=XA(e.links,e.agents,t),i=JSON.stringify(a.map(s=>s.agentIds.sort()));i!==qx&&(qx=i,JA(e.agents,a,(s,o)=>se.getState().moveToMeeting(s,o),s=>se.getState().returnFromMeeting(s)))},aE))}function mE(e,t,a){const i=ki.get(e);i&&(clearTimeout(i),ki.delete(e));const s=Nh(t),o=Nh(a);if(!s&&o){const u=setTimeout(()=>{ki.delete(e),pE(e)},eE);ki.set(e,u)}else if(s&&!o&&a==="idle"){const u=setTimeout(()=>{ki.delete(e),yE(e)},tE);ki.set(e,u)}}function pE(e){var i;const a=se.getState().agents.get(e);!a||!a.isSubAgent||a.zone!=="lounge"||((i=a.movement)==null?void 0:i.toZone)!=="hotDesk"&&se.getState().startMovement(e,"hotDesk")}function yE(e){var i;const a=se.getState().agents.get(e);!a||!a.isSubAgent||a.zone!=="hotDesk"||Nh(a.status)||((i=a.movement)==null?void 0:i.toZone)!=="lounge"&&se.getState().startMovement(e,"lounge")}function xE(e){return`agent:${e}:main`}function p1(e){const t=se.getState().agents.get(e);return!!(t&&t.confirmed&&!t.isPlaceholder&&!t.isSubAgent)}function bE(){var t;const e=Array.from(se.getState().agents.values()).filter(a=>a.confirmed&&!a.isPlaceholder&&!a.isSubAgent);return e.length===0?null:((t=e.find(a=>a.id==="main"))==null?void 0:t.id)??e[0].id}function vE(e){return p1(e)?e:bE()}function $x(e,t){var s;const a=`agent:${e}:`;return((s=t.filter(o=>o.key.startsWith(a)).sort((o,u)=>u.lastActiveAt-o.lastActiveAt)[0])==null?void 0:s.key)??xE(e)}function kE(e){return typeof e=="string"?e:Array.isArray(e)?e.filter(t=>t.type==="text"&&t.text).map(t=>t.text).join(`
|
|
431
|
-
`):""}Yn.open().catch(()=>{});const Qe=In((e,t)=>({messages:[],isStreaming:!1,currentSessionKey:"agent:main:main",dockExpanded:!1,targetAgentId:null,sessions:[],error:null,activeRunId:null,streamingMessage:null,isHistoryLoaded:!1,isHistoryLoading:!1,sendMessage:async a=>{const i=a.trim();if(!i)return;const{currentSessionKey:s}=t(),o={id:Cx(),role:"user",content:i,timestamp:Date.now()};e(u=>({messages:[...u.messages,o],isStreaming:!0,dockExpanded:!0,error:null,streamingMessage:null})),Yn.saveMessage(s,o).catch(()=>{});try{let u;try{u=Re()}catch(f){console.error("[ChatDock] Adapter not initialized:",f),e({error:Te.t("common:errors.adapterNotInitialized"),isStreaming:!1});return}console.log("[ChatDock] Sending chat.send:",{text:i,sessionKey:s}),await u.chatSend({text:i,sessionKey:s}),console.log("[ChatDock] chat.send completed")}catch(u){console.error("[ChatDock] chat.send error:",u),e({error:String(u),isStreaming:!1})}},abort:async()=>{const{currentSessionKey:a}=t();e({isStreaming:!1,streamingMessage:null});try{await Re().chatAbort(a)}catch(i){e({error:String(i)})}},toggleDock:()=>{e(a=>({dockExpanded:!a.dockExpanded}))},setDockExpanded:a=>{e({dockExpanded:a})},switchSession:a=>{e({currentSessionKey:a,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1,isHistoryLoaded:!1}),t().initializeHistory()},newSession:()=>{const{targetAgentId:a}=t(),s=`agent:${a??"main"}:session-${Date.now()}`;e({currentSessionKey:s,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1})},loadSessions:async()=>{try{const i=await Re().sessionsList(),s=Array.isArray(i)?i:[];e({sessions:s});const{targetAgentId:o,currentSessionKey:u}=t();if(o&&p1(o)){const f=$x(o,s);f!==u&&(e({currentSessionKey:f,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1,isHistoryLoaded:!1}),t().initializeHistory())}}catch{}},loadHistory:async()=>{const{currentSessionKey:a}=t();try{const o=(await Re().chatHistory(a)).map(u=>({id:u.id,role:u.role==="user"?"user":"assistant",content:u.content,timestamp:u.timestamp}));e({messages:o}),Yn.saveMessages(a,o).catch(()=>{})}catch{e({messages:[]})}},initializeHistory:async()=>{const{currentSessionKey:a}=t();e({isHistoryLoading:!0});try{const o=(await Re().chatHistory(a)).map(u=>({id:u.id,role:u.role==="user"?"user":"assistant",content:u.content,timestamp:u.timestamp}));e({messages:o,isHistoryLoaded:!0,isHistoryLoading:!1}),Yn.saveMessages(a,o).catch(()=>{})}catch{try{const i=await Yn.getMessages(a);e({messages:i,isHistoryLoaded:!0,isHistoryLoading:!1})}catch{e({messages:[],isHistoryLoaded:!0,isHistoryLoading:!1})}}},setTargetAgent:a=>{const i=vE(a);if(!i)return;const s=$x(i,t().sessions);e({targetAgentId:i,currentSessionKey:s,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1,isHistoryLoaded:!1}),t().initializeHistory()},handleChatEvent:(a,i)=>{const s=t().currentSessionKey,o=String(a.sessionKey||i||"");if(o&&o!==s)return;const u=String(a.state||""),f=String(a.runId||""),h=a.message;let g=u;switch(!g&&h&&(h.stopReason??h.stop_reason?g="final":(h.role||h.content)&&(g="delta")),g){case"delta":{h&&e({streamingMessage:h,activeRunId:f||t().activeRunId});break}case"final":{if(h){const x=kE(h.content);if(x){const p={id:h.id||Cx(),role:"assistant",content:x,timestamp:Date.now()};e(v=>({messages:[...v.messages,p],isStreaming:!1,streamingMessage:null,activeRunId:null}));const{currentSessionKey:b}=t();Yn.saveMessage(b,p).catch(()=>{})}else e({isStreaming:!1,streamingMessage:null,activeRunId:null}),t().loadHistory()}else e({isStreaming:!1,streamingMessage:null,activeRunId:null}),t().loadHistory();break}case"error":{const x=String(a.errorMessage||Te.t("common:errors.errorOccurred"));e({error:x,isStreaming:!1,streamingMessage:null,activeRunId:null});break}case"aborted":{e({isStreaming:!1,streamingMessage:null,activeRunId:null});break}default:{t().isStreaming&&h&&e({streamingMessage:h});break}}},clearError:()=>e({error:null}),initEventListeners:a=>a?a.onEvent("chat",s=>{const o=s.payload;t().handleChatEvent(o)}):()=>{}}));function y1(){const{t:e}=le("chat"),[t,a]=j.useState(!1),i=j.useRef(null),s=se(g=>g.agents),o=Qe(g=>g.targetAgentId),u=Qe(g=>g.setTargetAgent),f=Array.from(s.values()),h=f.find(g=>g.id===o)??f[0];return j.useEffect(()=>{function g(x){i.current&&!i.current.contains(x.target)&&a(!1)}if(t)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[t]),f.length===0?null:c.jsxs("div",{className:"relative",ref:i,children:[c.jsxs("button",{type:"button",onClick:()=>a(!t),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:Kx((h==null?void 0:h.id)??"")}}),c.jsx("span",{className:"max-w-[100px] truncate",children:(h==null?void 0:h.name)??e("agentSelector.defaultLabel")}),c.jsx(Un,{className:"h-3 w-3"})]}),t&&c.jsx("div",{className:"absolute bottom-full left-0 z-50 mb-1 min-w-[160px] rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:f.map(g=>c.jsxs("button",{type:"button",onClick:()=>{u(g.id),a(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-gray-50 dark:hover:bg-gray-800 ${g.id===o?"bg-blue-50 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:Kx(g.id)}}),c.jsx("span",{className:"truncate",children:g.name})]},g.id))})]})}function Kx(e){const t=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"];let a=0;for(let i=0;i<e.length;i++)a=(a<<5)-a+e.charCodeAt(i)|0;return t[Math.abs(a)%t.length]}function wE(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const SE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CE={};function Fx(e,t){return(CE.jsx?jE:SE).test(e)}const NE=/[ \t\n\f\r]/g;function AE(e){return typeof e=="object"?e.type==="text"?Px(e.value):!1:Px(e)}function Px(e){return e.replace(NE,"")===""}class yl{constructor(t,a,i){this.normal=a,this.property=t,i&&(this.space=i)}}yl.prototype.normal={};yl.prototype.property={};yl.prototype.space=void 0;function x1(e,t){const a={},i={};for(const s of e)Object.assign(a,s.property),Object.assign(i,s.normal);return new yl(a,i,t)}function Eh(e){return e.toLowerCase()}class Zt{constructor(t,a){this.attribute=a,this.property=t}}Zt.prototype.attribute="";Zt.prototype.booleanish=!1;Zt.prototype.boolean=!1;Zt.prototype.commaOrSpaceSeparated=!1;Zt.prototype.commaSeparated=!1;Zt.prototype.defined=!1;Zt.prototype.mustUseProperty=!1;Zt.prototype.number=!1;Zt.prototype.overloadedBoolean=!1;Zt.prototype.property="";Zt.prototype.spaceSeparated=!1;Zt.prototype.space=void 0;let EE=0;const Ee=Dr(),xt=Dr(),Th=Dr(),ie=Dr(),it=Dr(),Ai=Dr(),ln=Dr();function Dr(){return 2**++EE}const Mh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:xt,commaOrSpaceSeparated:ln,commaSeparated:Ai,number:ie,overloadedBoolean:Th,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),Rf=Object.keys(Mh);class cg extends Zt{constructor(t,a,i,s){let o=-1;if(super(t,a),Gx(this,"space",s),typeof i=="number")for(;++o<Rf.length;){const u=Rf[o];Gx(this,Rf[o],(i&Mh[u])===Mh[u])}}}cg.prototype.defined=!0;function Gx(e,t,a){a&&(e[t]=a)}function zi(e){const t={},a={};for(const[i,s]of Object.entries(e.properties)){const o=new cg(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,a[Eh(i)]=i,a[Eh(o.attribute)]=i}return new yl(t,a,e.space)}const b1=zi({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:it,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:ie,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:it,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:xt,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function v1(e,t){return t in e?e[t]:t}function k1(e,t){return v1(e,t.toLowerCase())}const TE=zi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ai,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:it,autoFocus:Ee,autoPlay:Ee,blocking:it,capture:null,charSet:null,checked:Ee,cite:null,className:it,cols:ie,colSpan:null,content:null,contentEditable:xt,controls:Ee,controlsList:it,coords:ie|Ai,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:Th,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:it,height:ie,hidden:Th,high:ie,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:it,itemRef:it,itemScope:Ee,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ee,optimum:ie,pattern:null,ping:it,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:it,required:Ee,reversed:Ee,rows:ie,rowSpan:ie,sandbox:it,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:xt,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:k1}),ME=zi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ln,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:it,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ai,g2:Ai,glyphName:Ai,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ln,rev:ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ln,requiredFeatures:ln,requiredFonts:ln,requiredFormats:ln,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ln,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:v1}),w1=zi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),S1=zi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:k1}),j1=zi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},_E=/[A-Z]/g,Vx=/-[a-z]/g,RE=/^data[-\w.:]+$/i;function OE(e,t){const a=Eh(t);let i=t,s=Zt;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&RE.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Vx,zE);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Vx.test(o)){let u=o.replace(_E,LE);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=cg}return new s(i,t)}function LE(e){return"-"+e.toLowerCase()}function zE(e){return e.charAt(1).toUpperCase()}const HE=x1([b1,TE,w1,S1,j1],"html"),ug=x1([b1,ME,w1,S1,j1],"svg");function UE(e){return e.join(" ").trim()}var Si={},Of,Yx;function IE(){if(Yx)return Of;Yx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
432
|
-
`,g="/",x="*",p="",b="comment",v="declaration";function w(E,S){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];S=S||{};var N=1,D=1;function U(W){var J=W.match(t);J&&(N+=J.length);var B=W.lastIndexOf(h);D=~B?W.length-B:D+W.length}function z(){var W={line:N,column:D};return function(J){return J.position=new L(W),F(),J}}function L(W){this.start=W,this.end={line:N,column:D},this.source=S.source}L.prototype.content=E;function G(W){var J=new Error(S.source+":"+N+":"+D+": "+W);if(J.reason=W,J.filename=S.source,J.line=N,J.column=D,J.source=E,!S.silent)throw J}function X(W){var J=W.exec(E);if(J){var B=J[0];return U(B),E=E.slice(B.length),J}}function F(){X(a)}function _(W){var J;for(W=W||[];J=q();)J!==!1&&W.push(J);return W}function q(){var W=z();if(!(g!=E.charAt(0)||x!=E.charAt(1))){for(var J=2;p!=E.charAt(J)&&(x!=E.charAt(J)||g!=E.charAt(J+1));)++J;if(J+=2,p===E.charAt(J-1))return G("End of comment missing");var B=E.slice(2,J-2);return D+=2,U(B),E=E.slice(J),D+=2,W({type:b,comment:B})}}function V(){var W=z(),J=X(i);if(J){if(q(),!X(s))return G("property missing ':'");var B=X(o),ee=W({type:v,property:C(J[0].replace(e,p)),value:B?C(B[0].replace(e,p)):p});return X(u),ee}}function re(){var W=[];_(W);for(var J;J=V();)J!==!1&&(W.push(J),_(W));return W}return F(),re()}function C(E){return E?E.replace(f,p):p}return Of=w,Of}var Qx;function BE(){if(Qx)return Si;Qx=1;var e=Si&&Si.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=a;const t=e(IE());function a(i,s){let o=null;if(!i||typeof i!="string")return o;const u=(0,t.default)(i),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:g,value:x}=h;f?s(g,x,h):x&&(o=o||{},o[g]=x)}),o}return Si}var Ls={},Xx;function qE(){if(Xx)return Ls;Xx=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(g){return!g||a.test(g)||e.test(g)},u=function(g,x){return x.toUpperCase()},f=function(g,x){return"".concat(x,"-")},h=function(g,x){return x===void 0&&(x={}),o(g)?g:(g=g.toLowerCase(),x.reactCompat?g=g.replace(s,f):g=g.replace(i,f),g.replace(t,u))};return Ls.camelCase=h,Ls}var zs,Zx;function $E(){if(Zx)return zs;Zx=1;var e=zs&&zs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(BE()),a=qE();function i(s,o){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(u[(0,a.camelCase)(f,o)]=h)}),u}return i.default=i,zs=i,zs}var KE=$E();const FE=$h(KE),C1=N1("end"),dg=N1("start");function N1(e){return t;function t(a){const i=a&&a.position&&a.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function PE(e){const t=dg(e),a=C1(e);if(t&&a)return{start:t,end:a}}function Ys(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jx(e.position):"start"in e||"end"in e?Jx(e):"line"in e||"column"in e?Dh(e):""}function Dh(e){return Wx(e&&e.line)+":"+Wx(e&&e.column)}function Jx(e){return Dh(e&&e.start)+"-"+Dh(e&&e.end)}function Wx(e){return e&&typeof e=="number"?e:1}class Rt extends Error{constructor(t,a,i){super(),typeof a=="string"&&(i=a,a=void 0);let s="",o={},u=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?s=t:!o.cause&&t&&(u=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?o.ruleId=i:(o.source=i.slice(0,h),o.ruleId=i.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Ys(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rt.prototype.file="";Rt.prototype.name="";Rt.prototype.reason="";Rt.prototype.message="";Rt.prototype.stack="";Rt.prototype.column=void 0;Rt.prototype.line=void 0;Rt.prototype.ancestors=void 0;Rt.prototype.cause=void 0;Rt.prototype.fatal=void 0;Rt.prototype.place=void 0;Rt.prototype.ruleId=void 0;Rt.prototype.source=void 0;const fg={}.hasOwnProperty,GE=new Map,VE=/[A-Z]/g,YE=new Set(["table","tbody","thead","tfoot","tr"]),QE=new Set(["td","th"]),A1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=rT(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=aT(a,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ug:HE,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=E1(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function E1(e,t,a){if(t.type==="element")return ZE(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return JE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eT(e,t,a);if(t.type==="mdxjsEsm")return WE(e,t);if(t.type==="root")return tT(e,t,a);if(t.type==="text")return nT(e,t)}function ZE(e,t,a){const i=e.schema;let s=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(s=ug,e.schema=s),e.ancestors.push(t);const o=M1(e,t.tagName,!1),u=iT(e,t);let f=gg(e,t);return YE.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!AE(h):!0})),T1(e,u,o,t),hg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,a)}function JE(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}il(e,t.position)}function WE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);il(e,t.position)}function eT(e,t,a){const i=e.schema;let s=i;t.name==="svg"&&i.space==="html"&&(s=ug,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:M1(e,t.name,!0),u=sT(e,t),f=gg(e,t);return T1(e,u,o,t),hg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,a)}function tT(e,t,a){const i={};return hg(i,gg(e,t)),e.create(t,e.Fragment,i,a)}function nT(e,t){return t.value}function T1(e,t,a,i){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=i)}function hg(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function aT(e,t,a){return i;function i(s,o,u,f){const g=Array.isArray(u.children)?a:t;return f?g(o,u,f):g(o,u)}}function rT(e,t){return a;function a(i,s,o,u){const f=Array.isArray(o.children),h=dg(i);return t(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function iT(e,t){const a={};let i,s;for(s in t.properties)if(s!=="children"&&fg.call(t.properties,s)){const o=lT(e,s,t.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&QE.has(t.tagName)?i=f:a[u]=f}}if(i){const o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return a}function sT(e,t){const a={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else il(e,t.position);else{const s=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else il(e,t.position);else o=i.value===null?!0:i.value;a[s]=o}return a}function gg(e,t){const a=[];let i=-1;const s=e.passKeys?new Map:GE;for(;++i<t.children.length;){const o=t.children[i];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const g=s.get(h)||0;u=h+"-"+g,s.set(h,g+1)}}const f=E1(e,o,u);f!==void 0&&a.push(f)}return a}function lT(e,t,a){const i=OE(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=i.commaSeparated?wE(a):UE(a)),i.property==="style"){let s=typeof a=="object"?a:oT(e,String(a));return e.stylePropertyNameCase==="css"&&(s=cT(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?DE[i.property]||i.property:i.attribute,a]}}function oT(e,t){try{return FE(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const i=a,s=new Rt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=A1+"#cannot-parse-style-attribute",s}}function M1(e,t,a){let i;if(!a)i={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,u;for(;++o<s.length;){const f=Fx(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}i=u}else i=Fx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const s=i.value;return fg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(i);il(e)}function il(e,t){const a=new Rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=A1+"#cannot-handle-mdx-estrees-without-createevaluater",a}function cT(e){const t={};let a;for(a in e)fg.call(e,a)&&(t[uT(a)]=e[a]);return t}function uT(e){let t=e.replace(VE,dT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dT(e){return"-"+e.toLowerCase()}const Lf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fT={};function mg(e,t){const a=fT,i=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,s=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return D1(e,i,s)}function D1(e,t,a){if(hT(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eb(e.children,t,a)}return Array.isArray(e)?eb(e,t,a):""}function eb(e,t,a){const i=[];let s=-1;for(;++s<e.length;)i[s]=D1(e[s],t,a);return i.join("")}function hT(e){return!!(e&&typeof e=="object")}const tb=document.createElement("i");function pg(e){const t="&"+e+";";tb.innerHTML=t;const a=tb.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function on(e,t,a,i){const s=e.length;let o=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,a=a>0?a:0,i.length<1e4)u=Array.from(i),u.unshift(t,a),e.splice(...u);else for(a&&e.splice(t,a);o<i.length;)u=i.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function kn(e,t){return e.length>0?(on(e,e.length,0,t),e):t}const nb={}.hasOwnProperty;function _1(e){const t={};let a=-1;for(;++a<e.length;)gT(t,e[a]);return t}function gT(e,t){let a;for(a in t){const s=(nb.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a];let u;if(o)for(u in o){nb.call(s,u)||(s[u]=[]);const f=o[u];mT(s[u],Array.isArray(f)?f:f?[f]:[])}}}function mT(e,t){let a=-1;const i=[];for(;++a<t.length;)(t[a].add==="after"?e:i).push(t[a]);on(e,0,0,i)}function R1(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ln(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const It=Za(/[A-Za-z]/),_t=Za(/[\dA-Za-z]/),pT=Za(/[#-'*+\--9=?A-Z^-~]/);function bc(e){return e!==null&&(e<32||e===127)}const _h=Za(/\d/),yT=Za(/[\dA-Fa-f]/),xT=Za(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const Bc=Za(new RegExp("\\p{P}|\\p{S}","u")),Tr=Za(/\s/);function Za(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Hi(e){const t=[];let a=-1,i=0,s=0;for(;++a<e.length;){const o=e.charCodeAt(a);let u="";if(o===37&&_t(e.charCodeAt(a+1))&&_t(e.charCodeAt(a+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(a+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(i,a),encodeURIComponent(u)),i=a+s+1,u=""),s&&(a+=s,s=0)}return t.join("")+e.slice(i)}function qe(e,t,a,i){const s=i?i-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return He(h)?(e.enter(a),f(h)):t(h)}function f(h){return He(h)&&o++<s?(e.consume(h),f):(e.exit(a),t(h))}}const bT={tokenize:vT};function vT(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let a;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=h),a=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return be(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const kT={tokenize:wT},ab={tokenize:ST};function wT(e){const t=this,a=[];let i=0,s,o,u;return f;function f(D){if(i<a.length){const U=a[i];return t.containerState=U[1],e.attempt(U[0].continuation,h,g)(D)}return g(D)}function h(D){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&N();const U=t.events.length;let z=U,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){L=t.events[z][1].end;break}S(i);let G=U;for(;G<t.events.length;)t.events[G][1].end={...L},G++;return on(t.events,z+1,0,t.events.slice(U)),t.events.length=G,g(D)}return f(D)}function g(D){if(i===a.length){if(!s)return b(D);if(s.currentConstruct&&s.currentConstruct.concrete)return w(D);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ab,x,p)(D)}function x(D){return s&&N(),S(i),b(D)}function p(D){return t.parser.lazy[t.now().line]=i!==a.length,u=t.now().offset,w(D)}function b(D){return t.containerState={},e.attempt(ab,v,w)(D)}function v(D){return i++,a.push([t.currentConstruct,t.containerState]),b(D)}function w(D){if(D===null){s&&N(),S(0),e.consume(D);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),C(D)}function C(D){if(D===null){E(e.exit("chunkFlow"),!0),S(0),e.consume(D);return}return be(D)?(e.consume(D),E(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(D),C)}function E(D,U){const z=t.sliceStream(D);if(U&&z.push(null),D.previous=o,o&&(o.next=D),o=D,s.defineSkip(D.start),s.write(z),t.parser.lazy[D.start.line]){let L=s.events.length;for(;L--;)if(s.events[L][1].start.offset<u&&(!s.events[L][1].end||s.events[L][1].end.offset>u))return;const G=t.events.length;let X=G,F,_;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if(F){_=t.events[X][1].end;break}F=!0}for(S(i),L=G;L<t.events.length;)t.events[L][1].end={..._},L++;on(t.events,X+1,0,t.events.slice(G)),t.events.length=L}}function S(D){let U=a.length;for(;U-- >D;){const z=a[U];t.containerState=z[1],z[0].exit.call(t,e)}a.length=D}function N(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function ST(e,t,a){return qe(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ti(e){if(e===null||at(e)||Tr(e))return 1;if(Bc(e))return 2}function qc(e,t,a){const i=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!i.includes(o)&&(t=o(t,a),i.push(o))}return t}const Rh={name:"attention",resolveAll:jT,tokenize:CT};function jT(e,t){let a=-1,i,s,o,u,f,h,g,x;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(i=a;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[i][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const p={...e[i][1].end},b={...e[a][1].start};rb(p,-h),rb(b,h),u={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:b},o={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[a][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[i][1].end={...u.start},e[a][1].start={...f.end},g=[],e[i][1].end.offset-e[i][1].start.offset&&(g=kn(g,[["enter",e[i][1],t],["exit",e[i][1],t]])),g=kn(g,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",o,t]]),g=kn(g,qc(t.parser.constructs.insideSpan.null,e.slice(i+1,a),t)),g=kn(g,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[a][1].end.offset-e[a][1].start.offset?(x=2,g=kn(g,[["enter",e[a][1],t],["exit",e[a][1],t]])):x=0,on(e,i-1,a-i+3,g),a=i+g.length-x-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function CT(e,t){const a=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Ti(i);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const g=e.exit("attentionSequence"),x=Ti(h),p=!x||x===2&&s||a.includes(h),b=!s||s===2&&x||a.includes(i);return g._open=!!(o===42?p:p&&(s||!b)),g._close=!!(o===42?b:b&&(x||!p)),t(h)}}function rb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const NT={name:"autolink",tokenize:AT};function AT(e,t,a){let i=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return It(v)?(e.consume(v),u):v===64?a(v):g(v)}function u(v){return v===43||v===45||v===46||_t(v)?(i=1,f(v)):g(v)}function f(v){return v===58?(e.consume(v),i=0,h):(v===43||v===45||v===46||_t(v))&&i++<32?(e.consume(v),f):(i=0,g(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||bc(v)?a(v):(e.consume(v),h)}function g(v){return v===64?(e.consume(v),x):pT(v)?(e.consume(v),g):a(v)}function x(v){return _t(v)?p(v):a(v)}function p(v){return v===46?(e.consume(v),i=0,x):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||_t(v))&&i++<63){const w=v===45?b:p;return e.consume(v),w}return a(v)}}const xl={partial:!0,tokenize:ET};function ET(e,t,a){return i;function i(o){return He(o)?qe(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||be(o)?t(o):a(o)}}const O1={continuation:{tokenize:MT},exit:DT,name:"blockQuote",tokenize:TT};function TT(e,t,a){const i=this;return s;function s(u){if(u===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return a(u)}function o(u){return He(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function MT(e,t,a){const i=this;return s;function s(u){return He(u)?qe(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(O1,t,a)(u)}}function DT(e){e.exit("blockQuote")}const L1={name:"characterEscape",tokenize:_T};function _T(e,t,a){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return xT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}const z1={name:"characterReference",tokenize:RT};function RT(e,t,a){const i=this;let s=0,o,u;return f;function f(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),g):(e.enter("characterReferenceValue"),o=31,u=_t,x(p))}function g(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=yT,x):(e.enter("characterReferenceValue"),o=7,u=_h,x(p))}function x(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return u===_t&&!pg(i.sliceSerialize(b))?a(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&s++<o?(e.consume(p),x):a(p)}}const ib={partial:!0,tokenize:LT},sb={concrete:!0,name:"codeFenced",tokenize:OT};function OT(e,t,a){const i=this,s={partial:!0,tokenize:z};let o=0,u=0,f;return h;function h(L){return g(L)}function g(L){const G=i.events[i.events.length-1];return o=G&&G[1].type==="linePrefix"?G[2].sliceSerialize(G[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(L)}function x(L){return L===f?(u++,e.consume(L),x):u<3?a(L):(e.exit("codeFencedFenceSequence"),He(L)?qe(e,p,"whitespace")(L):p(L))}function p(L){return L===null||be(L)?(e.exit("codeFencedFence"),i.interrupt?t(L):e.check(ib,C,U)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(L))}function b(L){return L===null||be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(L)):He(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,v,"whitespace")(L)):L===96&&L===f?a(L):(e.consume(L),b)}function v(L){return L===null||be(L)?p(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(L))}function w(L){return L===null||be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(L)):L===96&&L===f?a(L):(e.consume(L),w)}function C(L){return e.attempt(s,U,E)(L)}function E(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),S}function S(L){return o>0&&He(L)?qe(e,N,"linePrefix",o+1)(L):N(L)}function N(L){return L===null||be(L)?e.check(ib,C,U)(L):(e.enter("codeFlowValue"),D(L))}function D(L){return L===null||be(L)?(e.exit("codeFlowValue"),N(L)):(e.consume(L),D)}function U(L){return e.exit("codeFenced"),t(L)}function z(L,G,X){let F=0;return _;function _(J){return L.enter("lineEnding"),L.consume(J),L.exit("lineEnding"),q}function q(J){return L.enter("codeFencedFence"),He(J)?qe(L,V,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):V(J)}function V(J){return J===f?(L.enter("codeFencedFenceSequence"),re(J)):X(J)}function re(J){return J===f?(F++,L.consume(J),re):F>=u?(L.exit("codeFencedFenceSequence"),He(J)?qe(L,W,"whitespace")(J):W(J)):X(J)}function W(J){return J===null||be(J)?(L.exit("codeFencedFence"),G(J)):X(J)}}}function LT(e,t,a){const i=this;return s;function s(u){return u===null?a(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return i.parser.lazy[i.now().line]?a(u):t(u)}}const zf={name:"codeIndented",tokenize:HT},zT={partial:!0,tokenize:UT};function HT(e,t,a){const i=this;return s;function s(g){return e.enter("codeIndented"),qe(e,o,"linePrefix",5)(g)}function o(g){const x=i.events[i.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?u(g):a(g)}function u(g){return g===null?h(g):be(g)?e.attempt(zT,u,h)(g):(e.enter("codeFlowValue"),f(g))}function f(g){return g===null||be(g)?(e.exit("codeFlowValue"),u(g)):(e.consume(g),f)}function h(g){return e.exit("codeIndented"),t(g)}}function UT(e,t,a){const i=this;return s;function s(u){return i.parser.lazy[i.now().line]?a(u):be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):qe(e,o,"linePrefix",5)(u)}function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):be(u)?s(u):a(u)}}const IT={name:"codeText",previous:qT,resolve:BT,tokenize:$T};function BT(e){let t=e.length-4,a=3,i,s;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=a;++i<t;)if(e[i][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(i=a-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function qT(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $T(e,t,a){let i=0,s,o;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),f(p)}function f(p){return p===96?(e.consume(p),i++,f):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?a(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(o=e.enter("codeTextSequence"),s=0,x(p)):be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),g(p))}function g(p){return p===null||p===32||p===96||be(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),g)}function x(p){return p===96?(e.consume(p),s++,x):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",g(p))}}class KT{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const i=a??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,a,i){const s=a||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&Hs(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);Hs(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hs(this.left,a.reverse())}}}function Hs(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function H1(e){const t={};let a=-1,i,s,o,u,f,h,g;const x=new KT(e);for(;++a<x.length;){for(;a in t;)a=t[a];if(i=x.get(a),a&&i[1].type==="chunkFlow"&&x.get(a-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,FT(x,a)),a=t[a],g=!0);else if(i[1]._container){for(o=a,s=void 0;o--;)if(u=x.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(x.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(i[1].end={...x.get(s)[1].start},f=x.slice(s,a),f.unshift(i),x.splice(s,a-s+1,f))}}return on(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!g}function FT(e,t){const a=e.get(t)[1],i=e.get(t)[2];let s=t-1;const o=[];let u=a._tokenizer;u||(u=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],g={};let x,p,b=-1,v=a,w=0,C=0;const E=[C];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(x=i.sliceStream(v),v.next||x.push(null),p&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(x),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=a;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(C=b+1,E.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const S=f.slice(E[b],E[b+1]),N=o.pop();h.push([N,N+S.length-1]),e.splice(N,2,S)}for(h.reverse(),b=-1;++b<h.length;)g[w+h[b][0]]=w+h[b][1],w+=h[b][1]-h[b][0]-1;return g}const PT={resolve:VT,tokenize:YT},GT={partial:!0,tokenize:QT};function VT(e){return H1(e),e}function YT(e,t){let a;return i;function i(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):be(f)?e.check(GT,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,s}}function QT(e,t,a){const i=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),qe(e,o,"linePrefix")}function o(u){if(u===null||be(u))return a(u);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(i.parser.constructs.flow,a,t)(u)}}function U1(e,t,a,i,s,o,u,f,h){const g=h||Number.POSITIVE_INFINITY;let x=0;return p;function p(S){return S===60?(e.enter(i),e.enter(s),e.enter(o),e.consume(S),e.exit(o),b):S===null||S===32||S===41||bc(S)?a(S):(e.enter(i),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(S))}function b(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(s),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(f),b(S)):S===null||S===60||be(S)?a(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!x&&(S===null||S===41||at(S))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(i),t(S)):x<g&&S===40?(e.consume(S),x++,C):S===41?(e.consume(S),x--,C):S===null||S===32||S===40||bc(S)?a(S):(e.consume(S),S===92?E:C)}function E(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function I1(e,t,a,i,s,o){const u=this;let f=0,h;return g;function g(v){return e.enter(i),e.enter(s),e.consume(v),e.exit(s),e.enter(o),x}function x(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?a(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(i),t):be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||be(v)||f++>999?(e.exit("chunkString"),x(v)):(e.consume(v),h||(h=!He(v)),v===92?b:p)}function b(v){return v===91||v===92||v===93?(e.consume(v),f++,p):p(v)}}function B1(e,t,a,i,s,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(i),e.enter(s),e.consume(b),e.exit(s),u=b===40?41:b,h):a(b)}function h(b){return b===u?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),t):(e.enter(o),g(b))}function g(b){return b===u?(e.exit(o),h(u)):b===null?a(b):be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),qe(e,g,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===u||b===null||be(b)?(e.exit("chunkString"),g(b)):(e.consume(b),b===92?p:x)}function p(b){return b===u||b===92?(e.consume(b),x):x(b)}}function Qs(e,t){let a;return i;function i(s){return be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a=!0,i):He(s)?qe(e,i,a?"linePrefix":"lineSuffix")(s):t(s)}}const XT={name:"definition",tokenize:JT},ZT={partial:!0,tokenize:WT};function JT(e,t,a){const i=this;let s;return o;function o(v){return e.enter("definition"),u(v)}function u(v){return I1.call(i,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Ln(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):a(v)}function h(v){return at(v)?Qs(e,g)(v):g(v)}function g(v){return U1(e,x,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function x(v){return e.attempt(ZT,p,p)(v)}function p(v){return He(v)?qe(e,b,"whitespace")(v):b(v)}function b(v){return v===null||be(v)?(e.exit("definition"),i.parser.defined.push(s),t(v)):a(v)}}function WT(e,t,a){return i;function i(f){return at(f)?Qs(e,s)(f):a(f)}function s(f){return B1(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return He(f)?qe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||be(f)?t(f):a(f)}}const e6={name:"hardBreakEscape",tokenize:t6};function t6(e,t,a){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return be(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}const n6={name:"headingAtx",resolve:a6,tokenize:r6};function a6(e,t){let a=e.length-2,i=3,s,o;return e[i][1].type==="whitespace"&&(i+=2),a-2>i&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(i===a-1||a-4>i&&e[a-2][1].type==="whitespace")&&(a-=i+1===a?2:4),a>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},o={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},on(e,i,a-i+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function r6(e,t,a){let i=0;return s;function s(x){return e.enter("atxHeading"),o(x)}function o(x){return e.enter("atxHeadingSequence"),u(x)}function u(x){return x===35&&i++<6?(e.consume(x),u):x===null||at(x)?(e.exit("atxHeadingSequence"),f(x)):a(x)}function f(x){return x===35?(e.enter("atxHeadingSequence"),h(x)):x===null||be(x)?(e.exit("atxHeading"),t(x)):He(x)?qe(e,f,"whitespace")(x):(e.enter("atxHeadingText"),g(x))}function h(x){return x===35?(e.consume(x),h):(e.exit("atxHeadingSequence"),f(x))}function g(x){return x===null||x===35||at(x)?(e.exit("atxHeadingText"),f(x)):(e.consume(x),g)}}const i6=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lb=["pre","script","style","textarea"],s6={concrete:!0,name:"htmlFlow",resolveTo:c6,tokenize:u6},l6={partial:!0,tokenize:f6},o6={partial:!0,tokenize:d6};function c6(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function u6(e,t,a){const i=this;let s,o,u,f,h;return g;function g(M){return x(M)}function x(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),b):M===47?(e.consume(M),o=!0,C):M===63?(e.consume(M),s=3,i.interrupt?t:T):It(M)?(e.consume(M),u=String.fromCharCode(M),E):a(M)}function b(M){return M===45?(e.consume(M),s=2,v):M===91?(e.consume(M),s=5,f=0,w):It(M)?(e.consume(M),s=4,i.interrupt?t:T):a(M)}function v(M){return M===45?(e.consume(M),i.interrupt?t:T):a(M)}function w(M){const ce="CDATA[";return M===ce.charCodeAt(f++)?(e.consume(M),f===ce.length?i.interrupt?t:V:w):a(M)}function C(M){return It(M)?(e.consume(M),u=String.fromCharCode(M),E):a(M)}function E(M){if(M===null||M===47||M===62||at(M)){const ce=M===47,me=u.toLowerCase();return!ce&&!o&&lb.includes(me)?(s=1,i.interrupt?t(M):V(M)):i6.includes(u.toLowerCase())?(s=6,ce?(e.consume(M),S):i.interrupt?t(M):V(M)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?a(M):o?N(M):D(M))}return M===45||_t(M)?(e.consume(M),u+=String.fromCharCode(M),E):a(M)}function S(M){return M===62?(e.consume(M),i.interrupt?t:V):a(M)}function N(M){return He(M)?(e.consume(M),N):_(M)}function D(M){return M===47?(e.consume(M),_):M===58||M===95||It(M)?(e.consume(M),U):He(M)?(e.consume(M),D):_(M)}function U(M){return M===45||M===46||M===58||M===95||_t(M)?(e.consume(M),U):z(M)}function z(M){return M===61?(e.consume(M),L):He(M)?(e.consume(M),z):D(M)}function L(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(e.consume(M),h=M,G):He(M)?(e.consume(M),L):X(M)}function G(M){return M===h?(e.consume(M),h=null,F):M===null||be(M)?a(M):(e.consume(M),G)}function X(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||at(M)?z(M):(e.consume(M),X)}function F(M){return M===47||M===62||He(M)?D(M):a(M)}function _(M){return M===62?(e.consume(M),q):a(M)}function q(M){return M===null||be(M)?V(M):He(M)?(e.consume(M),q):a(M)}function V(M){return M===45&&s===2?(e.consume(M),B):M===60&&s===1?(e.consume(M),ee):M===62&&s===4?(e.consume(M),R):M===63&&s===3?(e.consume(M),T):M===93&&s===5?(e.consume(M),ke):be(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(l6,Q,re)(M)):M===null||be(M)?(e.exit("htmlFlowData"),re(M)):(e.consume(M),V)}function re(M){return e.check(o6,W,Q)(M)}function W(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),J}function J(M){return M===null||be(M)?re(M):(e.enter("htmlFlowData"),V(M))}function B(M){return M===45?(e.consume(M),T):V(M)}function ee(M){return M===47?(e.consume(M),u="",de):V(M)}function de(M){if(M===62){const ce=u.toLowerCase();return lb.includes(ce)?(e.consume(M),R):V(M)}return It(M)&&u.length<8?(e.consume(M),u+=String.fromCharCode(M),de):V(M)}function ke(M){return M===93?(e.consume(M),T):V(M)}function T(M){return M===62?(e.consume(M),R):M===45&&s===2?(e.consume(M),T):V(M)}function R(M){return M===null||be(M)?(e.exit("htmlFlowData"),Q(M)):(e.consume(M),R)}function Q(M){return e.exit("htmlFlow"),t(M)}}function d6(e,t,a){const i=this;return s;function s(u){return be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):a(u)}function o(u){return i.parser.lazy[i.now().line]?a(u):t(u)}}function f6(e,t,a){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(xl,t,a)}}const h6={name:"htmlText",tokenize:g6};function g6(e,t,a){const i=this;let s,o,u;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),g):T===47?(e.consume(T),z):T===63?(e.consume(T),D):It(T)?(e.consume(T),X):a(T)}function g(T){return T===45?(e.consume(T),x):T===91?(e.consume(T),o=0,w):It(T)?(e.consume(T),N):a(T)}function x(T){return T===45?(e.consume(T),v):a(T)}function p(T){return T===null?a(T):T===45?(e.consume(T),b):be(T)?(u=p,ee(T)):(e.consume(T),p)}function b(T){return T===45?(e.consume(T),v):p(T)}function v(T){return T===62?B(T):T===45?b(T):p(T)}function w(T){const R="CDATA[";return T===R.charCodeAt(o++)?(e.consume(T),o===R.length?C:w):a(T)}function C(T){return T===null?a(T):T===93?(e.consume(T),E):be(T)?(u=C,ee(T)):(e.consume(T),C)}function E(T){return T===93?(e.consume(T),S):C(T)}function S(T){return T===62?B(T):T===93?(e.consume(T),S):C(T)}function N(T){return T===null||T===62?B(T):be(T)?(u=N,ee(T)):(e.consume(T),N)}function D(T){return T===null?a(T):T===63?(e.consume(T),U):be(T)?(u=D,ee(T)):(e.consume(T),D)}function U(T){return T===62?B(T):D(T)}function z(T){return It(T)?(e.consume(T),L):a(T)}function L(T){return T===45||_t(T)?(e.consume(T),L):G(T)}function G(T){return be(T)?(u=G,ee(T)):He(T)?(e.consume(T),G):B(T)}function X(T){return T===45||_t(T)?(e.consume(T),X):T===47||T===62||at(T)?F(T):a(T)}function F(T){return T===47?(e.consume(T),B):T===58||T===95||It(T)?(e.consume(T),_):be(T)?(u=F,ee(T)):He(T)?(e.consume(T),F):B(T)}function _(T){return T===45||T===46||T===58||T===95||_t(T)?(e.consume(T),_):q(T)}function q(T){return T===61?(e.consume(T),V):be(T)?(u=q,ee(T)):He(T)?(e.consume(T),q):F(T)}function V(T){return T===null||T===60||T===61||T===62||T===96?a(T):T===34||T===39?(e.consume(T),s=T,re):be(T)?(u=V,ee(T)):He(T)?(e.consume(T),V):(e.consume(T),W)}function re(T){return T===s?(e.consume(T),s=void 0,J):T===null?a(T):be(T)?(u=re,ee(T)):(e.consume(T),re)}function W(T){return T===null||T===34||T===39||T===60||T===61||T===96?a(T):T===47||T===62||at(T)?F(T):(e.consume(T),W)}function J(T){return T===47||T===62||at(T)?F(T):a(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):a(T)}function ee(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),de}function de(T){return He(T)?qe(e,ke,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ke(T)}function ke(T){return e.enter("htmlTextData"),u(T)}}const yg={name:"labelEnd",resolveAll:x6,resolveTo:b6,tokenize:v6},m6={tokenize:k6},p6={tokenize:w6},y6={tokenize:S6};function x6(e){let t=-1;const a=[];for(;++t<e.length;){const i=e[t][1];if(a.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==a.length&&on(e,0,e.length,a),e}function b6(e,t){let a=e.length,i=0,s,o,u,f;for(;a--;)if(s=e[a][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[a][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=a,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(u=a);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},g={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},x={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",g,t]],f=kn(f,e.slice(o+1,o+i+3)),f=kn(f,[["enter",x,t]]),f=kn(f,qc(t.parser.constructs.insideSpan.null,e.slice(o+i+4,u-3),t)),f=kn(f,[["exit",x,t],e[u-2],e[u-1],["exit",g,t]]),f=kn(f,e.slice(u+1)),f=kn(f,[["exit",h,t]]),on(e,o,e.length,f),e}function v6(e,t,a){const i=this;let s=i.events.length,o,u;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){o=i.events[s][1];break}return f;function f(b){return o?o._inactive?p(b):(u=i.parser.defined.includes(Ln(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):a(b)}function h(b){return b===40?e.attempt(m6,x,u?x:p)(b):b===91?e.attempt(p6,x,u?g:p)(b):u?x(b):p(b)}function g(b){return e.attempt(y6,x,p)(b)}function x(b){return t(b)}function p(b){return o._balanced=!0,a(b)}}function k6(e,t,a){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return at(p)?Qs(e,o)(p):o(p)}function o(p){return p===41?x(p):U1(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return at(p)?Qs(e,h)(p):x(p)}function f(p){return a(p)}function h(p){return p===34||p===39||p===40?B1(e,g,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):x(p)}function g(p){return at(p)?Qs(e,x)(p):x(p)}function x(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):a(p)}}function w6(e,t,a){const i=this;return s;function s(f){return I1.call(i,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return i.parser.defined.includes(Ln(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function u(f){return a(f)}}function S6(e,t,a){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}const j6={name:"labelStartImage",resolveAll:yg.resolveAll,tokenize:C6};function C6(e,t,a){const i=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):a(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(f):t(f)}}const N6={name:"labelStartLink",resolveAll:yg.resolveAll,tokenize:A6};function A6(e,t,a){const i=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?a(u):t(u)}}const Hf={name:"lineEnding",tokenize:E6};function E6(e,t){return a;function a(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const ic={name:"thematicBreak",tokenize:T6};function T6(e,t,a){let i=0,s;return o;function o(g){return e.enter("thematicBreak"),u(g)}function u(g){return s=g,f(g)}function f(g){return g===s?(e.enter("thematicBreakSequence"),h(g)):i>=3&&(g===null||be(g))?(e.exit("thematicBreak"),t(g)):a(g)}function h(g){return g===s?(e.consume(g),i++,h):(e.exit("thematicBreakSequence"),He(g)?qe(e,f,"whitespace")(g):f(g))}}const Qt={continuation:{tokenize:R6},exit:L6,name:"list",tokenize:_6},M6={partial:!0,tokenize:z6},D6={partial:!0,tokenize:O6};function _6(e,t,a){const i=this,s=i.events[i.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(v){const w=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:_h(v)){if(i.containerState.type||(i.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(ic,a,g)(v):g(v);if(!i.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return a(v)}function h(v){return _h(v)&&++u<10?(e.consume(v),h):(!i.interrupt||u<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),g(v)):a(v)}function g(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,e.check(xl,i.interrupt?a:x,e.attempt(M6,b,p))}function x(v){return i.containerState.initialBlankLine=!0,o++,b(v)}function p(v){return He(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):a(v)}function b(v){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function R6(e,t,a){const i=this;return i.containerState._closeFlow=void 0,e.check(xl,s,o);function s(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,qe(e,t,"listItemIndent",i.containerState.size+1)(f)}function o(f){return i.containerState.furtherBlankLines||!He(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(D6,t,u)(f))}function u(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,qe(e,e.attempt(Qt,t,a),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function O6(e,t,a){const i=this;return qe(e,s,"listItemIndent",i.containerState.size+1);function s(o){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(o):a(o)}}function L6(e){e.exit(this.containerState.type)}function z6(e,t,a){const i=this;return qe(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=i.events[i.events.length-1];return!He(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}const ob={name:"setextUnderline",resolveTo:H6,tokenize:U6};function H6(e,t){let a=e.length,i,s,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){i=a;break}e[a][1].type==="paragraph"&&(s=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function U6(e,t,a){const i=this;let s;return o;function o(g){let x=i.events.length,p;for(;x--;)if(i.events[x][1].type!=="lineEnding"&&i.events[x][1].type!=="linePrefix"&&i.events[x][1].type!=="content"){p=i.events[x][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),s=g,u(g)):a(g)}function u(g){return e.enter("setextHeadingLineSequence"),f(g)}function f(g){return g===s?(e.consume(g),f):(e.exit("setextHeadingLineSequence"),He(g)?qe(e,h,"lineSuffix")(g):h(g))}function h(g){return g===null||be(g)?(e.exit("setextHeadingLine"),t(g)):a(g)}}const I6={tokenize:B6};function B6(e){const t=this,a=e.attempt(xl,i,e.attempt(this.parser.constructs.flowInitial,s,qe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(PT,s)),"linePrefix")));return a;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const q6={resolveAll:$1()},$6=q1("string"),K6=q1("text");function q1(e){return{resolveAll:$1(e==="text"?F6:void 0),tokenize:t};function t(a){const i=this,s=this.parser.constructs[e],o=a.attempt(s,u,f);return u;function u(x){return g(x)?o(x):f(x)}function f(x){if(x===null){a.consume(x);return}return a.enter("data"),a.consume(x),h}function h(x){return g(x)?(a.exit("data"),o(x)):(a.consume(x),h)}function g(x){if(x===null)return!0;const p=s[x];let b=-1;if(p)for(;++b<p.length;){const v=p[b];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function $1(e){return t;function t(a,i){let s=-1,o;for(;++s<=a.length;)o===void 0?a[s]&&a[s][1].type==="data"&&(o=s,s++):(!a[s]||a[s][1].type!=="data")&&(s!==o+2&&(a[o][1].end=a[s-1][1].end,a.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(a,i):a}}function F6(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const i=e[a-1][1],s=t.sliceStream(i);let o=s.length,u=-1,f=0,h;for(;o--;){const g=s[o];if(typeof g=="string"){for(u=g.length;g.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(g===-2)h=!0,f++;else if(g!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(f=0),f){const g={type:a===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:i.start._bufferIndex+u,_index:i.start._index+o,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...g.start},i.start.offset===i.end.offset?Object.assign(i,g):(e.splice(a,0,["enter",g,t],["exit",g,t]),a+=2)}a++}return e}const P6={42:Qt,43:Qt,45:Qt,48:Qt,49:Qt,50:Qt,51:Qt,52:Qt,53:Qt,54:Qt,55:Qt,56:Qt,57:Qt,62:O1},G6={91:XT},V6={[-2]:zf,[-1]:zf,32:zf},Y6={35:n6,42:ic,45:[ob,ic],60:s6,61:ob,95:ic,96:sb,126:sb},Q6={38:z1,92:L1},X6={[-5]:Hf,[-4]:Hf,[-3]:Hf,33:j6,38:z1,42:Rh,60:[NT,h6],91:N6,92:[e6,L1],93:yg,95:Rh,96:IT},Z6={null:[Rh,q6]},J6={null:[42,95]},W6={null:[]},eM=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J6,contentInitial:G6,disable:W6,document:P6,flow:Y6,flowInitial:V6,insideSpan:Z6,string:Q6,text:X6},Symbol.toStringTag,{value:"Module"}));function tM(e,t,a){let i={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:G(z),check:G(L),consume:N,enter:D,exit:U,interrupt:G(L,{interrupt:!0})},g={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:p};let x=t.tokenize.call(g,h);return t.resolveAll&&o.push(t),g;function p(q){return u=kn(u,q),E(),u[u.length-1]!==null?[]:(X(t,0),g.events=qc(o,g.events,g),g.events)}function b(q,V){return aM(v(q),V)}function v(q){return nM(u,q)}function w(){const{_bufferIndex:q,_index:V,line:re,column:W,offset:J}=i;return{_bufferIndex:q,_index:V,line:re,column:W,offset:J}}function C(q){s[q.line]=q.column,_()}function E(){let q;for(;i._index<u.length;){const V=u[i._index];if(typeof V=="string")for(q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===q&&i._bufferIndex<V.length;)S(V.charCodeAt(i._bufferIndex));else S(V)}}function S(q){x=x(q)}function N(q){be(q)?(i.line++,i.column=1,i.offset+=q===-3?2:1,_()):q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),g.previous=q}function D(q,V){const re=V||{};return re.type=q,re.start=w(),g.events.push(["enter",re,g]),f.push(re),re}function U(q){const V=f.pop();return V.end=w(),g.events.push(["exit",V,g]),V}function z(q,V){X(q,V.from)}function L(q,V){V.restore()}function G(q,V){return re;function re(W,J,B){let ee,de,ke,T;return Array.isArray(W)?Q(W):"tokenize"in W?Q([W]):R(W);function R(ye){return Me;function Me(rt){const Ge=rt!==null&&ye[rt],Ot=rt!==null&&ye.null,En=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(Ot)?Ot:Ot?[Ot]:[]];return Q(En)(rt)}}function Q(ye){return ee=ye,de=0,ye.length===0?B:M(ye[de])}function M(ye){return Me;function Me(rt){return T=F(),ke=ye,ye.partial||(g.currentConstruct=ye),ye.name&&g.parser.constructs.disable.null.includes(ye.name)?me():ye.tokenize.call(V?Object.assign(Object.create(g),V):g,h,ce,me)(rt)}}function ce(ye){return q(ke,T),J}function me(ye){return T.restore(),++de<ee.length?M(ee[de]):B}}}function X(q,V){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&on(g.events,V,g.events.length-V,q.resolve(g.events.slice(V),g)),q.resolveTo&&(g.events=q.resolveTo(g.events,g))}function F(){const q=w(),V=g.previous,re=g.currentConstruct,W=g.events.length,J=Array.from(f);return{from:W,restore:B};function B(){i=q,g.previous=V,g.currentConstruct=re,g.events.length=W,f=J,_()}}function _(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function nM(e,t){const a=t.start._index,i=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let u;if(a===s)u=[e[a].slice(i,o)];else{if(u=e.slice(a,s),i>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(i):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function aM(e,t){let a=-1;const i=[];let s;for(;++a<e.length;){const o=e[a];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
433
|
-
`;break}case-3:{u=`\r
|
|
434
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,i.push(u)}return i.join("")}function rM(e){const i={constructs:_1([eM,...(e||{}).extensions||[]]),content:s(bT),defined:[],document:s(kT),flow:s(I6),lazy:{},string:s($6),text:s(K6)};return i;function s(o){return u;function u(f){return tM(i,o,f)}}}function iM(e){for(;!H1(e););return e}const cb=/[\0\t\n\r]/g;function sM(){let e=1,t="",a=!0,i;return s;function s(o,u,f){const h=[];let g,x,p,b,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),p=0,t="",a&&(o.charCodeAt(0)===65279&&p++,a=void 0);p<o.length;){if(cb.lastIndex=p,g=cb.exec(o),b=g&&g.index!==void 0?g.index:o.length,v=o.charCodeAt(b),!g){t=o.slice(p);break}if(v===10&&p===b&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),p<b&&(h.push(o.slice(p,b)),e+=b-p),v){case 0:{h.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,h.push(-2);e++<x;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}p=b+1}return f&&(i&&h.push(-5),t&&h.push(t),h.push(null)),h}}const lM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oM(e){return e.replace(lM,cM)}function cM(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),o=s===120||s===88;return R1(a.slice(o?2:1),o?16:10)}return pg(a)||e}const K1={}.hasOwnProperty;function uM(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),dM(a)(iM(rM(a).document().write(sM()(e,t,!0))))}function dM(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Rr),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(un),blockQuote:o(Ot),characterEscape:F,characterReference:F,codeFenced:o(En),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(En,u),codeText:o(Ja,u),codeTextData:F,data:F,codeFlowValue:F,definition:o(Wa),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(pe),hardBreakEscape:o(_r),hardBreakTrailing:o(_r),htmlFlow:o(kl,u),htmlFlowData:F,htmlText:o(kl,u),htmlTextData:F,image:o(wl),label:u,link:o(Rr),listItem:o(Ui),listItemValue:b,listOrdered:o(Or,p),listUnordered:o(Or),paragraph:o(Yc),reference:M,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(un),strong:o(Qc),thematicBreak:o(Xc)},exit:{atxHeading:h(),atxHeadingSequence:z,autolink:h(),autolinkEmail:Ge,autolinkProtocol:rt,blockQuote:h(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ye,characterReference:Me,codeFenced:h(E),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:_,codeIndented:h(S),codeText:h(J),codeTextData:_,data:_,definition:h(),definitionDestinationString:U,definitionLabelString:N,definitionTitleString:D,emphasis:h(),hardBreakEscape:h(V),hardBreakTrailing:h(V),htmlFlow:h(re),htmlFlowData:_,htmlText:h(W),htmlTextData:_,image:h(ee),label:ke,labelText:de,lineEnding:q,link:h(B),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ce,resourceDestinationString:T,resourceTitleString:R,resource:Q,setextHeading:h(X),setextHeadingLineSequence:G,setextHeadingText:L,strong:h(),thematicBreak:h()}};F1(t,(e||{}).mdastExtensions||[]);const a={};return i;function i(te){let oe={type:"root",children:[]};const we={stack:[oe],tokenStack:[],config:t,enter:f,exit:g,buffer:u,resume:x,data:a},Oe=[];let Ve=-1;for(;++Ve<te.length;)if(te[Ve][1].type==="listOrdered"||te[Ve][1].type==="listUnordered")if(te[Ve][0]==="enter")Oe.push(Ve);else{const Jt=Oe.pop();Ve=s(te,Jt,Ve)}for(Ve=-1;++Ve<te.length;){const Jt=t[te[Ve][0]];K1.call(Jt,te[Ve][1].type)&&Jt[te[Ve][1].type].call(Object.assign({sliceSerialize:te[Ve][2].sliceSerialize},we),te[Ve][1])}if(we.tokenStack.length>0){const Jt=we.tokenStack[we.tokenStack.length-1];(Jt[1]||ub).call(we,void 0,Jt[0])}for(oe.position={start:Ya(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Ya(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)oe=t.transforms[Ve](oe)||oe;return oe}function s(te,oe,we){let Oe=oe-1,Ve=-1,Jt=!1,Jn,zt,bt,Bt;for(;++Oe<=we;){const tt=te[Oe];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ve++:Ve--,Bt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(Jn&&!Bt&&!Ve&&!bt&&(bt=Oe),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!Ve&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ve===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(Jn){let wa=Oe;for(zt=void 0;wa--;){const Tn=te[wa];if(Tn[1].type==="lineEnding"||Tn[1].type==="lineEndingBlank"){if(Tn[0]==="exit")continue;zt&&(te[zt][1].type="lineEndingBlank",Jt=!0),Tn[1].type="lineEnding",zt=wa}else if(!(Tn[1].type==="linePrefix"||Tn[1].type==="blockQuotePrefix"||Tn[1].type==="blockQuotePrefixWhitespace"||Tn[1].type==="blockQuoteMarker"||Tn[1].type==="listItemIndent"))break}bt&&(!zt||bt<zt)&&(Jn._spread=!0),Jn.end=Object.assign({},zt?te[zt][1].start:tt[1].end),te.splice(zt||Oe,0,["exit",Jn,tt[2]]),Oe++,we++}if(tt[1].type==="listItemPrefix"){const wa={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};Jn=wa,te.splice(Oe,0,["enter",wa,tt[2]]),Oe++,we++,bt=void 0,Bt=!0}}}return te[oe][1]._spread=Jt,we}function o(te,oe){return we;function we(Oe){f.call(this,te(Oe),Oe),oe&&oe.call(this,Oe)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(te,oe,we){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([oe,we||void 0]),te.position={start:Ya(oe.start),end:void 0}}function h(te){return oe;function oe(we){te&&te.call(this,we),g.call(this,we)}}function g(te,oe){const we=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==te.type&&(oe?oe.call(this,te,Oe[0]):(Oe[1]||ub).call(this,te,Oe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Ys({start:te.start,end:te.end})+"): it’s not open");we.position.end=Ya(te.end)}function x(){return mg(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(te){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=te}function w(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=te}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te.replace(/(\r?\n|\r)$/g,"")}function N(te){const oe=this.resume(),we=this.stack[this.stack.length-1];we.label=oe,we.identifier=Ln(this.sliceSerialize(te)).toLowerCase()}function D(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.title=te}function U(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.url=te}function z(te){const oe=this.stack[this.stack.length-1];if(!oe.depth){const we=this.sliceSerialize(te).length;oe.depth=we}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function G(te){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function F(te){const we=this.stack[this.stack.length-1].children;let Oe=we[we.length-1];(!Oe||Oe.type!=="text")&&(Oe=Lt(),Oe.position={start:Ya(te.start),end:void 0},we.push(Oe)),this.stack.push(Oe)}function _(te){const oe=this.stack.pop();oe.value+=this.sliceSerialize(te),oe.position.end=Ya(te.end)}function q(te){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=oe.children[oe.children.length-1];we.position.end=Ya(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(F.call(this,te),_.call(this,te))}function V(){this.data.atHardBreak=!0}function re(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function W(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function J(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function B(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=oe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ee(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=oe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function de(te){const oe=this.sliceSerialize(te),we=this.stack[this.stack.length-2];we.label=oM(oe),we.identifier=Ln(oe).toLowerCase()}function ke(){const te=this.stack[this.stack.length-1],oe=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Oe=te.children;we.children=Oe}else we.alt=oe}function T(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.url=te}function R(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.title=te}function Q(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ce(te){const oe=this.resume(),we=this.stack[this.stack.length-1];we.label=oe,we.identifier=Ln(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function me(te){this.data.characterReferenceType=te.type}function ye(te){const oe=this.sliceSerialize(te),we=this.data.characterReferenceType;let Oe;we?(Oe=R1(oe,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=pg(oe);const Ve=this.stack[this.stack.length-1];Ve.value+=Oe}function Me(te){const oe=this.stack.pop();oe.position.end=Ya(te.end)}function rt(te){_.call(this,te);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(te)}function Ge(te){_.call(this,te);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(te)}function Ot(){return{type:"blockquote",children:[]}}function En(){return{type:"code",lang:null,meta:null,value:""}}function Ja(){return{type:"inlineCode",value:""}}function Wa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function un(){return{type:"heading",depth:0,children:[]}}function _r(){return{type:"break"}}function kl(){return{type:"html",value:""}}function wl(){return{type:"image",title:null,url:"",alt:null}}function Rr(){return{type:"link",title:null,url:"",children:[]}}function Or(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Ui(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Yc(){return{type:"paragraph",children:[]}}function Qc(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function Xc(){return{type:"thematicBreak"}}}function Ya(e){return{line:e.line,column:e.column,offset:e.offset}}function F1(e,t){let a=-1;for(;++a<t.length;){const i=t[a];Array.isArray(i)?F1(e,i):fM(e,i)}}function fM(e,t){let a;for(a in t)if(K1.call(t,a))switch(a){case"canContainEols":{const i=t[a];i&&e[a].push(...i);break}case"transforms":{const i=t[a];i&&e[a].push(...i);break}case"enter":case"exit":{const i=t[a];i&&Object.assign(e[a],i);break}}}function ub(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ys({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ys({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ys({start:t.start,end:t.end})+") is still open")}function hM(e){const t=this;t.parser=a;function a(i){return uM(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function gM(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function mM(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
|
|
435
|
-
`}]}function pM(e,t){const a=t.value?t.value+`
|
|
436
|
-
`:"",i={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(i.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function yM(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xM(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bM(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),s=Hi(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let u,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(i,f);const h={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const g={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,g),e.applyData(t,g)}function vM(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kM(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function P1(e,t){const a=t.referenceType;let i="]";if(a==="collapsed"?i+="[]":a==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=i:s.push({type:"text",value:i}),s}function wM(e,t){const a=String(t.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return P1(e,t);const s={src:Hi(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(s.title=i.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function SM(e,t){const a={src:Hi(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function jM(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const i={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,i),e.applyData(t,i)}function CM(e,t){const a=String(t.identifier).toUpperCase(),i=e.definitionById.get(a);if(!i)return P1(e,t);const s={href:Hi(i.url||"")};i.title!==null&&i.title!==void 0&&(s.title=i.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function NM(e,t){const a={href:Hi(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function AM(e,t,a){const i=e.all(t),s=a?EM(a):G1(t),o={},u=[];if(typeof t.checked=="boolean"){const x=i[0];let p;x&&x.type==="element"&&x.tagName==="p"?p=x:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const x=i[f];(s||f!==0||x.type!=="element"||x.tagName!=="p")&&u.push({type:"text",value:`
|
|
437
|
-
`}),x.type==="element"&&x.tagName==="p"&&!s?u.push(...x.children):u.push(x)}const h=i[i.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
438
|
-
`});const g={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,g),e.applyData(t,g)}function EM(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let i=-1;for(;!t&&++i<a.length;)t=G1(a[i])}return t}function G1(e){const t=e.spread;return t??e.children.length>1}function TM(e,t){const a={},i=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++s<i.length;){const u=i[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function MM(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function DM(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function _M(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function RM(e,t){const a=e.all(t),i=a.shift(),s=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],u),s.push(u)}if(a.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=dg(t.children[1]),h=C1(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),s.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function OM(e,t,a){const i=a?a.children:void 0,o=(i?i.indexOf(t):1)===0?"th":"td",u=a&&a.type==="table"?a.align:void 0,f=u?u.length:t.children.length;let h=-1;const g=[];for(;++h<f;){const p=t.children[h],b={},v=u?u[h]:void 0;v&&(b.align=v);let w={type:"element",tagName:o,properties:b,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),g.push(w)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(t,x),e.applyData(t,x)}function LM(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const db=9,fb=32;function zM(e){const t=String(e),a=/\r?\n|\r/g;let i=a.exec(t),s=0;const o=[];for(;i;)o.push(hb(t.slice(s,i.index),s>0,!0),i[0]),s=i.index+i[0].length,i=a.exec(t);return o.push(hb(t.slice(s),s>0,!1)),o.join("")}function hb(e,t,a){let i=0,s=e.length;if(t){let o=e.codePointAt(i);for(;o===db||o===fb;)i++,o=e.codePointAt(i)}if(a){let o=e.codePointAt(s-1);for(;o===db||o===fb;)s--,o=e.codePointAt(s-1)}return s>i?e.slice(i,s):""}function HM(e,t){const a={type:"text",value:zM(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function UM(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const IM={blockquote:gM,break:mM,code:pM,delete:yM,emphasis:xM,footnoteReference:bM,heading:vM,html:kM,imageReference:wM,image:SM,inlineCode:jM,linkReference:CM,link:NM,listItem:AM,list:TM,paragraph:MM,root:DM,strong:_M,table:RM,tableCell:LM,tableRow:OM,text:HM,thematicBreak:UM,toml:Po,yaml:Po,definition:Po,footnoteDefinition:Po};function Po(){}const V1=-1,$c=0,Xs=1,vc=2,xg=3,bg=4,vg=5,kg=6,Y1=7,Q1=8,gb=typeof self=="object"?self:globalThis,BM=(e,t)=>{const a=(s,o)=>(e.set(o,s),s),i=s=>{if(e.has(s))return e.get(s);const[o,u]=t[s];switch(o){case $c:case V1:return a(u,s);case Xs:{const f=a([],s);for(const h of u)f.push(i(h));return f}case vc:{const f=a({},s);for(const[h,g]of u)f[i(h)]=i(g);return f}case xg:return a(new Date(u),s);case bg:{const{source:f,flags:h}=u;return a(new RegExp(f,h),s)}case vg:{const f=a(new Map,s);for(const[h,g]of u)f.set(i(h),i(g));return f}case kg:{const f=a(new Set,s);for(const h of u)f.add(i(h));return f}case Y1:{const{name:f,message:h}=u;return a(new gb[f](h),s)}case Q1:return a(BigInt(u),s);case"BigInt":return a(Object(BigInt(u)),s);case"ArrayBuffer":return a(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return a(new DataView(f),u)}}return a(new gb[o](u),s)};return i},mb=e=>BM(new Map,e)(0),ji="",{toString:qM}={},{keys:$M}=Object,Us=e=>{const t=typeof e;if(t!=="object"||!e)return[$c,t];const a=qM.call(e).slice(8,-1);switch(a){case"Array":return[Xs,ji];case"Object":return[vc,ji];case"Date":return[xg,ji];case"RegExp":return[bg,ji];case"Map":return[vg,ji];case"Set":return[kg,ji];case"DataView":return[Xs,a]}return a.includes("Array")?[Xs,a]:a.includes("Error")?[Y1,a]:[vc,a]},Go=([e,t])=>e===$c&&(t==="function"||t==="symbol"),KM=(e,t,a,i)=>{const s=(u,f)=>{const h=i.push(u)-1;return a.set(f,h),h},o=u=>{if(a.has(u))return a.get(u);let[f,h]=Us(u);switch(f){case $c:{let x=u;switch(h){case"bigint":f=Q1,x=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);x=null;break;case"undefined":return s([V1],u)}return s([f,x],u)}case Xs:{if(h){let b=u;return h==="DataView"?b=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(u)),s([h,[...b]],u)}const x=[],p=s([f,x],u);for(const b of u)x.push(o(b));return p}case vc:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const x=[],p=s([f,x],u);for(const b of $M(u))(e||!Go(Us(u[b])))&&x.push([o(b),o(u[b])]);return p}case xg:return s([f,u.toISOString()],u);case bg:{const{source:x,flags:p}=u;return s([f,{source:x,flags:p}],u)}case vg:{const x=[],p=s([f,x],u);for(const[b,v]of u)(e||!(Go(Us(b))||Go(Us(v))))&&x.push([o(b),o(v)]);return p}case kg:{const x=[],p=s([f,x],u);for(const b of u)(e||!Go(Us(b)))&&x.push(o(b));return p}}const{message:g}=u;return s([f,{name:h,message:g}],u)};return o},pb=(e,{json:t,lossy:a}={})=>{const i=[];return KM(!(t||a),!!t,new Map,i)(e),i},kc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?mb(pb(e,t)):structuredClone(e):(e,t)=>mb(pb(e,t));function FM(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function PM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||FM,i=e.options.footnoteBackLabel||PM,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const g=e.footnoteById.get(e.footnoteOrder[h]);if(!g)continue;const x=e.all(g),p=String(g.identifier).toUpperCase(),b=Hi(p.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let N=typeof a=="string"?a:a(h,v);typeof N=="string"&&(N={type:"text",value:N}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,v),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const E=x[x.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const N=E.children[E.children.length-1];N&&N.type==="text"?N.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...w)}else x.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(x,!0)};e.patch(g,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...kc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
439
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
440
|
-
`}]}}const Kc=(function(e){if(e==null)return XM;if(typeof e=="function")return Fc(e);if(typeof e=="object")return Array.isArray(e)?VM(e):YM(e);if(typeof e=="string")return QM(e);throw new Error("Expected function, string, or object as test")});function VM(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Kc(e[a]);return Fc(i);function i(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function YM(e){const t=e;return Fc(a);function a(i){const s=i;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function QM(e){return Fc(t);function t(a){return a&&a.type===e}}function Fc(e){return t;function t(a,i,s){return!!(ZM(a)&&e.call(this,a,typeof i=="number"?i:void 0,s||void 0))}}function XM(){return!0}function ZM(e){return e!==null&&typeof e=="object"&&"type"in e}const X1=[],JM=!0,Oh=!1,WM="skip";function Z1(e,t,a,i){let s;typeof t=="function"&&typeof a!="function"?(i=a,a=t):s=t;const o=Kc(s),u=i?-1:1;f(e,void 0,[])();function f(h,g,x){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=X1,w,C,E;if((!t||o(h,g,x[x.length-1]||void 0))&&(v=eD(a(h,x)),v[0]===Oh))return v;if("children"in h&&h.children){const S=h;if(S.children&&v[0]!==WM)for(C=(i?S.children.length:-1)+u,E=x.concat(S);C>-1&&C<S.children.length;){const N=S.children[C];if(w=f(N,C,E)(),w[0]===Oh)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function eD(e){return Array.isArray(e)?e:typeof e=="number"?[JM,e]:e==null?X1:[e]}function wg(e,t,a,i){let s,o,u;typeof t=="function"&&typeof a!="function"?(o=void 0,u=t,s=a):(o=t,u=a,s=i),Z1(e,o,f,s);function f(h,g){const x=g[g.length-1],p=x?x.children.indexOf(h):void 0;return u(h,p,x)}}const Lh={}.hasOwnProperty,tD={};function nD(e,t){const a=t||tD,i=new Map,s=new Map,o=new Map,u={...IM,...a.handlers},f={all:g,applyData:rD,definitionById:i,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:a,patch:aD,wrap:sD};return wg(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const p=x.type==="definition"?i:s,b=String(x.identifier).toUpperCase();p.has(b)||p.set(b,x)}}),f;function h(x,p){const b=x.type,v=f.handlers[b];if(Lh.call(f.handlers,b)&&v)return v(f,x,p);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in x){const{children:C,...E}=x,S=kc(E);return S.children=f.all(x),S}return kc(x)}return(f.options.unknownHandler||iD)(f,x,p)}function g(x){const p=[];if("children"in x){const b=x.children;let v=-1;for(;++v<b.length;){const w=f.one(b[v],x);if(w){if(v&&b[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=yb(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=yb(C.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function aD(e,t){e.position&&(t.position=PE(e))}function rD(e,t){let a=t;if(e&&e.data){const i=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(a.type==="element")a.tagName=i;else{const u="children"in a?a.children:[a];a={type:"element",tagName:i,properties:{},children:u}}a.type==="element"&&o&&Object.assign(a.properties,kc(o)),"children"in a&&a.children&&s!==null&&s!==void 0&&(a.children=s)}return a}function iD(e,t){const a=t.data||{},i="value"in t&&!(Lh.call(a,"hProperties")||Lh.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function sD(e,t){const a=[];let i=-1;for(t&&a.push({type:"text",value:`
|
|
441
|
-
`});++i<e.length;)i&&a.push({type:"text",value:`
|
|
442
|
-
`}),a.push(e[i]);return t&&e.length>0&&a.push({type:"text",value:`
|
|
443
|
-
`}),a}function yb(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function xb(e,t){const a=nD(e,t),i=a.one(e,void 0),s=GM(a),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
444
|
-
`},s),o}function lD(e,t){return e&&"run"in e?async function(a,i){const s=xb(a,{file:i,...t});await e.run(s,i)}:function(a,i){return xb(a,{file:i,...e||t})}}function bb(e){if(e)throw e}var Uf,vb;function oD(){if(vb)return Uf;vb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(g){return typeof Array.isArray=="function"?Array.isArray(g):t.call(g)==="[object Array]"},o=function(g){if(!g||t.call(g)!=="[object Object]")return!1;var x=e.call(g,"constructor"),p=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!x&&!p)return!1;var b;for(b in g);return typeof b>"u"||e.call(g,b)},u=function(g,x){a&&x.name==="__proto__"?a(g,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):g[x.name]=x.newValue},f=function(g,x){if(x==="__proto__")if(e.call(g,x)){if(i)return i(g,x).value}else return;return g[x]};return Uf=function h(){var g,x,p,b,v,w,C=arguments[0],E=1,S=arguments.length,N=!1;for(typeof C=="boolean"&&(N=C,C=arguments[1]||{},E=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});E<S;++E)if(g=arguments[E],g!=null)for(x in g)p=f(C,x),b=f(g,x),C!==b&&(N&&b&&(o(b)||(v=s(b)))?(v?(v=!1,w=p&&s(p)?p:[]):w=p&&o(p)?p:{},u(C,{name:x,newValue:h(N,w,b)})):typeof b<"u"&&u(C,{name:x,newValue:b}));return C},Uf}var cD=oD();const If=$h(cD);function zh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uD(){const e=[],t={run:a,use:i};return t;function a(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...g){const x=e[++o];let p=-1;if(h){u(h);return}for(;++p<s.length;)(g[p]===null||g[p]===void 0)&&(g[p]=s[p]);s=g,x?dD(x,f)(...g):u(null,...g)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function dD(e,t){let a;return i;function i(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(g){const x=g;if(f&&a)throw x;return s(x)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){a||(a=!0,t(u,...f))}function o(u){s(null,u)}}const Vn={basename:fD,dirname:hD,extname:gD,join:mD,sep:"/"};function fD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bl(e);let a=0,i=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else i<0&&(o=!0,i=s+1);return i<0?"":e.slice(a,i)}if(t===e)return"";let u=-1,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(i=s):(f=-1,i=u));return a===i?i=u:i<0&&(i=e.length),e.slice(a,i)}function hD(e){if(bl(e),e.length===0)return".";let t=-1,a=e.length,i;for(;--a;)if(e.codePointAt(a)===47){if(i){t=a;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function gD(e){bl(e);let t=e.length,a=-1,i=0,s=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){i=t+1;break}continue}a<0&&(u=!0,a=t+1),f===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||a<0||o===0||o===1&&s===a-1&&s===i+1?"":e.slice(s,a)}function mD(...e){let t=-1,a;for(;++t<e.length;)bl(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":pD(a)}function pD(e){bl(e);const t=e.codePointAt(0)===47;let a=yD(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function yD(e,t){let a="",i=0,s=-1,o=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(a.length<2||i!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(h=a.lastIndexOf("/"),h!==a.length-1){h<0?(a="",i=0):(a=a.slice(0,h),i=a.length-1-a.lastIndexOf("/")),s=u,o=0;continue}}else if(a.length>0){a="",i=0,s=u,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+e.slice(s+1,u):a=e.slice(s+1,u),i=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return a}function bl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xD={cwd:bD};function bD(){return"/"}function Hh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function vD(e){if(typeof e=="string")e=new URL(e);else if(!Hh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kD(e)}function kD(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const i=t.codePointAt(a+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Bf=["history","path","basename","stem","extname","dirname"];class J1{constructor(t){let a;t?Hh(t)?a={path:t}:typeof t=="string"||wD(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":xD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Bf.length;){const o=Bf[i];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let s;for(s in a)Bf.includes(s)||(this[s]=a[s])}get basename(){return typeof this.path=="string"?Vn.basename(this.path):void 0}set basename(t){$f(t,"basename"),qf(t,"basename"),this.path=Vn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vn.dirname(this.path):void 0}set dirname(t){kb(this.basename,"dirname"),this.path=Vn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vn.extname(this.path):void 0}set extname(t){if(qf(t,"extname"),kb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Vn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Hh(t)&&(t=vD(t)),$f(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vn.basename(this.path,this.extname):void 0}set stem(t){$f(t,"stem"),qf(t,"stem"),this.path=Vn.join(this.dirname||"",t+(this.extname||""))}fail(t,a,i){const s=this.message(t,a,i);throw s.fatal=!0,s}info(t,a,i){const s=this.message(t,a,i);return s.fatal=void 0,s}message(t,a,i){const s=new Rt(t,a,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qf(e,t){if(e&&e.includes(Vn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vn.sep+"`")}function $f(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function kb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function wD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SD=(function(e){const i=this.constructor.prototype,s=i[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),jD={}.hasOwnProperty;class Sg extends SD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=uD()}copy(){const t=new Sg;let a=-1;for(;++a<this.attachers.length;){const i=this.attachers[a];t.use(...i)}return t.data(If(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Pf("data",this.frozen),this.namespace[t]=a,this):jD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=a.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=Vo(t),i=this.parser||this.Parser;return Kf("parse",i),i(String(a),a)}process(t,a){const i=this;return this.freeze(),Kf("process",this.parser||this.Parser),Ff("process",this.compiler||this.Compiler),a?s(void 0,a):new Promise(s);function s(o,u){const f=Vo(t),h=i.parse(f);i.run(h,f,function(x,p,b){if(x||!p||!b)return g(x);const v=p,w=i.stringify(v,b);AD(w)?b.value=w:b.result=w,g(x,b)});function g(x,p){x||!p?u(x):o?o(p):a(void 0,p)}}}processSync(t){let a=!1,i;return this.freeze(),Kf("processSync",this.parser||this.Parser),Ff("processSync",this.compiler||this.Compiler),this.process(t,s),Sb("processSync","process",a),i;function s(o,u){a=!0,bb(o),i=u}}run(t,a,i){wb(t),this.freeze();const s=this.transformers;return!i&&typeof a=="function"&&(i=a,a=void 0),i?o(void 0,i):new Promise(o);function o(u,f){const h=Vo(a);s.run(t,h,g);function g(x,p,b){const v=p||t;x?f(x):u?u(v):i(void 0,v,b)}}}runSync(t,a){let i=!1,s;return this.run(t,a,o),Sb("runSync","run",i),s;function o(u,f){bb(u),s=f,i=!0}}stringify(t,a){this.freeze();const i=Vo(a),s=this.compiler||this.Compiler;return Ff("stringify",s),wb(t),s(t,i)}use(t,...a){const i=this.attachers,s=this.namespace;if(Pf("use",this.frozen),t!=null)if(typeof t=="function")h(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(g){if(typeof g=="function")h(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[x,...p]=g;h(x,p)}else u(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function u(g){if(!("plugins"in g)&&!("settings"in g))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(g.plugins),g.settings&&(s.settings=If(!0,s.settings,g.settings))}function f(g){let x=-1;if(g!=null)if(Array.isArray(g))for(;++x<g.length;){const p=g[x];o(p)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function h(g,x){let p=-1,b=-1;for(;++p<i.length;)if(i[p][0]===g){b=p;break}if(b===-1)i.push([g,...x]);else if(x.length>0){let[v,...w]=x;const C=i[b][1];zh(C)&&zh(v)&&(v=If(!0,C,v)),i[b]=[g,v,...w]}}}}const CD=new Sg().freeze();function Kf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ff(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wb(e){if(!zh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sb(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vo(e){return ND(e)?e:new J1(e)}function ND(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AD(e){return typeof e=="string"||ED(e)}function ED(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",jb=[],Cb={allowDangerousHtml:!0},MD=/^(https?|ircs?|mailto|xmpp)$/i,DD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jg(e){const t=_D(e),a=RD(e);return OD(t.runSync(t.parse(a),a),e)}function _D(e){const t=e.rehypePlugins||jb,a=e.remarkPlugins||jb,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cb}:Cb;return CD().use(hM).use(a).use(lD,i).use(t)}function RD(e){const t=e.children||"",a=new J1;return typeof t=="string"&&(a.value=t),a}function OD(e,t){const a=t.allowedElements,i=t.allowElement,s=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||LD;for(const x of DD)Object.hasOwn(t,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+TD+x.id,void 0);return wg(e,g),XE(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function g(x,p,b){if(x.type==="raw"&&b&&typeof p=="number")return u?b.children.splice(p,1):b.children[p]={type:"text",value:x.value},p;if(x.type==="element"){let v;for(v in Lf)if(Object.hasOwn(Lf,v)&&Object.hasOwn(x.properties,v)){const w=x.properties[v],C=Lf[v];(C===null||C.includes(x.tagName))&&(x.properties[v]=h(String(w||""),v,x))}}if(x.type==="element"){let v=a?!a.includes(x.tagName):o?o.includes(x.tagName):!1;if(!v&&i&&typeof p=="number"&&(v=!i(x,p,b)),v&&b&&typeof p=="number")return f&&x.children?b.children.splice(p,1,...x.children):b.children.splice(p,1),p}}}function LD(e){const t=e.indexOf(":"),a=e.indexOf("?"),i=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||a!==-1&&t>a||i!==-1&&t>i||MD.test(e.slice(0,t))?e:""}function Nb(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=a.indexOf(t);for(;s!==-1;)i++,s=a.indexOf(t,s+t.length);return i}function zD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function HD(e,t,a){const s=Kc((a||{}).ignore||[]),o=UD(t);let u=-1;for(;++u<o.length;)Z1(e,"text",f);function f(g,x){let p=-1,b;for(;++p<x.length;){const v=x[p],w=b?b.children:void 0;if(s(v,w?w.indexOf(v):void 0,b))return;b=v}if(b)return h(g,x)}function h(g,x){const p=x[x.length-1],b=o[u][0],v=o[u][1];let w=0;const E=p.children.indexOf(g);let S=!1,N=[];b.lastIndex=0;let D=b.exec(g.value);for(;D;){const U=D.index,z={index:D.index,input:D.input,stack:[...x,g]};let L=v(...D,z);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?b.lastIndex=U+1:(w!==U&&N.push({type:"text",value:g.value.slice(w,U)}),Array.isArray(L)?N.push(...L):L&&N.push(L),w=U+D[0].length,S=!0),!b.global)break;D=b.exec(g.value)}return S?(w<g.value.length&&N.push({type:"text",value:g.value.slice(w)}),p.children.splice(E,1,...N)):N=[g],E+N.length}}function UD(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<a.length;){const s=a[i];t.push([ID(s[0]),BD(s[1])])}return t}function ID(e){return typeof e=="string"?new RegExp(zD(e),"g"):e}function BD(e){return typeof e=="function"?e:function(){return e}}const Gf="phrasing",Vf=["autolink","link","image","label"];function qD(){return{transforms:[YD],enter:{literalAutolink:KD,literalAutolinkEmail:Yf,literalAutolinkHttp:Yf,literalAutolinkWww:Yf},exit:{literalAutolink:VD,literalAutolinkEmail:GD,literalAutolinkHttp:FD,literalAutolinkWww:PD}}}function $D(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gf,notInConstruct:Vf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gf,notInConstruct:Vf},{character:":",before:"[ps]",after:"\\/",inConstruct:Gf,notInConstruct:Vf}]}}function KD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yf(e){this.config.enter.autolinkProtocol.call(this,e)}function FD(e){this.config.exit.autolinkProtocol.call(this,e)}function PD(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function GD(e){this.config.exit.autolinkEmail.call(this,e)}function VD(e){this.exit(e)}function YD(e){HD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),XD]],{ignore:["link","linkReference"]})}function QD(e,t,a,i,s){let o="";if(!W1(s)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!ZD(a)))return!1;const u=JD(a+i);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function XD(e,t,a,i){return!W1(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function ZD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],i=a.indexOf(")");const s=Nb(e,"(");let o=Nb(e,")");for(;i!==-1&&s>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function W1(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Tr(a)||Bc(a))&&(!t||a!==47)}ek.peek=l_;function WD(){this.buffer()}function e_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function t_(){this.buffer()}function n_(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function a_(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),a.label=t}function r_(e){this.exit(e)}function i_(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ln(this.sliceSerialize(e)).toLowerCase(),a.label=t}function s_(e){this.exit(e)}function l_(){return"["}function ek(e,t,a,i){const s=a.createTracker(i);let o=s.move("[^");const u=a.enter("footnoteReference"),f=a.enter("reference");return o+=s.move(a.safe(a.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function o_(){return{enter:{gfmFootnoteCallString:WD,gfmFootnoteCall:e_,gfmFootnoteDefinitionLabelString:t_,gfmFootnoteDefinition:n_},exit:{gfmFootnoteCallString:a_,gfmFootnoteCall:r_,gfmFootnoteDefinitionLabelString:i_,gfmFootnoteDefinition:s_}}}function c_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:ek},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(i,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const g=o.enter("footnoteDefinition"),x=o.enter("label");return h+=f.move(o.safe(o.associationId(i),{before:h,after:"]"})),x(),h+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),h+=f.move((t?`
|
|
445
|
-
`:" ")+o.indentLines(o.containerFlow(i,f.current()),t?tk:u_))),g(),h}}function u_(e,t,a){return t===0?e:tk(e,t,a)}function tk(e,t,a){return(a?"":" ")+e}const d_=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nk.peek=p_;function f_(){return{canContainEols:["delete"],enter:{strikethrough:g_},exit:{strikethrough:m_}}}function h_(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:d_}],handlers:{delete:nk}}}function g_(e){this.enter({type:"delete",children:[]},e)}function m_(e){this.exit(e)}function nk(e,t,a,i){const s=a.createTracker(i),o=a.enter("strikethrough");let u=s.move("~~");return u+=a.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function p_(){return"~"}function y_(e){return e.length}function x_(e,t){const a=t||{},i=(a.align||[]).concat(),s=a.stringLength||y_,o=[],u=[],f=[],h=[];let g=0,x=-1;for(;++x<e.length;){const C=[],E=[];let S=-1;for(e[x].length>g&&(g=e[x].length);++S<e[x].length;){const N=b_(e[x][S]);if(a.alignDelimiters!==!1){const D=s(N);E[S]=D,(h[S]===void 0||D>h[S])&&(h[S]=D)}C.push(N)}u[x]=C,f[x]=E}let p=-1;if(typeof i=="object"&&"length"in i)for(;++p<g;)o[p]=Ab(i[p]);else{const C=Ab(i);for(;++p<g;)o[p]=C}p=-1;const b=[],v=[];for(;++p<g;){const C=o[p];let E="",S="";C===99?(E=":",S=":"):C===108?E=":":C===114&&(S=":");let N=a.alignDelimiters===!1?1:Math.max(1,h[p]-E.length-S.length);const D=E+"-".repeat(N)+S;a.alignDelimiters!==!1&&(N=E.length+N+S.length,N>h[p]&&(h[p]=N),v[p]=N),b[p]=D}u.splice(1,0,b),f.splice(1,0,v),x=-1;const w=[];for(;++x<u.length;){const C=u[x],E=f[x];p=-1;const S=[];for(;++p<g;){const N=C[p]||"";let D="",U="";if(a.alignDelimiters!==!1){const z=h[p]-(E[p]||0),L=o[p];L===114?D=" ".repeat(z):L===99?z%2?(D=" ".repeat(z/2+.5),U=" ".repeat(z/2-.5)):(D=" ".repeat(z/2),U=D):U=" ".repeat(z)}a.delimiterStart!==!1&&!p&&S.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&N==="")&&(a.delimiterStart!==!1||p)&&S.push(" "),a.alignDelimiters!==!1&&S.push(D),S.push(N),a.alignDelimiters!==!1&&S.push(U),a.padding!==!1&&S.push(" "),(a.delimiterEnd!==!1||p!==g-1)&&S.push("|")}w.push(a.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
|
|
446
|
-
`)}function b_(e){return e==null?"":String(e)}function Ab(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function v_(e,t,a,i){const s=a.enter("blockquote"),o=a.createTracker(i);o.move("> "),o.shift(2);const u=a.indentLines(a.containerFlow(e,o.current()),k_);return s(),u}function k_(e,t,a){return">"+(a?"":" ")+e}function w_(e,t){return Eb(e,t.inConstruct,!0)&&!Eb(e,t.notInConstruct,!1)}function Eb(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Tb(e,t,a,i){let s=-1;for(;++s<a.unsafe.length;)if(a.unsafe[s].character===`
|
|
447
|
-
`&&w_(a.stack,a.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
448
|
-
`}function S_(e,t){const a=String(e);let i=a.indexOf(t),s=i,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++o>u&&(u=o):o=1,s=i+t.length,i=a.indexOf(t,s);return u}function j_(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function C_(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function N_(e,t,a,i){const s=C_(a),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(j_(e,a)){const p=a.enter("codeIndented"),b=a.indentLines(o,A_);return p(),b}const f=a.createTracker(i),h=s.repeat(Math.max(S_(o,s)+1,3)),g=a.enter("codeFenced");let x=f.move(h);if(e.lang){const p=a.enter(`codeFencedLang${u}`);x+=f.move(a.safe(e.lang,{before:x,after:" ",encode:["`"],...f.current()})),p()}if(e.lang&&e.meta){const p=a.enter(`codeFencedMeta${u}`);x+=f.move(" "),x+=f.move(a.safe(e.meta,{before:x,after:`
|
|
449
|
-
`,encode:["`"],...f.current()})),p()}return x+=f.move(`
|
|
450
|
-
`),o&&(x+=f.move(o+`
|
|
451
|
-
`)),x+=f.move(h),g(),x}function A_(e,t,a){return(a?"":" ")+e}function Cg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function E_(e,t,a,i){const s=Cg(a),o=s==='"'?"Quote":"Apostrophe",u=a.enter("definition");let f=a.enter("label");const h=a.createTracker(i);let g=h.move("[");return g+=h.move(a.safe(a.associationId(e),{before:g,after:"]",...h.current()})),g+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(a.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=a.enter("destinationRaw"),g+=h.move(a.safe(e.url,{before:g,after:e.title?" ":`
|
|
452
|
-
`,...h.current()}))),f(),e.title&&(f=a.enter(`title${o}`),g+=h.move(" "+s),g+=h.move(a.safe(e.title,{before:g,after:s,...h.current()})),g+=h.move(s),f()),u(),g}function T_(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function sl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wc(e,t,a){const i=Ti(e),s=Ti(t);return i===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ak.peek=M_;function ak(e,t,a,i){const s=T_(a),o=a.enter("emphasis"),u=a.createTracker(i),f=u.move(s);let h=u.move(a.containerPhrasing(e,{after:s,before:f,...u.current()}));const g=h.charCodeAt(0),x=wc(i.before.charCodeAt(i.before.length-1),g,s);x.inside&&(h=sl(g)+h.slice(1));const p=h.charCodeAt(h.length-1),b=wc(i.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+sl(p));const v=u.move(s);return o(),a.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},f+h+v}function M_(e,t,a){return a.options.emphasis||"*"}function D_(e,t){let a=!1;return wg(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return a=!0,Oh}),!!((!e.depth||e.depth<3)&&mg(e)&&(t.options.setext||a))}function __(e,t,a,i){const s=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(i);if(D_(e,a)){const x=a.enter("headingSetext"),p=a.enter("phrasing"),b=a.containerPhrasing(e,{...o.current(),before:`
|
|
453
|
-
`,after:`
|
|
454
|
-
`});return p(),x(),b+`
|
|
455
|
-
`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
456
|
-
`))+1))}const u="#".repeat(s),f=a.enter("headingAtx"),h=a.enter("phrasing");o.move(u+" ");let g=a.containerPhrasing(e,{before:"# ",after:`
|
|
457
|
-
`,...o.current()});return/^[\t ]/.test(g)&&(g=sl(g.charCodeAt(0))+g.slice(1)),g=g?u+" "+g:u,a.options.closeAtx&&(g+=" "+u),h(),f(),g}rk.peek=R_;function rk(e){return e.value||""}function R_(){return"<"}ik.peek=O_;function ik(e,t,a,i){const s=Cg(a),o=s==='"'?"Quote":"Apostrophe",u=a.enter("image");let f=a.enter("label");const h=a.createTracker(i);let g=h.move("![");return g+=h.move(a.safe(e.alt,{before:g,after:"]",...h.current()})),g+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(a.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=a.enter("destinationRaw"),g+=h.move(a.safe(e.url,{before:g,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=a.enter(`title${o}`),g+=h.move(" "+s),g+=h.move(a.safe(e.title,{before:g,after:s,...h.current()})),g+=h.move(s),f()),g+=h.move(")"),u(),g}function O_(){return"!"}sk.peek=L_;function sk(e,t,a,i){const s=e.referenceType,o=a.enter("imageReference");let u=a.enter("label");const f=a.createTracker(i);let h=f.move("![");const g=a.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),u();const x=a.stack;a.stack=[],u=a.enter("reference");const p=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return u(),a.stack=x,o(),s==="full"||!g||g!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function L_(){return"!"}lk.peek=z_;function lk(e,t,a){let i=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const u=a.unsafe[o],f=a.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(i);){let g=h.index;i.charCodeAt(g)===10&&i.charCodeAt(g-1)===13&&g--,i=i.slice(0,g)+" "+i.slice(h.index+1)}}return s+i+s}function z_(){return"`"}function ok(e,t){const a=mg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ck.peek=H_;function ck(e,t,a,i){const s=Cg(a),o=s==='"'?"Quote":"Apostrophe",u=a.createTracker(i);let f,h;if(ok(e,a)){const x=a.stack;a.stack=[],f=a.enter("autolink");let p=u.move("<");return p+=u.move(a.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),f(),a.stack=x,p}f=a.enter("link"),h=a.enter("label");let g=u.move("[");return g+=u.move(a.containerPhrasing(e,{before:g,after:"](",...u.current()})),g+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=a.enter("destinationLiteral"),g+=u.move("<"),g+=u.move(a.safe(e.url,{before:g,after:">",...u.current()})),g+=u.move(">")):(h=a.enter("destinationRaw"),g+=u.move(a.safe(e.url,{before:g,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=a.enter(`title${o}`),g+=u.move(" "+s),g+=u.move(a.safe(e.title,{before:g,after:s,...u.current()})),g+=u.move(s),h()),g+=u.move(")"),f(),g}function H_(e,t,a){return ok(e,a)?"<":"["}uk.peek=U_;function uk(e,t,a,i){const s=e.referenceType,o=a.enter("linkReference");let u=a.enter("label");const f=a.createTracker(i);let h=f.move("[");const g=a.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),u();const x=a.stack;a.stack=[],u=a.enter("reference");const p=a.safe(a.associationId(e),{before:h,after:"]",...f.current()});return u(),a.stack=x,o(),s==="full"||!g||g!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function U_(){return"["}function Ng(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function I_(e){const t=Ng(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function B_(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dk(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function q_(e,t,a,i){const s=a.enter("list"),o=a.bulletCurrent;let u=e.ordered?B_(a):Ng(a);const f=e.ordered?u==="."?")":".":I_(a);let h=t&&a.bulletLastUsed?u===a.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(h=!0),dk(a)===u&&x){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),a.bulletCurrent=u;const g=a.containerFlow(e,i);return a.bulletLastUsed=u,a.bulletCurrent=o,s(),g}function $_(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function K_(e,t,a,i){const s=$_(a);let o=a.bulletCurrent||Ng(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=a.createTracker(i);f.move(o+" ".repeat(u-o.length)),f.shift(u);const h=a.enter("listItem"),g=a.indentLines(a.containerFlow(e,f.current()),x);return h(),g;function x(p,b,v){return b?(v?"":" ".repeat(u))+p:(v?o:o+" ".repeat(u-o.length))+p}}function F_(e,t,a,i){const s=a.enter("paragraph"),o=a.enter("phrasing"),u=a.containerPhrasing(e,i);return o(),s(),u}const P_=Kc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function G_(e,t,a,i){return(e.children.some(function(u){return P_(u)})?a.containerPhrasing:a.containerFlow).call(a,e,i)}function V_(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}fk.peek=Y_;function fk(e,t,a,i){const s=V_(a),o=a.enter("strong"),u=a.createTracker(i),f=u.move(s+s);let h=u.move(a.containerPhrasing(e,{after:s,before:f,...u.current()}));const g=h.charCodeAt(0),x=wc(i.before.charCodeAt(i.before.length-1),g,s);x.inside&&(h=sl(g)+h.slice(1));const p=h.charCodeAt(h.length-1),b=wc(i.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+sl(p));const v=u.move(s+s);return o(),a.attentionEncodeSurroundingInfo={after:b.outside,before:x.outside},f+h+v}function Y_(e,t,a){return a.options.strong||"*"}function Q_(e,t,a,i){return a.safe(e.value,i)}function X_(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Z_(e,t,a){const i=(dk(a)+(a.options.ruleSpaces?" ":"")).repeat(X_(a));return a.options.ruleSpaces?i.slice(0,-1):i}const hk={blockquote:v_,break:Tb,code:N_,definition:E_,emphasis:ak,hardBreak:Tb,heading:__,html:rk,image:ik,imageReference:sk,inlineCode:lk,link:ck,linkReference:uk,list:q_,listItem:K_,paragraph:F_,root:G_,strong:fk,text:Q_,thematicBreak:Z_};function J_(){return{enter:{table:W_,tableData:Mb,tableHeader:Mb,tableRow:tR},exit:{codeText:nR,table:eR,tableData:Qf,tableHeader:Qf,tableRow:Qf}}}function W_(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function eR(e){this.exit(e),this.data.inTable=void 0}function tR(e){this.enter({type:"tableRow",children:[]},e)}function Qf(e){this.exit(e)}function Mb(e){this.enter({type:"tableCell",children:[]},e)}function nR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aR));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function aR(e,t){return t==="|"?t:e}function rR(e){const t=e||{},a=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
458
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:h,tableRow:f}};function u(v,w,C,E){return g(x(v,C,E),v.align)}function f(v,w,C,E){const S=p(v,C,E),N=g([S]);return N.slice(0,N.indexOf(`
|
|
459
|
-
`))}function h(v,w,C,E){const S=C.enter("tableCell"),N=C.enter("phrasing"),D=C.containerPhrasing(v,{...E,before:o,after:o});return N(),S(),D}function g(v,w){return x_(v,{align:w,alignDelimiters:i,padding:a,stringLength:s})}function x(v,w,C){const E=v.children;let S=-1;const N=[],D=w.enter("table");for(;++S<E.length;)N[S]=p(E[S],w,C);return D(),N}function p(v,w,C){const E=v.children;let S=-1;const N=[],D=w.enter("tableRow");for(;++S<E.length;)N[S]=h(E[S],v,w,C);return D(),N}function b(v,w,C){let E=hk.inlineCode(v,w,C);return C.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function iR(){return{exit:{taskListCheckValueChecked:Db,taskListCheckValueUnchecked:Db,paragraph:lR}}}function sR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oR}}}function Db(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function lR(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const i=a.children[0];if(i&&i.type==="text"){const s=t.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function oR(e,t,a,i){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=a.createTracker(i);o&&f.move(u);let h=hk.listItem(e,t,a,{...i,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(x){return x+u}}function cR(){return[qD(),o_(),f_(),J_(),iR()]}function uR(e){return{extensions:[$D(),c_(e),h_(),rR(e),sR()]}}const dR={tokenize:yR,partial:!0},gk={tokenize:xR,partial:!0},mk={tokenize:bR,partial:!0},pk={tokenize:vR,partial:!0},fR={tokenize:kR,partial:!0},yk={name:"wwwAutolink",tokenize:mR,previous:bk},xk={name:"protocolAutolink",tokenize:pR,previous:vk},ka={name:"emailAutolink",tokenize:gR,previous:kk},Zn={};function hR(){return{text:Zn}}let vr=48;for(;vr<123;)Zn[vr]=ka,vr++,vr===58?vr=65:vr===91&&(vr=97);Zn[43]=ka;Zn[45]=ka;Zn[46]=ka;Zn[95]=ka;Zn[72]=[ka,xk];Zn[104]=[ka,xk];Zn[87]=[ka,yk];Zn[119]=[ka,yk];function gR(e,t,a){const i=this;let s,o;return u;function u(p){return!Uh(p)||!kk.call(i,i.previous)||Ag(i.events)?a(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(p))}function f(p){return Uh(p)?(e.consume(p),f):p===64?(e.consume(p),h):a(p)}function h(p){return p===46?e.check(fR,x,g)(p):p===45||p===95||_t(p)?(o=!0,e.consume(p),h):x(p)}function g(p){return e.consume(p),s=!0,h}function x(p){return o&&s&&It(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):a(p)}}function mR(e,t,a){const i=this;return s;function s(u){return u!==87&&u!==119||!bk.call(i,i.previous)||Ag(i.events)?a(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dR,e.attempt(gk,e.attempt(mk,o),a),a)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function pR(e,t,a){const i=this;let s="",o=!1;return u;function u(p){return(p===72||p===104)&&vk.call(i,i.previous)&&!Ag(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),f):a(p)}function f(p){if(It(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),f;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return a(p)}function h(p){return p===47?(e.consume(p),o?g:(o=!0,h)):a(p)}function g(p){return p===null||bc(p)||at(p)||Tr(p)||Bc(p)?a(p):e.attempt(gk,e.attempt(mk,x),a)(p)}function x(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function yR(e,t,a){let i=0;return s;function s(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),s):u===46&&i===3?(e.consume(u),o):a(u)}function o(u){return u===null?a(u):t(u)}}function xR(e,t,a){let i,s,o;return u;function u(g){return g===46||g===95?e.check(pk,h,f)(g):g===null||at(g)||Tr(g)||g!==45&&Bc(g)?h(g):(o=!0,e.consume(g),u)}function f(g){return g===95?i=!0:(s=i,i=void 0),e.consume(g),u}function h(g){return s||i||!o?a(g):t(g)}}function bR(e,t){let a=0,i=0;return s;function s(u){return u===40?(a++,e.consume(u),s):u===41&&i<a?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(pk,t,o)(u):u===null||at(u)||Tr(u)?t(u):(e.consume(u),s)}function o(u){return u===41&&i++,e.consume(u),s}}function vR(e,t,a){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||at(f)||Tr(f)?t(f):a(f)}function s(f){return f===null||f===40||f===91||at(f)||Tr(f)?t(f):i(f)}function o(f){return It(f)?u(f):a(f)}function u(f){return f===59?(e.consume(f),i):It(f)?(e.consume(f),u):a(f)}}function kR(e,t,a){return i;function i(o){return e.consume(o),s}function s(o){return _t(o)?a(o):t(o)}}function bk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||at(e)}function vk(e){return!It(e)}function kk(e){return!(e===47||Uh(e))}function Uh(e){return e===43||e===45||e===46||e===95||_t(e)}function Ag(e){let t=e.length,a=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const wR={tokenize:MR,partial:!0};function SR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:AR,continuation:{tokenize:ER},exit:TR}},text:{91:{name:"gfmFootnoteCall",tokenize:NR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jR,resolveTo:CR}}}}function jR(e,t,a){const i=this;let s=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;s--;){const h=i.events[s][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return a(h);const g=Ln(i.sliceSerialize({start:u.end,end:i.now()}));return g.codePointAt(0)!==94||!o.includes(g.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function CR(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[a+1],e[a+2],["enter",i,t],e[a+3],e[a+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(a,e.length-a+1,...f),e}function NR(e,t,a){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,u;return f;function f(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?a(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(p){if(o>999||p===93&&!u||p===null||p===91||at(p))return a(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Ln(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(p)}return at(p)||(u=!0),o++,e.consume(p),p===92?x:g}function x(p){return p===91||p===92||p===93?(e.consume(p),o++,g):g(p)}}function AR(e,t,a){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):a(w)}function x(w){if(u>999||w===93&&!f||w===null||w===91||at(w))return a(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=Ln(i.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return at(w)||(f=!0),u++,e.consume(w),w===92?p:x}function p(w){return w===91||w===92||w===93?(e.consume(w),u++,x):x(w)}function b(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(o)||s.push(o),qe(e,v,"gfmFootnoteDefinitionWhitespace")):a(w)}function v(w){return t(w)}}function ER(e,t,a){return e.check(xl,t,e.attempt(wR,t,a))}function TR(e){e.exit("gfmFootnoteDefinition")}function MR(e,t,a){const i=this;return qe(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):a(o)}}function DR(e){let a=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:s};return a==null&&(a=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let g=h;for(;g--;)if(u[g][0]==="exit"&&u[g][1].type==="strikethroughSequenceTemporary"&&u[g][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[g][1].end.offset-u[g][1].start.offset){u[h][1].type="strikethroughSequence",u[g][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},u[g][1].start),end:Object.assign({},u[h][1].end)},p={type:"strikethroughText",start:Object.assign({},u[g][1].end),end:Object.assign({},u[h][1].start)},b=[["enter",x,f],["enter",u[g][1],f],["exit",u[g][1],f],["enter",p,f]],v=f.parser.constructs.insideSpan.null;v&&on(b,b.length,0,qc(v,u.slice(g+1,h),f)),on(b,b.length,0,[["exit",p,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",x,f]]),on(u,g-1,h-g+3,b),h=g+b.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const g=this.previous,x=this.events;let p=0;return b;function b(w){return g===126&&x[x.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const C=Ti(g);if(w===126)return p>1?h(w):(u.consume(w),p++,v);if(p<2&&!a)return h(w);const E=u.exit("strikethroughSequenceTemporary"),S=Ti(w);return E._open=!S||S===2&&!!C,E._close=!C||C===2&&!!S,f(w)}}}class _R{constructor(){this.map=[]}add(t,a,i){RR(this,t,a,i)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const o of s)t.push(o);s=i.pop()}this.map.length=0}}function RR(e,t,a,i){let s=0;if(!(a===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=a,e.map[s][2].push(...i);return}s+=1}e.map.push([t,a,i])}}function OR(e,t){let a=!1;const i=[];for(;t<e.length;){const s=e[t];if(a){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return i}function LR(){return{flow:{null:{name:"table",tokenize:zR,resolveAll:HR}}}}function zR(e,t,a){const i=this;let s=0,o=0,u;return f;function f(_){let q=i.events.length-1;for(;q>-1;){const W=i.events[q][1].type;if(W==="lineEnding"||W==="linePrefix")q--;else break}const V=q>-1?i.events[q][1].type:null,re=V==="tableHead"||V==="tableRow"?L:h;return re===L&&i.parser.lazy[i.now().line]?a(_):re(_)}function h(_){return e.enter("tableHead"),e.enter("tableRow"),g(_)}function g(_){return _===124||(u=!0,o+=1),x(_)}function x(_){return _===null?a(_):be(_)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),v):a(_):He(_)?qe(e,x,"whitespace")(_):(o+=1,u&&(u=!1,s+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),u=!0,x):(e.enter("data"),p(_)))}function p(_){return _===null||_===124||at(_)?(e.exit("data"),x(_)):(e.consume(_),_===92?b:p)}function b(_){return _===92||_===124?(e.consume(_),p):p(_)}function v(_){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(_):(e.enter("tableDelimiterRow"),u=!1,He(_)?qe(e,w,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):w(_))}function w(_){return _===45||_===58?E(_):_===124?(u=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),C):z(_)}function C(_){return He(_)?qe(e,E,"whitespace")(_):E(_)}function E(_){return _===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),S):_===45?(o+=1,S(_)):_===null||be(_)?U(_):z(_)}function S(_){return _===45?(e.enter("tableDelimiterFiller"),N(_)):z(_)}function N(_){return _===45?(e.consume(_),N):_===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),D):(e.exit("tableDelimiterFiller"),D(_))}function D(_){return He(_)?qe(e,U,"whitespace")(_):U(_)}function U(_){return _===124?w(_):_===null||be(_)?!u||s!==o?z(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):z(_)}function z(_){return a(_)}function L(_){return e.enter("tableRow"),G(_)}function G(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),G):_===null||be(_)?(e.exit("tableRow"),t(_)):He(_)?qe(e,G,"whitespace")(_):(e.enter("data"),X(_))}function X(_){return _===null||_===124||at(_)?(e.exit("data"),G(_)):(e.consume(_),_===92?F:X)}function F(_){return _===92||_===124?(e.consume(_),X):X(_)}}function HR(e,t){let a=-1,i=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,g,x,p;const b=new _R;for(;++a<e.length;){const v=e[a],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(_b(b,t,h,g,x),x=void 0,h=0),g={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(a,0,[["enter",g,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(i=!0,p=void 0,o=[0,0,0,0],u=[0,a+1,0,0],f&&(f=!1,x={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},b.add(a,0,[["enter",x,t]])),s=w.type==="tableDelimiterRow"?2:x?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(i=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],p=Yo(b,t,o,s,void 0,p),o=[0,0,0,0]),u[2]=a)):w.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(u[0]=u[1],p=Yo(b,t,o,s,void 0,p)),o=u,u=[o[1],a,0,0])):w.type==="tableHead"?(f=!0,h=a):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=a,o[1]!==0?(u[0]=u[1],p=Yo(b,t,o,s,a,p)):u[1]!==0&&(p=Yo(b,t,u,s,a,p)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=a)}for(h!==0&&_b(b,t,h,g,x),b.consume(t.events),a=-1;++a<t.events.length;){const v=t.events[a];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=OR(t.events,a))}return e}function Yo(e,t,a,i,s,o){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(o.end=Object.assign({},Ni(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));const h=Ni(t.events,a[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){const g=Ni(t.events,a[2]),x=Ni(t.events,a[3]),p={type:f,start:Object.assign({},g),end:Object.assign({},x)};if(e.add(a[2],0,[["enter",p,t]]),i!==2){const b=t.events[a[2]],v=t.events[a[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const w=a[2]+1,C=a[3]-a[2]-1;e.add(w,C,[])}}e.add(a[3]+1,0,[["exit",p,t]])}return s!==void 0&&(o.end=Object.assign({},Ni(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function _b(e,t,a,i,s){const o=[],u=Ni(t.events,a);s&&(s.end=Object.assign({},u),o.push(["exit",s,t])),i.end=Object.assign({},u),o.push(["exit",i,t]),e.add(a+1,0,o)}function Ni(e,t){const a=e[t],i=a[0]==="enter"?"start":"end";return a[1][i]}const UR={name:"tasklistCheck",tokenize:BR};function IR(){return{text:{91:UR}}}function BR(e,t,a){const i=this;return s;function s(h){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return at(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):a(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(h)}function f(h){return be(h)?t(h):He(h)?e.check({tokenize:qR},t,a)(h):a(h)}}function qR(e,t,a){return qe(e,i,"whitespace");function i(s){return s===null?a(s):t(s)}}function $R(e){return _1([hR(),SR(),DR(e),LR(),IR()])}const KR={};function FR(e){const t=this,a=e||KR,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push($R(a)),o.push(cR()),u.push(uR(a))}const wk=j.memo(function({content:t}){return c.jsx("div",{className:"prose prose-sm max-w-none break-words dark:prose-invert prose-p:my-1 prose-pre:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:c.jsx(jg,{remarkPlugins:[FR],components:{pre:({children:a,...i})=>c.jsx("pre",{className:"overflow-x-auto rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",...i,children:a}),code:({children:a,className:i,...s})=>i?c.jsx("code",{className:i,...s,children:a}):c.jsx("code",{className:"rounded bg-gray-100 px-1 py-0.5 text-xs dark:bg-gray-800",...s,children:a}),a:({children:a,...i})=>c.jsx("a",{className:"text-blue-600 underline dark:text-blue-400",target:"_blank",rel:"noopener noreferrer",...i,children:a})},children:t})})});function Sk(){return c.jsx("span",{className:"ml-0.5 inline-block h-4 w-1.5 animate-pulse rounded-sm bg-blue-500 align-middle"})}const PR=j.memo(function({message:t}){const a=t.role==="user";return c.jsx("div",{className:`flex ${a?"justify-end":"justify-start"} mb-3`,children:c.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${a?"bg-blue-600 text-white":"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-gray-100"}`,children:a?c.jsx("p",{className:"whitespace-pre-wrap",children:t.content}):c.jsxs(c.Fragment,{children:[c.jsx(wk,{content:t.content}),t.isStreaming&&c.jsx(Sk,{})]})})})});function Rb(e){const t=e.split(":");if(t.length>=3&&t[0]==="agent"){const a=t.slice(2).join(":");return a==="main"?t[1]:a.length>20?a.slice(0,20)+"…":a}return e.length>15?e.slice(0,15)+"…":e}function GR(e){const t=Date.now()-e,a=Math.floor(t/6e4);if(a<1)return"just now";if(a<60)return`${a}m`;const i=Math.floor(a/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function VR(){const{t:e}=le("chat"),t=Qe(N=>N.sessions),a=Qe(N=>N.currentSessionKey),i=Qe(N=>N.switchSession),s=Qe(N=>N.newSession),o=Qe(N=>N.setTargetAgent),u=Qe(N=>N.loadSessions),f=Qe(N=>N.dockExpanded),h=se(N=>N.agents),g=Array.from(h.values()).filter(N=>!N.isSubAgent&&!N.isPlaceholder&&N.confirmed),[x,p]=j.useState(!1),b=j.useRef(null);j.useEffect(()=>{f&&u()},[f,u]),j.useEffect(()=>{if(!x)return;const N=D=>{b.current&&!b.current.contains(D.target)&&p(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[x]);const v=j.useCallback(N=>{i(N),p(!1)},[i]),w=j.useCallback(N=>{o(N),setTimeout(()=>{s(),p(!1)},0)},[o,s]),C=j.useCallback(()=>{s()},[s]),E=Rb(a),S=[...t??[]].sort((N,D)=>D.lastActiveAt-N.lastActiveAt);return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{ref:b,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>p(!x),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(j5,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"max-w-[140px] truncate",children:E}),c.jsx(Un,{className:`h-3 w-3 transition-transform ${x?"rotate-180":""}`})]}),x&&c.jsxs("div",{className:"absolute left-0 top-full z-60 mt-1 w-72 rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:[S.length>0?S.map(N=>c.jsxs("button",{type:"button",onClick:()=>v(N.key),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs hover:bg-gray-50 dark:hover:bg-gray-800 ${N.key===a?"bg-blue-50 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate font-medium",children:Rb(N.key)}),c.jsxs("div",{className:"truncate text-[10px] text-gray-400",children:[GR(N.lastActiveAt),N.messageCount>0&&` · ${N.messageCount} msgs`]})]}),N.key===a&&c.jsx("div",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-blue-500"})]},N.key)):c.jsx("div",{className:"px-3 py-2 text-xs text-gray-400",children:e("sessionSwitcher.noSessions")}),c.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-800",children:[c.jsx("div",{className:"px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400",children:e("sessionSwitcher.newSession")}),g.map(N=>c.jsxs("button",{type:"button",onClick:()=>w(N.id),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(jn,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{className:"truncate",children:e("sessionSwitcher.newSessionWith",{agent:N.name})})]},`new-${N.id}`)),g.length===0&&c.jsxs("button",{type:"button",onClick:()=>{s(),p(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(jn,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{children:e("sessionSwitcher.newSession")})]})]})]})]}),c.jsx("button",{type:"button",onClick:C,className:"flex h-6 w-6 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-green-600 dark:hover:bg-gray-800 dark:hover:text-green-400",title:e("sessionSwitcher.newSessionTooltip"),children:c.jsx(jn,{className:"h-4 w-4"})})]})}const jk=220,YR=.7,QR=420,Ih="openclaw-chat-dialog-height";function XR(){try{const e=localStorage.getItem(Ih);if(e){const t=parseInt(e,10);if(!Number.isNaN(t)&&t>=jk)return t}}catch{}return QR}function ZR(e){if(!e)return"";const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
|
|
460
|
-
`):""}function JR(){const{t:e}=le("chat"),t=Qe(T=>T.dockExpanded),a=Qe(T=>T.messages),i=Qe(T=>T.isStreaming),s=Qe(T=>T.streamingMessage),o=Qe(T=>T.isHistoryLoading),u=Qe(T=>T.setDockExpanded),f=Qe(T=>T.sendMessage),h=Qe(T=>T.abort),g=Qe(T=>T.error),x=Qe(T=>T.clearError),p=j.useRef(null),b=j.useRef(null),[v,w]=j.useState(!0),[C,E]=j.useState(XR),[S,N]=j.useState(!1),[D,U]=j.useState(!1),[z,L]=j.useState(""),[G,X]=j.useState(!1),F=j.useRef(0),_=j.useRef(0),q=j.useRef(!1),V=ZR(s),re=z.trim().length>0&&!i;j.useEffect(()=>{if(t&&!q.current){U(!0);const T=setTimeout(()=>U(!1),200);return q.current=!0,()=>clearTimeout(T)}if(!t&&q.current){U(!0);const T=setTimeout(()=>{U(!1),q.current=!1},150);return()=>clearTimeout(T)}},[t]),j.useEffect(()=>{if(t&&b.current){const T=setTimeout(()=>{var R;return(R=b.current)==null?void 0:R.focus()},220);return()=>clearTimeout(T)}},[t]),j.useEffect(()=>{v&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[a,V,v]);const W=j.useCallback(()=>{if(!p.current)return;const{scrollTop:T,scrollHeight:R,clientHeight:Q}=p.current,M=R-T-Q<40;w(M)},[]),J=j.useCallback(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight,w(!0))},[]);j.useEffect(()=>{if(!t)return;const T=R=>{R.key==="Escape"&&u(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[t,u]);const B=j.useCallback(T=>{T.preventDefault(),N(!0),F.current=T.clientY,_.current=C},[C]);j.useEffect(()=>{if(!S)return;const T=Q=>{const M=F.current-Q.clientY,ce=window.innerHeight*YR,me=Math.max(jk,Math.min(ce,_.current+M));E(me)},R=()=>{N(!1);try{localStorage.setItem(Ih,String(C))}catch{}};return document.addEventListener("mousemove",T),document.addEventListener("mouseup",R),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",R)}},[S,C]),j.useEffect(()=>{if(!S)try{localStorage.setItem(Ih,String(C))}catch{}},[C,S]);const ee=j.useCallback(()=>{const T=z.trim();!T||i||(f(T),L(""))},[z,i,f]),de=j.useCallback(T=>{T.key==="Enter"&&!T.shiftKey&&!G&&(T.preventDefault(),ee()),T.key==="Escape"&&u(!1)},[ee,G,u]);if(!t&&!D)return null;const ke=[...a];return c.jsxs("div",{className:`absolute inset-x-0 bottom-0 z-30 mx-auto flex w-full max-w-2xl flex-col overflow-hidden rounded-t-xl border border-b-0 border-gray-200 bg-white shadow-2xl dark:border-gray-700 dark:bg-gray-900 ${t?"animate-slide-up":"animate-slide-down"}`,style:{height:`${C}px`,transition:S?"none":void 0},children:[c.jsx("div",{className:"flex h-3 shrink-0 cursor-ns-resize items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800",onMouseDown:B,children:c.jsx("div",{className:"h-0.5 w-8 rounded-full bg-gray-300 dark:bg-gray-600"})}),c.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-gray-100 px-3 py-1 dark:border-gray-800",children:[c.jsx(VR,{}),c.jsx("button",{type:"button",onClick:()=>u(!1),className:"flex h-7 w-7 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.collapseDock"),children:c.jsx(N5,{className:"h-4 w-4"})})]}),o&&c.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-2 py-3 text-sm text-gray-400",children:[c.jsx(Dt,{className:"h-4 w-4 animate-spin"}),c.jsx("span",{children:e("chatDialog.loadingHistory")})]}),c.jsxs("div",{ref:p,onScroll:W,className:"relative min-h-0 flex-1 overflow-y-auto px-4 py-2",children:[ke.length===0&&!i&&!o?c.jsx("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:e("dock.startNewChat")}):c.jsxs(c.Fragment,{children:[ke.map(T=>c.jsx(PR,{message:T},T.id)),i&&V&&c.jsx("div",{className:"mb-3 flex justify-start",children:c.jsxs("div",{className:"max-w-[80%] rounded-lg bg-gray-100 px-3 py-2 text-sm text-gray-900 dark:bg-gray-800 dark:text-gray-100",children:[c.jsx(wk,{content:V}),c.jsx(Sk,{})]})}),i&&!V&&c.jsx("div",{className:"mb-3 flex justify-start",children:c.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-gray-100 px-3 py-2 text-sm text-gray-400 dark:bg-gray-800",children:[c.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"}),c.jsx("span",{children:e("dock.thinkingStatus")})]})})]}),!v&&c.jsx("button",{type:"button",onClick:J,title:e("chatDialog.scrollToBottom"),className:"sticky bottom-2 left-full z-10 -mr-2 flex h-8 w-8 items-center justify-center rounded-full border border-gray-200 bg-white shadow-md hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",children:c.jsx(q4,{className:"h-4 w-4 text-gray-500"})})]}),g&&c.jsxs("div",{className:"flex shrink-0 items-center justify-between bg-red-50 px-3 py-1.5 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400",children:[c.jsx("span",{className:"truncate",children:g}),c.jsx("button",{type:"button",onClick:x,className:"ml-2 text-red-500 hover:text-red-700",children:"✕"})]}),c.jsx("div",{className:"shrink-0 border-t border-gray-200 bg-white px-3 py-2 dark:border-gray-700 dark:bg-gray-900",children:c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx(y1,{}),c.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.attachmentWip"),children:c.jsx(Kv,{className:"h-4 w-4"})}),c.jsx(Xv,{ref:b,value:z,onChange:T=>L(T.target.value),onKeyDown:de,onCompositionStart:()=>X(!0),onCompositionEnd:()=>X(!1),placeholder:e("dock.placeholder"),maxRows:4,className:"flex-1 resize-none rounded-lg border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-400 focus:bg-white dark:border-gray-700 dark:bg-gray-800 dark:placeholder:text-gray-500 dark:focus:border-blue-500 dark:focus:bg-gray-900"}),i?c.jsx("button",{type:"button",onClick:()=>h(),className:"rounded-lg bg-red-500 p-1.5 text-white transition-colors hover:bg-red-600",title:e("common:actions.stop"),children:c.jsx(Wh,{className:"h-4 w-4"})}):c.jsx("button",{type:"button",onClick:ee,disabled:!re,className:`rounded-lg p-1.5 transition-colors ${re?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-400 dark:bg-gray-700"}`,title:e("common:actions.send"),children:c.jsx(Gv,{className:"h-4 w-4"})})]})})]})}function WR(){const{t:e}=le("chat"),[t,a]=j.useState(""),[i,s]=j.useState(!1),o=j.useRef(null),u=Qe(E=>E.sendMessage),f=Qe(E=>E.abort),h=Qe(E=>E.isStreaming),g=Qe(E=>E.dockExpanded),x=Qe(E=>E.setDockExpanded),p=Qe(E=>E.error),b=Qe(E=>E.clearError),v=t.trim().length>0&&!h,w=j.useCallback(()=>{const E=t.trim();!E||h||(u(E),a(""))},[t,h,u]),C=j.useCallback(E=>{E.key==="Enter"&&!E.shiftKey&&!i&&(E.preventDefault(),w())},[w,i]);return g?null:c.jsxs("div",{className:"border-t border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[p&&c.jsxs("div",{className:"flex items-center justify-between bg-red-50 px-3 py-1.5 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400",children:[c.jsx("span",{className:"truncate",children:p}),c.jsx("button",{type:"button",onClick:b,className:"ml-2 text-red-500 hover:text-red-700",children:"✕"})]}),c.jsxs("div",{className:"flex items-end gap-2 px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(y1,{}),c.jsx("button",{type:"button",onClick:()=>x(!0),className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.expandDock"),children:c.jsx(w5,{className:"h-4 w-4"})})]}),c.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.attachmentWip"),onClick:()=>{},children:c.jsx(Kv,{className:"h-4 w-4"})}),c.jsx(Xv,{ref:o,value:t,onChange:E=>a(E.target.value),onKeyDown:C,onFocus:()=>x(!0),onCompositionStart:()=>s(!0),onCompositionEnd:()=>s(!1),placeholder:e("dock.placeholder"),maxRows:4,className:"flex-1 resize-none rounded-lg border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-400 focus:bg-white dark:border-gray-700 dark:bg-gray-800 dark:placeholder:text-gray-500 dark:focus:border-blue-500 dark:focus:bg-gray-900"}),h?c.jsx("button",{type:"button",onClick:()=>f(),className:"rounded-lg bg-red-500 p-1.5 text-white transition-colors hover:bg-red-600",title:e("common:actions.stop"),children:c.jsx(Wh,{className:"h-4 w-4"})}):c.jsx("button",{type:"button",onClick:w,disabled:!v,className:`rounded-lg p-1.5 transition-colors ${v?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-400 dark:bg-gray-700"}`,title:e("common:actions.send"),children:c.jsx(Gv,{className:"h-4 w-4"})})]})]})}const Ne=In((e,t)=>({config:null,hash:null,configPath:null,configRaw:null,configValid:!0,loading:!1,error:null,schemaHints:null,status:null,statusLoading:!1,statusError:null,updateResult:null,updateLoading:!1,catalogModels:[],catalogLoading:!1,restartState:null,lifecycleState:null,setRestartPending:a=>e({restartState:{status:"pending",startedAt:Date.now(),estimatedDelayMs:a}}),setRestartReconnecting:()=>e(a=>a.restartState?{restartState:{...a.restartState,status:"reconnecting"}}:{}),setRestartComplete:()=>e(a=>a.restartState?{restartState:{...a.restartState,status:"complete"}}:{}),clearRestart:()=>e({restartState:null}),setLifecycleState:a=>e({lifecycleState:a}),setLifecycleFromWriteResult:(a,i,s)=>{var u;const o=Date.now();if((u=a.restart)!=null&&u.scheduled){e({lifecycleState:{status:i==="apply"?"apply-restarting":"saved-restart-required",source:i,startedAt:o,estimatedDelayMs:a.restart.delayMs},restartState:i==="apply"?{status:"pending",startedAt:o,estimatedDelayMs:a.restart.delayMs}:null});return}e({lifecycleState:s?{status:"saved-cli-restart-required",source:"cli",startedAt:o,command:s}:{status:"saved-hot-reload",source:i,startedAt:o},restartState:null})},setRuntimeApplied:a=>e({lifecycleState:{status:"effective-now",source:"runtime",startedAt:Date.now(),messageKey:a},restartState:null}),setLifecycleDisconnected:()=>e(a=>a.lifecycleState?{lifecycleState:{...a.lifecycleState,status:"disconnected"},restartState:a.restartState?{...a.restartState,status:"disconnected"}:a.restartState}:{}),setLifecycleReconnecting:()=>e(a=>a.lifecycleState?{lifecycleState:{...a.lifecycleState,status:"reconnecting"},restartState:a.restartState?{...a.restartState,status:"reconnecting"}:a.restartState}:{}),setLifecycleComplete:()=>e(a=>a.lifecycleState?{lifecycleState:{...a.lifecycleState,status:"complete"},restartState:a.restartState?{...a.restartState,status:"complete"}:a.restartState}:{}),clearLifecycle:()=>e({lifecycleState:null,restartState:null}),fetchConfig:async()=>{e({loading:!0,error:null});try{const i=await(await Fe()).configGet();e({config:i.config,hash:i.hash??null,configPath:i.path??null,configRaw:i.raw??null,configValid:i.valid,loading:!1})}catch(a){e({loading:!1,error:String(a)})}},saveConfig:async(a,i)=>{const s=t().config,o=t().hash??void 0;if(!s)return{ok:!1,config:{},error:"config not loaded"};try{const u=await Fe(),f=a(structuredClone(s)),h=await u.configSet(JSON.stringify(f),o);if(h.ok)e({config:h.config,error:null}),t().setLifecycleFromWriteResult(h,"save",i==null?void 0:i.fallbackCommand),await t().fetchConfig();else{const g=h.error??"config set failed";e({error:g}),g.includes("config changed")&&await t().fetchConfig()}return h}catch(u){const f=String(u);return e({error:f}),{ok:!1,config:s,error:f}}},applyConfig:async(a,i)=>{const s=t().config,o=t().hash??void 0;if(!s)return{ok:!1,config:{},error:"config not loaded"};try{const u=await Fe(),f=a(structuredClone(s)),h=await u.configApply(JSON.stringify(f),o,i);if(h.ok)e({config:h.config,error:null}),t().setLifecycleFromWriteResult(h,"apply"),await t().fetchConfig();else{const g=h.error??"config apply failed";e({error:g}),g.includes("config changed")&&await t().fetchConfig()}return h}catch(u){const f=String(u);return e({error:f}),{ok:!1,config:s,error:f}}},patchConfig:async a=>{var s;const{hash:i}=t();try{const o=await Fe(),u=JSON.stringify(a),f=await o.configPatch(u,i??void 0);if(f.ok)e({config:f.config,error:null}),(s=f.restart)!=null&&s.scheduled&&t().setRestartPending(f.restart.delayMs),await t().fetchConfig();else{const h=f.error??"config patch failed";e({error:h}),h.includes("config changed")&&await t().fetchConfig()}return f}catch(o){const u=String(o);return e({error:u}),{ok:!1,config:t().config??{},error:u}}},fetchSchema:async()=>{try{const i=await(await Fe()).configSchema();e({schemaHints:i})}catch{}},fetchStatus:async()=>{e({statusLoading:!0,statusError:null});try{const i=await(await Fe()).statusSummary();e({status:i,statusLoading:!1})}catch(a){e({statusLoading:!1,statusError:String(a)})}},fetchCatalogModels:async()=>{e({catalogLoading:!0});try{const i=await(await Fe()).modelsList();e({catalogModels:i,catalogLoading:!1})}catch{e({catalogLoading:!1})}},runUpdate:async a=>{e({updateLoading:!0,updateResult:null});try{const s=await(await Fe()).updateRun(a);return e({updateResult:s,updateLoading:!1}),s}catch(i){const s={ok:!1,result:{status:"error",mode:"unknown",reason:String(i),steps:[],durationMs:0},restart:null};return e({updateResult:s,updateLoading:!1}),s}}})),eO=2500;function Ck(){const{t:e}=le("console"),t=Ne(C=>C.lifecycleState),a=Ne(C=>C.clearLifecycle),i=Ne(C=>C.setLifecycleDisconnected),s=Ne(C=>C.setLifecycleReconnecting),o=Ne(C=>C.setLifecycleComplete),u=se(C=>C.connectionStatus),[f,h]=j.useState(null),[g,x]=j.useState(!1);j.useEffect(()=>{if(!(t!=null&&t.estimatedDelayMs)){h(null);return}const C=()=>{const S=Math.max(0,t.estimatedDelayMs-(Date.now()-t.startedAt));h(Math.ceil(S/1e3))};C();const E=setInterval(C,1e3);return()=>clearInterval(E)},[t]),j.useEffect(()=>{if(t){if(t.status==="apply-restarting"){u==="disconnected"||u==="error"?i():u==="connecting"||u==="reconnecting"?s():u==="connected"&&o();return}(t.status==="disconnected"||t.status==="reconnecting")&&(u==="connected"?o():(u==="connecting"||u==="reconnecting")&&t.status!=="reconnecting"?s():(u==="disconnected"||u==="error")&&t.status!=="disconnected"&&i())}},[u,t,o,i,s]),j.useEffect(()=>{if(t&&(t.status==="complete"||t.status==="effective-now"||t.status==="saved-hot-reload")){const C=setTimeout(()=>a(),eO);return()=>clearTimeout(C)}},[a,t]);const p=j.useMemo(()=>{if(!t)return null;const C=t.messageKey??tO(t.status),E=t.status==="apply-restarting"?e(C,{seconds:f??0}):e(C);switch(t.status){case"effective-now":case"saved-hot-reload":case"complete":return{icon:Ri,className:"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-900/20 dark:text-green-300",message:E,animate:""};case"saved-restart-required":case"saved-cli-restart-required":return{icon:Nn,className:"border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",message:E,animate:""};case"apply-restarting":case"disconnected":case"reconnecting":return{icon:Dt,className:"border-blue-200 bg-blue-50 text-blue-800 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-300",message:E,animate:"animate-spin"};default:return null}},[f,t,e]);if(!t||!p)return null;const b=p.icon,v=!!t.command,w=async()=>{!t.command||!navigator.clipboard||(await navigator.clipboard.writeText(t.command),x(!0),setTimeout(()=>x(!1),1500))};return c.jsx("div",{className:`border-b px-4 py-3 text-sm ${p.className}`,children:c.jsxs("div",{className:"mx-auto flex max-w-7xl items-start gap-3",children:[c.jsx(b,{className:`mt-0.5 h-4 w-4 shrink-0 ${p.animate}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"font-medium",children:p.message}),v&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border border-current/20 bg-black/5 px-3 py-1.5 font-mono text-xs dark:bg-white/5",children:[c.jsx(Yv,{className:"h-3.5 w-3.5"}),t.command]}),c.jsxs("button",{type:"button",onClick:()=>void w(),className:"inline-flex items-center gap-1 rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5",children:[c.jsx(Zh,{className:"h-3.5 w-3.5"}),e(g?"configLifecycle.copiedCommand":"configLifecycle.copyCommand")]})]})]})]})})}function tO(e){switch(e){case"effective-now":return"configLifecycle.effectiveNow";case"saved-hot-reload":return"configLifecycle.savedHotReload";case"saved-restart-required":return"configLifecycle.savedRestartRequired";case"saved-cli-restart-required":return"configLifecycle.savedCliRestartRequired";case"apply-restarting":return"configLifecycle.applyRestarting";case"disconnected":return"configLifecycle.disconnected";case"reconnecting":return"configLifecycle.reconnecting";case"complete":return"configLifecycle.complete"}}const nO=5,Pc=In(e=>({toasts:[],addToast:t=>{const a=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,i={id:a,type:t.type,title:t.title,message:t.message,detail:t.detail,duration:t.duration??5e3,createdAt:Date.now()};return e(s=>{const o=[...s.toasts,i];return o.length>nO&&o.shift(),{toasts:o}}),a},removeToast:t=>e(a=>({toasts:a.toasts.filter(i=>i.id!==t)})),clearAll:()=>e({toasts:[]})}));function Ob(e,t){return Pc.getState().addToast({type:"success",title:e,message:t})}function Qo(e,t,a){return Pc.getState().addToast({type:"error",title:e,message:t,detail:a,duration:0})}const aO={success:Ri,error:Xh,warning:Li,info:Rc},rO={success:{border:"border-green-300 dark:border-green-700",icon:"text-green-500",bg:"bg-green-50 dark:bg-green-900/20"},error:{border:"border-red-300 dark:border-red-700",icon:"text-red-500",bg:"bg-red-50 dark:bg-red-900/20"},warning:{border:"border-yellow-300 dark:border-yellow-700",icon:"text-yellow-500",bg:"bg-yellow-50 dark:bg-yellow-900/20"},info:{border:"border-blue-300 dark:border-blue-700",icon:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20"}};function iO({toast:e}){const{t}=le("console"),a=Pc(b=>b.removeToast),[i,s]=j.useState(!1),[o,u]=j.useState(!1),f=j.useRef(null),h=j.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),g=j.useCallback(()=>{h(),e.duration>0&&!i&&(f.current=setTimeout(()=>a(e.id),e.duration))},[e.duration,e.id,i,a,h]);j.useEffect(()=>(o?h():g(),h),[o,g,h]);const x=aO[e.type],p=rO[e.type];return c.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`pointer-events-auto w-80 rounded-xl border ${p.border} ${p.bg} p-3 shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:c.jsxs("div",{className:"flex items-start gap-2.5",children:[c.jsx(x,{className:`mt-0.5 h-4 w-4 shrink-0 ${p.icon}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.title}),e.message&&c.jsx("p",{className:"mt-0.5 text-xs text-gray-600 dark:text-gray-400",children:e.message}),e.detail&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>s(!i),className:"mt-1 flex items-center gap-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",children:[i?c.jsx(Qh,{className:"h-3 w-3"}):c.jsx(Un,{className:"h-3 w-3"}),t(i?"toast.hideDetail":"toast.showDetail")]}),i&&c.jsx("pre",{className:"mt-1.5 max-h-[200px] overflow-auto rounded-lg bg-gray-900 p-2 text-xs text-gray-200 dark:bg-gray-800",children:e.detail})]})]}),c.jsx("button",{type:"button",onClick:()=>a(e.id),className:"shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:c.jsx(Sn,{className:"h-3.5 w-3.5"})})]})})}function sO(){const e=Pc(t=>t.toasts);return e.length===0?null:c.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-50 flex flex-col gap-2",children:e.map(t=>c.jsx(iO,{toast:t},t.id))})}const Mi=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#ec4899"];function Eg(e){let t=0;for(let a=0;a<e.length;a++){const i=e.charCodeAt(a);t=(t<<5)-t+i|0}return Math.abs(t)}function lO(e){const t=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,i=parseInt(e.slice(5,7),16)/255;return .299*t+.587*a+.114*i}function oO(e,t){const a=Eg(e),i=Mi[a%Mi.length],s=lO(i)>.5?"#000000":"#ffffff",u=(t??e).charAt(0).toUpperCase()||"?";return{backgroundColor:i,textColor:s,initial:u}}function Iz(e){const t=Eg(e);return Mi[t%Mi.length]}const Lb=["round","square","oval"],zb=["short","spiky","side-part","curly","buzz"],Hb=["dot","line","wide"],Ub=["#fde2c8","#f5c5a0","#d4956b","#a0714f","#6b4226","#ffe0bd"],Ib=["#2c1b0e","#5a3214","#c2884a","#e8c068"];function Nk(e){const t=Eg(e),a=(i,s)=>(t>>>i)%s;return{faceShape:Lb[a(0,Lb.length)],hairStyle:zb[a(3,zb.length)],eyeStyle:Hb[a(6,Hb.length)],skinColor:Ub[a(8,Ub.length)],hairColor:Ib[a(11,Ib.length)],shirtColor:Mi[t%Mi.length]}}function cO({shape:e,color:t}){switch(e){case"round":return c.jsx("circle",{cx:"24",cy:"20",r:"12",fill:t});case"square":return c.jsx("rect",{x:"12",y:"8",width:"24",height:"24",rx:"4",fill:t});case"oval":return c.jsx("ellipse",{cx:"24",cy:"20",rx:"11",ry:"14",fill:t})}}function uO({style:e,color:t}){switch(e){case"short":return c.jsx("path",{d:"M12 16 Q12 6 24 6 Q36 6 36 16 L36 12 Q36 4 24 4 Q12 4 12 12 Z",fill:t});case"spiky":return c.jsx("path",{d:"M14 14 L16 4 L20 12 L24 2 L28 12 L32 4 L34 14 Q34 6 24 6 Q14 6 14 14 Z",fill:t});case"side-part":return c.jsx("path",{d:"M12 16 Q12 5 24 5 Q36 5 36 16 L36 11 Q36 3 24 3 Q14 3 10 10 Z",fill:t});case"curly":return c.jsx("path",{d:"M12 18 Q10 8 16 5 Q20 2 24 4 Q28 2 32 5 Q38 8 36 18 L36 12 Q36 4 24 4 Q12 4 12 12 Z",fill:t});case"buzz":return c.jsx("path",{d:"M13 15 Q13 6 24 6 Q35 6 35 15 L35 13 Q35 5 24 5 Q13 5 13 13 Z",fill:t})}}function dO({style:e}){switch(e){case"dot":return c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"19",cy:"19",r:"1.5",fill:"#333"}),c.jsx("circle",{cx:"29",cy:"19",r:"1.5",fill:"#333"})]});case"line":return c.jsxs(c.Fragment,{children:[c.jsx("line",{x1:"17",y1:"19",x2:"21",y2:"19",stroke:"#333",strokeWidth:"1.5",strokeLinecap:"round"}),c.jsx("line",{x1:"27",y1:"19",x2:"31",y2:"19",stroke:"#333",strokeWidth:"1.5",strokeLinecap:"round"})]});case"wide":return c.jsxs(c.Fragment,{children:[c.jsx("ellipse",{cx:"19",cy:"19",rx:"2.5",ry:"2",fill:"white"}),c.jsx("circle",{cx:"19",cy:"19",r:"1.2",fill:"#333"}),c.jsx("ellipse",{cx:"29",cy:"19",rx:"2.5",ry:"2",fill:"white"}),c.jsx("circle",{cx:"29",cy:"19",r:"1.2",fill:"#333"})]})}}function Ak({agentId:e,size:t=40,className:a}){const i=Nk(e);return c.jsxs("svg",{viewBox:"0 0 48 48",width:t,height:t,className:a,style:{borderRadius:"50%",overflow:"hidden"},children:[c.jsx("rect",{width:"48",height:"48",fill:i.shirtColor,rx:"24"}),c.jsx("path",{d:"M8 42 Q8 34 24 34 Q40 34 40 42 L40 48 L8 48 Z",fill:i.shirtColor}),c.jsx(cO,{shape:i.faceShape,color:i.skinColor}),c.jsx(uO,{style:i.hairStyle,color:i.hairColor}),c.jsx(dO,{style:i.eyeStyle}),c.jsx("path",{d:"M21 24 Q24 26 27 24",stroke:"#333",strokeWidth:"0.8",fill:"none",strokeLinecap:"round"})]})}function fO(){const{t:e}=le("panels"),t=se(o=>o.selectedAgentId),a=se(o=>o.agents),i=se(o=>o.selectAgent);if(!t)return null;const s=a.get(t);return s?c.jsxs("div",{className:"px-3 py-2",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(Ak,{agentId:s.id,size:32}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-sm font-medium text-gray-800 dark:text-gray-200",children:s.name}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:pl[s.status]}}),c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:e(`common:agent.statusLabels.${s.status}`)})]})]}),c.jsx("button",{onClick:()=>i(null),className:"shrink-0 text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",title:e("agentDetail.deselect"),children:"✕"})]}),s.currentTool&&c.jsx("div",{className:"mb-2 rounded bg-orange-50 px-2 py-1.5 text-xs dark:bg-orange-950/50",children:c.jsxs("div",{className:"text-orange-600 dark:text-orange-400",children:["🔧 ",s.currentTool.name]})}),s.speechBubble&&c.jsx("div",{className:"mb-2 rounded bg-white px-2 py-1.5 text-xs leading-relaxed text-gray-700 shadow-sm dark:bg-gray-800 dark:text-gray-300",children:c.jsx(jg,{children:s.speechBubble.text})}),s.toolCallHistory.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("div",{className:"mb-1 text-xs font-medium text-gray-400 dark:text-gray-500",children:e("agentDetail.toolCallHistory")}),s.toolCallHistory.map((o,u)=>c.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 py-1 text-xs text-gray-500 dark:border-gray-700 dark:text-gray-400",children:[c.jsx("span",{children:o.name}),c.jsx("span",{className:"text-gray-400",children:new Date(o.timestamp).toLocaleTimeString()})]},`${o.name}-${o.timestamp}-${u}`))]})]}):null}const hO={lifecycle:"●",tool:"🔧",assistant:"💬",error:"⚠"};function gO(){const{t:e}=le("panels"),t=se(g=>g.eventHistory),a=se(g=>g.selectAgent),i=j.useRef(null),[s,o]=j.useState(!0),u=j.useRef(0),f=t.slice(-50);j.useEffect(()=>{s&&i.current&&t.length>u.current&&(i.current.scrollTop=i.current.scrollHeight),u.current=t.length},[t.length,s]);const h=()=>{if(!i.current)return;const{scrollTop:g,scrollHeight:x,clientHeight:p}=i.current,b=x-g-p<30;o(b)};return c.jsxs("div",{ref:i,onScroll:h,className:"flex-1 overflow-y-auto",children:[!s&&t.length>0&&c.jsx("div",{className:"sticky top-0 z-10 flex justify-end bg-white/80 px-2 py-0.5 backdrop-blur-sm dark:bg-gray-900/80",children:c.jsx("button",{onClick:()=>{o(!0),i.current&&(i.current.scrollTop=i.current.scrollHeight)},className:"rounded bg-blue-600 px-1.5 py-0.5 text-[10px] text-white",children:e("eventTimeline.newEvents")})}),f.map((g,x)=>c.jsxs("button",{onClick:()=>a(g.agentId),className:"flex w-full items-start gap-1.5 border-b border-gray-100 px-3 py-1 text-left text-xs hover:bg-gray-50 dark:border-gray-800 dark:hover:bg-gray-800",children:[c.jsx("span",{className:"mt-0.5 shrink-0 text-gray-400",children:new Date(g.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}),c.jsx("span",{className:"shrink-0",children:hO[g.stream]??"·"}),c.jsx("span",{className:"shrink-0 font-medium",style:{color:pl[g.stream==="error"?"error":"thinking"]},children:g.agentName}),c.jsx("span",{className:"min-w-0 truncate text-gray-500 dark:text-gray-400",children:g.summary})]},`${g.timestamp}-${g.agentId}-${x}`)),f.length===0&&c.jsx("div",{className:"py-3 text-center text-xs text-gray-400 dark:text-gray-500",children:e("common:empty.noEvents")})]})}const mO=j.lazy(()=>fl(()=>import("./TokenLineChart-odcmdCAg.js"),__vite__mapDeps([0,1])).then(e=>({default:e.TokenLineChart}))),pO=j.lazy(()=>fl(()=>import("./CostPieChart-DmUzkXKt.js"),__vite__mapDeps([2,1])).then(e=>({default:e.CostPieChart}))),yO=j.lazy(()=>fl(()=>import("./NetworkGraph-C0F11y9I.js"),[]).then(e=>({default:e.NetworkGraph}))),xO=j.lazy(()=>fl(()=>import("./ActivityHeatmap-CnKWcUWF.js"),[]).then(e=>({default:e.ActivityHeatmap})));function Xo(){return c.jsx("div",{className:"flex min-h-[140px] items-center justify-center",children:c.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"})})}function bO(){const{t:e}=le("panels"),[t,a]=j.useState("overview"),i=se(u=>u.globalMetrics),s=[{id:"overview",label:e("metrics.tabs.overview")},{id:"trend",label:e("metrics.tabs.trend")},{id:"topology",label:e("metrics.tabs.topology")},{id:"activity",label:e("metrics.tabs.activity")}],o=[{label:e("metrics.activeAgents"),value:`${i.activeAgents}/${i.totalAgents}`,color:"#3b82f6"},{label:e("metrics.totalTokens"),value:vO(i.totalTokens),color:"#22c55e"},{label:e("metrics.collaboration"),value:`${Math.round(i.collaborationHeat)}%`,color:"#f97316"},{label:e("metrics.tokenRate"),value:`${i.tokenRate.toFixed(0)}${e("metrics.tokenRateUnit")}`,color:"#a855f7"}];return c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"grid grid-cols-4 gap-1 p-2",children:o.map(u=>c.jsxs("div",{className:"rounded-lg bg-gray-50 px-1 py-1 text-center dark:bg-gray-800",children:[c.jsx("div",{className:"text-xs font-bold leading-tight",style:{color:u.color},children:u.value}),c.jsx("div",{className:"text-[8px] text-gray-500 dark:text-gray-400",children:u.label})]},u.label))}),c.jsx("div",{className:"flex gap-1 border-t border-gray-100 px-2 py-1 dark:border-gray-800",children:s.map(u=>c.jsx("button",{type:"button",onClick:()=>a(u.id),className:`rounded px-2 py-0.5 text-[10px] ${t===u.id?"bg-gray-200 font-medium dark:bg-gray-700 dark:text-gray-200":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"}`,children:u.label},u.id))}),c.jsxs("div",{className:"p-2",children:[t==="overview"&&c.jsx(j.Suspense,{fallback:c.jsx(Xo,{}),children:c.jsx(pO,{})}),t==="trend"&&c.jsx(j.Suspense,{fallback:c.jsx(Xo,{}),children:c.jsx(mO,{})}),t==="topology"&&c.jsx(j.Suspense,{fallback:c.jsx(Xo,{}),children:c.jsx(yO,{})}),t==="activity"&&c.jsx(j.Suspense,{fallback:c.jsx(Xo,{}),children:c.jsx(xO,{})})]})]})}function vO(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function kO({agentId:e,agentName:t,size:a=32}){const{backgroundColor:i,textColor:s,initial:o}=oO(e,t);return c.jsx("div",{className:"flex shrink-0 items-center justify-center rounded-full font-bold",style:{width:a,height:a,backgroundColor:i,color:s,fontSize:a*.45},children:o})}function wO(){const{t:e}=le(),t=se(s=>s.agents),a=se(s=>s.selectAgent),i=Array.from(t.values()).filter(s=>s.isSubAgent);return i.length===0?c.jsx("div",{className:"py-2 text-center text-xs text-gray-400 dark:text-gray-500",children:e("empty.noSubAgents")}):c.jsx("div",{children:i.map(s=>{const o=s.parentAgentId?t.get(s.parentAgentId):null,u=SO(s.lastActiveAt,e);return c.jsxs("button",{onClick:()=>a(s.id),className:"flex w-full items-start gap-2 border-b border-gray-50 px-3 py-2 text-left transition-colors hover:bg-blue-50 dark:border-gray-800 dark:hover:bg-blue-950",children:[c.jsx(kO,{agentId:s.id,agentName:s.name,size:24}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"truncate text-xs font-medium text-gray-800 dark:text-gray-200",children:s.name}),c.jsx("span",{className:"inline-flex items-center rounded px-1 py-0.5 text-[9px] font-medium text-white",style:{backgroundColor:pl[s.status]},children:e(`agent.statusLabels.${s.status}`)})]}),o&&c.jsxs("span",{role:"link",tabIndex:0,onClick:f=>{f.stopPropagation(),a(o.id)},onKeyDown:f=>{f.key==="Enter"&&(f.stopPropagation(),a(o.id))},className:"cursor-pointer text-[10px] text-blue-500 hover:underline",children:["← ",o.name]}),s.speechBubble&&c.jsx("div",{className:"mt-0.5 truncate text-[10px] text-gray-400",children:s.speechBubble.text.slice(0,80)}),c.jsx("div",{className:"text-[10px] text-gray-400",children:u})]})]},s.id)})})}function SO(e,t){const a=Math.max(0,Math.floor((Date.now()-e)/1e3));if(a<60)return t("time.running",{seconds:a});const i=Math.floor(a/60),s=a%60;return t("time.runningMinutes",{minutes:i,seconds:s})}function Is({title:e,collapsed:t,onToggle:a,height:i,onHeightChange:s,minHeight:o=60,maxHeight:u=600,headerExtra:f,children:h,flex:g=!1,badge:x}){const p=j.useRef(null),b=j.useRef(null),v=t?0:i??o,w=j.useCallback(C=>{var D;if(t)return;C.preventDefault();const E=((D=p.current)==null?void 0:D.offsetHeight)??v;b.current={startY:C.clientY,startHeight:E};const S=U=>{if(!b.current)return;const z=U.clientY-b.current.startY,L=Math.max(o,Math.min(u,b.current.startHeight+z));s(L)},N=()=>{b.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",N),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="ns-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",S),document.addEventListener("mouseup",N)},[t,v,o,u,s]);return j.useEffect(()=>()=>{document.body.style.cursor="",document.body.style.userSelect=""},[]),c.jsxs("div",{className:`flex flex-col ${g&&!t?"min-h-0 flex-1":""}`,style:!t&&!g?{flexShrink:0}:void 0,children:[c.jsxs("button",{type:"button",onClick:a,className:"flex h-6 w-full items-center gap-1 border-b border-gray-200 bg-gray-50 px-2 text-[11px] font-semibold uppercase tracking-wide text-gray-600 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/70 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx("span",{className:"inline-block text-[9px] transition-transform duration-150",style:{transform:t?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),c.jsx("span",{className:"select-none",children:e}),x!==void 0&&c.jsx("span",{className:"ml-1 rounded-sm bg-gray-200 px-1 text-[10px] font-normal text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:x}),f&&c.jsx("span",{className:"ml-auto flex items-center",onClick:C=>C.stopPropagation(),children:f})]}),!t&&c.jsx("div",{ref:p,className:`overflow-y-auto overflow-x-hidden ${g?"min-h-0 flex-1":""}`,style:g?{minHeight:o}:{height:v},children:h}),!t&&c.jsx("div",{onMouseDown:w,className:"group relative z-10 h-1 shrink-0 cursor-ns-resize",children:c.jsx("div",{className:"absolute inset-x-0 -top-0.5 bottom-0 transition-colors group-hover:bg-blue-500/30 group-active:bg-blue-500/50"})})]})}const Ek="openclaw-sidebar-layout",Bb={metrics:{collapsed:!0,height:null},agents:{collapsed:!1,height:null},subAgents:{collapsed:!1,height:null},detail:{collapsed:!1,height:null},timeline:{collapsed:!1,height:null}};function jO(){try{const e=localStorage.getItem(Ek);if(e){const t=JSON.parse(e);return{...Bb,...t}}}catch{}return{...Bb}}function CO(e){try{localStorage.setItem(Ek,JSON.stringify(e))}catch{}}function NO(){const[e,t]=j.useState(jO),a=j.useRef(e);a.current=e,j.useEffect(()=>{CO(e)},[e]);const i=j.useCallback(u=>{t(f=>{var h;return{...f,[u]:{...f[u],collapsed:!((h=f[u])!=null&&h.collapsed)}}})},[]),s=j.useCallback((u,f)=>{t(h=>({...h,[u]:{...h[u],height:f}}))},[]),o=j.useCallback(u=>e[u]??{collapsed:!1,height:null},[e]);return{layout:e,toggleSection:i,setSectionHeight:s,getSection:o}}function qb(){const{t:e}=le("layout"),t=se(z=>z.agents),a=se(z=>z.selectedAgentId),i=se(z=>z.selectAgent),s=se(z=>z.sidebarCollapsed),o=se(z=>z.setSidebarCollapsed),{getSection:u,toggleSection:f,setSectionHeight:h}=NO(),[g,x]=j.useState(""),[p,b]=j.useState("all"),v=j.useMemo(()=>{let z=Array.from(t.values());if(g){const L=g.toLowerCase();z=z.filter(G=>G.name.toLowerCase().includes(L))}return p==="active"?z=z.filter(L=>L.status!=="idle"&&L.status!=="offline"):p==="idle"?z=z.filter(L=>L.status==="idle"):p==="error"&&(z=z.filter(L=>L.status==="error")),z},[t,g,p]),w=j.useMemo(()=>Array.from(t.values()).filter(z=>z.isSubAgent),[t]),C=[{key:"all",label:e("sidebar.filters.all")},{key:"active",label:e("sidebar.filters.active")},{key:"idle",label:e("sidebar.filters.idle")},{key:"error",label:e("sidebar.filters.error")}];if(s)return c.jsx("aside",{className:"flex w-12 flex-col items-center border-l border-gray-200 bg-white py-3 dark:border-gray-700 dark:bg-gray-900",children:c.jsx("button",{onClick:()=>o(!1),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",title:e("sidebar.expand"),children:"◀"})});const E=u("metrics"),S=u("agents"),N=u("subAgents"),D=u("detail"),U=u("timeline");return c.jsxs("aside",{className:"flex w-80 flex-col border-l border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"flex h-8 shrink-0 items-center justify-between border-b border-gray-200 px-3 dark:border-gray-700",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:e("sidebar.agents")}),c.jsx("button",{onClick:()=>o(!0),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",title:e("sidebar.collapse"),children:"▶"})]}),c.jsx(Is,{id:"metrics",title:e("sidebar.metricsTitle"),collapsed:E.collapsed,onToggle:()=>f("metrics"),height:E.height,onHeightChange:z=>h("metrics",z),minHeight:120,maxHeight:400,children:c.jsx(bO,{})}),c.jsxs(Is,{id:"agents",title:e("sidebar.agentList"),collapsed:S.collapsed,onToggle:()=>f("agents"),height:S.height,onHeightChange:z=>h("agents",z),minHeight:100,maxHeight:600,flex:!0,badge:v.length,headerExtra:c.jsx(AO,{filter:p,filterTags:C}),children:[c.jsxs("div",{className:"border-b border-gray-100 px-3 py-1.5 dark:border-gray-800",children:[c.jsx("input",{type:"text",placeholder:e("sidebar.searchPlaceholder"),value:g,onChange:z=>x(z.target.value),className:"w-full rounded border border-gray-200 bg-gray-50 px-2 py-1 text-sm text-gray-800 placeholder-gray-400 outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:placeholder-gray-500"}),c.jsx("div",{className:"mt-1.5 flex gap-1",children:C.map(z=>c.jsx("button",{onClick:()=>b(z.key),className:`rounded px-2 py-0.5 text-xs transition-colors ${p===z.key?"bg-blue-600 text-white":"bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:z.label},z.key))})]}),c.jsxs("div",{children:[v.map(z=>c.jsxs("button",{onClick:()=>i(z.id),className:`flex w-full items-center gap-3 border-b border-gray-50 px-3 py-2 text-left transition-colors hover:bg-gray-50 dark:border-gray-800 dark:hover:bg-gray-800 ${a===z.id?"bg-blue-50 dark:bg-blue-950":""}`,children:[c.jsx(Ak,{agentId:z.id,size:24}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-xs font-medium text-gray-800 dark:text-gray-200",children:z.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:pl[z.status]}}),c.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400",children:e(`common:agent.statusLabels.${z.status}`)}),c.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-gray-500",children:["· ",EO(e,z.lastActiveAt)]})]})]})]},z.id)),v.length===0&&c.jsx("div",{className:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500",children:e("common:empty.noMatchingAgents")})]})]}),w.length>0&&c.jsx(Is,{id:"subAgents",title:e("sidebar.subAgents"),collapsed:N.collapsed,onToggle:()=>f("subAgents"),height:N.height,onHeightChange:z=>h("subAgents",z),minHeight:60,maxHeight:300,badge:w.length,children:c.jsx(wO,{})}),a&&c.jsx(Is,{id:"detail",title:e("sidebar.agentDetail"),collapsed:D.collapsed,onToggle:()=>f("detail"),height:D.height,onHeightChange:z=>h("detail",z),minHeight:80,maxHeight:400,children:c.jsx(fO,{})}),c.jsx(Is,{id:"timeline",title:e("sidebar.eventTimeline"),collapsed:U.collapsed,onToggle:()=>f("timeline"),height:U.height,onHeightChange:z=>h("timeline",z),minHeight:60,maxHeight:400,children:c.jsx(gO,{})})]})}function AO({filter:e,filterTags:t}){var i;if(e==="all")return null;const a=((i=t.find(s=>s.key===e))==null?void 0:i.label)??e;return c.jsx("span",{className:"rounded bg-blue-100 px-1 text-[9px] text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",children:a})}function EO(e,t){const a=Math.max(0,Math.floor((Date.now()-t)/1e3));return a<5?e("common:time.justNow"):a<60?e("common:time.secondsAgo",{count:a}):a<3600?e("common:time.minutesAgo",{count:Math.floor(a/60)}):e("common:time.hoursAgo",{count:Math.floor(a/3600)})}function TO(){var u;const{i18n:e,t}=le("layout"),a=(u=e.language)==null?void 0:u.startsWith("zh"),i=a?"中文":"EN",s=t(a?"topbar.language.switchToEn":"topbar.language.switchToZh"),o=()=>{e.changeLanguage(a?"en":"zh")};return c.jsx("button",{onClick:o,"aria-label":s,title:s,className:"ml-1 flex h-7 w-7 items-center justify-center rounded-md text-xs font-semibold transition-colors hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400",children:i})}function MO(){try{const e=document.createElement("canvas");return(e.getContext("webgl2")??e.getContext("webgl"))!==null}catch{return!1}}const DO="2026.3.8";function _O(e){return{connecting:{color:"#eab308",pulse:!0,label:e("common:status.connecting")},connected:{color:"#22c55e",pulse:!1,label:e("common:status.connected")},reconnecting:{color:"#f97316",pulse:!0,label:e("common:status.reconnecting")},disconnected:{color:"#6b7280",pulse:!1,label:e("common:status.disconnected")},error:{color:"#ef4444",pulse:!1,label:e("common:status.error")}}}function Tk({isMobile:e=!1}){const{t}=le("layout"),a=se(v=>v.connectionStatus),i=se(v=>v.connectionError),s=se(v=>v.globalMetrics),o=se(v=>v.viewMode),u=se(v=>v.setViewMode),f=se(v=>v.theme),h=se(v=>v.setTheme),g=se(v=>v.currentPage),x=j.useMemo(()=>MO(),[]),p=_O(t)[a],b=g==="office";return c.jsxs("header",{className:"flex h-12 shrink-0 items-center border-b border-gray-200 bg-white px-4 shadow-sm dark:border-gray-700 dark:bg-gray-900",children:[b?c.jsx(RO,{viewMode:o,setViewMode:u,metrics:s,webglAvailable:x,isMobile:e}):c.jsx(OO,{currentPage:g}),c.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[c.jsx(LO,{currentPage:g}),c.jsx(UO,{theme:f,setTheme:h}),c.jsx(TO,{}),c.jsx(zO,{statusCfg:p,connectionError:i,connectionStatus:a})]})]})}function RO({viewMode:e,setViewMode:t,metrics:a,webglAvailable:i,isMobile:s}){const{t:o}=le("layout");return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h1",{className:"text-lg font-semibold tracking-tight text-gray-800 dark:text-gray-100",children:"OpenClaw Office"}),c.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-xs text-gray-500 dark:bg-gray-800 dark:text-gray-400",children:["v",DO]})]}),c.jsx(HO,{viewMode:e,setViewMode:t,webglAvailable:i,isMobile:s}),c.jsxs("div",{className:"mx-8 flex items-center gap-6 text-sm text-gray-500 dark:text-gray-400",children:[c.jsxs("span",{children:[o("topbar.activeCountText")," ",c.jsxs("strong",{className:"text-gray-800 dark:text-gray-200",children:[a.activeAgents,"/",a.totalAgents]})]}),c.jsxs("span",{children:[o("topbar.tokensLabel")," ",c.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:IO(a.totalTokens)})]})]})]})}function OO({currentPage:e}){const{t}=le("layout");return c.jsx("div",{className:"flex items-center gap-3",children:c.jsx("h1",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:t(`topbar.pageTitles.${e}`,{defaultValue:t("topbar.pageTitles.fallback")})})})}function LO({currentPage:e}){const{t}=le("layout"),a=ul(),i=e!=="office";return c.jsx("button",{onClick:()=>a(i?"/":"/dashboard"),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors ${i?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"}`,children:i?c.jsxs(c.Fragment,{children:[c.jsx(Bv,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:t("topbar.office")})]}):c.jsxs(c.Fragment,{children:[c.jsx(p5,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:t("topbar.console")})]})})}function zO({statusCfg:e,connectionError:t,connectionStatus:a}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:e.color,animation:e.pulse?"pulse 1.5s ease-in-out infinite":"none"}}),c.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t&&a==="error"?t:e.label})]})}function HO({viewMode:e,setViewMode:t,webglAvailable:a,isMobile:i}){const{t:s}=le("layout"),o=[{key:"2d",label:"2D"},{key:"3d",label:"3D"}];return c.jsx("div",{className:"ml-6 flex items-center rounded-md bg-gray-100 p-0.5 dark:bg-gray-800",children:o.map(({key:u,label:f})=>{const h=e===u,g=u==="3d"&&(!a||i),x=g?s(i?"topbar.viewMode.mobileNotSupported":"topbar.viewMode.webglNotSupported"):s("topbar.viewMode.switchTo",{mode:f});return c.jsx("button",{onClick:()=>!g&&t(u),disabled:g,title:x,className:`rounded px-3 py-1 text-xs font-medium transition-colors ${h?"bg-blue-600 text-white shadow-sm":g?"cursor-not-allowed text-gray-300 dark:text-gray-600":"text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"}`,children:f},u)})})}function UO({theme:e,setTheme:t}){const{t:a}=le("layout");return c.jsx("button",{onClick:()=>t(e==="light"?"dark":"light"),title:a(e==="light"?"topbar.theme.switchToDark":"topbar.theme.switchToLight"),className:"ml-2 flex h-7 w-7 items-center justify-center rounded-md text-base transition-colors hover:bg-gray-200 dark:hover:bg-gray-700",children:e==="light"?"🌙":"☀️"})}function IO(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function BO({children:e,wsClient:t,isMobile:a=!1}){const{t:i}=le("layout"),s=se(v=>v.sidebarCollapsed),o=se(v=>v.setSidebarCollapsed),u=Qe(v=>v.initEventListeners),f=Qe(v=>v.setTargetAgent),h=se(v=>v.connectionStatus),g=se(v=>v.agents),x=se(v=>v.selectedAgentId),p=se(v=>v.initEventHistory);j.useEffect(()=>{a&&o(!0)},[a,o]),j.useEffect(()=>{p()},[p]),j.useEffect(()=>{if(h!=="connected")return;const v=(t==null?void 0:t.current)??null;return v?u(v):void 0},[h,t,u]),j.useEffect(()=>{if(h==="connected"&&g.size>0){const v=Qe.getState().targetAgentId,w=Array.from(g.values()).filter(E=>E.confirmed&&!E.isPlaceholder&&!E.isSubAgent);if(w.length===0)return;if(!(v!=null&&w.some(E=>E.id===v))){const E=w.find(S=>S.id==="main")??w[0];f(E.id)}}},[h,g,f]),j.useEffect(()=>{if(!x)return;const v=g.get(x);if(!v||!(v.confirmed&&!v.isPlaceholder&&!v.isSubAgent))return;Qe.getState().targetAgentId!==x&&f(x)},[x,g,f]);const b=e??c.jsx(Sv,{});return c.jsxs("div",{className:"flex h-screen w-screen flex-col bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100",children:[c.jsx(Ck,{}),c.jsx(Tk,{isMobile:a}),c.jsx(sO,{}),c.jsxs("div",{className:"relative flex flex-1 overflow-hidden",children:[c.jsxs("main",{className:"relative flex flex-1 flex-col overflow-hidden",children:[c.jsx("div",{className:"relative flex-1 overflow-hidden",children:b}),c.jsx(JR,{}),c.jsx(WR,{})]}),a?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>o(!s),className:"fixed bottom-0 left-1/2 z-20 flex h-10 w-full max-w-xs -translate-x-1/2 items-center justify-center border-t border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-900","aria-label":i(s?"sidebar.expandSidebar":"sidebar.collapseSidebar"),children:c.jsx("div",{className:"h-1 w-12 rounded-full bg-gray-300 dark:bg-gray-600"})}),!s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"button",tabIndex:0,onClick:()=>o(!0),onKeyDown:v=>v.key==="Escape"&&o(!0),className:"fixed inset-0 z-30 bg-black/30","aria-label":i("sidebar.closeSidebar")}),c.jsx("aside",{className:"fixed inset-x-0 bottom-10 top-12 z-40 overflow-hidden rounded-t-xl border-t border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-900",children:c.jsx(qb,{})})]})]}):c.jsx(qb,{})]})]})}function qO(){const{t:e}=le("layout"),t=Hn(),a=ul(),i=[{path:"/dashboard",labelKey:"consoleNav.dashboard",icon:u5},{path:"/agents",labelKey:"consoleNav.agents",icon:qv},{path:"/channels",labelKey:"consoleNav.channels",icon:hl},{path:"/skills",labelKey:"consoleNav.skills",icon:Pv},{path:"/cron",labelKey:"consoleNav.cron",icon:Oi},{path:"/settings",labelKey:"consoleNav.settings",icon:Jh}];return c.jsxs("div",{className:"flex h-screen w-screen flex-col bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100",children:[c.jsx(Ck,{}),c.jsx(Tk,{}),c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx("nav",{className:"flex w-52 shrink-0 flex-col border-r border-gray-200 bg-white py-3 dark:border-gray-700 dark:bg-gray-900",children:i.map(s=>{const o=t.pathname===s.path,u=s.icon;return c.jsxs("button",{onClick:()=>a(s.path),className:`mx-2 flex items-center gap-2.5 rounded-md px-3 py-2 text-sm transition-colors ${o?"bg-blue-50 font-medium text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"}`,children:[c.jsx(u,{className:"h-4 w-4"}),c.jsx("span",{children:e(s.labelKey)})]},s.path)})}),c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"mx-auto max-w-6xl p-6",children:c.jsx(Sv,{})})})]})]})}function $O({agent:e}){var v;const{t}=le("common"),[a,i]=j.useState(!0),[s,o]=j.useState(!1),u=((v=e.speechBubble)==null?void 0:v.text)??"";if(j.useEffect(()=>{o(!1),i(!0)},[u]),j.useEffect(()=>{if(s){i(!1);return}if(e.status!=="speaking"){const w=Math.min(3e4,Math.max(12e3,9e3+u.length*30)),C=setTimeout(()=>i(!1),w);return()=>clearTimeout(C)}i(!0)},[e.status,s,u]),!e.speechBubble||!a||s)return null;const f=e.position.x/Uc*100,h=e.position.y/Ic*100,g=f<25,x=f>75;let p="-50%",b="center";return g?(p="-10%",b="left"):x&&(p="-90%",b="right"),c.jsxs("div",{className:"pointer-events-none absolute","data-testid":"speech-bubble-anchor",style:{left:`${f}%`,top:`${h}%`,transform:`translate(${p}, -100%) translateY(-52px)`,opacity:e.status==="speaking"?1:0,transition:"opacity 500ms ease",zIndex:21},children:[c.jsxs("div",{className:"pointer-events-auto min-w-[320px] w-[min(54vw,520px)] max-w-[min(94vw,560px)] max-h-[40vh] overflow-y-auto rounded-2xl border border-slate-300/80 bg-white px-4 py-3.5 text-[14px] leading-7 text-slate-900 shadow-2xl [overflow-wrap:anywhere] dark:border-slate-600/90 dark:bg-slate-900 dark:text-slate-100","data-testid":"speech-bubble-overlay",children:[c.jsx("div",{className:"mb-2 flex items-start justify-end",children:c.jsx("button",{type:"button",onClick:()=>{o(!0),i(!1)},"aria-label":t("actions.close"),className:"rounded-md px-1.5 py-0.5 text-sm leading-none text-slate-500 transition-colors hover:bg-slate-200 hover:text-slate-800 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-slate-100",children:"×"})}),c.jsx("div",{className:"[&_p]:my-0 [&_p+*]:mt-2.5 [&_ul]:my-1.5 [&_ol]:my-1.5 [&_li]:my-0.5",children:c.jsx(jg,{children:e.speechBubble.text})})]}),c.jsx("div",{className:"h-0 w-0 border-l-[6px] border-r-[6px] border-t-[8px] border-l-transparent border-r-transparent border-t-gray-200 dark:border-t-gray-700","data-testid":`speech-bubble-arrow-${b}`,style:{marginLeft:b==="left"?"16px":"auto",marginRight:b==="right"?"16px":"auto"}})]})}const KO=2,FO=8,Fs=j.memo(function({agent:t}){const{t:a}=le("common"),i=se(F=>F.selectedAgentId),s=se(F=>F.selectAgent),o=se(F=>F.tickMovement),u=se(F=>F.theme),[f,h]=j.useState(!1),g=j.useRef(null),x=j.useRef(0),p=j.useRef(0),b=i===t.id,v=b?Ks.selectedRadius:Ks.radius,w=t.isPlaceholder,C=!t.confirmed,E=t.movement!==null,S=w||C?"#6b7280":pl[t.status],N=u==="dark",D=Nk(t.id),U=`avatar-clip-${t.id}`,z=w?.3:C?.5:1,L=t.name.length>Ks.nameLabelMaxChars?`${t.name.slice(0,Ks.nameLabelMaxChars)}…`:t.name,G=j.useRef(t.id);G.current=t.id;const X=j.useCallback(F=>{if(!g.current)return;const _=p.current?(F-p.current)/1e3:.016;p.current=F,o(G.current,_);const V=se.getState().agents.get(G.current);if(!V)return;let re=0,W=1;if(V.movement){const J=V.movement.progress,B=(Date.now()-V.movement.startTime)/1e3;if(re=Math.sin(B*FO*Math.PI*2)*KO,J<.1)W=.9+J;else if(J>.9){const ee=(J-.9)/.1;W=1-.05*Math.sin(ee*Math.PI)}}g.current.setAttribute("transform",`translate(${V.position.x}, ${V.position.y+re}) scale(${W})`),V.movement&&(x.current=requestAnimationFrame(X))},[o]);return j.useEffect(()=>(E&&(p.current=0,x.current=requestAnimationFrame(X)),()=>{x.current&&cancelAnimationFrame(x.current)}),[E,X]),c.jsxs("g",{ref:g,transform:`translate(${t.position.x}, ${t.position.y})`,style:{cursor:w?"default":"pointer"},opacity:z,onClick:()=>!w&&s(t.id),onMouseEnter:()=>!w&&h(!0),onMouseLeave:()=>h(!1),children:[b&&c.jsx("circle",{r:v+8,fill:S,opacity:.18,style:{filter:`drop-shadow(0 0 10px ${S})`}}),c.jsx(PO,{status:t.status,r:v,color:S,isWalking:E,isPlaceholder:w}),c.jsx("defs",{children:c.jsx("clipPath",{id:U,children:c.jsx("circle",{r:v-2})})}),c.jsx("circle",{r:v-2,fill:N?"#1e293b":"#f8fafc"}),c.jsx("g",{clipPath:`url(#${U})`,children:c.jsx(QO,{data:D,size:v*2-4})}),t.isSubAgent&&c.jsxs("g",{transform:`translate(${v*.6}, ${v*.5})`,children:[c.jsx("circle",{r:7,fill:N?"#1e293b":"#fff",stroke:S,strokeWidth:1.2}),c.jsx("text",{textAnchor:"middle",dy:"3.5",fontSize:"9",fill:S,fontWeight:"bold",children:"S"})]}),t.status==="thinking"&&c.jsx(VO,{r:v}),t.status==="error"&&c.jsxs("g",{transform:`translate(${v*.65}, ${-v*.65})`,children:[c.jsx("circle",{r:7,fill:"#ef4444"}),c.jsx("text",{textAnchor:"middle",dy:"4",fontSize:"10",fill:"#fff",fontWeight:"bold",children:"!"})]}),t.status==="speaking"&&c.jsx(YO,{r:v}),t.status==="tool_calling"&&t.currentTool&&c.jsx("foreignObject",{x:-50,y:v+2,width:100,height:20,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsx("span",{style:{fontSize:"9px",fontWeight:600,color:"#fff",backgroundColor:"#f97316",borderRadius:"4px",padding:"1px 6px",whiteSpace:"nowrap",maxWidth:"90px",overflow:"hidden",textOverflow:"ellipsis"},children:t.currentTool.name})})}),c.jsx("foreignObject",{x:-60,y:v+(t.status==="tool_calling"&&t.currentTool?18:4),width:120,height:22,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsx("span",{title:t.name,style:{fontSize:"11px",fontWeight:500,color:N?"#cbd5e1":"#475569",backgroundColor:N?"rgba(30,41,59,0.7)":"rgba(255,255,255,0.75)",backdropFilter:"blur(6px)",borderRadius:"6px",padding:"1px 8px",whiteSpace:"nowrap",border:`1px solid ${N?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:L})})}),f&&c.jsx("foreignObject",{x:-80,y:-v-38,width:160,height:32,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsxs("span",{style:{fontSize:"11px",fontWeight:500,color:N?"#e2e8f0":"#374151",backgroundColor:N?"rgba(30,41,59,0.85)":"rgba(255,255,255,0.9)",backdropFilter:"blur(8px)",borderRadius:"8px",padding:"4px 10px",whiteSpace:"nowrap",boxShadow:N?"0 4px 8px rgba(0,0,0,0.3)":"0 4px 8px rgba(0,0,0,0.1)",border:`1px solid ${N?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[t.name," · ",a(`agent.statusLabels.${t.status}`)]})})})]})});function PO({status:e,r:t,color:a,isWalking:i,isPlaceholder:s}){const o=i||s?{}:GO(e),u=i?"4 3":s?"6 3":void 0,f=i?"#3b82f6":a;return c.jsx("circle",{r:t,fill:"none",stroke:f,strokeWidth:Ks.strokeWidth,strokeDasharray:u,style:{transition:"stroke 300ms ease",...o}})}function GO(e){switch(e){case"thinking":return{animation:"agent-pulse 1.5s ease-in-out infinite"};case"tool_calling":return{animation:"agent-pulse 2s ease-in-out infinite",strokeDasharray:"6 3"};case"speaking":return{animation:"agent-pulse 1s ease-in-out infinite"};case"error":return{animation:"agent-blink 0.8s ease-in-out infinite"};case"spawning":return{animation:"agent-spawn 0.5s ease-out forwards"};default:return{}}}function VO({r:e}){return c.jsx("g",{transform:`translate(${e*.55}, ${-e*.7})`,children:[0,1,2].map(t=>c.jsx("circle",{cx:t*5,cy:0,r:2,fill:"#3b82f6",style:{animation:`thinking-dots 1.2s ease-in-out ${t*.15}s infinite`}},t))})}function YO({r:e}){return c.jsxs("g",{transform:`translate(${e*.55}, ${-e*.75})`,children:[c.jsxs("circle",{r:7,fill:"#a855f7",opacity:.9,children:[c.jsx("animate",{attributeName:"r",values:"6;8;6",dur:"1.5s",repeatCount:"indefinite"}),c.jsx("animate",{attributeName:"opacity",values:"0.9;0.5;0.9",dur:"1.5s",repeatCount:"indefinite"})]}),c.jsx("g",{transform:"translate(-4.5,-4.5) scale(0.45)",children:c.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M3.43 2.524A41.29 41.29 0 0110 2c2.236 0 4.43.18 6.57.524 1.437.231 2.43 1.49 2.43 2.902v5.148c0 1.413-.993 2.67-2.43 2.902a41.102 41.102 0 01-3.55.414c-.28.02-.521.18-.643.413l-1.712 3.293a.75.75 0 01-1.33 0l-1.713-3.293a.783.783 0 00-.642-.413 41.108 41.108 0 01-3.55-.414C1.993 13.245 1 11.986 1 10.574V5.426c0-1.413.993-2.67 2.43-2.902z",clipRule:"evenodd"})})]})}function QO({data:e,size:t}){const a=t/2,i=e.faceShape==="round"?a*.8:e.faceShape==="oval"?a*.7:a*.75,s=e.faceShape==="oval"?a*.9:i;return c.jsxs("g",{children:[c.jsx("rect",{x:-a,y:a*.4,width:t,height:a*1.2,fill:e.shirtColor}),c.jsx("ellipse",{cx:0,cy:-a*.05,rx:i,ry:s,fill:e.skinColor}),c.jsx(XO,{style:e.hairStyle,color:e.hairColor,s:a,faceRx:i}),c.jsx(ZO,{style:e.eyeStyle,s:a})]})}function XO({style:e,color:t,s:a,faceRx:i}){switch(e){case"short":return c.jsx("ellipse",{cx:0,cy:-a*.55,rx:i*.95,ry:a*.45,fill:t});case"spiky":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:0,cy:-a*.55,rx:i*.9,ry:a*.4,fill:t}),[-.4,-.15,.1,.35].map(s=>c.jsx("polygon",{points:`${s*a*2},-${a*.85} ${s*a*2-3},-${a*.5} ${s*a*2+3},-${a*.5}`,fill:t},s))]});case"side-part":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:-a*.1,cy:-a*.55,rx:i,ry:a*.45,fill:t}),c.jsx("rect",{x:i*.3,y:-a*.9,width:i*.5,height:a*.3,rx:3,fill:t})]});case"curly":return c.jsx("g",{children:[[-.35,-.7],[0,-.78],[.35,-.7],[-.5,-.45],[.5,-.45]].map(([s,o],u)=>c.jsx("circle",{cx:s*a,cy:o*a,r:a*.22,fill:t},u))});case"buzz":return c.jsx("ellipse",{cx:0,cy:-a*.45,rx:i*.85,ry:a*.35,fill:t,opacity:.7});default:return null}}function ZO({style:e,s:t}){const a=-t*.08,i=t*.28;switch(e){case"dot":return c.jsxs("g",{children:[c.jsx("circle",{cx:-i,cy:a,r:2,fill:"#333"}),c.jsx("circle",{cx:i,cy:a,r:2,fill:"#333"})]});case"line":return c.jsxs("g",{children:[c.jsx("line",{x1:-i-3,y1:a,x2:-i+3,y2:a,stroke:"#333",strokeWidth:1.5,strokeLinecap:"round"}),c.jsx("line",{x1:i-3,y1:a,x2:i+3,y2:a,stroke:"#333",strokeWidth:1.5,strokeLinecap:"round"})]});case"wide":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:-i,cy:a,rx:3,ry:2.5,fill:"#fff",stroke:"#333",strokeWidth:.8}),c.jsx("circle",{cx:-i,cy:a,r:1.2,fill:"#333"}),c.jsx("ellipse",{cx:i,cy:a,rx:3,ry:2.5,fill:"#fff",stroke:"#333",strokeWidth:.8}),c.jsx("circle",{cx:i,cy:a,r:1.2,fill:"#333"})]});default:return null}}function JO({x1:e,y1:t,x2:a,y2:i,strength:s}){const o=(e+a)/2,u=(t+i)/2,f=a-e,h=i-t,g=Math.sqrt(f*f+h*h),x=Math.min(g*.2,50),p=o-h/g*x,b=u+f/g*x,v=`M ${e} ${t} Q ${p} ${b} ${a} ${i}`,w=s>=.5,C=w?3:1.5,E=Math.max(.2,s);return c.jsxs("g",{children:[c.jsx("path",{d:v,fill:"none",stroke:"#60a5fa",strokeWidth:C+2,opacity:Math.max(.03,s*.15),style:{filter:"blur(3px)"}}),c.jsx("path",{d:v,fill:"none",stroke:"#60a5fa",strokeWidth:C,strokeDasharray:w?"12,6":"6,4",opacity:E,style:{animation:w?"connection-pulse 0.8s linear infinite":"dash-flow 1.5s linear infinite",filter:w?"drop-shadow(0 0 4px rgba(96,165,250,0.8))":void 0}})]})}const WO=j.memo(function({x:t,y:a,isDark:i=!1}){const s=i?"#334155":"#dfe5ed",o=i?"#283548":"#c8d0dc",u=i?"#1e293b":"#f1f5f9",f=i?"#475569":"#94a3b8";return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx("rect",{x:-50,y:-6,width:100,height:60,rx:6,fill:s,stroke:o,strokeWidth:1}),c.jsx("path",{d:"M -50 54 L -50 60 Q -50 66 -44 66 L 44 66 Q 50 66 50 60 L 50 54",fill:o,opacity:.6}),c.jsx("rect",{x:-20,y:4,width:40,height:26,rx:3,fill:u,stroke:f,strokeWidth:.8}),c.jsx("rect",{x:-16,y:36,width:32,height:12,rx:2,fill:i?"#475569":"#cbd5e1",opacity:.6})]})}),Bh=j.memo(function({x:t,y:a,isDark:i=!1}){const s=i?"#475569":"#94a3b8",o=i?"#334155":"#7c8ba0";return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx("path",{d:"M -12 -14 Q 0 -20 12 -14",fill:"none",stroke:o,strokeWidth:4,strokeLinecap:"round"}),c.jsx("circle",{r:14,fill:s,opacity:.85})]})}),eL=j.memo(function({x:t,y:a,radius:i=80,isDark:s=!1}){const o=`mt-grad-${t}-${a}`,u=s?"#334155":"#bfcbda",f=s?"#3d4f66":"#dbe4ef";return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx("defs",{children:c.jsxs("radialGradient",{id:o,children:[c.jsx("stop",{offset:"0%",stopColor:f}),c.jsx("stop",{offset:"100%",stopColor:u})]})}),c.jsx("circle",{r:i,fill:`url(#${o})`,stroke:s?"#475569":"#94a3b8",strokeWidth:1.5,style:{filter:"drop-shadow(0 3px 6px rgba(0,0,0,0.10))"}})]})}),Zo=j.memo(function({x:t,y:a,rotation:i=0,isDark:s=!1}){const o=s?"#475569":"#a5b4c8",u=s?"#334155":"#8494a7",f=s?"#5b6b80":"#c8d5e3";return c.jsxs("g",{transform:`translate(${t}, ${a}) rotate(${i})`,children:[c.jsx("rect",{x:-55,y:-22,width:110,height:44,rx:10,fill:u}),c.jsx("rect",{x:-48,y:-16,width:96,height:32,rx:6,fill:o}),c.jsx("circle",{cx:-30,cy:0,r:8,fill:f,opacity:.7}),c.jsx("circle",{cx:30,cy:0,r:8,fill:f,opacity:.7}),c.jsx("rect",{x:-52,y:-25,width:104,height:8,rx:4,fill:u,opacity:.7})]})}),Jo=j.memo(function({x:t,y:a}){return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx("path",{d:"M -8 6 L -10 18 Q -10 22 -6 22 L 6 22 Q 10 22 10 18 L 8 6 Z",fill:"#a07050"}),c.jsx("ellipse",{cx:0,cy:-2,rx:12,ry:10,fill:"#4ade80",opacity:.85}),c.jsx("ellipse",{cx:-6,cy:-8,rx:8,ry:6,fill:"#22c55e",opacity:.7}),c.jsx("ellipse",{cx:6,cy:-6,rx:7,ry:5,fill:"#16a34a",opacity:.6})]})}),$b=j.memo(function({x:t,y:a}){return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx("ellipse",{cx:0,cy:4,rx:9,ry:3,fill:"#d1d5db",opacity:.5}),c.jsx("rect",{x:-5,y:-4,width:10,height:10,rx:2,fill:"#f5f5f4",stroke:"#d1d5db",strokeWidth:.6}),c.jsx("ellipse",{cx:0,cy:-2,rx:4,ry:1.5,fill:"#92400e",opacity:.7}),c.jsx("path",{d:"M 5 -1 Q 9 -1 9 3 Q 9 6 5 6",fill:"none",stroke:"#d1d5db",strokeWidth:1}),c.jsx("path",{d:"M -1 -7 Q 0 -10 1 -7",fill:"none",stroke:"#94a3b8",strokeWidth:.5,opacity:.4})]})}),Mk=j.memo(function({x:t,y:a,agent:i}){const s=se(o=>o.theme)==="dark";return c.jsxs("g",{transform:`translate(${t}, ${a})`,children:[c.jsx(WO,{x:0,y:30,isDark:s}),c.jsx(Bh,{x:0,y:-12,isDark:s}),i&&c.jsx(Fs,{agent:{...i,position:{x:0,y:-12}}})]})},(e,t)=>{var a,i,s,o;return e.x!==t.x||e.y!==t.y?!1:e.agent===null&&t.agent===null?!0:e.agent===null||t.agent===null?!1:e.agent.id===t.agent.id&&e.agent.status===t.agent.status&&e.agent.name===t.agent.name&&((a=e.agent.currentTool)==null?void 0:a.name)===((i=t.agent.currentTool)==null?void 0:i.name)&&e.agent.isSubAgent===t.agent.isSubAgent&&((s=e.agent.speechBubble)==null?void 0:s.text)===((o=t.agent.speechBubble)==null?void 0:o.text)});function tL({zone:e,zoneKey:t}){const{t:a}=le("common"),o=se(u=>u.theme)==="dark"?"#64748b":"#94a3b8";return c.jsx("text",{x:e.x+14,y:e.y+22,fill:o,fontSize:11,fontWeight:600,fontFamily:"system-ui, sans-serif",letterSpacing:"0.05em",children:a(`zones.${t}`)})}function nL(){const e=se(N=>N.agents),t=se(N=>N.links),a=se(N=>N.theme),i=Array.from(e.values()),s=a==="dark",o=s?lg:sg,u=j.useMemo(()=>i.filter(N=>N.zone==="desk"&&!N.isSubAgent&&!N.movement&&N.confirmed),[i]),f=j.useMemo(()=>i.filter(N=>N.zone==="hotDesk"&&!N.movement),[i]),h=j.useMemo(()=>i.filter(N=>N.zone==="lounge"&&!N.movement),[i]),g=j.useMemo(()=>i.filter(N=>N.zone==="meeting"&&!N.movement),[i]),x=j.useMemo(()=>i.filter(N=>N.movement!==null),[i]),p=j.useMemo(()=>i.filter(N=>N.zone==="corridor"&&!N.movement),[i]),b=se(N=>N.maxSubAgents),v=j.useMemo(()=>Hx(De.desk,u.length,Math.max(u.length,4)),[u.length]),w=j.useMemo(()=>Hx(De.hotDesk,f.length,Math.max(f.length,b)),[f.length,b]),C={x:De.meeting.x+De.meeting.width/2,y:De.meeting.y+De.meeting.height/2},E=Math.min(60+g.length*8,Math.min(De.meeting.width,De.meeting.height)/2-40),S=j.useMemo(()=>HA(g.length,C,E+36),[g.length,C.x,C.y,E]);return c.jsxs("div",{className:"relative h-full w-full bg-gray-100 dark:bg-gray-950",children:[c.jsxs("svg",{viewBox:`0 0 ${Uc} ${Ic}`,className:"h-full w-full",preserveAspectRatio:"xMidYMid meet",children:[c.jsxs("defs",{children:[c.jsx("filter",{id:"building-shadow",x:"-3%",y:"-3%",width:"106%",height:"106%",children:c.jsx("feDropShadow",{dx:"0",dy:"3",stdDeviation:"6",floodOpacity:s?.5:.12})}),c.jsxs("pattern",{id:"corridor-tiles",width:"28",height:"28",patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:"28",height:"28",fill:o.corridor}),c.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",fill:"none",stroke:s?"#1f2937":"#d5dbe3",strokeWidth:"0.3",rx:"1"})]}),c.jsxs("pattern",{id:"lounge-carpet",width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:"6",height:"6",fill:o.lounge}),c.jsx("circle",{cx:"3",cy:"3",r:"0.5",fill:s?"#2d2540":"#e5e0ed",opacity:"0.4"})]})]}),c.jsx("rect",{x:ue.x,y:ue.y,width:ue.width,height:ue.height,rx:ue.cornerRadius,fill:o.corridor,stroke:o.wall,strokeWidth:ue.wallThickness,filter:"url(#building-shadow)"}),c.jsx(aL,{isDark:s}),Object.entries(De).map(([N,D])=>c.jsx("rect",{x:D.x,y:D.y,width:D.width,height:D.height,fill:N==="lounge"?"url(#lounge-carpet)":o[N]},`floor-${N}`)),c.jsx(rL,{isDark:s}),c.jsx(iL,{isDark:s}),Object.entries(De).map(([N,D])=>c.jsx(tL,{zone:D,zoneKey:N},`label-${N}`)),c.jsx(sL,{deskSlots:v,deskAgents:u}),c.jsx(eL,{x:C.x,y:C.y,radius:E,isDark:s}),c.jsx(oL,{seats:S,meetingAgentCount:g.length,isDark:s}),c.jsx(lL,{slots:w,agents:f}),c.jsx(cL,{isDark:s}),h.map(N=>c.jsx(Fs,{agent:N},`lounge-${N.id}`)),c.jsx(uL,{isDark:s}),t.map(N=>{const D=e.get(N.sourceId),U=e.get(N.targetId);return!D||!U?null:c.jsx(JO,{x1:D.position.x,y1:D.position.y,x2:U.position.x,y2:U.position.y,strength:N.strength},`${N.sourceId}-${N.targetId}`)}),g.map((N,D)=>{const U=S[D];return U?c.jsx(Fs,{agent:{...N,position:U}},N.id):null}),p.map(N=>c.jsx(Fs,{agent:N},`corridor-${N.id}`)),x.map(N=>c.jsx(Fs,{agent:N},`walk-${N.id}`))]}),i.filter(N=>N.speechBubble).map(N=>c.jsx($O,{agent:N},`bubble-${N.id}`))]})}function aL({isDark:e}){const t=ue.corridorWidth,a=ue.x,i=ue.y+(ue.height-t)/2,s=ue.x+(ue.width-t)/2,o=ue.y;return c.jsxs("g",{children:[c.jsx("rect",{x:a,y:i,width:ue.width,height:t,fill:"url(#corridor-tiles)"}),c.jsx("rect",{x:s,y:o,width:t,height:ue.height,fill:"url(#corridor-tiles)"}),c.jsx("line",{x1:a,y1:i+t/2,x2:a+ue.width,y2:i+t/2,stroke:e?"#334155":"#c8d0dc",strokeWidth:.5,strokeDasharray:"8 6",opacity:.6}),c.jsx("line",{x1:s+t/2,y1:o,x2:s+t/2,y2:o+ue.height,stroke:e?"#334155":"#c8d0dc",strokeWidth:.5,strokeDasharray:"8 6",opacity:.6})]})}function rL({isDark:e}){const t=e?"#475569":"#8b9bb0",a=e?"#334155":"#c8d0dc",i=4,s=ue.corridorWidth,o=ue.x+(ue.width-s)/2,u=ue.y+(ue.height-s)/2,f=[{x:o-i/2,y:ue.y,w:i,h:u-ue.y},{x:o-i/2,y:u+s,w:i,h:ue.y+ue.height-u-s},{x:o+s-i/2,y:ue.y,w:i,h:u-ue.y},{x:o+s-i/2,y:u+s,w:i,h:ue.y+ue.height-u-s},{x:ue.x,y:u-i/2,w:o-ue.x,h:i},{x:o+s,y:u-i/2,w:ue.x+ue.width-o-s,h:i},{x:ue.x,y:u+s-i/2,w:o-ue.x,h:i},{x:o+s,y:u+s-i/2,w:ue.x+ue.width-o-s,h:i}];return c.jsx("g",{children:f.map((h,g)=>c.jsx("rect",{x:h.x,y:h.y,width:h.w,height:h.h,fill:a,stroke:t,strokeWidth:.5},`wall-${g}`))})}function iL({isDark:e}){const t=ue.corridorWidth,a=ue.x+(ue.width-t)/2,i=ue.y+(ue.height-t)/2,s=40,o=e?lg.corridor:sg.corridor,u=e?"#64748b":"#94a3b8",f=[{cx:(ue.x+a)/2,cy:i,horizontal:!0},{cx:(a+t+ue.x+ue.width)/2,cy:i,horizontal:!0},{cx:(ue.x+a)/2,cy:i+t,horizontal:!0},{cx:(a+t+ue.x+ue.width)/2,cy:i+t,horizontal:!0},{cx:a,cy:(ue.y+i)/2,horizontal:!1},{cx:a+t,cy:(ue.y+i)/2,horizontal:!1},{cx:a,cy:(i+t+ue.y+ue.height)/2,horizontal:!1},{cx:a+t,cy:(i+t+ue.y+ue.height)/2,horizontal:!1}];return c.jsx("g",{children:f.map((h,g)=>{const x=s/2;return h.horizontal?c.jsxs("g",{children:[c.jsx("rect",{x:h.cx-x,y:h.cy-3,width:s,height:6,fill:o}),c.jsx("path",{d:`M ${h.cx-x} ${h.cy} A ${x} ${x} 0 0 1 ${h.cx+x} ${h.cy}`,fill:"none",stroke:u,strokeWidth:.8,strokeDasharray:"3 2",opacity:.5})]},`door-${g}`):c.jsxs("g",{children:[c.jsx("rect",{x:h.cx-3,y:h.cy-x,width:6,height:s,fill:o}),c.jsx("path",{d:`M ${h.cx} ${h.cy-x} A ${x} ${x} 0 0 1 ${h.cx} ${h.cy+x}`,fill:"none",stroke:u,strokeWidth:.8,strokeDasharray:"3 2",opacity:.5})]},`door-${g}`)})})}function sL({deskSlots:e,deskAgents:t}){const a=j.useMemo(()=>{const i=new Map;for(const s of t){let o=0;for(let h=0;h<s.id.length;h++)o=(o<<5)-o+s.id.charCodeAt(h)|0;let f=Math.abs(o)%e.length;for(;i.has(f);)f=(f+1)%e.length;i.set(f,s)}return i},[t,e.length]);return c.jsx("g",{children:e.map((i,s)=>c.jsx(Mk,{x:i.unitX,y:i.unitY,agent:a.get(s)??null},`desk-${s}`))})}function lL({slots:e,agents:t}){return c.jsx("g",{children:e.map((a,i)=>c.jsx(Mk,{x:a.unitX,y:a.unitY,agent:t[i]??null},`hotdesk-${i}`))})}function oL({seats:e,meetingAgentCount:t,isDark:a}){const i={x:De.meeting.x+De.meeting.width/2,y:De.meeting.y+De.meeting.height/2};if(t>0)return c.jsx("g",{children:e.map((u,f)=>c.jsx(Bh,{x:u.x,y:u.y,isDark:a},`mc-${f}`))});const s=6,o=100;return c.jsx("g",{children:Array.from({length:s},(u,f)=>{const h=2*Math.PI*f/s-Math.PI/2;return c.jsx(Bh,{x:Math.round(i.x+Math.cos(h)*o),y:Math.round(i.y+Math.sin(h)*o),isDark:a},`mc-empty-${f}`)})})}function cL({isDark:e}){const t=De.lounge,a=t.x+t.width/2,i=e?"#334155":"#5a6878",s=e?"#475569":"#8494a7",o=e?"#64748b":"#a5b4c8",u=e?"#94a3b8":"#ffffff",f=e?"#1e293b":"#3b4f6b",h=200,g=36,x=t.y+t.height*.52,p=160,b=24,v=x+g+14;return c.jsxs("g",{children:[c.jsx(Zo,{x:t.x+100,y:t.y+60,rotation:0,isDark:e}),c.jsx(Zo,{x:t.x+280,y:t.y+60,rotation:0,isDark:e}),c.jsx(Zo,{x:t.x+100,y:t.y+140,rotation:180,isDark:e}),c.jsx($b,{x:t.x+190,y:t.y+100}),c.jsx($b,{x:t.x+100,y:t.y+100}),c.jsx(Zo,{x:t.x+440,y:t.y+100,rotation:90,isDark:e}),c.jsx("rect",{x:a-h/2,y:x,width:h,height:g,rx:4,fill:f}),c.jsx("rect",{x:a-h/2,y:x,width:h,height:3,rx:1.5,fill:e?"#64748b":"#7a9bc0"}),c.jsx("text",{x:a,y:x+g/2+5,textAnchor:"middle",fill:u,fontSize:14,fontWeight:700,fontFamily:"system-ui, sans-serif",letterSpacing:"0.12em",children:"OpenClaw"}),c.jsx("rect",{x:a-p/2,y:v,width:p,height:b,rx:12,fill:s,stroke:i,strokeWidth:1}),c.jsx("rect",{x:a-p/2+4,y:v+3,width:p-8,height:b-6,rx:9,fill:o,opacity:.5}),c.jsx(Jo,{x:a-h/2-30,y:x+g/2}),c.jsx(Jo,{x:a+h/2+30,y:x+g/2}),c.jsx(Jo,{x:t.x+40,y:t.y+t.height-50}),c.jsx(Jo,{x:t.x+t.width-40,y:t.y+t.height-50})]})}function uL({isDark:e}){const t=De.lounge,a=t.x+t.width/2,i=ue.y+ue.height,s=70,o=s/2,u=e?lg.lounge:sg.lounge,f=e?"#64748b":"#8b9bb0",h=e?"#374151":"#b0a090",g=e?"#64748b":"#94a3b8";return c.jsxs("g",{children:[c.jsx("rect",{x:a-o-2,y:i-ue.wallThickness-1,width:s+4,height:ue.wallThickness+4,fill:u}),c.jsx("rect",{x:a-o-3,y:i-10,width:3,height:12,rx:1,fill:f}),c.jsx("rect",{x:a+o,y:i-10,width:3,height:12,rx:1,fill:f}),c.jsx("path",{d:`M ${a-o} ${i} A ${o} ${o} 0 0 0 ${a} ${i-o}`,fill:"none",stroke:f,strokeWidth:.8,strokeDasharray:"4 3",opacity:.5}),c.jsx("path",{d:`M ${a+o} ${i} A ${o} ${o} 0 0 1 ${a} ${i-o}`,fill:"none",stroke:f,strokeWidth:.8,strokeDasharray:"4 3",opacity:.5}),c.jsx("rect",{x:a-30,y:i-18,width:60,height:12,rx:3,fill:h,opacity:.5}),c.jsx("text",{x:a,y:i+14,textAnchor:"middle",fill:g,fontSize:9,fontWeight:600,fontFamily:"system-ui, sans-serif",letterSpacing:"0.15em",children:"ENTRANCE"})]})}function Sc(e,t){const a=e.agents;if(!a)return;const i=a.list;if(Array.isArray(i))return i.find(s=>s.id===t)}function Dk(e){return JSON.parse(JSON.stringify(e))}async function dL(e,t,a,i){try{const s=await e.configGet(),o=s.config;if(!Sc(o,t))return{ok:!1,error:"agent_not_found"};const f=Dk(o),g=f.agents.list,x=g.findIndex(b=>b.id===t);if(x<0)return{ok:!1,error:"agent_not_found"};g[x]={...g[x],tools:a};const p=await e.configSet(JSON.stringify(f),i??s.hash);return p.ok?{ok:!0,restart:p.restart??void 0}:{ok:!1,error:p.error??"conflict"}}catch(s){return{ok:!1,error:String(s)}}}async function fL(e,t,a,i){try{const s=await e.configGet(),o=s.config;if(!Sc(o,t))return{ok:!1,error:"agent_not_found"};const f=Dk(o),g=f.agents.list,x=g.findIndex(b=>b.id===t);if(x<0)return{ok:!1,error:"agent_not_found"};if(a===null){const{skills:b,...v}=g[x];g[x]=v}else g[x]={...g[x],skills:a};const p=await e.configSet(JSON.stringify(f),i??s.hash);return p.ok?{ok:!0,restart:p.restart??void 0}:{ok:!1,error:p.error??"conflict"}}catch(s){return{ok:!1,error:String(s)}}}const hL=["feishu","dingtalk","telegram","discord","slack","whatsapp","signal","imessage","matrix","line","msteams","googlechat","mattermost","irc","nostr","nextcloud-talk","bluebubbles","synology-chat","zalo","zalouser","tlon"];function gL(e,t){const a=e.trim(),i=`agent:${t}:`;if(!a.startsWith(i))return!1;const s=a.slice(i.length);return hL.some(o=>s.startsWith(`${o}:`))}async function mL(e,t){const i=(await e.sessionsList()).map(s=>s.key).filter(s=>gL(s,t));for(const s of i)await e.sessionsDelete(s);return i.length}const Kb={agentTools:[],agentToolsLoading:!1,agentToolsConfig:null,configHash:null,agentSkills:[],agentSkillsLoading:!1,agentSkillsAllowlist:null,agentChannels:[],agentChannelsLoading:!1,agentCronJobs:[],agentCronJobsLoading:!1,cronDialogOpen:!1,cronEditingTask:null},An=In((e,t)=>({agents:[],defaultAgentId:"",selectedAgentId:null,activeTab:"overview",isLoading:!1,error:null,searchQuery:"",files:[],filesLoading:!1,selectedFileName:null,fileContent:null,originalFileContent:null,isFileDirty:!1,fileSaving:!1,createDialogOpen:!1,deleteDialogOpen:!1,systemModels:[],agentModelConfigs:{},...Kb,fetchSystemModels:async()=>{var a;try{await Fe();const i=Re(),[s,o]=await Promise.all([i.configGet(),i.modelsList().catch(()=>[])]),u=s.config,f=new Set,h=[],g=new Map;for(const w of o){const C=`${w.provider}/${w.id}`;f.has(C)||(f.add(C),h.push({id:C,label:w.name??w.id,provider:w.provider}),g.has(w.provider)||g.set(w.provider,[]),g.get(w.provider).push(w))}const x=u==null?void 0:u.models,p=x==null?void 0:x.providers;if(p)for(const[w,C]of Object.entries(p)){const E=C.models;if(E)for(const S of E){const N=`${w}/${S.id}`;f.has(N)||(f.add(N),h.push({id:N,label:S.name??S.id,provider:w}))}}const b={},v=(a=u==null?void 0:u.agents)==null?void 0:a.list;if(v)for(const w of v){const C=w.id;if(!C)continue;const E=w.model;if(typeof E=="string")b[C]={primary:E,fallbacks:[]};else if(E&&typeof E=="object"&&!Array.isArray(E)){const S=E;b[C]={primary:S.primary??"",fallbacks:S.fallbacks??[]}}}e({systemModels:h,agentModelConfigs:b})}catch{}},fetchAgents:async()=>{e({isLoading:!0,error:null});try{await Fe();const a=await Re().agentsList(),i=a.agents.map(u=>({...u,default:u.id===a.defaultId})),{selectedAgentId:s}=t(),o=s??a.defaultId;e({agents:i,defaultAgentId:a.defaultId,selectedAgentId:o,isLoading:!1})}catch(a){e({error:String(a),isLoading:!1})}},selectAgent:a=>{e({selectedAgentId:a,activeTab:"overview",files:[],selectedFileName:null,fileContent:null,originalFileContent:null,isFileDirty:!1,...Kb})},setActiveTab:a=>e({activeTab:a}),setSearchQuery:a=>e({searchQuery:a}),fetchFiles:async a=>{e({filesLoading:!0,files:[]});try{await Fe();const i=await Re().agentsFilesList(a);e({files:i.files,filesLoading:!1})}catch{e({filesLoading:!1})}},fetchFileContent:async(a,i)=>{e({selectedFileName:i,fileContent:null,originalFileContent:null,isFileDirty:!1});try{await Fe();const s=await Re().agentsFilesGet(a,i);e({fileContent:s.file.content,originalFileContent:s.file.content,isFileDirty:!1})}catch{e({fileContent:"",originalFileContent:""})}},setFileContent:a=>{const{originalFileContent:i}=t();e({fileContent:a,isFileDirty:a!==i})},resetFileContent:()=>{const{originalFileContent:a}=t();e({fileContent:a,isFileDirty:!1})},saveFileContent:async(a,i,s)=>{e({fileSaving:!0});try{return await Fe(),await Re().agentsFilesSet(a,i,s),e({fileSaving:!1,originalFileContent:s,isFileDirty:!1}),!0}catch{return e({fileSaving:!1}),!1}},createAgent:async a=>{try{await Fe();const i=await Re().agentsCreate(a);return i.ok?(await t().fetchAgents(),i.agentId):null}catch{return null}},updateAgentModel:async(a,i)=>{try{await Fe();const s=Re(),o=await s.agentsUpdate({agentId:a,model:i});if(o.ok){let u="configLifecycle.runtimeAgentModel";try{await mL(s,a)>0&&(u="configLifecycle.runtimeAgentModelSessionsReset")}catch{}Ne.getState().setRuntimeApplied(u)}return o.ok}catch{return!1}},deleteAgent:async(a,i)=>{try{return await Fe(),(await Re().agentsDelete({agentId:a,deleteFiles:i})).ok?(e({selectedAgentId:null}),await t().fetchAgents(),!0):!1}catch{return!1}},setCreateDialogOpen:a=>e({createDialogOpen:a}),setDeleteDialogOpen:a=>e({deleteDialogOpen:a}),fetchAgentTools:async a=>{e({agentToolsLoading:!0});try{await Fe();const i=Re(),[s,o]=await Promise.all([i.toolsCatalog(a),i.configGet()]),u=Sc(o.config,a),f=u==null?void 0:u.tools;e({agentTools:s.tools,agentToolsConfig:f??null,configHash:o.hash??null,agentToolsLoading:!1})}catch{e({agentToolsLoading:!1})}},saveAgentToolsConfig:async(a,i)=>{try{await Fe();const s=Re(),{configHash:o}=t(),u=await dL(s,a,i,o??void 0);if(u.ok){const f=await s.configGet();e({agentToolsConfig:i,configHash:f.hash??null}),Ne.getState().setLifecycleFromWriteResult({...u,config:f.config},"save")}return u}catch{return{ok:!1,error:"unknown"}}},fetchAgentSkills:async a=>{e({agentSkillsLoading:!0});try{await Fe();const i=Re(),[s,o]=await Promise.all([i.skillsStatus(a),i.configGet()]),u=Sc(o.config,a),f=(u==null?void 0:u.skills)??null;e({agentSkills:s,agentSkillsAllowlist:f,configHash:o.hash??null,agentSkillsLoading:!1})}catch{e({agentSkillsLoading:!1})}},saveAgentSkillsAllowlist:async(a,i)=>{try{await Fe();const s=Re(),{configHash:o}=t(),u=await fL(s,a,i,o??void 0);if(u.ok){const f=await s.configGet();e({agentSkillsAllowlist:i,configHash:f.hash??null}),Ne.getState().setLifecycleFromWriteResult({...u,config:f.config},"save")}return u}catch{return{ok:!1,error:"unknown"}}},fetchAgentChannels:async()=>{e({agentChannelsLoading:!0});try{await Fe();const a=await Re().channelsStatus();e({agentChannels:a,agentChannelsLoading:!1})}catch{e({agentChannelsLoading:!1})}},fetchAgentCronJobs:async a=>{e({agentCronJobsLoading:!0});try{await Fe();const i=await Re().cronList();e({agentCronJobs:i.filter(s=>s.agentId===a),agentCronJobsLoading:!1})}catch{e({agentCronJobsLoading:!1})}},addAgentCronJob:async(a,i)=>{await Fe();const s=await Re().cronAdd({...i,agentId:a});e(o=>({agentCronJobs:[...o.agentCronJobs,s]})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")},updateAgentCronJob:async(a,i)=>{await Fe();const s=await Re().cronUpdate(a,i);e(o=>({agentCronJobs:o.agentCronJobs.map(u=>u.id===a?s:u)})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")},removeAgentCronJob:async a=>{await Fe(),await Re().cronRemove(a),e(i=>({agentCronJobs:i.agentCronJobs.filter(s=>s.id!==a)})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")},runAgentCronJob:async a=>{await Fe(),await Re().cronRun(a),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")},toggleAgentCronJob:async(a,i)=>{await Fe();const s=await Re().cronUpdate(a,{enabled:i});e(o=>({agentCronJobs:o.agentCronJobs.map(u=>u.id===a?s:u)})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")},openAgentCronDialog:a=>{e({cronDialogOpen:!0,cronEditingTask:a??null})},closeAgentCronDialog:()=>{e({cronDialogOpen:!1,cronEditingTask:null})}}));function pL({agent:e}){var f,h,g;const{t}=le("console"),a=An(x=>x.defaultAgentId),i=((f=e.identity)==null?void 0:f.name)??e.name??e.id,s=(h=e.identity)==null?void 0:h.emoji,o=(g=e.identity)==null?void 0:g.avatarUrl,u=e.id===a;return c.jsxs("div",{className:"flex items-start gap-4 rounded-2xl border border-gray-200 bg-white p-5 dark:border-gray-700 dark:bg-gray-900",children:[c.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-xl bg-gray-100 text-2xl dark:bg-gray-800",children:o?c.jsx("img",{src:o,alt:i,className:"h-14 w-14 rounded-xl object-cover"}):c.jsx("span",{children:s??i.charAt(0).toLowerCase()})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:i})}),c.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:t("agents.detailDescription",{id:e.id})})]}),c.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[c.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:e.id}),u&&c.jsx("span",{className:"rounded-md bg-gray-200 px-2 py-0.5 text-xs font-semibold uppercase text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:t("agents.defaultBadge")})]})]})}const yL={connected:"bg-green-500",disconnected:"bg-gray-400",connecting:"bg-yellow-500",error:"bg-red-500"},xL={telegram:"TG",discord:"DC",whatsapp:"WA",signal:"SG",feishu:"FS",imessage:"iM",matrix:"MX",line:"LN",msteams:"MS",googlechat:"GC",mattermost:"MM"};function bL({agent:e}){const{t}=le("console"),{agentChannels:a,agentChannelsLoading:i,fetchAgentChannels:s}=An();j.useEffect(()=>{s()},[e.id,s]);const o=a??[];return i?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.channels.title")}),c.jsx("button",{onClick:()=>s(),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Nn,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-200 bg-blue-50 px-4 py-3 dark:border-blue-800 dark:bg-blue-900/20",children:[c.jsx(Rc,{className:"mt-0.5 h-4 w-4 shrink-0 text-blue-600 dark:text-blue-400"}),c.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t("agents.channels.gatewayInfo")})]}),o.length===0?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(hl,{className:"mx-auto mb-2 h-8 w-8 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500",children:t("agents.channels.noBindings")})]}):c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:o.map(u=>c.jsx(vL,{channel:u},u.id))})]})}function vL({channel:e}){const{t}=le("console"),a=xL[e.type]??e.type.slice(0,2).toUpperCase(),i=yL[e.status]??"bg-gray-400",s=t(`agents.channels.${e.status}`);return c.jsx("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-sm font-bold text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:a}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("span",{className:"truncate text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name||e.type})}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${i}`}),c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:s}),e.configured&&c.jsx("span",{className:"rounded bg-green-100 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:t("agents.channels.configured")})]}),e.error&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.error})]})]})})}function kL(e){const t=wL(e.schedule),a=e.payload.kind==="agentTurn"?e.payload.message:e.payload.kind==="systemEvent"?e.payload.text:"";return{id:e.id,name:e.name,schedule:t,scheduleLabel:SL(t),enabled:e.enabled,lastRunAt:e.state.lastRunAtMs??null,nextRunAt:e.state.nextRunAtMs??null,lastRunStatus:e.state.lastRunStatus??null,message:a,statusLabel:e.enabled?Te.t("console:viewModels.taskStatus.active"):Te.t("console:viewModels.taskStatus.paused")}}function wL(e){return e.kind==="cron"&&e.expr?e.expr:e.kind==="every"&&e.everyMs?Te.t("console:viewModels.schedule.every",{minutes:Math.round(e.everyMs/6e4)}):e.kind==="at"&&e.at?Te.t("console:viewModels.schedule.at",{time:e.at}):Te.t("console:viewModels.schedule.unknown")}function SL(e){const t=e.split(" ");if(t.length!==5)return e;const[a,i,s,o,u]=t;return s==="*"&&u==="*"&&i!=="*"&&a!=="*"?Te.t("console:viewModels.schedule.daily",{time:`${i}:${a.padStart(2,"0")}`}):u!=="*"&&s==="*"?Te.t("console:viewModels.schedule.weekly",{day:u,time:`${i}:${a.padStart(2,"0")}`}):e}const jL={ok:c.jsx(jr,{className:"h-3.5 w-3.5 text-green-500"}),error:c.jsx(Mc,{className:"h-3.5 w-3.5 text-red-500"}),skipped:c.jsx(E5,{className:"h-3.5 w-3.5 text-gray-400"})};function _k({task:e,onToggle:t,onRun:a,onEdit:i,onDelete:s}){const{t:o}=le("console"),u=kL(e),f=e.payload.kind==="agentTurn"?e.payload.message:e.payload.kind==="systemEvent"?e.payload.text:"",h=u.lastRunAt?new Date(u.lastRunAt).toLocaleString():"—",g=u.nextRunAt?new Date(u.nextRunAt).toLocaleString():"—";return c.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 transition-opacity dark:border-gray-700 dark:bg-gray-800 ${e.enabled?"":"opacity-60"}`,children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsxs("label",{className:"relative mt-0.5 inline-flex cursor-pointer items-center",children:[c.jsx("input",{type:"checkbox",checked:e.enabled,onChange:()=>t(e.id,!e.enabled),className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:u.scheduleLabel})]}),f&&c.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500 dark:text-gray-400",children:f}),c.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-gray-400 dark:text-gray-500",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[o("cron.card.lastRun"),": ",h,e.state.lastRunStatus&&c.jsx("span",{className:"ml-1",children:jL[e.state.lastRunStatus]??null})]}),c.jsxs("span",{children:[o("cron.card.nextRun"),": ",g]})]}),e.state.lastError&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.state.lastError})]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button",onClick:()=>a(e.id),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("cron.card.runNow"),children:c.jsx(H5,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>i(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("common:actions.edit"),children:c.jsx(Fv,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>s(e.id),className:"rounded p-1.5 text-gray-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20 dark:hover:text-red-400 transition-colors",title:o("common:actions.delete"),children:c.jsx(gl,{className:"h-4 w-4"})})]})]})})}const Fb=[{labelKey:"console:cron.presets.everyHour",schedule:{kind:"cron",expr:"0 * * * *"}},{labelKey:"console:cron.presets.daily9am",schedule:{kind:"cron",expr:"0 9 * * *"}},{labelKey:"console:cron.presets.daily6pm",schedule:{kind:"cron",expr:"0 18 * * *"}},{labelKey:"console:cron.presets.weeklyMon",schedule:{kind:"cron",expr:"0 9 * * 1"}},{labelKey:"console:cron.presets.monthlyFirst",schedule:{kind:"cron",expr:"0 9 1 * *"}},{labelKey:"console:cron.presets.every30min",schedule:{kind:"every",everyMs:18e5}}];function Pb(e){return e.kind==="cron"?e.expr:e.kind==="every"?`every ${Math.round(e.everyMs/6e4)}m`:e.kind==="at"?`at ${e.at}`:""}function CL(e){const t=e.payloadKind??"agentTurn",a=t==="systemEvent"?{kind:"systemEvent",text:e.message.trim()}:{kind:"agentTurn",message:e.message.trim()};return{name:e.name.trim(),description:e.description.trim()||void 0,schedule:e.schedule,sessionTarget:t==="systemEvent"?"main":"isolated",wakeMode:"now",payload:a}}function Rk({open:e,editingTask:t,onSave:a,onUpdate:i,onClose:s}){const{t:o}=le("console"),u=j.useRef(null),[f,h]=j.useState(""),[g,x]=j.useState(""),[p,b]=j.useState({kind:"cron",expr:"0 18 * * *"}),[v,w]=j.useState("0 18 * * *"),[C,E]=j.useState(""),[S,N]=j.useState(null),[D,U]=j.useState({});j.useEffect(()=>{const X=u.current;X&&(e&&!X.open?(t?(h(t.name),x(t.description??""),b(t.schedule),w(Pb(t.schedule)),E(t.payload.kind==="agentTurn"?t.payload.message:t.payload.kind==="systemEvent"?t.payload.text:""),N(null)):(h(""),x(""),b({kind:"cron",expr:"0 18 * * *"}),w("0 18 * * *"),E(""),N(null)),U({}),X.showModal()):!e&&X.open&&X.close())},[e,t]);const z=X=>{const F=Fb[X];N(X),b(F.schedule),w(Pb(F.schedule))},L=X=>{w(X),N(null),b({kind:"cron",expr:X})},G=()=>{const X={};if(f.trim()||(X.name=!0),C.trim()||(X.message=!0),v.trim()||(X.cronExpr=!0),U(X),Object.keys(X).length>0)return;const F=CL({name:f,description:g,schedule:p,message:C,payloadKind:(t==null?void 0:t.payload.kind)==="systemEvent"?"systemEvent":"agentTurn"});t?i(t.id,F):a(F)};return c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto max-w-lg rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"max-h-[80vh] overflow-y-auto p-6",children:[c.jsx("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-gray-100",children:o(t?"cron.dialog.editTitle":"cron.dialog.createTitle")}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[o("cron.dialog.name")," ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("input",{type:"text",value:f,onChange:X=>h(X.target.value),placeholder:o("cron.dialog.namePlaceholder"),className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${D.name?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),D.name&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:o("cron.dialog.required")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("cron.dialog.description")}),c.jsx("input",{type:"text",value:g,onChange:X=>x(X.target.value),placeholder:o("cron.dialog.descriptionPlaceholder"),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("cron.dialog.schedule")}),c.jsx("div",{className:"mb-3 flex flex-wrap gap-2",children:Fb.map((X,F)=>c.jsx("button",{type:"button",onClick:()=>z(F),className:`rounded-md border px-3 py-1.5 text-xs font-medium transition-colors ${S===F?"border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/20 dark:text-blue-400":"border-gray-300 text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:o(X.labelKey)},F))}),c.jsx("input",{type:"text",value:v,onChange:X=>L(X.target.value),placeholder:"0 * * * *",className:`w-full rounded-md border bg-white px-3 py-2 text-sm font-mono dark:bg-gray-700 dark:text-gray-100 ${D.cronExpr?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),c.jsx("p",{className:"mt-1 text-xs text-gray-400",children:o("cron.dialog.cronHelp")})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[o("cron.dialog.message")," ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("textarea",{value:C,onChange:X=>E(X.target.value),placeholder:o("cron.dialog.messagePlaceholder"),rows:3,className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${D.message?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),D.message&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:o("cron.dialog.required")})]})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("common:actions.cancel")}),c.jsx("button",{type:"button",onClick:G,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:o(t?"common:actions.save":"common:actions.create")})]})]})})}function NL({agent:e}){const{t}=le("console"),{agentCronJobs:a,agentCronJobsLoading:i,cronDialogOpen:s,cronEditingTask:o,fetchAgentCronJobs:u,addAgentCronJob:f,updateAgentCronJob:h,removeAgentCronJob:g,runAgentCronJob:x,toggleAgentCronJob:p,openAgentCronDialog:b,closeAgentCronDialog:v}=An();j.useEffect(()=>{u(e.id)},[e.id,u]);const w=a??[],C=w.length,E=w.filter(U=>U.enabled).length,S=w.filter(U=>U.state.lastRunStatus==="error").length,N=U=>{f(e.id,U)},D=(U,z)=>{h(U,z)};return i?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.cronJobs.title")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{onClick:()=>b(),className:"flex items-center gap-1 rounded-lg bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700",children:[c.jsx(jn,{className:"h-3.5 w-3.5"}),t("agents.cronJobs.addTask")]}),c.jsx("button",{onClick:()=>u(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Nn,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(Xf,{label:t("agents.cronJobs.total"),value:C}),c.jsx(Xf,{label:t("agents.cronJobs.enabled"),value:E,color:"green"}),c.jsx(Xf,{label:t("agents.cronJobs.errors"),value:S,color:"red"})]}),w.length===0?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(Oi,{className:"mx-auto mb-2 h-8 w-8 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500",children:t("agents.cronJobs.noCronJobs")}),c.jsx("button",{onClick:()=>b(),className:"mt-2 text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400",children:t("cron.empty.createFirst")})]}):c.jsx("div",{className:"space-y-2",children:w.map(U=>c.jsx(_k,{task:U,onToggle:(z,L)=>p(z,L),onRun:z=>x(z),onEdit:z=>b(z),onDelete:z=>g(z)},U.id))}),c.jsx(Rk,{open:s,editingTask:o,onSave:N,onUpdate:D,onClose:v})]})}function Xf({label:e,value:t,color:a}){const i=a==="green"?"text-green-600 dark:text-green-400":a==="red"?"text-red-600 dark:text-red-400":"text-gray-900 dark:text-gray-100";return c.jsxs("div",{className:"rounded-lg border border-gray-200 px-3 py-2 dark:border-gray-700",children:[c.jsx("div",{className:`text-lg font-semibold ${i}`,children:t}),c.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:e})]})}function AL(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function EL(e,t){const a=typeof e=="number"?e:new Date(e).getTime();if(Number.isNaN(a)||a===0)return"—";const i=Date.now()-a;if(i<0)return t("agents.files.justNow");const s=Math.floor(i/36e5);if(s<1)return t("agents.files.justNow");if(s<24)return t("agents.files.hoursAgo",{count:s});const o=Math.floor(s/24);return t("agents.files.daysAgo",{count:o})}function TL({agent:e}){const{t}=le("console"),{files:a,filesLoading:i,selectedFileName:s,fileContent:o,isFileDirty:u,fileSaving:f,fetchFiles:h,fetchFileContent:g,setFileContent:x,resetFileContent:p,saveFileContent:b}=An();j.useEffect(()=>{h(e.id)},[e.id,h]);const v=a.find(C=>C.name===s),w=async()=>{s&&o!=null&&await b(e.id,s,o)};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.files.title")}),c.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:t("agents.files.description")})]}),c.jsx("button",{onClick:()=>h(e.id),disabled:i,className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:c.jsx(Nn,{className:`h-4 w-4 ${i?"animate-spin":""}`})})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx("div",{className:"w-56 shrink-0 space-y-2",children:a.map(C=>c.jsxs("button",{onClick:()=>g(e.id,C.name),className:`w-full rounded-xl border px-3 py-2.5 text-left transition-colors ${s===C.name?"border-red-400 bg-red-50 dark:border-red-600 dark:bg-red-900/20":"border-gray-200 hover:border-gray-300 hover:bg-gray-50 dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-800"}`,children:[c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:C.name}),c.jsxs("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:[AL(C.size)," · ",EL(C.modifiedAt,t)]})]},C.name))}),c.jsx("div",{className:"min-w-0 flex-1",children:v&&o!=null?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{children:c.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:v.name})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:p,disabled:!u,className:"rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:t("agents.files.reset")}),c.jsx("button",{onClick:w,disabled:!u||f,className:"rounded-md bg-red-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-red-600 disabled:opacity-50",children:t(f?"agents.files.saving":"agents.files.save")})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-xs font-medium text-gray-500 dark:text-gray-400",children:t("agents.files.content")}),c.jsx("textarea",{value:o,onChange:C=>x(C.target.value),className:"h-80 w-full resize-y rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200"})]})]}):c.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-gray-400 dark:text-gray-500",children:t("agents.files.selectFile")})})]})]})}function ML({agent:e}){var L;const{t}=le("console"),{defaultAgentId:a,updateAgentModel:i,setDeleteDialogOpen:s,systemModels:o,fetchSystemModels:u,agentModelConfigs:f}=An(),h=e.id===a,g=f[e.id],[x,p]=j.useState((g==null?void 0:g.primary)??""),[b,v]=j.useState((g==null?void 0:g.fallbacks)??[]),[w,C]=j.useState(!1),[E,S]=j.useState("idle");j.useEffect(()=>{o.length===0&&u()},[o.length,u]),j.useEffect(()=>{const G=f[e.id];p((G==null?void 0:G.primary)??""),v((G==null?void 0:G.fallbacks)??[]),S("idle")},[e.id,f]);const N=async()=>{C(!0),S("idle");const G=b.filter(_=>_.length>0),X=G.length>0?{primary:x||void 0,fallbacks:G}:x||"",F=await i(e.id,X);C(!1),S(F?"success":"error"),F&&(await u(),setTimeout(()=>S("idle"),2e3))},D=()=>v([...b,""]),U=G=>v(b.filter((X,F)=>F!==G)),z=(G,X)=>{const F=[...b];F[G]=X,v(F)};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.overview.title")}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Zf,{label:t("agents.overview.agentId"),value:e.id,mono:!0}),c.jsx(Zf,{label:t("agents.overview.name"),value:((L=e.identity)==null?void 0:L.name)??e.name??e.id}),c.jsx(Zf,{label:t("agents.overview.isDefault"),value:t(h?"agents.overview.yes":"agents.overview.no")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.overview.modelConfig")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.overview.primaryModel")}),c.jsx(Gb,{value:x,onChange:p,models:o,placeholder:t("agents.overview.primaryModelPlaceholder")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.overview.fallbackModels")}),b.map((G,X)=>c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(Gb,{value:G,onChange:F=>z(X,F),models:o,placeholder:t("agents.overview.fallbackPlaceholder")}),c.jsx("button",{onClick:()=>U(X),className:"shrink-0 rounded-md p-1.5 text-gray-400 hover:bg-gray-100 hover:text-red-500 dark:hover:bg-gray-800",children:c.jsx(Sn,{className:"h-4 w-4"})})]},X)),c.jsxs("button",{onClick:D,className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400",children:[c.jsx(jn,{className:"h-3 w-3"}),t("agents.overview.addFallback")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:N,disabled:w,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(w?"agents.overview.saving":"agents.overview.save")}),E==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.overview.saveSuccess")}),E==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.overview.saveError")})]}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t("agents.overview.runtimeHint")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsxs("button",{onClick:()=>s(!0),disabled:h,className:"flex items-center gap-2 rounded-lg border border-red-200 px-4 py-2 text-sm font-medium text-red-600 transition-colors hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50 dark:border-red-800 dark:text-red-400 dark:hover:bg-red-900/20",title:h?t("agents.overview.cannotDeleteDefault"):void 0,children:[c.jsx(gl,{className:"h-4 w-4"}),t("agents.overview.deleteAgent")]}),h&&c.jsx("p",{className:"mt-1 text-xs text-gray-400",children:t("agents.overview.cannotDeleteDefault")})]})]})}function Zf({label:e,value:t,mono:a}){return c.jsxs("div",{children:[c.jsx("dt",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:e}),c.jsx("dd",{className:`mt-0.5 text-sm text-gray-900 dark:text-gray-100 ${a?"font-mono":""}`,children:t})]})}function Gb({value:e,onChange:t,models:a,placeholder:i}){const s=[...new Set(a.map(u=>u.provider))],o=a.some(u=>u.id===e);return c.jsxs("div",{className:"relative w-full",children:[c.jsxs("select",{value:o?e:"",onChange:u=>t(u.target.value),className:"w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",children:[c.jsx("option",{value:"",children:i}),!o&&e&&c.jsx("option",{value:e,children:e}),s.map(u=>c.jsx("optgroup",{label:u,children:a.filter(f=>f.provider===u).map(f=>c.jsxs("option",{value:f.id,children:[f.label," (",f.id,")"]},f.id))},u))]}),c.jsx(Un,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})}function DL({agent:e}){const{t}=le("console"),{agentSkills:a,agentSkillsLoading:i,agentSkillsAllowlist:s,fetchAgentSkills:o,saveAgentSkillsAllowlist:u}=An(),[f,h]=j.useState("all"),[g,x]=j.useState([]),[p,b]=j.useState(!1),[v,w]=j.useState("idle");j.useEffect(()=>{o(e.id)},[e.id,o]),j.useEffect(()=>{s==null?(h("all"),x([])):(h("selected"),x(s)),w("idle")},[s]);const C=q=>{if(h(q),q==="all")x([]);else{const V=(a==null?void 0:a.filter(re=>re.enabled).map(re=>re.slug))??[];x(V)}},E=(q,V)=>{x(re=>V?[...re,q]:re.filter(W=>W!==q))},S=a??[],N=j.useMemo(()=>S.filter(q=>!Wo(q)),[S]),D=()=>{x(S.map(q=>q.slug))},U=()=>{const q=S.filter(V=>Wo(V)).map(V=>V.slug);x(q)},z=j.useCallback(async()=>{b(!0),w("idle");const q=await u(e.id,f==="all"?null:g);b(!1),w(q.ok?"success":"error"),q.ok&&setTimeout(()=>w("idle"),2e3)},[e.id,f,g,u]),{totalCount:L,enabledCount:G,blockedCount:X}=j.useMemo(()=>{const q=S.length;if(f==="all")return{totalCount:q,enabledCount:S.filter(W=>W.enabled).length,blockedCount:S.filter(W=>W.blockedByAllowlist).length};const V=new Set(g),re=S.filter(W=>Wo(W)||V.has(W.slug)).length;return{totalCount:q,enabledCount:re,blockedCount:q-re}},[S,f,g]),F=f==="selected"&&N.every(q=>g.includes(q.slug)),_=f==="selected"&&N.every(q=>!g.includes(q.slug));return i?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.skills.title")}),c.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Nn,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(Jf,{label:t("agents.skills.total"),value:L}),c.jsx(Jf,{label:t("agents.skills.enabled"),value:G,color:"green"}),c.jsx(Jf,{label:t("agents.skills.blocked"),value:X,color:"red"})]}),c.jsx("div",{className:"rounded-lg border border-gray-200 p-4 dark:border-gray-700",children:c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"radio",name:"skillMode",checked:f==="all",onChange:()=>C("all"),className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:t("agents.skills.modeAll")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"radio",name:"skillMode",checked:f==="selected",onChange:()=>C("selected"),className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:t("agents.skills.modeSelected")})]})]})}),f==="selected"&&S.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{onClick:D,disabled:F,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700",children:[c.jsx(e3,{className:"h-3.5 w-3.5"}),t("agents.skills.selectAll")]}),c.jsxs("button",{onClick:U,disabled:_,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700",children:[c.jsx(Wh,{className:"h-3.5 w-3.5"}),t("agents.skills.deselectAll")]})]}),c.jsx("div",{className:"space-y-1",children:S.length===0?c.jsx("div",{className:"py-8 text-center text-sm text-gray-400 dark:text-gray-500",children:t("agents.skills.noRestriction")}):S.map(q=>c.jsx(RL,{skill:q,selectable:f==="selected",checked:_L(q,f,g),locked:Wo(q),onToggle:V=>E(q.slug,V)},q.id))}),c.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-4 dark:border-gray-700",children:[c.jsx("button",{onClick:z,disabled:p,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(p?"agents.skills.saving":"agents.skills.save")}),v==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.skills.saveSuccess")}),v==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.skills.saveError")})]})]})}function _L(e,t,a){return t==="all"?e.enabled:e.isCore&&e.always?!0:a.includes(e.slug)}function Wo(e){return!!(e.isCore&&e.always)}function Jf({label:e,value:t,color:a}){const i=a==="green"?"text-green-600 dark:text-green-400":a==="red"?"text-red-600 dark:text-red-400":"text-gray-900 dark:text-gray-100";return c.jsxs("div",{className:"rounded-lg border border-gray-200 px-3 py-2 dark:border-gray-700",children:[c.jsx("div",{className:`text-lg font-semibold ${i}`,children:t}),c.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:e})]})}function RL({skill:e,selectable:t,checked:a,locked:i,onToggle:s}){var p,b;const{t:o}=le("console"),u=((p=e.missing)==null?void 0:p.bins)&&e.missing.bins.length>0||((b=e.missing)==null?void 0:b.env)&&e.missing.env.length>0,f=e.isCore||e.isBundled?o("agents.skills.sourceBuiltIn"):o("agents.skills.sourceMarketplace"),h=e.isCore||e.isBundled?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",g=t?o(a?"skills.detail.enabled":"skills.detail.disabled"):e.enabled?o("skills.detail.enabled"):o("skills.detail.disabled"),x=t?a?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400":e.enabled?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400";return c.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2.5 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[t&&c.jsx("input",{type:"checkbox",checked:a,disabled:i,onChange:v=>s(v.target.checked),"aria-label":e.name,className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 disabled:opacity-50"}),c.jsx("span",{className:"text-lg",children:e.icon||c.jsx(J5,{className:"h-4 w-4 text-gray-400"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${x}`,children:g}),c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${h}`,children:f})]}),e.description&&c.jsx("p",{className:"mt-0.5 line-clamp-1 text-xs text-gray-500 dark:text-gray-400",children:e.description})]}),u&&c.jsx("span",{title:o("agents.skills.missingDeps"),children:c.jsx(Li,{className:"h-4 w-4 shrink-0 text-amber-500"})})]})}const OL=["full","minimal","custom",""];function LL({agent:e}){const{t}=le("console"),{agentTools:a,agentToolsLoading:i,agentToolsConfig:s,fetchAgentTools:o,saveAgentToolsConfig:u}=An(),[f,h]=j.useState(""),[g,x]=j.useState([]),[p,b]=j.useState([]),[v,w]=j.useState(""),[C,E]=j.useState(""),[S,N]=j.useState(!1),[D,U]=j.useState("idle");j.useEffect(()=>{o(e.id)},[e.id,o]),j.useEffect(()=>{s&&(h(s.profile??""),x(s.alsoAllow??[]),b(s.deny??[])),U("idle")},[s]);const z=j.useCallback(async()=>{N(!0),U("idle");const q=await u(e.id,{profile:f||void 0,alsoAllow:g.length>0?g:void 0,deny:p.length>0?p:void 0});N(!1),U(q.ok?"success":"error"),q.ok&&setTimeout(()=>U("idle"),2e3)},[e.id,f,g,p,u]),L=(q,V,re)=>{const W=re.trim();W&&!q.includes(W)&&V([...q,W])},G=(q,V,re)=>{V(q.filter((W,J)=>J!==re))},X=UL(a??[]),F=(a==null?void 0:a.filter(q=>q.enabled!==!1).length)??0,_=(a==null?void 0:a.length)??0;return i?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.tools.title")}),c.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Nn,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50",children:c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("agents.tools.profile"),":"]}),c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:f||t("agents.tools.profileDefault")}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"|"}),c.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:t("agents.tools.enabledCount",{enabled:F,total:_})})]})}),c.jsxs("div",{className:"space-y-4 border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.tools.profile")}),c.jsxs("div",{className:"relative w-full max-w-xs",children:[c.jsx("select",{value:f,onChange:q=>h(q.target.value),"aria-label":t("agents.tools.profile"),className:"w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",children:OL.map(q=>c.jsx("option",{value:q,children:q||t("agents.tools.profileDefault")},q))}),c.jsx(Un,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]}),c.jsx(Vb,{label:t("agents.tools.alsoAllow"),tags:g,inputValue:v,onInputChange:w,onAdd:q=>{L(g,x,q),w("")},onRemove:q=>G(g,x,q),placeholder:t("agents.tools.addTool")}),c.jsx(Vb,{label:t("agents.tools.deny"),tags:p,inputValue:C,onInputChange:E,onAdd:q=>{L(p,b,q),E("")},onRemove:q=>G(p,b,q),placeholder:t("agents.tools.addTool")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:z,disabled:S,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(S?"agents.tools.saving":"agents.tools.save")}),D==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.tools.saveSuccess")}),D==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.tools.saveError")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.tools.catalogTitle")}),_===0?c.jsx(HL,{message:t("agents.tools.noTools")}):c.jsx("div",{className:"space-y-4",children:Object.entries(X).map(([q,V])=>c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:q}),c.jsx("div",{className:"space-y-1",children:V.map(re=>c.jsx(zL,{tool:re},re.name))})]},q))})]})]})}function Vb({label:e,tags:t,inputValue:a,onInputChange:i,onAdd:s,onRemove:o,placeholder:u}){return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:e}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.map((f,h)=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-gray-100 px-2 py-1 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:[f,c.jsx("button",{onClick:()=>o(h),className:"rounded-sm text-gray-400 hover:text-red-500",title:f,children:c.jsx(Sn,{className:"h-3 w-3"})})]},`${f}-${h}`)),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"text",value:a,onChange:f=>i(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),s(a))},placeholder:u,className:"w-36 rounded-md border border-gray-300 bg-white px-2 py-1 text-xs dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"}),c.jsx("button",{onClick:()=>s(a),className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-blue-600 dark:hover:bg-gray-700",title:e,children:c.jsx(jn,{className:"h-3.5 w-3.5"})})]})]})]})}function zL({tool:e}){const t=e.source==="built-in"?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":e.source==="plugin"?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";return c.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[c.jsx(Oc,{className:"h-4 w-4 shrink-0 text-gray-400"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name}),e.description&&c.jsx("p",{className:"line-clamp-1 text-xs text-gray-500 dark:text-gray-400",children:e.description})]}),e.source&&c.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ${t}`,children:e.source})]})}function HL({message:e}){return c.jsx("div",{className:"py-8 text-center text-sm text-gray-400 dark:text-gray-500",children:e})}function UL(e){const t={};for(const a of e){const i=a.source??"other";t[i]||(t[i]=[]),t[i].push(a)}return t}const IL=["overview","files","tools","skills","channels","cronJobs"];function BL({agent:e}){const{t}=le("console"),{activeTab:a,setActiveTab:i}=An();return c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsx("div",{className:"flex border-b border-gray-200 px-4 dark:border-gray-700",children:IL.map(s=>c.jsxs("button",{onClick:()=>i(s),className:`relative px-4 py-3 text-sm font-medium transition-colors ${a===s?"text-red-600 dark:text-red-400":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`,children:[t(`agents.tabs.${s}`),a===s&&c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-red-500"})]},s))}),c.jsxs("div",{className:"p-5",children:[a==="overview"&&c.jsx(ML,{agent:e},e.id),a==="files"&&c.jsx(TL,{agent:e},e.id),a==="tools"&&c.jsx(LL,{agent:e},e.id),a==="skills"&&c.jsx(DL,{agent:e},e.id),a==="channels"&&c.jsx(bL,{agent:e},e.id),a==="cronJobs"&&c.jsx(NL,{agent:e},e.id)]})]})}function qL({agent:e,isSelected:t,isDefault:a,onSelect:i}){var h,g,x;const{t:s}=le("console"),o=((h=e.identity)==null?void 0:h.name)??e.name??e.id,u=(g=e.identity)==null?void 0:g.emoji,f=(x=e.identity)==null?void 0:x.avatarUrl;return c.jsxs("button",{onClick:i,className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left transition-colors ${t?"border-l-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-lg dark:bg-gray-800",children:f?c.jsx("img",{src:f,alt:o,className:"h-9 w-9 rounded-lg object-cover"}):c.jsx("span",{children:u??o.charAt(0).toLowerCase()})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-sm font-medium text-gray-900 dark:text-gray-100",children:o}),a&&c.jsx("span",{className:"shrink-0 rounded-md bg-gray-200 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:s("agents.defaultBadge")})]}),c.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:e.id})]})]})}function $L(){const{t:e}=le("console"),{agents:t,isLoading:a,selectedAgentId:i,searchQuery:s,defaultAgentId:o,fetchAgents:u,selectAgent:f,setSearchQuery:h,setCreateDialogOpen:g}=An(),x=t.filter(p=>{var w;if(!s)return!0;const b=s.toLowerCase();return(((w=p.identity)==null?void 0:w.name)??p.name??p.id).toLowerCase().includes(b)||p.id.toLowerCase().includes(b)});return c.jsxs("div",{className:"flex w-72 shrink-0 flex-col rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-700",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:e("agents.panelTitle")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("agents.configured",{count:t.length})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>g(!0),className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",title:e("agents.addAgent"),children:c.jsx(jn,{className:"h-4 w-4"})}),c.jsx("button",{onClick:()=>u(),disabled:a,className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",title:e("agents.refresh"),children:c.jsx(Nn,{className:`h-4 w-4 ${a?"animate-spin":""}`})})]})]}),c.jsx("div",{className:"px-3 py-2",children:c.jsxs("div",{className:"relative",children:[c.jsx(ph,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-gray-400"}),c.jsx("input",{type:"text",value:s,onChange:p=>h(p.target.value),placeholder:e("agents.searchPlaceholder"),className:"w-full rounded-lg border border-gray-200 bg-gray-50 py-1.5 pl-8 pr-3 text-xs text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:placeholder:text-gray-500"})]})}),c.jsx("div",{className:"flex-1 overflow-auto px-2 pb-2",children:x.length===0?c.jsx("div",{className:"flex flex-col items-center py-8 text-center",children:c.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:e("agents.noAgents")})}):c.jsx("div",{className:"space-y-1",children:x.map(p=>c.jsx(qL,{agent:p,isSelected:i===p.id,isDefault:p.id===o,onSelect:()=>f(p.id)},p.id))})})]})}function KL(){const{t:e}=le("console"),{createDialogOpen:t,setCreateDialogOpen:a,createAgent:i,selectAgent:s}=An(),[o,u]=j.useState(""),[f,h]=j.useState(""),[g,x]=j.useState(""),[p,b]=j.useState(!1),[v,w]=j.useState("");if(!t)return null;const C=()=>{a(!1),u(""),h(""),x(""),w("")},E=async()=>{if(!o.trim()){w(e("agents.createDialog.nameRequired"));return}const S=f.trim()||`~/.openclaw/workspace-${o.trim().toLowerCase().replace(/\s+/g,"-")}`;b(!0),w("");const N=await i({name:o.trim(),workspace:S,emoji:g.trim()||void 0});b(!1),N?(s(N),C()):w(e("agents.overview.saveError"))};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e("agents.createDialog.title")}),c.jsx("button",{onClick:C,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800",children:c.jsx(Sn,{className:"h-5 w-5"})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[e("agents.createDialog.name")," *"]}),c.jsx("input",{type:"text",value:o,onChange:S=>u(S.target.value),placeholder:e("agents.createDialog.namePlaceholder"),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:e("agents.createDialog.workspace")}),c.jsx("input",{type:"text",value:f,onChange:S=>h(S.target.value),placeholder:e("agents.createDialog.workspacePlaceholder"),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:e("agents.createDialog.emoji")}),c.jsx("input",{type:"text",value:g,onChange:S=>x(S.target.value),placeholder:e("agents.createDialog.emojiPlaceholder"),className:"w-24 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),v&&c.jsx("p",{className:"text-sm text-red-600",children:v}),c.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[c.jsx("button",{onClick:C,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",children:e("agents.createDialog.cancel")}),c.jsx("button",{onClick:E,disabled:p,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:e(p?"agents.createDialog.creating":"agents.createDialog.create")})]})]})]})})}function FL(){var w;const{t:e}=le("console"),{deleteDialogOpen:t,setDeleteDialogOpen:a,selectedAgentId:i,agents:s,deleteAgent:o}=An(),[u,f]=j.useState(!1),[h,g]=j.useState(!1),x=s.find(C=>C.id===i);if(!t||!x)return null;const p=((w=x.identity)==null?void 0:w.name)??x.name??x.id,b=()=>{a(!1),f(!1)},v=async()=>{g(!0),await o(x.id,u),g(!1),b()};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Li,{className:"h-5 w-5 text-red-500"}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e("agents.deleteDialog.title")})]}),c.jsx("button",{onClick:b,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800",children:c.jsx(Sn,{className:"h-5 w-5"})})]}),c.jsx("p",{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:e("agents.deleteDialog.confirm",{name:p})}),c.jsxs("label",{className:"mb-4 flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:C=>f(C.target.checked),className:"rounded border-gray-300 text-red-600 focus:ring-red-500"}),e("agents.deleteDialog.deleteFiles")]}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:b,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",children:e("agents.deleteDialog.cancel")}),c.jsx("button",{onClick:v,disabled:h,className:"rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 disabled:opacity-50",children:e(h?"agents.deleteDialog.deleting":"agents.deleteDialog.delete")})]})]})})}function PL(){const{t:e}=le("console"),{selectedAgentId:t,agents:a,fetchAgents:i}=An(),s=a.find(o=>o.id===t)??null;return j.useEffect(()=>{i()},[i]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e("agents.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e("agents.description")})]}),c.jsxs("div",{className:"flex gap-6",children:[c.jsx($L,{}),c.jsx("div",{className:"min-w-0 flex-1",children:s?c.jsxs("div",{className:"space-y-4",children:[c.jsx(pL,{agent:s}),c.jsx(BL,{agent:s})]}):c.jsxs("div",{className:"flex h-96 flex-col items-center justify-center rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsx(qv,{className:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:e("agents.selectAgent")}),c.jsx("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:e("agents.selectAgentDesc")})]})})]}),c.jsx(KL,{}),c.jsx(FL,{})]})}const Gc={telegram:{type:"telegram",nameKey:"console:channels.types.telegram",icon:"✈️",fields:[{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"}]},discord:{type:"discord",nameKey:"console:channels.types.discord",icon:"🎮",fields:[{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"},{key:"applicationId",labelKey:"console:channels.fields.applicationId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.applicationId"}]},whatsapp:{type:"whatsapp",nameKey:"console:channels.types.whatsapp",icon:"📱",fields:[],hasQrFlow:!0},signal:{type:"signal",nameKey:"console:channels.types.signal",icon:"🔒",fields:[{key:"phoneNumber",labelKey:"console:channels.fields.phoneNumber",type:"text",required:!0,placeholderKey:"console:channels.placeholders.phoneNumber"}]},feishu:{type:"feishu",nameKey:"console:channels.types.feishu",icon:"🐦",fields:[{key:"appId",labelKey:"console:channels.fields.appId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.appId"},{key:"appSecret",labelKey:"console:channels.fields.appSecret",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.appSecret"}]},imessage:{type:"imessage",nameKey:"console:channels.types.imessage",icon:"💬",fields:[]},matrix:{type:"matrix",nameKey:"console:channels.types.matrix",icon:"🔗",fields:[{key:"homeserver",labelKey:"console:channels.fields.homeserver",type:"text",required:!0,placeholderKey:"console:channels.placeholders.homeserver"},{key:"accessToken",labelKey:"console:channels.fields.accessToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.accessToken"}]},line:{type:"line",nameKey:"console:channels.types.line",icon:"🟢",fields:[{key:"channelAccessToken",labelKey:"console:channels.fields.channelAccessToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.channelAccessToken"},{key:"channelSecret",labelKey:"console:channels.fields.channelSecret",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.channelSecret"}]},msteams:{type:"msteams",nameKey:"console:channels.types.msteams",icon:"👔",fields:[{key:"appId",labelKey:"console:channels.fields.appId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.appId"},{key:"appPassword",labelKey:"console:channels.fields.appPassword",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.appPassword"}]},googlechat:{type:"googlechat",nameKey:"console:channels.types.googlechat",icon:"💭",fields:[{key:"serviceAccountJson",labelKey:"console:channels.fields.serviceAccount",type:"textarea",required:!0,placeholderKey:"console:channels.placeholders.serviceAccount"}]},mattermost:{type:"mattermost",nameKey:"console:channels.types.mattermost",icon:"💠",fields:[{key:"serverUrl",labelKey:"console:channels.fields.serverUrl",type:"text",required:!0,placeholderKey:"console:channels.placeholders.serverUrl"},{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"}]}},GL=Object.keys(Gc);function VL({channels:e,onSelect:t}){const{t:a}=le("console"),i=new Set(e.map(s=>s.type));return c.jsxs("div",{children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:a("channels.available.title")}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4",children:GL.map(s=>{const o=Gc[s],u=i.has(s);return c.jsxs("button",{type:"button",onClick:()=>t(s),className:"flex flex-col items-center gap-2 rounded-lg border border-gray-200 bg-white p-4 transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx("span",{className:"text-2xl",children:o.icon}),c.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:a(o.nameKey)}),u?c.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(jr,{className:"h-3 w-3"}),a("channels.available.configured")]}):c.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:[c.jsx(jn,{className:"h-3 w-3"}),a("channels.available.add")]})]},s)})})]})}const YL={connected:"bg-green-500",active:"bg-green-500",ok:"bg-green-500",disconnected:"bg-gray-400",paused:"bg-gray-400",disabled:"bg-gray-400",connecting:"bg-yellow-500",pending:"bg-yellow-500",running:"bg-yellow-500",error:"bg-red-500",failed:"bg-red-500"};function Ok({status:e,className:t=""}){const{t:a}=le("common"),i=YL[e]??"bg-gray-400",s=a(`status.${e}`,{defaultValue:e});return c.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs ${t}`,children:[c.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${i}`}),c.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s})]})}const QL={connected:"border-l-green-500",error:"border-l-red-500",connecting:"border-l-yellow-500",disconnected:"border-l-gray-300 dark:border-l-gray-600"};function XL({channel:e,onLogout:t,onDetail:a}){const{t:i}=le("console"),s=Gc[e.type],o=QL[e.status]??"border-l-gray-300",u=e.lastConnectedAt?new Date(e.lastConnectedAt).toLocaleString():null;return c.jsxs("div",{className:`flex items-center justify-between rounded-lg border border-l-4 bg-white p-4 dark:bg-gray-800 ${o} border-gray-200 dark:border-gray-700`,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"text-2xl",children:(s==null?void 0:s.icon)??"📡"}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:e.type})]}),c.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[c.jsx(Ok,{status:e.status}),u&&c.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:i("channels.card.lastConnected",{time:u})})]}),e.error&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.error})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>a(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:i("channels.card.details"),children:c.jsx(Rc,{className:"h-4 w-4"})}),e.status==="connected"&&c.jsx("button",{type:"button",onClick:()=>t(e),className:"rounded p-1.5 text-gray-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20 dark:hover:text-red-400 transition-colors",title:i("channels.card.logout"),children:c.jsx(v5,{className:"h-4 w-4"})})]})]})}const Lk=In((e,t)=>({channels:[],isLoading:!1,error:null,selectedChannel:null,configDialogOpen:!1,configDialogChannelType:null,qrState:"idle",qrDataUrl:null,qrError:null,fetchChannels:async()=>{e({isLoading:!0,error:null});try{await Fe();const a=await Re().channelsStatus();e({channels:a,isLoading:!1})}catch(a){e({error:String(a),isLoading:!1})}},logoutChannel:async(a,i)=>{try{await Re().channelsLogout(a,i),await t().fetchChannels()}catch(s){e({error:String(s)})}},openConfigDialog:(a,i)=>{e({configDialogOpen:!0,configDialogChannelType:a,selectedChannel:i??null,qrState:"idle",qrDataUrl:null,qrError:null})},closeConfigDialog:()=>{e({configDialogOpen:!1,configDialogChannelType:null,selectedChannel:null,qrState:"idle",qrDataUrl:null,qrError:null})},startQrPairing:async()=>{e({qrState:"loading",qrError:null});try{const a=await Re().webLoginStart(!0);e({qrState:"qr",qrDataUrl:a.qrDataUrl??null}),e({qrState:"scanning"});const i=await Re().webLoginWait();i.connected?(e({qrState:"success"}),await t().fetchChannels()):e({qrState:"error",qrError:i.message})}catch(a){e({qrState:"error",qrError:String(a)})}},cancelQrPairing:()=>{e({qrState:"idle",qrDataUrl:null,qrError:null})}}));function ZL({onClose:e}){const{t}=le("console"),{qrState:a,qrDataUrl:i,qrError:s,startQrPairing:o,cancelQrPairing:u}=Lk();return a==="idle"||a==="cancel"?c.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t("channels.qr.description")}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md bg-green-600 px-6 py-2 text-sm font-medium text-white hover:bg-green-700 transition-colors",children:t("channels.qr.startPairing")})]}):a==="loading"?c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(Dt,{className:"h-8 w-8 animate-spin text-green-500"}),c.jsx("p",{className:"text-sm text-gray-500",children:t("channels.qr.loading")})]}):a==="qr"||a==="scanning"?c.jsxs("div",{className:"flex flex-col items-center gap-4 py-4",children:[i&&c.jsx("img",{src:i,alt:"WhatsApp QR Code",className:"h-48 w-48 rounded-lg border border-gray-200 dark:border-gray-700"}),c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t(a==="scanning"?"channels.qr.waitingScan":"channels.qr.scanPrompt")}),a==="scanning"&&c.jsx(Dt,{className:"h-5 w-5 animate-spin text-green-500"}),c.jsx("button",{type:"button",onClick:u,className:"text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",children:t("common:actions.cancel")})]}):a==="success"?c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(Ri,{className:"h-10 w-10 text-green-500"}),c.jsx("p",{className:"font-medium text-green-600",children:t("channels.qr.success")}),c.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-gray-300 px-4 py-1.5 text-sm text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:t("common:actions.close")})]}):c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(Mc,{className:"h-10 w-10 text-red-500"}),c.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:s??t("channels.qr.error")}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-red-300 px-4 py-1.5 text-sm text-red-600 hover:bg-red-50 dark:border-red-700 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",children:t("common:actions.retry")})]})}function JL({open:e,channelType:t,onClose:a}){const{t:i}=le("console"),s=j.useRef(null),[o,u]=j.useState({}),[f,h]=j.useState({}),[g,x]=j.useState(new Set),p=t?Gc[t]:null;if(j.useEffect(()=>{const w=s.current;w&&(e&&!w.open?(u({}),h({}),x(new Set),w.showModal()):!e&&w.open&&w.close())},[e]),!p)return null;if(p.hasQrFlow)return c.jsx("dialog",{ref:s,onClose:a,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:p.icon}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:i(p.nameKey)})]}),c.jsx(ZL,{onClose:a})]})});const b=()=>{var E;const w={};let C=!1;for(const S of p.fields)S.required&&!((E=o[S.key])!=null&&E.trim())&&(w[S.key]=!0,C=!0);h(w),C||a()},v=w=>{x(C=>{const E=new Set(C);return E.has(w)?E.delete(w):E.add(w),E})};return c.jsx("dialog",{ref:s,onClose:a,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:p.icon}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:i(p.nameKey)})]}),c.jsx("div",{className:"space-y-4",children:p.fields.map(w=>c.jsx(WL,{field:w,value:o[w.key]??"",onChange:C=>u(E=>({...E,[w.key]:C})),hasError:f[w.key]??!1,isSecretVisible:g.has(w.key),onToggleSecret:()=>v(w.key)},w.key))}),c.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:i("channels.configDialog.cancel",{defaultValue:i("common:actions.cancel")})}),c.jsx("button",{type:"button",onClick:b,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:i("channels.configDialog.save",{defaultValue:i("common:actions.save")})})]})]})})}function WL({field:e,value:t,onChange:a,hasError:i,isSecretVisible:s,onToggleSecret:o}){const{t:u}=le("console"),f=i?"border-red-500":"border-gray-300 dark:border-gray-600";return e.type==="textarea"?c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[u(e.labelKey)," ",e.required&&c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("textarea",{value:t,onChange:h=>a(h.target.value),placeholder:u(e.placeholderKey),rows:4,className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${f}`}),i&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:u("channels.configDialog.required")})]}):c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[u(e.labelKey)," ",e.required&&c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:e.type==="secret"&&!s?"password":"text",value:t,onChange:h=>a(h.target.value),placeholder:u(e.placeholderKey),className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${f} ${e.type==="secret"?"pr-10":""}`}),e.type==="secret"&&c.jsx("button",{type:"button",onClick:o,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:s?c.jsx(Dc,{className:"h-4 w-4"}):c.jsx(_c,{className:"h-4 w-4"})})]}),i&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:u("channels.configDialog.required")})]})}function e8({channels:e}){const{t}=le("console"),a=e.filter(s=>s.status==="connected").length,i=e.filter(s=>s.status==="error").length;return c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("channels.stats.total")," ",c.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:e.length})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:[t("channels.stats.connected")," ",c.jsx("strong",{children:a})]}),i>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[t("channels.stats.errors")," ",c.jsx("strong",{children:i})]})]})]})}function ll({open:e,title:t,description:a,confirmLabel:i,onConfirm:s,onCancel:o,variant:u="default"}){const{t:f}=le("common"),h=j.useRef(null);j.useEffect(()=>{const x=h.current;x&&(e&&!x.open?x.showModal():!e&&x.open&&x.close())},[e]);const g=u==="danger"?"bg-red-600 hover:bg-red-700 text-white":"bg-blue-600 hover:bg-blue-700 text-white";return c.jsx("dialog",{ref:h,onClose:o,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-900 dark:text-gray-100",children:t}),c.jsx("p",{className:"mb-6 text-sm text-gray-600 dark:text-gray-400",children:a}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:f("actions.cancel")}),c.jsx("button",{type:"button",onClick:s,className:`rounded-md px-4 py-2 text-sm font-medium transition-colors ${g}`,children:i??f("actions.confirm")})]})]})})}function Sr({icon:e,title:t,description:a,action:i}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx(e,{className:"mb-4 h-12 w-12 text-gray-300 dark:text-gray-600",strokeWidth:1.5}),c.jsx("h3",{className:"mb-1 text-base font-medium text-gray-700 dark:text-gray-300",children:t}),a&&c.jsx("p",{className:"mb-4 max-w-sm text-sm text-gray-500 dark:text-gray-400",children:a}),i&&c.jsx("button",{type:"button",onClick:i.onClick,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:i.label})]})}function Vc({message:e,onRetry:t}){const{t:a}=le("common");return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx(Xh,{className:"mb-3 h-10 w-10 text-red-500"}),c.jsx("p",{className:"mb-4 text-sm text-red-600 dark:text-red-400",children:e}),t&&c.jsx("button",{type:"button",onClick:t,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:border-red-700 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",children:a("actions.retry")})]})}function vl({message:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(Dt,{className:"mb-3 h-8 w-8 animate-spin text-blue-500"}),e&&c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e})]})}function t8(){const{t:e}=le("console"),{channels:t,isLoading:a,error:i,fetchChannels:s,logoutChannel:o,configDialogOpen:u,configDialogChannelType:f,openConfigDialog:h,closeConfigDialog:g}=Lk(),[x,p]=j.useState(null);j.useEffect(()=>{s()},[s]);const b=async()=>{x&&(await o(x.type,x.accountId),p(null))};return a&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Wf,{title:e("channels.title"),description:e("channels.description"),onRefresh:s}),c.jsx(vl,{})]}):i&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Wf,{title:e("channels.title"),description:e("channels.description"),onRefresh:s}),c.jsx(Vc,{message:i,onRetry:s})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsx(Wf,{title:e("channels.title"),description:e("channels.description"),onRefresh:s,loading:a}),c.jsx(e8,{channels:t}),t.length===0?c.jsx(Sr,{icon:h5,title:e("channels.empty.title"),description:e("channels.empty.description")}):c.jsx("div",{className:"space-y-3",children:t.map(v=>c.jsx(XL,{channel:v,onLogout:p,onDetail:w=>h(w.type,w)},v.id))}),c.jsx(VL,{channels:t,onSelect:v=>h(v)}),c.jsx(JL,{open:u,channelType:f,onClose:g}),c.jsx(ll,{open:x!==null,title:e("channels.logout.title"),description:e("channels.logout.description",{name:(x==null?void 0:x.name)??""}),onConfirm:b,onCancel:()=>p(null),variant:"danger"})]})}function Wf({title:e,description:t,onRefresh:a,loading:i}){const{t:s}=le("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:a,disabled:i,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Nn,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`}),s("actions.refresh")]})]})}function n8({tasks:e}){const{t}=le("console"),a=e.filter(o=>o.enabled&&o.state.lastRunStatus!=="error").length,i=e.filter(o=>!o.enabled).length,s=e.filter(o=>o.state.lastRunStatus==="error").length;return c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("cron.stats.total")," ",c.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:e.length})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:[t("cron.stats.active")," ",c.jsx("strong",{children:a})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("cron.stats.paused")," ",c.jsx("strong",{children:i})]}),s>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[t("cron.stats.failed")," ",c.jsx("strong",{children:s})]})]})]})}const a8=In((e,t)=>({tasks:[],isLoading:!1,error:null,dialogOpen:!1,editingTask:null,fetchTasks:async()=>{e({isLoading:!0,error:null});try{await Fe();const a=await Re().cronList();e({tasks:a,isLoading:!1})}catch(a){e({error:String(a),isLoading:!1})}},addTask:async a=>{try{const i=await Re().cronAdd(a);e(s=>({tasks:[...s.tasks,i],dialogOpen:!1,editingTask:null})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(i){e({error:String(i)})}},updateTask:async(a,i)=>{try{const s=await Re().cronUpdate(a,i);e(o=>({tasks:o.tasks.map(u=>u.id===a?s:u),dialogOpen:!1,editingTask:null})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(s){e({error:String(s)})}},removeTask:async a=>{try{await Re().cronRemove(a),e(i=>({tasks:i.tasks.filter(s=>s.id!==a)})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(i){e({error:String(i)})}},runTask:async a=>{try{await Re().cronRun(a),Ne.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(i){e({error:String(i)})}},openDialog:a=>e({dialogOpen:!0,editingTask:a??null}),closeDialog:()=>e({dialogOpen:!1,editingTask:null}),handleCronEvent:a=>{!a.jobId||!a.state||e(i=>({tasks:i.tasks.map(s=>s.id===a.jobId?{...s,state:{...s.state,...a.state}}:s)}))},initEventListeners:()=>{const a=(o,u)=>{o==="cron"&&t().handleCronEvent(u)};let i=!1,s=()=>{};return Fe().then(()=>{i||(s=Re().onEvent(a))}).catch(()=>{s=()=>{}}),()=>{i=!0,s()}}}));function r8(){const{t:e}=le("console"),{tasks:t,isLoading:a,error:i,dialogOpen:s,editingTask:o,fetchTasks:u,addTask:f,updateTask:h,removeTask:g,runTask:x,openDialog:p,closeDialog:b,initEventListeners:v}=a8(),[w,C]=j.useState(null),[E,S]=j.useState(null);j.useEffect(()=>(u(),v()),[u,v]);const N=(L,G)=>{h(L,{enabled:G})},D=async()=>{w&&(await g(w),C(null))},U=async()=>{E&&(await x(E),S(null),await u())};if(a&&t.length===0)return c.jsxs("div",{className:"space-y-6",children:[c.jsx(eh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,onCreate:()=>p()}),c.jsx(vl,{})]});if(i&&t.length===0)return c.jsxs("div",{className:"space-y-6",children:[c.jsx(eh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,onCreate:()=>p()}),c.jsx(Vc,{message:i,onRetry:u})]});const z=[...t].sort((L,G)=>{const X=L.state.nextRunAtMs??1/0,F=G.state.nextRunAtMs??1/0;return X-F});return c.jsxs("div",{className:"space-y-6",children:[c.jsx(eh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,loading:a,onCreate:()=>p()}),c.jsx(n8,{tasks:t}),t.length===0?c.jsx(Sr,{icon:Oi,title:e("cron.empty.title"),action:{label:e("cron.empty.createFirst"),onClick:()=>p()}}):c.jsx("div",{className:"space-y-3",children:z.map(L=>c.jsx(_k,{task:L,onToggle:N,onRun:S,onEdit:p,onDelete:C},L.id))}),c.jsx(Rk,{open:s,editingTask:o,onSave:f,onUpdate:h,onClose:b}),c.jsx(ll,{open:w!==null,title:e("cron.delete.title"),description:e("cron.delete.description"),onConfirm:D,onCancel:()=>C(null),variant:"danger"}),c.jsx(ll,{open:E!==null,title:e("cron.run.title"),description:e("cron.run.description"),onConfirm:U,onCancel:()=>S(null)})]})}function eh({title:e,description:t,onRefresh:a,loading:i,onCreate:s}){const{t:o}=le("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(jn,{className:"h-3.5 w-3.5"}),o("actions.create")]}),c.jsxs("button",{type:"button",onClick:a,disabled:i,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Nn,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`}),o("actions.refresh")]})]})]})}const i8={warning:"border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-700 dark:bg-amber-900/20 dark:text-amber-300",error:"border-red-300 bg-red-50 text-red-800 dark:border-red-700 dark:bg-red-900/20 dark:text-red-300"};function Yb({variant:e,message:t,actionLabel:a,onAction:i}){const s=e==="warning"?Li:Mc;return c.jsxs("div",{className:`flex items-center gap-3 rounded-lg border px-4 py-3 text-sm ${i8[e]}`,children:[c.jsx(s,{className:"h-4 w-4 flex-shrink-0"}),c.jsx("span",{className:"flex-1",children:t}),a&&i&&c.jsx("button",{type:"button",onClick:i,className:"text-xs font-medium underline hover:no-underline",children:a})]})}const s8={whatsapp:"📱",telegram:"✈️",discord:"🎮",signal:"🔒",feishu:"🐦",imessage:"💬",matrix:"🔗",line:"🟢",msteams:"👔",googlechat:"💭",mattermost:"💠"};function l8({channels:e}){const{t}=le("console"),a=e.filter(i=>i.status==="connected");return a.length===0?c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.channelOverview.title")}),c.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[c.jsx(hl,{className:"h-4 w-4"}),c.jsx("span",{children:t("dashboard.channelOverview.empty")})]})]}):c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.channelOverview.title")}),c.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(i=>c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-50 px-3 py-1.5 dark:bg-gray-700/50",children:[c.jsx("span",{className:"text-base",children:s8[i.type]??"📡"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i.name}),c.jsx(Ok,{status:i.status})]},i.id))})]})}const o8=[{path:"/channels",icon:hl,titleKey:"console:channels.title",descKey:"console:channels.description"},{path:"/skills",icon:Oc,titleKey:"console:skills.title",descKey:"console:skills.description"},{path:"/cron",icon:Oi,titleKey:"console:cron.title",descKey:"console:cron.description"},{path:"/settings",icon:Jh,titleKey:"console:settings.title",descKey:"console:settings.description"}];function c8(){const e=ul(),{t}=le();return c.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:o8.map(a=>c.jsxs("button",{type:"button",onClick:()=>e(a.path),className:"flex flex-col items-start gap-2 rounded-lg border border-gray-200 bg-white p-4 text-left transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx(a.icon,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:t(a.titleKey)}),c.jsx("div",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 line-clamp-2",children:t(a.descKey)})]})]},a.path))})}function u8({skills:e}){const{t}=le("console"),a=e.filter(i=>i.enabled);return a.length===0?c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.skillOverview.title")}),c.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[c.jsx(Oc,{className:"h-4 w-4"}),c.jsx("span",{children:t("dashboard.skillOverview.empty")})]})]}):c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.skillOverview.title")}),c.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(i=>c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-50 px-3 py-1.5 dark:bg-gray-700/50",children:[c.jsx("span",{className:"text-base",children:i.icon||"📦"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i.name})]},i.id))})]})}function ec({icon:e,title:t,value:a,subtitle:i,progress:s,color:o="text-blue-500"}){return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(e,{className:`h-5 w-5 ${o}`}),c.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:t})]}),c.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:a}),i&&c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:i}),s!=null&&c.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700",children:c.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all",style:{width:`${Math.min(100,Math.max(0,s))}%`}})})]})}const d8=In(e=>({channelsSummary:[],skillsSummary:[],usage:null,uptime:0,isLoading:!1,error:null,refresh:async()=>{e({isLoading:!0,error:null});try{const t=await Fe(),a=await Promise.allSettled([t.channelsStatus(),t.skillsStatus(),t.usageStatus()]),i=a[0].status==="fulfilled"?a[0].value:[],s=a[1].status==="fulfilled"?a[1].value:[],o=a[2].status==="fulfilled"?a[2].value:null,u=[];a[0].status==="rejected"&&u.push(`channels: ${a[0].reason}`),a[1].status==="rejected"&&u.push(`skills: ${a[1].reason}`),a[2].status==="rejected"&&u.push(`usage: ${a[2].reason}`),e({channelsSummary:i,skillsSummary:s,usage:o,isLoading:!1,error:u.length>0?u.join("; "):null})}catch(t){e({error:String(t),isLoading:!1})}}}));function f8(){const{t:e}=le("console"),{channelsSummary:t,skillsSummary:a,usage:i,isLoading:s,error:o,refresh:u}=d8(),f=se(w=>w.connectionStatus);if(j.useEffect(()=>{u()},[u]),s&&t.length===0){const w=f!=="connected"&&f!=="connecting";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(th,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u}),w?c.jsx(Qb,{status:f,onRetry:u}):c.jsx(vl,{message:e("dashboard.loading")})]})}if(o&&t.length===0&&a.length===0){const w=f!=="connected";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(th,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u}),w?c.jsx(Qb,{status:f,onRetry:u}):c.jsx(Vc,{message:o,onRetry:u})]})}const h=t.filter(w=>w.status==="connected").length,g=t.filter(w=>w.status==="error").length,x=a.filter(w=>w.enabled).length,p=i==null?void 0:i.providers[0],b=p==null?void 0:p.windows[0],v=p?`${p.displayName}: ${(b==null?void 0:b.usedPercent)??0}%`:"—";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(th,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u,loading:s}),f!=="connected"&&c.jsx(Yb,{variant:"warning",message:e("dashboard.alerts.gatewayDisconnected")}),g>0&&c.jsx(Yb,{variant:"error",message:e("dashboard.alerts.channelErrors",{count:g})}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[c.jsx(ec,{icon:hl,title:e("dashboard.stats.channels"),value:`${h} / ${t.length}`,color:"text-green-500"}),c.jsx(ec,{icon:Oc,title:e("dashboard.stats.skills"),value:`${x} / ${a.length}`,color:"text-purple-500"}),c.jsx(ec,{icon:Qv,title:e("dashboard.stats.usage"),value:v,progress:b==null?void 0:b.usedPercent,color:"text-blue-500"}),c.jsx(ec,{icon:Oi,title:e("dashboard.stats.uptime"),value:f==="connected"?e("dashboard.stats.uptimeOnline"):"—",color:"text-amber-500"})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:e("dashboard.quickNav.title")}),c.jsx(c8,{})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(l8,{channels:t}),c.jsx(u8,{skills:a})]})]})}function Qb({status:e,onRetry:t}){const{t:a}=le("console"),{t:i}=le("common"),s=e==="reconnecting";return c.jsx("div",{className:"flex flex-col items-center justify-center py-12",children:c.jsxs("div",{className:"w-full max-w-md rounded-lg border border-amber-500/30 bg-amber-500/5 p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s?c.jsx(Dt,{className:"h-8 w-8 animate-spin text-amber-500"}):c.jsx(eg,{className:"h-8 w-8 text-amber-500"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:a("dashboard.connectionGuide.title")}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a(s?"dashboard.connectionGuide.reconnecting":"dashboard.connectionGuide.subtitle")})]})]}),c.jsxs("ol",{className:"mb-5 space-y-2.5 text-sm text-gray-600 dark:text-gray-300",children:[c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"1"}),c.jsx("span",{children:a("dashboard.connectionGuide.step1")})]}),c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"2"}),c.jsx("span",{children:a("dashboard.connectionGuide.step2")})]}),c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"3"}),c.jsx("span",{children:a("dashboard.connectionGuide.step3")})]})]}),c.jsxs("div",{className:"mb-4 rounded-md bg-gray-900/60 px-3 py-2 font-mono text-xs text-gray-300",children:[c.jsxs("p",{className:"text-gray-500",children:["# ",a("dashboard.connectionGuide.cmdComment")]}),c.jsx("p",{children:"openclaw-office --token <your-token>"})]}),c.jsx("button",{type:"button",onClick:t,className:"w-full rounded-md bg-amber-500/90 px-4 py-2 text-sm font-medium text-white hover:bg-amber-500 transition-colors",children:i("actions.retry")})]})})}function th({title:e,description:t,onRefresh:a,loading:i}){const{t:s}=le("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:a,disabled:i,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Nn,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`}),s("actions.refresh")]})]})}function h8(){const{t:e}=le("console"),t=Ne(a=>a.status);return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.about.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"text-center py-2",children:[c.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:e("settings.about.appName")}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("settings.about.tagline")}),(t==null?void 0:t.version)&&c.jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[e("settings.about.version"),": ",t.version]})]}),c.jsxs("div",{className:"flex justify-center gap-4 pt-2",children:[c.jsxs("a",{href:"https://docs.openclaw.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(fc,{className:"h-3.5 w-3.5"}),e("settings.about.docs")]}),c.jsxs("a",{href:"https://github.com/openclaw/openclaw",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(fc,{className:"h-3.5 w-3.5"}),e("settings.about.github")]})]})]})]})}const Xb="openclaw-console-theme",Zb="openclaw-console-lang",Jb="openclaw-console-dev-mode";function Wb(e,t){return typeof window>"u"?t:localStorage.getItem(e)??t}function g8(e,t){if(typeof window>"u")return t;const a=localStorage.getItem(e);return a===null?t:a==="true"}const ol=In(e=>({theme:Wb(Xb,"system"),language:Wb(Zb,"zh"),devModeUnlocked:g8(Jb,!1),setTheme:t=>{localStorage.setItem(Xb,t),e({theme:t})},setLanguage:t=>{localStorage.setItem(Zb,t),e({language:t})},setDevModeUnlocked:t=>{localStorage.setItem(Jb,String(t)),e({devModeUnlocked:t})}}));function m8(){const{t:e}=le("console"),t=ol(i=>i.devModeUnlocked),a=ol(i=>i.setDevModeUnlocked);return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.advanced.title")}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.advanced.devMode")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("settings.advanced.devModeHint")})]}),c.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>a(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${t?"bg-blue-600":"bg-gray-300 dark:bg-gray-600"}`,children:c.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})]})}const p8=[{value:"light",icon:r3,labelKey:"settings.appearance.themeLight"},{value:"dark",icon:_5,labelKey:"settings.appearance.themeDark"},{value:"system",icon:M5,labelKey:"settings.appearance.themeSystem"}],y8=[{value:"zh",labelKey:"settings.appearance.langZh"},{value:"en",labelKey:"settings.appearance.langEn"}];function x8(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function b8(){const{t:e,i18n:t}=le("console"),a=ol(u=>u.theme),i=ol(u=>u.setTheme),s=se(u=>u.setTheme),o=u=>{i(u);const f=u==="system"?x8():u;s(f)};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.appearance.title")}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.appearance.theme")}),c.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 p-1 dark:border-gray-600",children:p8.map(({value:u,icon:f,labelKey:h})=>c.jsxs("button",{type:"button",onClick:()=>o(u),className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${a===u?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:[c.jsx(f,{className:"h-3.5 w-3.5"}),e(h)]},u))})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.appearance.language")}),c.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 p-1 dark:border-gray-600",children:y8.map(({value:u,labelKey:f})=>c.jsx("button",{type:"button",onClick:()=>t.changeLanguage(u),className:`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${t.language===u?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:e(f)},u))})]})]})]})}const ev="/gateway-ws",tv="token";function nh(e){return`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}`}function v8(e,t){const a=e.toString();return/^[a-z]+:\/\/[^/?#]+(?:\?[^#]*)?(?:#.*)?$/i.test(t)?a.replace(/\/$/,""):a}function sc(e){if(!e||e.startsWith("/"))return{url:e,token:""};try{const t=new URL(e),a=t.searchParams.get(tv)??"";return t.searchParams.delete(tv),t.protocol==="http:"?t.protocol="ws:":t.protocol==="https:"&&(t.protocol="wss:"),{url:v8(t,e),token:a}}catch{return{url:e,token:""}}}function zk(e,t,a,i={}){const s=sc(e);return i.preferSameOriginProxy?{url:`${nh(a)}${ev}`,token:t||s.token}:s.url?s.url.startsWith("/")?{url:`${nh(a)}${s.url}`,token:t||s.token}:{url:s.url,token:t||s.token}:{url:`${nh(a)}${ev}`,token:t||s.token}}const Tg=["openai-completions","openai-responses","openai-codex-responses","anthropic-messages","google-generative-ai","github-copilot","bedrock-converse-stream","ollama"],k8=["text","image"],w8=["openai","zai","qwen"],S8=["max_completion_tokens","max_tokens"];function j8(){return{id:"",name:"",reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192}}const Xt=[{id:"anthropic",name:"Anthropic",icon:"🤖",defaultBaseUrl:"https://api.anthropic.com",defaultApi:"anthropic-messages",requiresApiKey:!0,placeholder:"sk-ant-..."},{id:"openai",name:"OpenAI",icon:"🧠",defaultBaseUrl:"https://api.openai.com/v1",defaultApi:"openai-responses",requiresApiKey:!0,placeholder:"sk-..."},{id:"openai-codex",name:"OpenAI Codex",icon:"🧬",defaultBaseUrl:"https://api.openai.com/v1",defaultApi:"openai-codex-responses",requiresApiKey:!1},{id:"google",name:"Google AI",icon:"🔮",defaultBaseUrl:"https://generativelanguage.googleapis.com",defaultApi:"google-generative-ai",requiresApiKey:!0},{id:"openrouter",name:"OpenRouter",icon:"🔀",defaultBaseUrl:"https://openrouter.ai/api/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-or-..."},{id:"deepseek",name:"DeepSeek",icon:"🔍",defaultBaseUrl:"https://api.deepseek.com/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"moonshot",name:"Moonshot (CN)",icon:"🌙",defaultBaseUrl:"https://api.moonshot.cn/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"qwen",name:"通义千问 (CN)",icon:"🌐",defaultBaseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"siliconflow",name:"SiliconFlow (CN)",icon:"⚡",defaultBaseUrl:"https://api.siliconflow.cn/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"ollama",name:"Ollama",icon:"🦙",defaultBaseUrl:"http://localhost:11434",defaultApi:"ollama",requiresApiKey:!1},{id:"bedrock",name:"AWS Bedrock",icon:"☁️",defaultBaseUrl:"",defaultApi:"bedrock-converse-stream",requiresApiKey:!1},{id:"github-copilot",name:"GitHub Copilot",icon:"🐙",defaultBaseUrl:"",defaultApi:"github-copilot",requiresApiKey:!1},{id:"custom",name:"Custom",icon:"⚙️",defaultBaseUrl:"",defaultApi:"openai-completions",requiresApiKey:!0}];function Mg(e,t,a){const i=Xt.find(s=>s.id===e);if(i)return i;if(t){const s=Xt.find(o=>o.defaultApi===t);if(s)return s}if(a){if(a.includes("anthropic.com"))return Xt[0];if(a.includes("openai.com"))return Xt[1];if(a.includes("googleapis.com"))return Xt[2];if(a.includes("openrouter.ai"))return Xt[3];if(a.includes("deepseek.com"))return Xt[4];if(a.includes("moonshot.cn"))return Xt[5];if(a.includes("dashscope.aliyuncs.com"))return Xt[6];if(a.includes("siliconflow.cn"))return Xt[7];if(a.includes("localhost:11434"))return Xt[8]}return Xt[Xt.length-1]}const Dg="__OPENCLAW_REDACTED__";function C8(e){return Array.isArray(e)?e.map(t=>({id:String(t.id??""),name:String(t.name??""),api:t.api,reasoning:t.reasoning===!0,input:Array.isArray(t.input)?t.input:["text"],cost:t.cost?{input:Number(t.cost.input??0),output:Number(t.cost.output??0),cacheRead:Number(t.cost.cacheRead??0),cacheWrite:Number(t.cost.cacheWrite??0)}:void 0,contextWindow:typeof t.contextWindow=="number"?t.contextWindow:void 0,maxTokens:typeof t.maxTokens=="number"?t.maxTokens:void 0,compat:t.compat})):[]}function Hk(e){const t={id:e.id,name:e.name,reasoning:e.reasoning??!1,input:e.input??["text"]};return e.api&&(t.api=e.api),e.cost&&(t.cost=e.cost),e.contextWindow&&(t.contextWindow=e.contextWindow),e.maxTokens&&(t.maxTokens=e.maxTokens),e.compat&&(t.compat=e.compat),e.headers&&(t.headers=e.headers),t}function N8(){var C;const{t:e}=le("console"),t=Ne(E=>E.config),a=Ne(E=>E.configPath),i=Ne(E=>E.status),s=Ne(E=>E.configRaw),o=(i==null?void 0:i.configPath)??a,[u,f]=j.useState(!1),[h,g]=j.useState(null),x=(C=t==null?void 0:t.gateway)==null?void 0:C.auth,p=(x==null?void 0:x.token)===Dg,b=window.__OPENCLAW_CONFIG__,v=zk((b==null?void 0:b.gatewayUrl)||"ws://localhost:18789",(b==null?void 0:b.gatewayToken)||"5qd1bnvCHA2JwLn5NUBwUqKS7ZWMY37Vo2TO7pvZHc9sgL0U",window.location,{preferSameOriginProxy:!1}),w=(E,S)=>{navigator.clipboard.writeText(E),g(S),setTimeout(()=>g(null),2e3)};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.developer.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(ah,{label:e("settings.developer.gatewayToken"),value:p?e("settings.developer.tokenConfigured"):"—",hint:e("settings.developer.tokenHint")}),c.jsx(ah,{label:e("settings.developer.configPath"),value:o??"—",copyable:!0,onCopy:()=>o&&w(o,"path"),copied:h==="path",copiedLabel:e("settings.developer.copied")}),c.jsx(ah,{label:e("settings.developer.wsUrl"),value:v.url,copyable:!0,onCopy:()=>w(v.url,"ws"),copied:h==="ws",copiedLabel:e("settings.developer.copied")}),s&&c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>f(!u),className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[u?c.jsx(Qh,{className:"h-4 w-4"}):c.jsx(Un,{className:"h-4 w-4"}),e(u?"settings.developer.hideConfig":"settings.developer.showConfig")," ",e("settings.developer.rawConfig")]}),u&&c.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-800 dark:bg-gray-900 dark:text-gray-300",children:s})]})]})]})}function ah({label:e,value:t,hint:a,copyable:i,onCopy:s,copied:o,copiedLabel:u}){return c.jsxs("div",{className:"flex items-center justify-between rounded-md bg-gray-50 px-3 py-2 dark:bg-gray-700/50",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e}),c.jsx("p",{className:"text-sm font-mono text-gray-900 dark:text-gray-100 truncate",children:t}),a&&c.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:a})]}),i&&s&&c.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:u,children:o?c.jsx(jr,{className:"h-4 w-4 text-green-500"}):c.jsx(Zh,{className:"h-4 w-4"})})]})}function A8(){const{t:e}=le("console"),t=Ne(f=>f.status),a=Ne(f=>f.statusLoading),i=Ne(f=>f.statusError),s=Ne(f=>f.fetchStatus),o=t!=null&&t.uptime?Math.floor(t.uptime/3600):0,u=t!=null&&t.uptime?Math.floor(t.uptime%3600/60):0;return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.gateway.title")}),c.jsxs("button",{type:"button",onClick:s,disabled:a,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Nn,{className:`h-3.5 w-3.5 ${a?"animate-spin":""}`}),e("settings.gateway.refresh")]})]}),i?c.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-amber-50 px-4 py-3 dark:bg-amber-900/20",children:[c.jsx(eg,{className:"h-5 w-5 text-amber-500 shrink-0"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-300",children:e("settings.gateway.notConnected")}),c.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:e("settings.gateway.notConnectedHint")})]})]}):t?c.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[c.jsx(Ci,{label:e("settings.gateway.version"),value:t.version??"—"}),c.jsx(Ci,{label:e("settings.gateway.port"),value:t.port!=null?String(t.port):"—"}),c.jsx(Ci,{label:e("settings.gateway.uptime"),value:t.uptime!=null?e("settings.gateway.uptimeFormat",{hours:o,minutes:u}):"—"}),c.jsx(Ci,{label:e("settings.gateway.mode"),value:t.mode??"—"}),c.jsx(Ci,{label:e("settings.gateway.nodeVersion"),value:t.nodeVersion??"—"}),c.jsx(Ci,{label:e("settings.gateway.platform"),value:t.platform??"—"})]}):null]})}function Ci({label:e,value:t}){return c.jsxs("div",{className:"rounded-md bg-gray-50 px-3 py-2 dark:bg-gray-700/50",children:[c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e}),c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:t})]})}function E8({model:e,onChange:t,onRemove:a,defaultCollapsed:i=!1}){var w,C,E;const{t:s}=le("console"),[o,u]=j.useState(i),[f,h]=j.useState(!1),g=S=>t({...e,...S}),x=(S,N)=>{const D=e.cost??{input:0,output:0,cacheRead:0,cacheWrite:0};t({...e,cost:{...D,[S]:N}})},p=S=>{const N=e.input??["text"],D=N.includes(S)?N.filter(U=>U!==S):[...N,S];D.length!==0&&g({input:D})},b=S=>{t({...e,compat:{...e.compat??{},...S}})},v=e.name||e.id||s("settings.providers.models.untitled");return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 dark:border-gray-600 dark:bg-gray-700/30",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[c.jsxs("button",{type:"button",onClick:()=>u(!o),className:"flex items-center gap-2 text-sm font-medium text-gray-800 dark:text-gray-200",children:[o?c.jsx(Un,{className:"h-4 w-4"}):c.jsx(Qh,{className:"h-4 w-4"}),c.jsx("span",{className:"truncate max-w-xs",children:v}),e.reasoning&&c.jsx("span",{title:"reasoning",children:c.jsx(dc,{className:"h-3.5 w-3.5 text-purple-500"})}),((w=e.input)==null?void 0:w.includes("image"))&&c.jsx("span",{title:"image",children:c.jsx(hc,{className:"h-3.5 w-3.5 text-green-500"})})]}),c.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-gray-400 hover:bg-red-100 hover:text-red-500 dark:hover:bg-red-900/30 transition-colors",title:s("settings.providers.models.remove"),children:c.jsx(gl,{className:"h-4 w-4"})})]}),!o&&c.jsxs("div",{className:"space-y-4 border-t border-gray-200 px-4 py-4 dark:border-gray-600",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Pn,{label:s("settings.providers.models.id"),children:c.jsx("input",{type:"text",value:e.id,onChange:S=>g({id:S.target.value}),className:Bs,placeholder:"gpt-4o"})}),c.jsx(Pn,{label:s("settings.providers.models.name"),children:c.jsx("input",{type:"text",value:e.name,onChange:S=>g({name:S.target.value}),className:Bs,placeholder:"GPT-4o"})})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Pn,{label:s("settings.providers.models.reasoning"),children:c.jsx(nv,{active:e.reasoning===!0,onClick:()=>g({reasoning:!e.reasoning}),icon:c.jsx(dc,{className:"h-4 w-4"}),label:e.reasoning?s("settings.providers.models.yes"):s("settings.providers.models.no")})}),c.jsx(Pn,{label:s("settings.providers.models.inputTypes"),children:c.jsx("div",{className:"flex gap-2",children:k8.map(S=>c.jsx(nv,{active:(e.input??["text"]).includes(S),onClick:()=>p(S),icon:S==="text"?c.jsx(d3,{className:"h-4 w-4"}):c.jsx(hc,{className:"h-4 w-4"}),label:s(`settings.providers.models.input_${S}`)},S))})})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(Pn,{label:s("settings.providers.models.apiOverride"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:e.api??"",onChange:S=>g({api:S.target.value?S.target.value:void 0}),className:rh,"aria-label":s("settings.providers.models.apiOverride"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.inheritProvider")}),Tg.map(S=>c.jsx("option",{value:S,children:S},S))]}),c.jsx(ih,{})]})}),c.jsx(Pn,{label:s("settings.providers.models.contextWindow"),children:c.jsx("input",{type:"number",value:e.contextWindow??"",onChange:S=>g({contextWindow:S.target.value?Number(S.target.value):void 0}),className:Bs,placeholder:"128000",min:1})}),c.jsx(Pn,{label:s("settings.providers.models.maxTokens"),children:c.jsx("input",{type:"number",value:e.maxTokens??"",onChange:S=>g({maxTokens:S.target.value?Number(S.target.value):void 0}),className:Bs,placeholder:"8192",min:1})})]}),c.jsxs(Pn,{label:s("settings.providers.models.cost"),children:[c.jsx("p",{className:"mb-2 text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.models.costHint")}),c.jsx("div",{className:"grid grid-cols-4 gap-3",children:["input","output","cacheRead","cacheWrite"].map(S=>{var N;return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs text-gray-500 dark:text-gray-400",children:s(`settings.providers.models.cost_${S}`)}),c.jsx("input",{type:"number",value:((N=e.cost)==null?void 0:N[S])??"",onChange:D=>x(S,D.target.value?Number(D.target.value):0),className:Bs,placeholder:"0",min:0,step:"0.01"})]},S)})})]}),c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>h(!f),className:"flex items-center gap-1 text-xs text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(Qv,{className:"h-3 w-3"}),s(f?"settings.providers.models.hideAdvanced":"settings.providers.models.showAdvanced")]}),f&&c.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-600 dark:bg-gray-800",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Pn,{label:s("settings.providers.models.thinkingFormat"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:((C=e.compat)==null?void 0:C.thinkingFormat)??"",onChange:S=>b({thinkingFormat:S.target.value?S.target.value:void 0}),className:rh,"aria-label":s("settings.providers.models.thinkingFormat"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.default")}),w8.map(S=>c.jsx("option",{value:S,children:S},S))]}),c.jsx(ih,{})]})}),c.jsx(Pn,{label:s("settings.providers.models.maxTokensField"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:((E=e.compat)==null?void 0:E.maxTokensField)??"",onChange:S=>b({maxTokensField:S.target.value?S.target.value:void 0}),className:rh,"aria-label":s("settings.providers.models.maxTokensField"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.default")}),S8.map(S=>c.jsx("option",{value:S,children:S},S))]}),c.jsx(ih,{})]})})]}),c.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:["supportsStore","supportsDeveloperRole","supportsReasoningEffort","supportsUsageInStreaming","supportsStrictMode","requiresToolResultName","requiresAssistantAfterToolResult","requiresThinkingAsText","requiresMistralToolIds"].map(S=>{var N;return c.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-700 dark:text-gray-300",children:[c.jsx("input",{type:"checkbox",checked:((N=e.compat)==null?void 0:N[S])===!0,onChange:D=>b({[S]:D.target.checked||void 0}),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s(`settings.providers.models.compat_${S}`)]},S)})})]})]})]})]})}function Uk({models:e,onChange:t}){const{t:a}=le("console"),i=()=>{t([...e,j8()])},s=(u,f)=>{const h=[...e];h[u]=f,t(h)},o=u=>{t(e.filter((f,h)=>h!==u))};return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[a("settings.providers.models.title")," (",e.length,")"]}),c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1 rounded-lg border border-dashed border-gray-300 px-3 py-1.5 text-xs text-gray-600 hover:border-blue-400 hover:text-blue-600 dark:border-gray-500 dark:text-gray-400 dark:hover:border-blue-400 dark:hover:text-blue-400 transition-colors",children:[c.jsx(jn,{className:"h-3.5 w-3.5"}),a("settings.providers.models.add")]})]}),e.length===0?c.jsx("div",{className:"rounded-lg border border-dashed border-gray-300 px-4 py-6 text-center text-sm text-gray-400 dark:border-gray-600",children:a("settings.providers.models.empty")}):c.jsx("div",{className:"space-y-2",children:e.map((u,f)=>c.jsx(E8,{model:u,onChange:h=>s(f,h),onRemove:()=>o(f),defaultCollapsed:u.id.length>0},f))})]})}const Bs="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",rh="w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function ih(){return c.jsx(Un,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})}function Pn({label:e,children:t}){return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-600 dark:text-gray-400",children:e}),t]})}function nv({active:e,onClick:t,icon:a,label:i}){return c.jsxs("button",{type:"button",onClick:t,className:`flex items-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors ${e?"border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-300":"border-gray-300 bg-white text-gray-500 hover:border-gray-400 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400"}`,children:[a,i]})}function T8({open:e,existingIds:t,onSave:a,onCancel:i}){const{t:s}=le("console"),o=j.useRef(null),[u,f]=j.useState(1),[h,g]=j.useState(null),[x,p]=j.useState(""),[b,v]=j.useState(""),[w,C]=j.useState(""),[E,S]=j.useState("openai-completions"),[N,D]=j.useState(!1),[U,z]=j.useState([]);j.useEffect(()=>{const _=o.current;_&&(e&&!_.open?(_.showModal(),f(1),g(null),p(""),v(""),C(""),S("openai-completions"),D(!1),z([])):!e&&_.open&&_.close())},[e]);const L=_=>{g(_),p(_.id==="custom"?"":_.id),v(_.defaultBaseUrl),S(_.defaultApi),f(2)},G=t.includes(x),X=x.length>0&&!G,F=_=>{if(!X)return;const q={baseUrl:b,api:E,models:U.filter(V=>V.id.length>0).map(Hk)};w&&(q.apiKey=w),a(x,q,_)};return c.jsx("dialog",{ref:o,onClose:i,className:"fixed inset-0 z-50 m-auto w-[92vw] max-w-3xl max-h-[90vh] overflow-y-auto rounded-xl border border-gray-200 bg-white p-0 shadow-2xl backdrop:bg-black/50 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-8",children:[u===1&&c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:s("settings.providers.addDialog.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:s("settings.providers.addDialog.selectType")}),c.jsx("div",{className:"mt-6 grid grid-cols-3 gap-3 sm:grid-cols-4",children:Xt.map(_=>c.jsxs("button",{type:"button",onClick:()=>L(_),className:"flex flex-col items-center gap-2 rounded-xl border border-gray-200 px-4 py-5 text-center hover:border-blue-400 hover:bg-blue-50/80 dark:border-gray-600 dark:hover:border-blue-500 dark:hover:bg-blue-900/20 transition-all",children:[c.jsx("span",{className:"text-2xl",children:_.icon}),c.jsx("span",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:_.name})]},_.id))}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("settings.providers.addDialog.cancel")})})]}),u===2&&h&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:()=>f(1),className:"rounded-lg p-2 text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:c.jsx(Bv,{className:"h-5 w-5"})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-2xl",children:h.icon}),c.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:[s("settings.providers.addDialog.title")," — ",h.name]})]})]}),c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.providerId")}),c.jsx("input",{type:"text",value:x,onChange:_=>p(_.target.value.replace(/\s/g,"-").toLowerCase()),className:sh,placeholder:h.id}),c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.addDialog.providerIdHint")}),G&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:s("settings.providers.addDialog.idConflict")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.apiType")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{value:E,onChange:_=>S(_.target.value),className:M8,children:Tg.map(_=>c.jsx("option",{value:_,children:_},_))}),c.jsx(Un,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.baseUrl")}),c.jsx("input",{type:"text",value:b,onChange:_=>v(_.target.value),className:sh,placeholder:"https://api.example.com/v1"})]}),h.requiresApiKey&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.apiKey")}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:N?"text":"password",value:w,onChange:_=>C(_.target.value),className:`${sh} pr-11`,placeholder:h.placeholder??"sk-..."}),c.jsx("button",{type:"button",onClick:()=>D(!N),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:N?c.jsx(Dc,{className:"h-4 w-4"}):c.jsx(_c,{className:"h-4 w-4"})})]})]}),c.jsx("hr",{className:"border-gray-200 dark:border-gray-600"}),c.jsx(Uk,{models:U,onChange:z})]}),c.jsxs("div",{className:"mt-8 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("settings.providers.addDialog.cancel")}),c.jsx("button",{type:"button",onClick:()=>F("save"),disabled:!X,className:"rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s("settings.providers.addDialog.save")}),c.jsx("button",{type:"button",onClick:()=>F("apply"),disabled:!X,className:"rounded-lg border border-blue-200 px-5 py-2.5 text-sm font-medium text-blue-700 hover:bg-blue-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors dark:border-blue-800 dark:text-blue-300 dark:hover:bg-blue-900/20",children:s("settings.providers.addDialog.saveAndRestart")})]})]})]})})}const sh="w-full rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",M8="w-full appearance-none rounded-lg border border-gray-300 bg-white px-4 py-2.5 pr-10 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function D8({providerId:e,models:t}){const{t:a}=le("console"),i=Mg(e),s=t.filter(u=>u.reasoning===!0).length,o=t.filter(u=>{var f;return(f=u.input)==null?void 0:f.includes("image")}).length;return c.jsx("div",{className:"rounded-lg border border-dashed border-emerald-300 bg-emerald-50/50 px-4 py-3 dark:border-emerald-700 dark:bg-emerald-900/10",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:"text-xl",title:i.name,children:i.icon}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e}),i.id!==e&&c.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",i.name,")"]}),c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-800/40 dark:text-emerald-300",children:[c.jsx(X5,{className:"h-3 w-3"}),a("settings.providers.systemDiscovered")]})]}),c.jsx("div",{className:"mt-0.5 flex flex-wrap gap-1.5",children:t.map(u=>c.jsx("span",{className:"inline-block rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600 dark:bg-gray-700 dark:text-gray-300",title:`${e}/${u.id}`,children:u.name||u.id},u.id))})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:a("settings.providers.modelCount",{count:t.length})}),s>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-purple-600 dark:text-purple-400",title:a("settings.providers.models.reasoning"),children:[c.jsx(dc,{className:"h-3 w-3"}),s]}),o>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400",title:a("settings.providers.models.input_image"),children:[c.jsx(hc,{className:"h-3 w-3"}),o]})]}),c.jsx("span",{className:"flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:i.requiresApiKey?"OAuth":a("settings.providers.apiKeyConfigured")})]})]})})}function _8({open:e,providerId:t,config:a,onSave:i,onCancel:s}){const{t:o}=le("console"),u=j.useRef(null),f=Mg(t,a.api,a.baseUrl),[h,g]=j.useState(String(a.baseUrl??"")),[x,p]=j.useState(""),[b,v]=j.useState(a.api??"openai-completions"),[w,C]=j.useState(!1),[E,S]=j.useState(()=>C8(a.models));j.useEffect(()=>{const z=u.current;z&&(e&&!z.open?z.showModal():!e&&z.open&&z.close())},[e]);const N=z=>{const L={baseUrl:h,api:b,models:E.filter(G=>G.id.length>0).map(Hk)};x.length>0&&(L.apiKey=x),i(L,z)},U=typeof a.auth=="string"&&a.auth.length>0||a.apiKey===Dg||typeof a.apiKey=="string"&&a.apiKey.length>0;return c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto w-[92vw] max-w-3xl max-h-[90vh] overflow-y-auto rounded-xl border border-gray-200 bg-white p-0 shadow-2xl backdrop:bg-black/50 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-8",children:[c.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[c.jsx("span",{className:"text-2xl",children:f.icon}),c.jsxs("div",{children:[c.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:[o("settings.providers.editDialog.title")," — ",t]}),f.id!==t&&c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:f.name})]})]}),c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.apiType")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{value:b,onChange:z=>v(z.target.value),className:R8,children:Tg.map(z=>c.jsx("option",{value:z,children:z},z))}),c.jsx(Un,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.baseUrl")}),c.jsx("input",{type:"text",value:h,onChange:z=>g(z.target.value),className:av})]})]}),f.requiresApiKey&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.apiKey")}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:w?"text":"password",value:x,onChange:z=>p(z.target.value),className:`${av} pr-11`,placeholder:U?o("settings.providers.editDialog.apiKeyPlaceholder"):f.placeholder}),c.jsx("button",{type:"button",onClick:()=>C(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:w?c.jsx(Dc,{className:"h-4 w-4"}):c.jsx(_c,{className:"h-4 w-4"})})]}),U&&!x&&c.jsx("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:o("settings.providers.apiKeyConfigured")})]}),c.jsx("hr",{className:"border-gray-200 dark:border-gray-600"}),c.jsx(Uk,{models:E,onChange:S})]}),c.jsxs("div",{className:"mt-8 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("settings.providers.editDialog.cancel")}),c.jsx("button",{type:"button",onClick:()=>N("save"),className:"rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:o("settings.providers.editDialog.save")}),c.jsx("button",{type:"button",onClick:()=>N("apply"),className:"rounded-lg border border-blue-200 px-5 py-2.5 text-sm font-medium text-blue-700 hover:bg-blue-50 transition-colors dark:border-blue-800 dark:text-blue-300 dark:hover:bg-blue-900/20",children:o("settings.providers.editDialog.saveAndRestart")})]})]})})}const av="w-full rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",R8="w-full appearance-none rounded-lg border border-gray-300 bg-white px-4 py-2.5 pr-10 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function O8({providerId:e,config:t,onEdit:a,onDelete:i}){const{t:s}=le("console"),o=Mg(e,t.api,t.baseUrl),f=typeof t.auth=="string"&&t.auth.length>0||t.apiKey===Dg||typeof t.apiKey=="string"&&t.apiKey.length>0,h=Array.isArray(t.models)?t.models:[],g=h.filter(p=>p.reasoning===!0).length,x=h.filter(p=>Array.isArray(p.input)&&p.input.includes("image")).length;return c.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 dark:border-gray-600 dark:bg-gray-700/50",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:"text-xl",title:o.name,children:o.icon}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e}),o.id!==e&&c.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",o.name,")"]})]}),c.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 dark:text-gray-400",children:[typeof t.baseUrl=="string"&&t.baseUrl&&c.jsx("span",{className:"truncate max-w-48",title:t.baseUrl,children:t.baseUrl}),typeof t.api=="string"&&c.jsx("span",{children:t.api})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[h.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.modelCount",{count:h.length})}),g>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-purple-600 dark:text-purple-400",title:s("settings.providers.models.reasoning"),children:[c.jsx(dc,{className:"h-3 w-3"}),g]}),x>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400",title:s("settings.providers.models.input_image"),children:[c.jsx(hc,{className:"h-3 w-3"}),x]})]}),o.requiresApiKey&&c.jsx("span",{className:"flex items-center gap-1 text-xs",children:f?c.jsxs(c.Fragment,{children:[c.jsx(Ri,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{className:"text-green-600 dark:text-green-400",children:s("settings.providers.apiKeyConfigured")})]}):c.jsxs(c.Fragment,{children:[c.jsx(Mc,{className:"h-3.5 w-3.5 text-amber-500"}),c.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:s("settings.providers.apiKeyNotConfigured")})]})}),c.jsx("button",{type:"button",onClick:a,className:"rounded p-1.5 text-gray-500 hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-600 dark:hover:text-gray-300 transition-colors",title:"Edit",children:c.jsx(Fv,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:i,className:"rounded p-1.5 text-gray-500 hover:bg-red-100 hover:text-red-600 dark:hover:bg-red-900/30 dark:hover:text-red-400 transition-colors",title:"Delete",children:c.jsx(gl,{className:"h-4 w-4"})})]})]})})}function L8(e){if(!e)return{};const t=e.models;return(t==null?void 0:t.providers)??{}}function z8(e,t){const a=new Map;for(const i of e)t.has(i.provider)||(a.has(i.provider)||a.set(i.provider,[]),a.get(i.provider).push(i));return a}function H8(){const{t:e}=le("console"),t=Ne(U=>U.config),a=Ne(U=>U.saveConfig),i=Ne(U=>U.applyConfig),s=Ne(U=>U.catalogModels),o=Ne(U=>U.fetchCatalogModels),[u,f]=j.useState(!1),[h,g]=j.useState(null),[x,p]=j.useState(null);j.useEffect(()=>{s.length===0&&o()},[s.length,o]);const b=L8(t),v=Object.entries(b),w=new Set(Object.keys(b)),C=z8(s,w),E=async(U,z,L)=>{await(L==="apply"?i:a)(X=>{const F=X,_=F.models??{},q=_.providers??{};return F.models={..._,providers:{...q,[U]:z}},F}),f(!1)},S=async(U,z)=>{if(!h)return;await(z==="apply"?i:a)(G=>{const X=G,F=X.models??{},_=F.providers??{};return X.models={...F,providers:{..._,[h.id]:U}},X}),g(null)},N=async()=>{x&&(await a(U=>{const z=U,L=z.models??{},G={...L.providers??{}};return delete G[x],z.models={...L,providers:G},z}),p(null))},D=v.length>0||C.size>0;return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.providers.title")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("settings.providers.description")})]}),c.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(jn,{className:"h-4 w-4"}),e("settings.providers.add")]})]}),D?c.jsxs("div",{className:"space-y-2",children:[v.map(([U,z])=>c.jsx(O8,{providerId:U,config:z,onEdit:()=>g({id:U,config:z}),onDelete:()=>p(U)},U)),Array.from(C.entries()).map(([U,z])=>c.jsx(D8,{providerId:U,models:z},`catalog-${U}`))]}):c.jsx(Sr,{icon:P4,title:e("settings.providers.empty"),description:e("settings.providers.emptyHint")}),c.jsx(T8,{open:u,existingIds:Object.keys(b),onSave:E,onCancel:()=>f(!1)}),h&&c.jsx(_8,{open:!!h,providerId:h.id,config:h.config,onSave:S,onCancel:()=>g(null)},h.id),c.jsx(ll,{open:!!x,title:e("settings.providers.deleteTitle"),description:e("settings.providers.deleteDescription",{name:x??""}),variant:"danger",onConfirm:N,onCancel:()=>p(null)})]})}function U8(){var x;const{t:e}=le("console"),t=Ne(p=>p.status),a=Ne(p=>p.config),i=Ne(p=>p.updateResult),s=Ne(p=>p.updateLoading),o=Ne(p=>p.runUpdate),[u,f]=j.useState(!1),h=(x=a==null?void 0:a.update)==null?void 0:x.channel,g=async()=>{f(!1),await o({restartDelayMs:3e3})};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.update.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.update.currentVersion")}),c.jsx("span",{className:"text-sm font-mono font-medium text-gray-900 dark:text-gray-100",children:(t==null?void 0:t.version)??"—"})]}),h&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.update.channel")}),c.jsx("span",{className:"rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:h})]}),c.jsx("div",{className:"pt-2",children:c.jsx("button",{type:"button",onClick:()=>f(!0),disabled:s,className:"flex items-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:s?c.jsxs(c.Fragment,{children:[c.jsx(Dt,{className:"h-4 w-4 animate-spin"}),e("settings.update.updating")]}):c.jsxs(c.Fragment,{children:[c.jsx(Ws,{className:"h-4 w-4"}),e("settings.update.checkUpdate")]})})}),i&&c.jsxs("div",{className:`mt-3 flex items-start gap-2 rounded-lg px-4 py-3 text-sm ${i.result.status==="ok"?"bg-green-50 text-green-800 dark:bg-green-900/20 dark:text-green-300":i.result.status==="noop"?"bg-blue-50 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300":"bg-red-50 text-red-800 dark:bg-red-900/20 dark:text-red-300"}`,children:[i.result.status==="ok"&&c.jsx(Ri,{className:"mt-0.5 h-4 w-4 shrink-0"}),i.result.status==="noop"&&c.jsx(Rc,{className:"mt-0.5 h-4 w-4 shrink-0"}),i.result.status==="error"&&c.jsx(Li,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("span",{children:[i.result.status==="ok"&&e("settings.update.resultOk",{before:i.result.before??"?",after:i.result.after??"?"}),i.result.status==="noop"&&e("settings.update.resultNoop"),i.result.status==="error"&&e("settings.update.resultError",{reason:i.result.reason??"Unknown error"})]})]})]}),c.jsx(ll,{open:u,title:e("settings.update.confirmTitle"),description:e("settings.update.confirmDescription"),onConfirm:g,onCancel:()=>f(!1)})]})}function I8(){const{t:e}=le("console"),t=Ne(o=>o.loading),a=Ne(o=>o.fetchConfig),i=Ne(o=>o.fetchStatus),s=ol(o=>o.devModeUnlocked);return j.useEffect(()=>{a(),i()},[a,i]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e("settings.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e("settings.description")})]}),t?c.jsx(vl,{}):c.jsxs("div",{className:"space-y-4",children:[c.jsx(b8,{}),c.jsx(H8,{}),c.jsx(A8,{}),c.jsx(U8,{}),c.jsx(m8,{}),s&&c.jsx(N8,{}),c.jsx(h8,{})]})]})}class Xa extends Error{constructor(t,a){super(a),this.code=t,this.name="ClawHubError"}}const qh=new Map;function Ik(e){const t=qh.get(e);return t?Date.now()>t.expiresAt?(qh.delete(e),null):t.data:null}function Bk(e,t,a){qh.set(e,{data:t,expiresAt:Date.now()+a})}let qk=0;function B8(){return Date.now()<qk}const q8=6e4,$8=3e5,K8=5e3;function F8(){return"https://clawhub.ai"}async function _g(e,t){if(B8())throw new Xa(429,"Rate limited, please wait before retrying");const a=new URL(e,F8());if(t)for(const[s,o]of Object.entries(t))o!==void 0&&o!==""&&a.searchParams.set(s,o);let i;try{i=await fetch(a.toString())}catch(s){throw new Xa(0,`Network error: ${s instanceof Error?s.message:String(s)}`)}if(i.status===429)throw qk=Date.now()+K8,new Xa(429,"Search service is busy, please try again later");if(!i.ok){const s=await i.text().catch(()=>"");throw new Xa(i.status,s||`HTTP ${i.status}`)}return i.json()}async function P8(e,t=20){return(await _g("/api/v1/search",{q:e,limit:String(t)})).results??[]}async function G8(e){const t=e==null?void 0:e.limit,a=e==null?void 0:e.cursor,i=`explore:${t}:${a??""}`,s=Ik(i);if(s)return s;const o={limit:String(t)};a&&(o.cursor=a);const u=await _g("/api/v1/skills",o),f={items:u.items??[],nextCursor:u.nextCursor??null};return Bk(i,f,q8),f}async function V8(e){const t=`detail:${e}`,a=Ik(t);if(a)return a;const i=await _g(`/api/v1/skills/${encodeURIComponent(e)}`);return Bk(t,i,$8),i}let ya=null;const Ps=In((e,t)=>({searchResults:[],exploreItems:[],searchQuery:"",isSearching:!1,isExploring:!1,searchError:null,exploreError:null,nextCursor:null,selectedDetail:null,detailLoading:!1,offlineMode:!1,search:async a=>{if(e({searchQuery:a}),!a.trim()){e({searchResults:[],searchError:null});return}ya&&clearTimeout(ya),ya=setTimeout(()=>{t().searchImmediate(a)},300)},searchImmediate:async a=>{ya&&(clearTimeout(ya),ya=null);const i=a.trim();if(i){e({isSearching:!0,searchError:null,searchQuery:i});try{const s=await P8(i,30);e({searchResults:s,isSearching:!1,offlineMode:!1})}catch(s){const o=s instanceof Xa?s.message:String(s),u=s instanceof Xa&&s.code===0;e({searchError:o,isSearching:!1,offlineMode:u})}}},explore:async(a=!1)=>{const i=t();if(!i.isExploring&&!(a&&!i.nextCursor)){e({isExploring:!0,exploreError:null});try{const s=a?i.nextCursor??void 0:void 0,o=await G8({limit:20,cursor:s});e(u=>({exploreItems:a?[...u.exploreItems,...o.items]:o.items,nextCursor:o.nextCursor,isExploring:!1,offlineMode:!1}))}catch(s){const o=s instanceof Xa?s.message:String(s),u=s instanceof Xa&&s.code===0;e({exploreError:o,isExploring:!1,offlineMode:u})}}},fetchDetail:async a=>{e({detailLoading:!0});try{const i=await V8(a);e({selectedDetail:i,detailLoading:!1})}catch{e({detailLoading:!1})}},clearSearch:()=>{ya&&(clearTimeout(ya),ya=null),e({searchQuery:"",searchResults:[],searchError:null})},clearDetail:()=>e({selectedDetail:null}),setOfflineMode:a=>e({offlineMode:a})}));function Y8({slug:e,onClose:t,onInstall:a,isInstalled:i}){const{t:s}=le("console"),o=Ps(b=>b.fetchDetail),u=Ps(b=>b.selectedDetail),f=Ps(b=>b.detailLoading),h=Ps(b=>b.clearDetail);if(j.useEffect(()=>(e&&o(e),()=>{h()}),[e,o,h]),!e)return null;const g=u==null?void 0:u.skill,x=u==null?void 0:u.latestVersion,p=u==null?void 0:u.owner;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:t,children:c.jsxs("div",{className:"relative mx-4 w-full max-w-lg rounded-2xl border border-gray-200 bg-white shadow-2xl dark:border-gray-700 dark:bg-gray-900",onClick:b=>b.stopPropagation(),children:[c.jsx("button",{type:"button",onClick:t,className:"absolute right-3 top-3 rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",children:c.jsx(Sn,{className:"h-5 w-5"})}),f?c.jsx("div",{className:"flex h-48 items-center justify-center",children:c.jsx(Dt,{className:"h-6 w-6 animate-spin text-gray-400"})}):g?c.jsxs("div",{className:"p-6",children:[c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:g.displayName}),g.summary&&c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:g.summary}),p&&p.handle&&c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[p.image?c.jsx("img",{src:p.image,alt:"",className:"h-6 w-6 rounded-full"}):c.jsx(h3,{className:"h-5 w-5 text-gray-400"}),c.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:p.displayName??p.handle})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-4 text-sm text-gray-500 dark:text-gray-400",children:[g.stats.downloads>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Ws,{className:"h-4 w-4"}),g.stats.downloads.toLocaleString()," ",s("clawhub.downloads")]}),g.stats.stars>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Vv,{className:"h-4 w-4"}),g.stats.stars," ",s("clawhub.stars")]})]}),x&&c.jsxs("div",{className:"mt-4 rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:["v",x.version]}),c.jsx("span",{className:"text-xs text-gray-400",children:new Date(x.createdAt).toLocaleDateString()})]}),x.changelog&&c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400 line-clamp-3",children:x.changelog})]}),c.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i?c.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-lg bg-green-100 px-4 py-2 text-sm font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:s("skills.marketplace.installed")}):c.jsxs("button",{type:"button",onClick:()=>a(g.slug,g.displayName),className:"inline-flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(Ws,{className:"h-4 w-4"}),s("skills.card.install")]}),c.jsxs("a",{href:`https://clawhub.ai/skills/${g.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(fc,{className:"h-3.5 w-3.5"}),s("clawhub.viewOnClawHub")]})]})]}):c.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-gray-500",children:s("clawhub.notFound")})]})})}function Q8({open:e,slug:t,displayName:a,onClose:i,onConfirmDone:s}){const{t:o}=le("console"),[u,f]=j.useState(!1);if(!e)return null;const h=`clawhub install ${t}`,g=async()=>{await navigator.clipboard.writeText(h),f(!0),setTimeout(()=>f(!1),2e3)};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:i,children:c.jsxs("div",{className:"relative mx-4 w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-2xl dark:border-gray-700 dark:bg-gray-900",onClick:x=>x.stopPropagation(),children:[c.jsx("button",{type:"button",onClick:i,className:"absolute right-3 top-3 rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",children:c.jsx(Sn,{className:"h-5 w-5"})}),c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:o("clawhub.installTitle",{name:a})}),c.jsx("div",{className:"mt-3 rounded-xl border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-800 dark:bg-yellow-900/20",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(G5,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-600 dark:text-yellow-400"}),c.jsx("p",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:o("clawhub.securityWarning")})]})}),c.jsxs("div",{className:"mt-4",children:[c.jsx("p",{className:"mb-2 text-xs font-medium text-gray-600 dark:text-gray-400",children:o("clawhub.installCommand")}),c.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 dark:bg-gray-800",children:[c.jsx(Yv,{className:"h-4 w-4 shrink-0 text-gray-400"}),c.jsx("code",{className:"flex-1 text-sm text-green-400",children:h}),c.jsx("button",{type:"button",onClick:g,className:"shrink-0 rounded p-1 text-gray-400 hover:bg-gray-700 hover:text-gray-200",children:u?c.jsx(jr,{className:"h-4 w-4 text-green-400"}):c.jsx(Zh,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:i,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:o("clawhub.cancel")}),c.jsx("button",{type:"button",onClick:s,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700",children:o("clawhub.installDone")})]})]})})}function lh(e){return"score"in e}function X8(e){const t=Date.now()-e,a=Math.floor(t/6e4);if(a<60)return`${a}m ago`;const i=Math.floor(a/60);if(i<24)return`${i}h ago`;const s=Math.floor(i/24);return s<30?`${s}d ago`:`${Math.floor(s/30)}mo ago`}function rv({item:e,isInstalled:t,onInstall:a,onOpenDetail:i}){var b;const{t:s}=le("console"),o=e.slug,u=e.displayName,f=e.summary,h=e.updatedAt,g=lh(e)?e.version:(b=e.latestVersion)==null?void 0:b.version,x=lh(e)?e.score:null,p=lh(e)?null:e.stats;return c.jsxs("div",{className:"group relative flex flex-col justify-between rounded-2xl border border-gray-200 bg-white p-4 transition-all hover:border-blue-300 hover:shadow-md dark:border-gray-700 dark:bg-gray-800/80 dark:hover:border-blue-600",children:[c.jsx("button",{type:"button",onClick:()=>i(o),className:"absolute inset-0 rounded-2xl focus:outline-none","aria-label":u}),c.jsxs("div",{className:"relative z-10 pointer-events-none",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:u}),f&&c.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500 dark:text-gray-400",children:f})]}),c.jsx("div",{className:"pointer-events-auto shrink-0",children:t?c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(Ri,{className:"h-3 w-3"}),s("skills.marketplace.installed")]}):c.jsxs("button",{type:"button",onClick:v=>{v.stopPropagation(),a(o,u)},className:"inline-flex items-center gap-1 rounded-lg bg-blue-600 px-2.5 py-1 text-xs font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(Ws,{className:"h-3 w-3"}),s("skills.card.install")]})})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-gray-400 dark:text-gray-500",children:[g&&c.jsxs("span",{className:"flex items-center gap-1",children:["v",g]}),h&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Oi,{className:"h-3 w-3"}),X8(h)]}),x!=null&&c.jsxs("span",{className:"flex items-center gap-1 text-blue-500 dark:text-blue-400",children:[c.jsx(o3,{className:"h-3 w-3"}),x.toFixed(1)]}),p&&p.downloads>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Ws,{className:"h-3 w-3"}),p.downloads.toLocaleString()]}),p&&p.stars>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Vv,{className:"h-3 w-3"}),p.stars]})]})]})]})}function Z8({open:e,skillName:t,options:a,onSelect:i,onCancel:s}){const{t:o}=le("console"),u=j.useRef(null);return j.useEffect(()=>{const f=u.current;f&&(e&&!f.open?f.showModal():!e&&f.open&&f.close())},[e]),c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto max-w-sm rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsx("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-gray-100",children:o("skills.install.title",{name:t})}),c.jsx("div",{className:"space-y-2",children:a.map(f=>c.jsxs("button",{type:"button",onClick:()=>i(f.id),className:"flex w-full items-center gap-3 rounded-lg border border-gray-200 p-3 text-left transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:f.label}),c.jsxs("span",{className:"text-xs text-gray-400",children:["(",f.kind,")"]})]},f.id))}),c.jsx("div",{className:"mt-4 flex justify-end",children:c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("common:actions.cancel")})})]})})}function iv({skill:e,onToggle:t,onConfigure:a,isInstalling:i,onInstall:s}){var g,x,p,b;const{t:o}=le("console"),u=e.isCore&&e.always,f=((x=(g=e.missing)==null?void 0:g.bins)==null?void 0:x.length)||((b=(p=e.missing)==null?void 0:p.env)==null?void 0:b.length),h=e.isBundled?o("skills.source.builtIn"):o("skills.source.marketplace");return c.jsx("div",{className:`rounded-2xl border p-4 transition-colors dark:bg-gray-800 ${e.enabled?"border-blue-200 bg-blue-50/40 dark:border-blue-900/40":"border-gray-200 bg-white opacity-75 dark:border-gray-700"}`,children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("button",{type:"button",onClick:()=>a(e),className:"flex min-w-0 flex-1 items-start gap-3 text-left",children:[c.jsx("span",{className:"text-2xl",children:e.icon||"📦"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:`rounded-md px-2 py-0.5 text-[10px] font-medium ${e.isBundled?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}`,children:h}),e.isCore?c.jsx($v,{className:"h-3.5 w-3.5 text-gray-400"}):e.isBundled?c.jsx(Pv,{className:"h-3.5 w-3.5 text-blue-500/70"}):c.jsx(o5,{className:"h-3.5 w-3.5 text-purple-500/70"}),e.version&&c.jsxs("span",{className:"text-[10px] text-gray-400",children:["v",e.version]})]}),c.jsx("p",{className:"mt-2 line-clamp-2 text-sm text-gray-500 dark:text-gray-400",children:e.description}),f&&c.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",children:[c.jsx(Li,{className:"h-3.5 w-3.5"}),o("skills.card.missingDeps")]})]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>a(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("skills.card.configure"),children:c.jsx(Jh,{className:"h-4 w-4"})}),!e.eligible&&s&&c.jsx("button",{type:"button",onClick:()=>s(e),disabled:i,className:"rounded-xl bg-blue-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:o(i?"skills.card.installing":"skills.card.install")}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",title:u?o("skills.card.coreProtected"):void 0,children:[c.jsx("input",{type:"checkbox",checked:e.enabled,onChange:()=>t(e.id,!e.enabled),disabled:u,className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]})]})]})})}function J8({open:e,skill:t,onClose:a,onSaved:i}){var X;const{t:s}=le("console"),o=j.useRef(null),[u,f]=j.useState(""),[h,g]=j.useState(!1),[x,p]=j.useState([]),[b,v]=j.useState("info"),[w,C]=j.useState(!0),[E,S]=j.useState(!1);if(j.useEffect(()=>{const F=o.current;F&&(e&&!F.open?(v("info"),g(!1),F.showModal()):!e&&F.open&&F.close())},[e]),j.useEffect(()=>{var _,q;if(!t)return;f(typeof((_=t.config)==null?void 0:_.apiKey)=="string"?t.config.apiKey:"");const F=(q=t.config)==null?void 0:q.env;p(F&&typeof F=="object"?Object.entries(F).map(([V,re])=>({key:V,value:String(re)})):[])},[t]),!t)return null;const N=t.primaryEnv||t.configChecks&&t.configChecks.length>0,D=t.isCore&&t.always,U=async()=>{S(!0);try{const F=x.reduce((_,q)=>{const V=q.key.trim();return V&&(_[V]=q.value.trim()),_},{});await Re().skillsUpdate(t.id,{apiKey:u||void 0,env:Object.keys(F).length>0?F:void 0}),Ne.getState().setRuntimeApplied("configLifecycle.runtimeSkill"),i(),a()}catch{}finally{S(!1)}},z=()=>p(F=>[...F,{key:"",value:""}]),L=F=>{p(_=>_.filter((q,V)=>V!==F))},G=(F,_,q)=>{p(V=>V.map((re,W)=>W===F?{...re,[_]:q}:re))};return c.jsx("dialog",{ref:o,onClose:a,className:"fixed inset-0 z-50 m-auto max-h-[90vh] w-[min(760px,calc(100vw-2rem))] rounded-xl border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"flex max-h-[90vh] flex-col",children:[c.jsx("div",{className:"border-b border-gray-200 p-6 dark:border-gray-700",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("span",{className:"text-3xl",children:t.icon||"📦"}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:t.name}),D&&c.jsx($v,{className:"h-4 w-4 text-gray-400"})]}),c.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[t.version||"—"," · ",t.author??"—"]}),c.jsxs("div",{className:"mt-3 flex gap-2",children:[c.jsx("button",{type:"button",onClick:()=>v("info"),className:`rounded-lg px-3 py-1.5 text-sm font-medium ${b==="info"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}`,children:s("skills.detail.info")}),c.jsx("button",{type:"button",onClick:()=>v("config"),disabled:!N,className:`rounded-lg px-3 py-1.5 text-sm font-medium ${b==="config"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"} disabled:cursor-not-allowed disabled:opacity-50`,children:s("skills.detail.config")})]})]})]}),c.jsx("button",{type:"button",onClick:a,className:"rounded-full p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700",children:c.jsx(Sn,{className:"h-4 w-4"})})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:b==="info"?c.jsxs("div",{className:"space-y-5",children:[c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.description}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(tc,{label:s("skills.detail.source"),value:t.source??"—"}),c.jsx(tc,{label:s("skills.detail.version"),value:t.version||"—"}),c.jsx(tc,{label:s("skills.detail.author"),value:t.author??"—"}),c.jsx(tc,{label:s("skills.detail.primaryEnv"),value:t.primaryEnv??"—"})]}),t.homepage&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[s("skills.detail.homepage"),":"]}),c.jsxs("a",{href:t.homepage,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-600 hover:underline dark:text-blue-400",children:[t.homepage,c.jsx(fc,{className:"h-3 w-3"})]})]}),t.requirements&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:s("skills.detail.requirements")}),c.jsx("div",{className:"space-y-2",children:(X=t.requirements.bins)==null?void 0:X.map(F=>{var q,V;const _=(V=(q=t.missing)==null?void 0:q.bins)==null?void 0:V.includes(F);return c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[_?c.jsx(Sn,{className:"h-4 w-4 text-red-500"}):c.jsx(jr,{className:"h-4 w-4 text-green-500"}),c.jsx("code",{className:"text-xs",children:F})]},F)})})]})]}):N?c.jsxs("div",{className:"space-y-5",children:[t.primaryEnv&&c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-xs text-gray-500 dark:text-gray-400",children:["API Key (",t.primaryEnv,")"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:h?"text":"password",value:u,onChange:F=>f(F.target.value),placeholder:s("skills.detail.apiKeyPlaceholder"),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 pr-10 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100"}),c.jsx("button",{type:"button",onClick:()=>g(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:h?c.jsx(Dc,{className:"h-4 w-4"}):c.jsx(_c,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 dark:border-gray-700",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("button",{type:"button",onClick:()=>C(F=>!F),className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:[w?c.jsx(Un,{className:"h-4 w-4"}):c.jsx(X4,{className:"h-4 w-4"}),s("skills.detail.envVars")]}),c.jsxs("button",{type:"button",onClick:z,className:"inline-flex items-center gap-1 rounded-md border border-gray-300 px-2 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700",children:[c.jsx(jn,{className:"h-3 w-3"}),s("skills.detail.addVariable")]})]}),w&&c.jsx("div",{className:"mt-4 space-y-3",children:x.length===0?c.jsx("p",{className:"text-xs italic text-gray-400",children:s("skills.detail.noEnvVars")}):x.map((F,_)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:F.key,onChange:q=>G(_,"key",q.target.value),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-mono dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100",placeholder:s("skills.detail.keyPlaceholder")}),c.jsx("span",{className:"text-gray-400",children:"="}),c.jsx("input",{value:F.value,onChange:q=>G(_,"value",q.target.value),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-mono dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100",placeholder:s("skills.detail.valuePlaceholder")}),c.jsx("button",{type:"button",onClick:()=>L(_),className:"rounded-md p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",children:c.jsx(gl,{className:"h-4 w-4"})})]},`${F.key}-${_}`))})]}),t.configChecks&&t.configChecks.length>0&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-2 block text-xs text-gray-500 dark:text-gray-400",children:s("skills.detail.configChecks")}),c.jsx("div",{className:"space-y-1",children:t.configChecks.map(F=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[F.satisfied?c.jsx(jr,{className:"h-4 w-4 text-green-500"}):c.jsx(Sn,{className:"h-4 w-4 text-red-500"}),c.jsx("code",{className:"text-xs",children:F.path})]},F.path))})]}),c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{type:"button",onClick:U,disabled:E,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:s(E?"skills.detail.saving":"common:actions.save")})})]}):c.jsx("p",{className:"text-sm text-gray-400",children:s("skills.detail.noConfig")})}),c.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.enabled?c.jsx(jr,{className:"h-4 w-4 text-green-500"}):c.jsx(Sn,{className:"h-4 w-4 text-gray-400"}),c.jsx("span",{className:t.enabled?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400",children:t.enabled?s("skills.detail.enabled"):s("skills.detail.disabled")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("common:actions.close")}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",title:D?s("skills.card.coreProtected"):void 0,children:[c.jsx("input",{type:"checkbox",checked:t.enabled,onChange:()=>{Re().skillsUpdate(t.id,{enabled:!t.enabled}).then(()=>{Ne.getState().setRuntimeApplied("configLifecycle.runtimeSkill"),i()})},disabled:D,className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]})]})]})]})})}function tc({label:e,value:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[e,":"]}),c.jsx("span",{className:"text-gray-900 dark:text-gray-100",children:t})]})}const W8=["installed","marketplace"];function ez({activeTab:e,onTabChange:t}){const{t:a}=le("console");return c.jsx("div",{className:"flex gap-1 rounded-xl bg-gray-100 p-1 dark:bg-gray-800",children:W8.map(i=>c.jsx("button",{type:"button",onClick:()=>t(i),className:`rounded-lg px-5 py-2 text-sm font-semibold transition-colors ${e===i?"bg-white text-gray-900 shadow-sm dark:bg-gray-700 dark:text-gray-100":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,children:a(`skills.tabs.${i}`)},i))})}function tz(e,t){return e.enabled&&!t.enabled?-1:!e.enabled&&t.enabled?1:e.isCore&&!t.isCore?-1:!e.isCore&&t.isCore?1:e.name.localeCompare(t.name)}function nz(e){return new Set(e.map(t=>t.id))}function az(e,t,a){const i=t.trim().toLowerCase();return e.filter(s=>s.isBundled||s.eligible).filter(s=>i?[s.name,s.description,s.slug,s.source].filter(Boolean).join(" ").toLowerCase().includes(i):!0).filter(s=>a==="built-in"?!!s.isBundled:a==="marketplace"?!s.isBundled:!0).sort(tz)}function rz(e,t){const a=t.trim().toLowerCase();return e.filter(i=>!i.isBundled).filter(i=>a?[i.name,i.description,i.slug,i.author,i.source].filter(Boolean).join(" ").toLowerCase().includes(a):!0).sort((i,s)=>i.name.localeCompare(s.name))}const iz=In((e,t)=>({skills:[],isLoading:!1,error:null,activeTab:"installed",sourceFilter:"all",selectedSkill:null,detailDialogOpen:!1,installing:new Set,fetchSkills:async()=>{e({isLoading:!0,error:null});try{await Fe();const a=await Re().skillsStatus();e({skills:a,isLoading:!1})}catch(a){e({error:String(a),isLoading:!1})}},setTab:a=>e({activeTab:a}),setSourceFilter:a=>e({sourceFilter:a}),openDetail:a=>e({selectedSkill:a,detailDialogOpen:!0}),closeDetail:()=>e({selectedSkill:null,detailDialogOpen:!1}),toggleSkill:async(a,i)=>{try{if((await Re().skillsUpdate(a,{enabled:i})).ok){e(f=>({skills:f.skills.map(h=>h.id===a?{...h,enabled:i}:h)})),Ne.getState().setRuntimeApplied("configLifecycle.runtimeSkill");const o=t().skills.find(f=>f.id===a),u=(o==null?void 0:o.name)??a;Ob(i?Te.t("console:skills.toast.enabled",{name:u}):Te.t("console:skills.toast.disabled",{name:u}))}}catch(s){Qo(Te.t("console:skills.toast.toggleFailed"),String(s)),e({error:String(s)})}},installSkill:async(a,i)=>{var o;const s=new Set(t().installing);s.add(a),e({installing:s});try{const u=await Re().skillsInstall(a,i);if(u.ok)await t().fetchSkills(),Ob(Te.t("console:skills.toast.installSuccess",{name:a}));else{const f=[u.stdout,u.stderr].filter(Boolean).join(`
|
|
461
|
-
|
|
462
|
-
`);Qo(Te.t("console:skills.toast.installFailed",{name:a}),u.message,f||void 0)}if((o=u.warnings)!=null&&o.length)for(const f of u.warnings)Qo(Te.t("console:skills.toast.installWarning"),f);return u}catch(u){return Qo(Te.t("console:skills.toast.installFailed",{name:a}),String(u)),{ok:!1,message:String(u)}}finally{const u=new Set(t().installing);u.delete(a),e({installing:u})}}}));function sz(){const{t:e}=le("console"),{skills:t,isLoading:a,error:i,activeTab:s,sourceFilter:o,selectedSkill:u,detailDialogOpen:f,installing:h,fetchSkills:g,setTab:x,setSourceFilter:p,openDetail:b,closeDetail:v,toggleSkill:w,installSkill:C}=iz(),{searchResults:E,exploreItems:S,searchQuery:N,isSearching:D,isExploring:U,searchError:z,exploreError:L,nextCursor:G,offlineMode:X,search:F,searchImmediate:_,explore:q,clearSearch:V}=Ps(),[re,W]=j.useState(null),[J,B]=j.useState(""),[ee,de]=j.useState(null),[ke,T]=j.useState(null);j.useEffect(()=>{g()},[g]),j.useEffect(()=>{s==="marketplace"&&S.length===0&&!X&&q()},[s,S.length,X,q]);const R=j.useMemo(()=>az(t,J,o),[t,J,o]),Q=j.useMemo(()=>rz(t,N),[t,N]),M=j.useMemo(()=>nz(t),[t]),ce=j.useMemo(()=>({all:t.filter(pe=>pe.isBundled||pe.eligible).length,"built-in":t.filter(pe=>pe.isBundled).length,marketplace:t.filter(pe=>!pe.isBundled).length}),[t]),me=pe=>{pe.installOptions&&pe.installOptions.length>1?W(pe):pe.installOptions&&pe.installOptions.length===1&&C(pe.id,pe.installOptions[0].id)},ye=async pe=>{re&&(await C(re.id,pe),W(null))},Me=j.useCallback((pe,un)=>{de({slug:pe,displayName:un})},[]),rt=j.useCallback(()=>{de(null),g()},[g]),Ge=j.useCallback(pe=>{F(pe)},[F]),Ot=j.useCallback(()=>{N.trim()&&_(N)},[N,_]),En=j.useCallback(()=>{V()},[V]),Ja=N.trim().length>0,Wa=z||L;return a&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(oh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g}),c.jsx(vl,{})]}):i&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(oh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g}),c.jsx(Vc,{message:i,onRetry:g})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsx(oh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g,loading:a}),c.jsx(ez,{activeTab:s,onTabChange:x}),s==="installed"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[c.jsxs("div",{className:"relative w-full lg:max-w-md",children:[c.jsx(ph,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),c.jsx("input",{value:J,onChange:pe=>B(pe.target.value),placeholder:e("skills.installed.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 bg-white py-2 pl-10 pr-4 text-sm text-gray-700 outline-none transition-colors focus:border-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:["all","built-in","marketplace"].map(pe=>c.jsx("button",{type:"button",onClick:()=>p(pe),className:`rounded-xl px-3 py-2 text-sm font-medium transition-colors ${o===pe?"bg-blue-600 text-white":"border border-gray-300 bg-white text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"}`,children:e(`skills.filters.${pe}`,{count:ce[pe]})},pe))})]}),R.length===0?c.jsx(Sr,{icon:$o,title:e("skills.empty.title"),description:e("skills.empty.description")}):c.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:R.map(pe=>c.jsx(iv,{skill:pe,onToggle:w,onConfigure:b,onInstall:me,isInstalling:h.has(pe.id)},pe.id))})]}):c.jsxs("div",{className:"space-y-5",children:[c.jsx("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/80 p-4 dark:border-gray-700 dark:bg-gray-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Y5,{className:"mt-0.5 h-5 w-5 text-gray-500"}),c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:e("skills.marketplace.securityNote")})]})}),X&&c.jsx("div",{className:"rounded-xl border border-orange-200 bg-orange-50 px-4 py-3 dark:border-orange-800 dark:bg-orange-900/20",children:c.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-600 dark:text-orange-400",children:[c.jsx(eg,{className:"h-4 w-4"}),e("clawhub.offlineNotice")]})}),c.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(ph,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),c.jsx("input",{value:N,onChange:pe=>Ge(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Ot(),placeholder:e("clawhub.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 bg-white py-2 pl-10 pr-10 text-sm text-gray-700 outline-none transition-colors focus:border-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"}),N&&c.jsx("button",{type:"button",onClick:En,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:c.jsx(Sn,{className:"h-4 w-4"})})]}),c.jsx("button",{type:"button",onClick:Ot,disabled:D||!N.trim(),className:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700 disabled:opacity-50",children:D?c.jsx(Dt,{className:"mx-auto h-4 w-4 animate-spin"}):e("skills.marketplace.searchButton")})]}),Wa&&c.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-600 dark:border-red-900/50 dark:bg-red-900/10 dark:text-red-400",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Xh,{className:"h-4 w-4"}),Wa]})}),X?Q.length===0?c.jsx(Sr,{icon:$o,title:e("skills.marketplace.emptyTitle"),description:e("skills.marketplace.emptyDescription")}):c.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:Q.map(pe=>c.jsx(iv,{skill:pe,onToggle:w,onConfigure:b,onInstall:me,isInstalling:h.has(pe.id)},pe.id))}):Ja?D?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-6 w-6 animate-spin text-gray-400"})}):E.length===0?c.jsx(Sr,{icon:$o,title:e("clawhub.noSearchResults"),description:e("clawhub.tryDifferentQuery")}):c.jsx("div",{className:"grid grid-cols-1 gap-3 xl:grid-cols-2",children:E.map(pe=>c.jsx(rv,{item:pe,isInstalled:M.has(pe.slug),onInstall:Me,onOpenDetail:un=>T(un)},pe.slug))}):c.jsx(c.Fragment,{children:U&&S.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Dt,{className:"h-6 w-6 animate-spin text-gray-400"})}):S.length===0?c.jsx(Sr,{icon:$o,title:e("clawhub.noSkills"),description:e("clawhub.noSkillsDescription")}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"grid grid-cols-1 gap-3 xl:grid-cols-2",children:S.map(pe=>c.jsx(rv,{item:pe,isInstalled:M.has(pe.slug),onInstall:Me,onOpenDetail:un=>T(un)},pe.slug))}),G&&c.jsx("div",{className:"flex justify-center",children:c.jsx("button",{type:"button",onClick:()=>q(!0),disabled:U,className:"rounded-xl border border-gray-300 px-6 py-2 text-sm font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:U?c.jsx(Dt,{className:"mx-auto h-4 w-4 animate-spin"}):e("clawhub.loadMore")})})]})})]}),c.jsx(J8,{open:f,skill:u,onClose:v,onSaved:g}),c.jsx(Z8,{open:re!==null,skillName:(re==null?void 0:re.name)??"",options:(re==null?void 0:re.installOptions)??[],onSelect:ye,onCancel:()=>W(null)}),c.jsx(Y8,{slug:ke,onClose:()=>T(null),onInstall:Me,isInstalled:ke?M.has(ke):!1}),c.jsx(Q8,{open:ee!==null,slug:(ee==null?void 0:ee.slug)??"",displayName:(ee==null?void 0:ee.displayName)??"",onClose:()=>de(null),onConfirmDone:rt})]})}function oh({title:e,description:t,onRefresh:a,loading:i}){const{t:s}=le("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:a,disabled:i,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Nn,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`}),s("actions.refresh")]})]})}function lz({initialPreference:e,onSubmit:t,submitting:a,error:i}){const{t:s}=le("common"),[o,u]=j.useState((e==null?void 0:e.mode)??"local"),[f,h]=j.useState((e==null?void 0:e.gatewayUrl)??""),[g,x]=j.useState((e==null?void 0:e.gatewayToken)??""),[p,b]=j.useState(null),v=j.useRef("");j.useEffect(()=>{const E=sc(f.trim());E.token&&(g.length===0||g===v.current)&&x(E.token),v.current=E.token},[f,g]);const w=async()=>{if(o==="local"){b(null),await t({mode:o,gatewayUrl:"",gatewayToken:""});return}const E=sc(f.trim()),S=(E.url??"").trim(),N=g.trim()||E.token;if(!S){b(s("connectionSetup.validation.gatewayUrlRequired"));return}if(!N){b(s("connectionSetup.validation.gatewayTokenRequired"));return}b(null),await t({mode:o,gatewayUrl:S,gatewayToken:N})},C=sc(f.trim());return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/70 px-4 backdrop-blur-sm",children:c.jsxs("div",{className:"w-full max-w-2xl rounded-3xl border border-slate-200 bg-white p-8 shadow-2xl dark:border-slate-700 dark:bg-slate-900",children:[c.jsxs("div",{className:"mb-6",children:[c.jsx("p",{className:"text-sm font-medium uppercase tracking-[0.24em] text-sky-600 dark:text-sky-400",children:s("connectionSetup.eyebrow")}),c.jsx("h2",{className:"mt-2 text-3xl font-semibold text-slate-900 dark:text-slate-50",children:s("connectionSetup.title")}),c.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600 dark:text-slate-300",children:s("connectionSetup.description")})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(sv,{active:o==="local",title:s("connectionSetup.local.title"),description:s("connectionSetup.local.description"),onClick:()=>u("local")}),c.jsx(sv,{active:o==="remote",title:s("connectionSetup.remote.title"),description:s("connectionSetup.remote.description"),onClick:()=>u("remote")})]}),o==="remote"&&c.jsxs("div",{className:"mt-6 space-y-4 rounded-2xl border border-slate-200 bg-slate-50 p-5 dark:border-slate-700 dark:bg-slate-950/40",children:[c.jsx(lv,{label:s("connectionSetup.remote.gatewayUrlLabel"),hint:s("connectionSetup.remote.gatewayUrlHint"),value:f,onChange:h,placeholder:s("connectionSetup.remote.gatewayUrlPlaceholder")}),c.jsx(lv,{label:s("connectionSetup.remote.gatewayTokenLabel"),hint:C.token?s("connectionSetup.remote.gatewayTokenExtracted"):s("connectionSetup.remote.gatewayTokenHint"),value:g,onChange:x,placeholder:s("connectionSetup.remote.gatewayTokenPlaceholder"),type:"password"})]}),(p||i)&&c.jsx("div",{className:"mt-5 rounded-2xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/40 dark:text-rose-300",children:p||i}),c.jsxs("div",{className:"mt-6 flex items-center justify-between gap-4",children:[c.jsx("p",{className:"text-xs leading-5 text-slate-500 dark:text-slate-400",children:s("connectionSetup.footer")}),c.jsx("button",{type:"button",onClick:()=>void w(),disabled:a,className:"inline-flex min-w-36 items-center justify-center rounded-xl bg-sky-600 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-sky-500 disabled:cursor-not-allowed disabled:opacity-60",children:s(a?"connectionSetup.actions.connecting":"connectionSetup.actions.continue")})]})]})})}function sv({active:e,title:t,description:a,onClick:i}){return c.jsx("button",{type:"button",onClick:i,className:`rounded-2xl border p-5 text-left transition ${e?"border-sky-500 bg-sky-50 shadow-sm dark:border-sky-400 dark:bg-sky-950/30":"border-slate-200 bg-white hover:border-slate-300 dark:border-slate-700 dark:bg-slate-900"}`,children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-slate-900 dark:text-slate-100",children:t}),c.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600 dark:text-slate-300",children:a})]}),c.jsx("span",{className:`mt-1 h-4 w-4 rounded-full border ${e?"border-sky-500 bg-sky-500 shadow-[0_0_0_4px_rgba(14,165,233,0.18)]":"border-slate-300 bg-transparent dark:border-slate-600"}`})]})})}function lv({label:e,hint:t,value:a,onChange:i,placeholder:s,type:o="text"}){return c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-sm font-medium text-slate-800 dark:text-slate-100",children:e}),c.jsx("input",{type:o,value:a,onChange:u=>i(u.target.value),placeholder:s,className:"mt-2 w-full rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm text-slate-900 outline-none ring-0 transition placeholder:text-slate-400 focus:border-sky-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-50"}),c.jsx("span",{className:"mt-2 block text-xs leading-5 text-slate-500 dark:text-slate-400",children:t})]})}const oz=500,ov=200;function cz(e){if(e.stream==="error")return!0;if(e.stream==="lifecycle"){const t=e.data.phase;return t==="start"||t==="end"}return!1}class uz{constructor(){_e(this,"queue",[]);_e(this,"rafId",null);_e(this,"handler",null);_e(this,"immediateHandler",null)}onBatch(t){this.handler=t}onImmediate(t){this.immediateHandler=t}push(t){var a;if(cz(t)){(a=this.immediateHandler)==null||a.call(this,t);return}this.queue.push(t),this.queue.length>oz&&(console.warn(`[EventThrottle] Queue overflow: ${this.queue.length} events, trimming to ${ov}`),this.queue=this.queue.slice(-ov)),this.scheduleFlush()}scheduleFlush(){this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.flush()}))}flush(){var a;if(this.rafId=null,this.queue.length===0)return;const t=this.queue;this.queue=[],(a=this.handler)==null||a.call(this,t)}destroy(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.queue=[]}}const dz=3e3;function fz(e,t){const a=new Set(e.map(u=>u.sessionKey)),i=new Set(t.map(u=>u.sessionKey)),s=t.filter(u=>!a.has(u.sessionKey)),o=e.filter(u=>!i.has(u.sessionKey));return{added:s,removed:o}}function hz(e){const t=":subagent:",a=e.indexOf(t);return a>=0?e.slice(a+t.length):null}function gz(e){return e.filter(t=>t.requesterSessionKey).map(t=>{const a=hz(t.sessionKey),i=a??t.agentId;return{sessionKey:t.sessionKey,agentId:i,label:t.label??(a?`Sub-${a.slice(0,6)}`:t.agentId),task:t.task??"",requesterSessionKey:t.requesterSessionKey,startedAt:t.startedAt??Date.now()}})}function mz(e){const t=j.useRef(null),a=se(s=>s.connectionStatus);j.useEffect(()=>{if(a!=="connected"||!e.current){t.current&&(clearInterval(t.current),t.current=null);return}const s=async()=>{const o=e.current;if(o)try{const u=await o.request("sessions.list"),f=gz(u.sessions??[]),h=se.getState().lastSessionsSnapshot,g=(h==null?void 0:h.sessions)??[],{added:x,removed:p}=fz(g,f);for(const b of x){const v=i(b.requesterSessionKey);v&&se.getState().addSubAgent(v,b)}for(const b of p)se.getState().agents.has(b.agentId)&&se.getState().removeSubAgent(b.agentId);se.getState().setSessionsSnapshot({sessions:f,fetchedAt:Date.now()})}catch{}};return t.current=setInterval(s,dz),s(),()=>{t.current&&(clearInterval(t.current),t.current=null)}},[a]);function i(s){const u=se.getState().sessionKeyMap.get(s);if(u&&u.length>0)return u[0];for(const[f,h]of se.getState().agents)if(!h.isSubAgent)return f;return null}}const pz=6e4,yz=3;function xz(e){const t=j.useRef(null),a=j.useRef(0),i=se(u=>u.connectionStatus),s=se(u=>u.pushTokenSnapshot),o=se(u=>u.setAgentCosts);j.useEffect(()=>{if(i!=="connected"||!e.current){t.current&&(clearInterval(t.current),t.current=null);return}const u=async()=>{const f=e.current;if(f)try{const[h,g]=await Promise.all([f.request("usage.status"),f.request("usage.cost").catch(()=>null)]);a.current=0;const x=vz(h);x&&s({timestamp:Date.now(),total:x.total,byAgent:x.byAgent});const p=(g==null?void 0:g.byAgent)??(g==null?void 0:g.costs)??{};Object.keys(p).length>0&&o(p)}catch{if(a.current+=1,a.current>=yz){const h=se.getState().eventHistory,g=kz(h);g&&s(g)}}};return t.current=setInterval(u,pz),u(),()=>{t.current&&(clearInterval(t.current),t.current=null)}},[i,s,o])}function bz(e){let t=0;for(const a of Object.values(e))typeof a=="number"&&(t+=a);return t}function vz(e){var s,o,u,f;if(!e)return null;const t=e.byAgent??((s=e.tokens)==null?void 0:s.byAgent)??((o=e.usage)==null?void 0:o.byAgent)??{},i=[e.total,(u=e.tokens)==null?void 0:u.total,(f=e.usage)==null?void 0:f.totalTokens].filter(h=>typeof h=="number"&&Number.isFinite(h))[0]??bz(t);return!Number.isFinite(i)||i<=0?null:{total:Math.max(0,Math.round(i)),byAgent:t}}function kz(e){const t={};let a=0;for(const i of e){if(i.stream!=="tool")continue;const s=100;t[i.agentId]=(t[i.agentId]??0)+s,a+=s}return a===0?null:{timestamp:Date.now(),total:a,byAgent:t}}function wz({url:e,token:t}){const a=j.useRef(null),i=j.useRef(null),s=j.useRef(null),o=se(p=>p.setConnectionStatus),u=se(p=>p.initAgents),f=se(p=>p.processAgentEvent),h=se(p=>p.setOperatorScopes),g=se(p=>p.setMaxSubAgents),x=se(p=>p.setAgentToAgentConfig);return j.useEffect(()=>{if(!e)return;const p=new Wv,b=new Jv(p),v=new uz;return a.current=p,i.current=b,s.current=v,v.onBatch(w=>{for(const C of w)f(C)}),v.onImmediate(w=>{f(w)}),p.onStatusChange((w,C)=>{if(o(w,C),w==="connected"){Sz(p,u);const E=p.getSnapshot(),S=E==null?void 0:E.scopes;h(Array.isArray(S)?S:["operator"]),J3("ws",{wsClient:p,rpcClient:b}),jz(b,g,x)}}),p.onEvent("agent",w=>{v.push(w.payload)}),p.onEvent("health",w=>{const C=w.payload;if(C!=null&&C.agents){const E=$k(C);u(E)}}),p.connect(e,t),()=>{v.destroy(),p.disconnect(),a.current=null,i.current=null,s.current=null}},[e,t,o,u,f,h,g,x]),mz(i),xz(i),{wsClient:a,rpcClient:i}}function $k(e){return e.agents?e.agents.map(t=>({id:t.agentId,name:t.agentId})):[]}function Sz(e,t){const a=e.getSnapshot(),i=a==null?void 0:a.health;i!=null&&i.agents&&t($k(i))}async function jz(e,t,a){try{const s=(await e.request("config.get")).config;if(!s)return;const o=s.agents,u=o==null?void 0:o.defaults,f=u==null?void 0:u.subagents;f!=null&&f.maxConcurrent&&f.maxConcurrent>=1&&f.maxConcurrent<=50&&t(f.maxConcurrent);const h=s.tools,g=h==null?void 0:h.agentToAgent;g&&a({enabled:g.enabled??!1,allow:Array.isArray(g.allow)?g.allow:[]})}catch{}}const Kk="openclaw-connection-preference";function Fk(){return typeof window<"u"&&typeof window.localStorage<"u"}function Cz(){if(!Fk())return null;try{const e=window.localStorage.getItem(Kk);if(!e)return null;const t=JSON.parse(e);return t.mode!=="local"&&t.mode!=="remote"?null:{mode:t.mode,gatewayUrl:typeof t.gatewayUrl=="string"?t.gatewayUrl:"",gatewayToken:typeof t.gatewayToken=="string"?t.gatewayToken:""}}catch{return null}}function Nz(e){Fk()&&window.localStorage.setItem(Kk,JSON.stringify(e))}const Az="/__openclaw/connection";async function nc(e){const t=await fetch(Az,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const a=await t.text();throw new Error(a||`Runtime connection update failed: ${t.status}`)}}function Ez(){const[e,t]=j.useState(()=>cv());return j.useEffect(()=>{const a=matchMedia("(max-width: 767px)"),i=matchMedia("(min-width: 768px) and (max-width: 1023px)");function s(){t(cv())}return a.addEventListener("change",s),i.addEventListener("change",s),()=>{a.removeEventListener("change",s),i.removeEventListener("change",s)}},[]),e}function cv(){if(typeof window>"u")return{isMobile:!1,isTablet:!1,isDesktop:!0};const e=window.innerWidth;return{isMobile:e<768,isTablet:e>=768&&e<1024,isDesktop:e>=1024}}const Tz=j.lazy(()=>fl(()=>import("./Scene3D-q5P1N1qu.js"),[]));function Mz(){const{t:e}=le("office");return c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-50 dark:bg-gray-950",children:c.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"}),c.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("loading3D")})]})})}function Dz(){const e=se(o=>o.viewMode),[t,a]=j.useState(!1),[i,s]=j.useState(e);return j.useEffect(()=>{if(e!==i){a(!0);const o=setTimeout(()=>{s(e),a(!1)},150);return()=>clearTimeout(o)}},[e,i]),c.jsx("div",{className:"h-full w-full transition-opacity duration-300",style:{opacity:t?0:1},children:i==="2d"?c.jsx(nL,{}):c.jsx(j.Suspense,{fallback:c.jsx(Mz,{}),children:c.jsx(Tz,{})})})}function ch(){const e=se(t=>t.theme);return j.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),null}function _z({message:e}){return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[radial-gradient(circle_at_top,#e0f2fe,transparent_35%),linear-gradient(180deg,#f8fafc_0%,#e2e8f0_100%)] px-6 dark:bg-[radial-gradient(circle_at_top,#082f49,transparent_35%),linear-gradient(180deg,#020617_0%,#0f172a_100%)]",children:c.jsxs("div",{className:"flex w-full max-w-md flex-col items-center rounded-3xl border border-white/60 bg-white/80 px-8 py-10 text-center shadow-2xl backdrop-blur dark:border-slate-700/80 dark:bg-slate-900/80",children:[c.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-2 border-sky-500 border-t-transparent"}),c.jsx("p",{className:"mt-4 text-sm text-slate-600 dark:text-slate-300",children:e})]})})}const Rz={"/":"office","/dashboard":"dashboard","/agents":"agents","/channels":"channels","/skills":"skills","/cron":"cron","/settings":"settings"};function Oz(){const e=Hn(),t=se(a=>a.setCurrentPage);return j.useEffect(()=>{const a=Rz[e.pathname]??"office";t(a)},[e.pathname,t]),null}function Lz(){const{t:e}=le("common"),t=window.__OPENCLAW_CONFIG__,a=(t==null?void 0:t.gatewayUrl)||"/gateway-ws",i=(t==null?void 0:t.gatewayToken)||"5qd1bnvCHA2JwLn5NUBwUqKS7ZWMY37Vo2TO7pvZHc9sgL0U",[s,o]=j.useState(()=>Cz()),[u,f]=j.useState(!1),[h,g]=j.useState(null),[x,p]=j.useState(()=>s!==null),{isMobile:b}=Ez(),v=se(N=>N.setViewMode);j.useEffect(()=>{if(!s){p(!1);return}const N=s;let D=!1;const U=a.startsWith("/");async function z(){p(!1),g(null);try{U&&(N.mode==="remote"?await nc({mode:"remote",gatewayUrl:N.gatewayUrl}):await nc({mode:"local"})),D||p(!0)}catch(L){if(!D){const G=L instanceof Error?L.message:e("errors.unknownError");g(G)}}}return z(),()=>{D=!0}},[s,a,e]);const w=(s==null?void 0:s.mode)==="remote"?s.gatewayToken:i,C=zk(a,w,window.location,{preferSameOriginProxy:!1}),{wsClient:E}=wz({url:x?C.url:"",token:x?C.token:""});j.useEffect(()=>{b&&v("2d")},[b,v]);const S=async N=>{f(!0),g(null);try{N.mode==="remote"?await nc({mode:"remote",gatewayUrl:N.gatewayUrl}):await nc({mode:"local"}),Nz(N),o(N),p(!0)}catch(D){const U=D instanceof Error?D.message:e("errors.unknownError");g(U)}finally{f(!1)}};return!s||h?c.jsxs(c.Fragment,{children:[c.jsx(ch,{}),c.jsx(lz,{initialPreference:s,onSubmit:S,submitting:u,error:h})]}):x?c.jsxs(c.Fragment,{children:[c.jsx(ch,{}),c.jsx(Oz,{}),c.jsxs(pj,{children:[c.jsx(Rn,{element:c.jsx(BO,{wsClient:E,isMobile:b}),children:c.jsx(Rn,{path:"/",element:c.jsx(Dz,{})})}),c.jsxs(Rn,{element:c.jsx(qO,{}),children:[c.jsx(Rn,{path:"/dashboard",element:c.jsx(f8,{})}),c.jsx(Rn,{path:"/agents",element:c.jsx(PL,{})}),c.jsx(Rn,{path:"/channels",element:c.jsx(t8,{})}),c.jsx(Rn,{path:"/skills",element:c.jsx(sz,{})}),c.jsx(Rn,{path:"/cron",element:c.jsx(r8,{})}),c.jsx(Rn,{path:"/settings",element:c.jsx(I8,{})})]}),c.jsx(Rn,{path:"*",element:c.jsx(gj,{to:"/",replace:!0})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx(ch,{}),c.jsx(_z,{message:e("connectionSetup.syncing")})]})}p2.createRoot(document.getElementById("root")).render(c.jsx(j.StrictMode,{children:c.jsx(Bj,{children:c.jsx(Lz,{})})}));export{Mi as P,pl as S,De as Z,yh as _,YC as a,d2 as b,O3 as c,j as d,wr as e,p2 as f,$h as g,se as h,Iz as i,c as j,XA as k,Hz as l,Uz as p,Cc as r,le as u};
|