cicy-desktop 2.1.342 → 2.1.357
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/package.json +1 -1
- package/scripts/build-homepage.cjs +16 -1
- package/src/app-updater.js +6 -0
- package/src/backends/homepage-preload.js +3 -1
- package/src/backends/homepage-react/assets/index-Buyk0RlW.js +655 -0
- package/src/backends/homepage-react/assets/index-CVk0uc2g.css +1 -0
- package/src/backends/homepage-react/index.html +5 -3
- package/src/backends/homepage-react/panel/facebook-matrix.html +305 -87
- package/src/backends/homepage-react/panel/ipcheck.html +112 -0
- package/src/backends/homepage-react/panel/matrix.html +595 -0
- package/src/backends/homepage-react/panel/telegram-matrix.html +96 -22
- package/src/backends/homepage-react/panel/tiktok-matrix.html +599 -0
- package/src/backends/hub-client.js +108 -2
- package/src/backends/sidecar-ipc.js +33 -6
- package/src/main.js +67 -11
- package/src/sidecar/host-mihomo.js +47 -2
- package/src/tabbrowser/facebook-identity.js +12 -1
- package/src/tabbrowser/facebook-matrix.html +305 -87
- package/src/tabbrowser/fb-login.js +115 -0
- package/src/tabbrowser/newtab-protocol.js +6 -1
- package/src/tabbrowser/panel-cells.js +9 -1
- package/src/tabbrowser/telegram-matrix.html +96 -22
- package/src/tabbrowser/telegram-web-preferences.js +5 -1
- package/src/tabbrowser/tiktok-matrix.html +305 -87
- package/src/tools/tab-browser-tools.js +21 -100
- package/src/tray.js +22 -0
- package/test/bootstrap-failure-reporting.test.js +1 -1
- package/test/facebook-identity.test.js +3 -1
- package/test/facebook-matrix.test.js +2 -1
- package/test/telegram-matrix.test.js +2 -2
- package/test/tiktok-matrix.test.js +2 -1
- package/tools/arm-fblogin.js +32 -0
- package/tools/wsd-ws +114 -0
- package/workers/render/index.html +3 -1
- package/workers/render/package.json +2 -3
- package/workers/render/public/panel/facebook-matrix.html +305 -87
- package/workers/render/public/panel/ipcheck.html +112 -0
- package/workers/render/public/panel/matrix.html +595 -0
- package/workers/render/public/panel/telegram-matrix.html +96 -22
- package/workers/render/public/panel/tiktok-matrix.html +599 -0
- package/workers/render/src/App.css +4 -0
- package/workers/render/src/App.jsx +917 -52
- package/workers/render/stamp-panel-version.mjs +16 -0
- package/workers/render/worker.js +1 -1
- package/src/backends/homepage-react/assets/index-C6Zrdgc0.css +0 -1
- package/src/backends/homepage-react/assets/index-OG6JB73F.js +0 -411
- package/src/tabbrowser/cicy-code-tab-restore.js +0 -10
- package/test/cicy-code-tab-restore.test.js +0 -21
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))d(S);new MutationObserver(S=>{for(const w of S)if(w.type==="childList")for(const b of w.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&d(b)}).observe(document,{childList:!0,subtree:!0});function h(S){const w={};return S.integrity&&(w.integrity=S.integrity),S.referrerPolicy&&(w.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?w.credentials="include":S.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function d(S){if(S.ep)return;S.ep=!0;const w=h(S);fetch(S.href,w)}})();var yr={exports:{}},_i={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Dm;function ky(){if(Dm)return _i;Dm=1;var c=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function h(d,S,w){var b=null;if(w!==void 0&&(b=""+w),S.key!==void 0&&(b=""+S.key),"key"in S){w={};for(var M in S)M!=="key"&&(w[M]=S[M])}else w=S;return S=w.ref,{$$typeof:c,type:d,key:b,ref:S!==void 0?S:null,props:w}}return _i.Fragment=f,_i.jsx=h,_i.jsxs=h,_i}var Om;function Ty(){return Om||(Om=1,yr.exports=ky()),yr.exports}var s=Ty(),gr={exports:{}},ji={},br={exports:{}},vr={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Mm;function Cy(){return Mm||(Mm=1,(function(c){function f(C,Y){var H=C.length;C.push(Y);e:for(;0<H;){var ie=H-1>>>1,ee=C[ie];if(0<S(ee,Y))C[ie]=Y,C[H]=ee,H=ie;else break e}}function h(C){return C.length===0?null:C[0]}function d(C){if(C.length===0)return null;var Y=C[0],H=C.pop();if(H!==Y){C[0]=H;e:for(var ie=0,ee=C.length,m=ee>>>1;ie<m;){var x=2*(ie+1)-1,q=C[x],K=x+1,I=C[K];if(0>S(q,H))K<ee&&0>S(I,q)?(C[ie]=I,C[K]=H,ie=K):(C[ie]=q,C[x]=H,ie=x);else if(K<ee&&0>S(I,H))C[ie]=I,C[K]=H,ie=K;else break e}}return Y}function S(C,Y){var H=C.sortIndex-Y.sortIndex;return H!==0?H:C.id-Y.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var w=performance;c.unstable_now=function(){return w.now()}}else{var b=Date,M=b.now();c.unstable_now=function(){return b.now()-M}}var j=[],p=[],N=1,T=null,Z=3,D=!1,J=!1,R=!1,U=!1,F=typeof setTimeout=="function"?setTimeout:null,Se=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function we(C){for(var Y=h(p);Y!==null;){if(Y.callback===null)d(p);else if(Y.startTime<=C)d(p),Y.sortIndex=Y.expirationTime,f(j,Y);else break;Y=h(p)}}function ce(C){if(R=!1,we(C),!J)if(h(j)!==null)J=!0,te||(te=!0,$e());else{var Y=h(p);Y!==null&&oe(ce,Y.startTime-C)}}var te=!1,V=-1,ae=5,X=-1;function je(){return U?!0:!(c.unstable_now()-X<ae)}function qe(){if(U=!1,te){var C=c.unstable_now();X=C;var Y=!0;try{e:{J=!1,R&&(R=!1,Se(V),V=-1),D=!0;var H=Z;try{t:{for(we(C),T=h(j);T!==null&&!(T.expirationTime>C&&je());){var ie=T.callback;if(typeof ie=="function"){T.callback=null,Z=T.priorityLevel;var ee=ie(T.expirationTime<=C);if(C=c.unstable_now(),typeof ee=="function"){T.callback=ee,we(C),Y=!0;break t}T===h(j)&&d(j),we(C)}else d(j);T=h(j)}if(T!==null)Y=!0;else{var m=h(p);m!==null&&oe(ce,m.startTime-C),Y=!1}}break e}finally{T=null,Z=H,D=!1}Y=void 0}}finally{Y?$e():te=!1}}}var $e;if(typeof le=="function")$e=function(){le(qe)};else if(typeof MessageChannel<"u"){var st=new MessageChannel,Xe=st.port2;st.port1.onmessage=qe,$e=function(){Xe.postMessage(null)}}else $e=function(){F(qe,0)};function oe(C,Y){V=F(function(){C(c.unstable_now())},Y)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(C){C.callback=null},c.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<C?Math.floor(1e3/C):5},c.unstable_getCurrentPriorityLevel=function(){return Z},c.unstable_next=function(C){switch(Z){case 1:case 2:case 3:var Y=3;break;default:Y=Z}var H=Z;Z=Y;try{return C()}finally{Z=H}},c.unstable_requestPaint=function(){U=!0},c.unstable_runWithPriority=function(C,Y){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var H=Z;Z=C;try{return Y()}finally{Z=H}},c.unstable_scheduleCallback=function(C,Y,H){var ie=c.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ie+H:ie):H=ie,C){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=H+ee,C={id:N++,callback:Y,priorityLevel:C,startTime:H,expirationTime:ee,sortIndex:-1},H>ie?(C.sortIndex=H,f(p,C),h(j)===null&&C===h(p)&&(R?(Se(V),V=-1):R=!0,oe(ce,H-ie))):(C.sortIndex=ee,f(j,C),J||D||(J=!0,te||(te=!0,$e()))),C},c.unstable_shouldYield=je,c.unstable_wrapCallback=function(C){var Y=Z;return function(){var H=Z;Z=Y;try{return C.apply(this,arguments)}finally{Z=H}}}})(vr)),vr}var Rm;function Ey(){return Rm||(Rm=1,br.exports=Cy()),br.exports}var Sr={exports:{}},Ae={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Um;function Ay(){if(Um)return Ae;Um=1;var c=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),b=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),Z=Symbol.iterator;function D(m){return m===null||typeof m!="object"?null:(m=Z&&m[Z]||m["@@iterator"],typeof m=="function"?m:null)}var J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,U={};function F(m,x,q){this.props=m,this.context=x,this.refs=U,this.updater=q||J}F.prototype.isReactComponent={},F.prototype.setState=function(m,x){if(typeof m!="object"&&typeof m!="function"&&m!=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,m,x,"setState")},F.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function Se(){}Se.prototype=F.prototype;function le(m,x,q){this.props=m,this.context=x,this.refs=U,this.updater=q||J}var we=le.prototype=new Se;we.constructor=le,R(we,F.prototype),we.isPureReactComponent=!0;var ce=Array.isArray;function te(){}var V={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function X(m,x,q){var K=q.ref;return{$$typeof:c,type:m,key:x,ref:K!==void 0?K:null,props:q}}function je(m,x){return X(m.type,x,m.props)}function qe(m){return typeof m=="object"&&m!==null&&m.$$typeof===c}function $e(m){var x={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(q){return x[q]})}var st=/\/+/g;function Xe(m,x){return typeof m=="object"&&m!==null&&m.key!=null?$e(""+m.key):x.toString(36)}function oe(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(te,te):(m.status="pending",m.then(function(x){m.status==="pending"&&(m.status="fulfilled",m.value=x)},function(x){m.status==="pending"&&(m.status="rejected",m.reason=x)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function C(m,x,q,K,I){var ge=typeof m;(ge==="undefined"||ge==="boolean")&&(m=null);var me=!1;if(m===null)me=!0;else switch(ge){case"bigint":case"string":case"number":me=!0;break;case"object":switch(m.$$typeof){case c:case f:me=!0;break;case N:return me=m._init,C(me(m._payload),x,q,K,I)}}if(me)return I=I(m),me=K===""?"."+Xe(m,0):K,ce(I)?(q="",me!=null&&(q=me.replace(st,"$&/")+"/"),C(I,x,q,"",function(Gt){return Gt})):I!=null&&(qe(I)&&(I=je(I,q+(I.key==null||m&&m.key===I.key?"":(""+I.key).replace(st,"$&/")+"/")+me)),x.push(I)),1;me=0;var Qe=K===""?".":K+":";if(ce(m))for(var Me=0;Me<m.length;Me++)K=m[Me],ge=Qe+Xe(K,Me),me+=C(K,x,q,ge,I);else if(Me=D(m),typeof Me=="function")for(m=Me.call(m),Me=0;!(K=m.next()).done;)K=K.value,ge=Qe+Xe(K,Me++),me+=C(K,x,q,ge,I);else if(ge==="object"){if(typeof m.then=="function")return C(oe(m),x,q,K,I);throw x=String(m),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return me}function Y(m,x,q){if(m==null)return m;var K=[],I=0;return C(m,K,"","",function(ge){return x.call(q,ge,I++)}),K}function H(m){if(m._status===-1){var x=m._result;x=x(),x.then(function(q){(m._status===0||m._status===-1)&&(m._status=1,m._result=q)},function(q){(m._status===0||m._status===-1)&&(m._status=2,m._result=q)}),m._status===-1&&(m._status=0,m._result=x)}if(m._status===1)return m._result.default;throw m._result}var ie=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var x=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(x))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},ee={map:Y,forEach:function(m,x,q){Y(m,function(){x.apply(this,arguments)},q)},count:function(m){var x=0;return Y(m,function(){x++}),x},toArray:function(m){return Y(m,function(x){return x})||[]},only:function(m){if(!qe(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return Ae.Activity=T,Ae.Children=ee,Ae.Component=F,Ae.Fragment=h,Ae.Profiler=S,Ae.PureComponent=le,Ae.StrictMode=d,Ae.Suspense=j,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(m){return V.H.useMemoCache(m)}},Ae.cache=function(m){return function(){return m.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(m,x,q){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var K=R({},m.props),I=m.key;if(x!=null)for(ge in x.key!==void 0&&(I=""+x.key),x)!ae.call(x,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&x.ref===void 0||(K[ge]=x[ge]);var ge=arguments.length-2;if(ge===1)K.children=q;else if(1<ge){for(var me=Array(ge),Qe=0;Qe<ge;Qe++)me[Qe]=arguments[Qe+2];K.children=me}return X(m.type,I,K)},Ae.createContext=function(m){return m={$$typeof:b,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:w,_context:m},m},Ae.createElement=function(m,x,q){var K,I={},ge=null;if(x!=null)for(K in x.key!==void 0&&(ge=""+x.key),x)ae.call(x,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(I[K]=x[K]);var me=arguments.length-2;if(me===1)I.children=q;else if(1<me){for(var Qe=Array(me),Me=0;Me<me;Me++)Qe[Me]=arguments[Me+2];I.children=Qe}if(m&&m.defaultProps)for(K in me=m.defaultProps,me)I[K]===void 0&&(I[K]=me[K]);return X(m,ge,I)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(m){return{$$typeof:M,render:m}},Ae.isValidElement=qe,Ae.lazy=function(m){return{$$typeof:N,_payload:{_status:-1,_result:m},_init:H}},Ae.memo=function(m,x){return{$$typeof:p,type:m,compare:x===void 0?null:x}},Ae.startTransition=function(m){var x=V.T,q={};V.T=q;try{var K=m(),I=V.S;I!==null&&I(q,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(te,ie)}catch(ge){ie(ge)}finally{x!==null&&q.types!==null&&(x.types=q.types),V.T=x}},Ae.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ae.use=function(m){return V.H.use(m)},Ae.useActionState=function(m,x,q){return V.H.useActionState(m,x,q)},Ae.useCallback=function(m,x){return V.H.useCallback(m,x)},Ae.useContext=function(m){return V.H.useContext(m)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(m,x){return V.H.useDeferredValue(m,x)},Ae.useEffect=function(m,x){return V.H.useEffect(m,x)},Ae.useEffectEvent=function(m){return V.H.useEffectEvent(m)},Ae.useId=function(){return V.H.useId()},Ae.useImperativeHandle=function(m,x,q){return V.H.useImperativeHandle(m,x,q)},Ae.useInsertionEffect=function(m,x){return V.H.useInsertionEffect(m,x)},Ae.useLayoutEffect=function(m,x){return V.H.useLayoutEffect(m,x)},Ae.useMemo=function(m,x){return V.H.useMemo(m,x)},Ae.useOptimistic=function(m,x){return V.H.useOptimistic(m,x)},Ae.useReducer=function(m,x,q){return V.H.useReducer(m,x,q)},Ae.useRef=function(m){return V.H.useRef(m)},Ae.useState=function(m){return V.H.useState(m)},Ae.useSyncExternalStore=function(m,x,q){return V.H.useSyncExternalStore(m,x,q)},Ae.useTransition=function(){return V.H.useTransition()},Ae.version="19.2.6",Ae}var Hm;function Hr(){return Hm||(Hm=1,Sr.exports=Ay()),Sr.exports}var wr={exports:{}},qt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Bm;function Ny(){if(Bm)return qt;Bm=1;var c=Hr();function f(j){var p="https://react.dev/errors/"+j;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)p+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+j+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(){}var d={d:{f:h,r:function(){throw Error(f(522))},D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},S=Symbol.for("react.portal");function w(j,p,N){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:T==null?null:""+T,children:j,containerInfo:p,implementation:N}}var b=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(j,p){if(j==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,qt.createPortal=function(j,p){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(f(299));return w(j,p,null,N)},qt.flushSync=function(j){var p=b.T,N=d.p;try{if(b.T=null,d.p=2,j)return j()}finally{b.T=p,d.p=N,d.d.f()}},qt.preconnect=function(j,p){typeof j=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,d.d.C(j,p))},qt.prefetchDNS=function(j){typeof j=="string"&&d.d.D(j)},qt.preinit=function(j,p){if(typeof j=="string"&&p&&typeof p.as=="string"){var N=p.as,T=M(N,p.crossOrigin),Z=typeof p.integrity=="string"?p.integrity:void 0,D=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;N==="style"?d.d.S(j,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:T,integrity:Z,fetchPriority:D}):N==="script"&&d.d.X(j,{crossOrigin:T,integrity:Z,fetchPriority:D,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},qt.preinitModule=function(j,p){if(typeof j=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var N=M(p.as,p.crossOrigin);d.d.M(j,{crossOrigin:N,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&d.d.M(j)},qt.preload=function(j,p){if(typeof j=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var N=p.as,T=M(N,p.crossOrigin);d.d.L(j,N,{crossOrigin:T,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},qt.preloadModule=function(j,p){if(typeof j=="string")if(p){var N=M(p.as,p.crossOrigin);d.d.m(j,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:N,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else d.d.m(j)},qt.requestFormReset=function(j){d.d.r(j)},qt.unstable_batchedUpdates=function(j,p){return j(p)},qt.useFormState=function(j,p,N){return b.H.useFormState(j,p,N)},qt.useFormStatus=function(){return b.H.useHostTransitionStatus()},qt.version="19.2.6",qt}var Lm;function sh(){if(Lm)return wr.exports;Lm=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(f){console.error(f)}}return c(),wr.exports=Ny(),wr.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var qm;function zy(){if(qm)return ji;qm=1;var c=Ey(),f=Hr(),h=sh();function d(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function S(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function b(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function M(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j(e){if(w(e)!==e)throw Error(d(188))}function p(e){var t=e.alternate;if(!t){if(t=w(e),t===null)throw Error(d(188));return t!==e?null:e}for(var a=e,n=t;;){var l=a.return;if(l===null)break;var i=l.alternate;if(i===null){if(n=l.return,n!==null){a=n;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===a)return j(l),e;if(i===n)return j(l),t;i=i.sibling}throw Error(d(188))}if(a.return!==n.return)a=l,n=i;else{for(var o=!1,u=l.child;u;){if(u===a){o=!0,a=l,n=i;break}if(u===n){o=!0,n=l,a=i;break}u=u.sibling}if(!o){for(u=i.child;u;){if(u===a){o=!0,a=i,n=l;break}if(u===n){o=!0,n=i,a=l;break}u=u.sibling}if(!o)throw Error(d(189))}}if(a.alternate!==n)throw Error(d(190))}if(a.tag!==3)throw Error(d(188));return a.stateNode.current===a?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var T=Object.assign,Z=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),J=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),Se=Symbol.for("react.consumer"),le=Symbol.for("react.context"),we=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),je=Symbol.for("react.memo_cache_sentinel"),qe=Symbol.iterator;function $e(e){return e===null||typeof e!="object"?null:(e=qe&&e[qe]||e["@@iterator"],typeof e=="function"?e:null)}var st=Symbol.for("react.client.reference");function Xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===st?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case F:return"Profiler";case U:return"StrictMode";case ce:return"Suspense";case te:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case J:return"Portal";case le:return e.displayName||"Context";case Se:return(e._context.displayName||"Context")+".Consumer";case we:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Xe(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return Xe(e(t))}catch{}}return null}var oe=Array.isArray,C=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=h.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},ie=[],ee=-1;function m(e){return{current:e}}function x(e){0>ee||(e.current=ie[ee],ie[ee]=null,ee--)}function q(e,t){ee++,ie[ee]=e.current,e.current=t}var K=m(null),I=m(null),ge=m(null),me=m(null);function Qe(e,t){switch(q(ge,t),q(I,e),q(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tm(t),e=am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}x(K),q(K,e)}function Me(){x(K),x(I),x(ge)}function Gt(e){e.memoizedState!==null&&q(me,e);var t=K.current,a=am(t,e.type);t!==a&&(q(I,e),q(K,a))}function ct(e){I.current===e&&(x(K),x(I)),me.current===e&&(x(me),vi._currentValue=H)}var Dt,ca;function bt(e){if(Dt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Dt=t&&t[1]||"",ca=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Dt+e+ca}var $t=!1;function vt(e,t){if(!e||$t)return"";$t=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(O){var z=O}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(O){z=O}e.call(Q.prototype)}}else{try{throw Error()}catch(O){z=O}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(O){if(O&&z&&typeof O.stack=="string")return[O.stack,z.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),o=i[0],u=i[1];if(o&&u){var y=o.split(`
|
|
44
|
+
`),A=u.split(`
|
|
45
|
+
`);for(l=n=0;n<y.length&&!y[n].includes("DetermineComponentFrameRoot");)n++;for(;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;if(n===y.length||l===A.length)for(n=y.length-1,l=A.length-1;1<=n&&0<=l&&y[n]!==A[l];)l--;for(;1<=n&&0<=l;n--,l--)if(y[n]!==A[l]){if(n!==1||l!==1)do if(n--,l--,0>l||y[n]!==A[l]){var B=`
|
|
46
|
+
`+y[n].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=n&&0<=l);break}}}finally{$t=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?bt(a):""}function oa(e,t){switch(e.tag){case 26:case 27:case 5:return bt(e.type);case 16:return bt("Lazy");case 13:return e.child!==t&&t!==null?bt("Suspense Fallback"):bt("Suspense");case 19:return bt("SuspenseList");case 0:case 15:return vt(e.type,!1);case 11:return vt(e.type.render,!1);case 1:return vt(e.type,!0);case 31:return bt("Activity");default:return""}}function ra(e){try{var t="",a=null;do t+=oa(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var jt=Object.prototype.hasOwnProperty,Ot=c.unstable_scheduleCallback,ka=c.unstable_cancelCallback,kt=c.unstable_shouldYield,Ct=c.unstable_requestPaint,ht=c.unstable_now,G=c.unstable_getCurrentPriorityLevel,be=c.unstable_ImmediatePriority,re=c.unstable_UserBlockingPriority,ue=c.unstable_NormalPriority,Re=c.unstable_LowPriority,Ee=c.unstable_IdlePriority,at=c.log,k=c.unstable_setDisableYieldValue,W=null,he=null;function se(e){if(typeof at=="function"&&k(e),he&&typeof he.setStrictMode=="function")try{he.setStrictMode(W,e)}catch{}}var ye=Math.clz32?Math.clz32:Et,ke=Math.log,Ne=Math.LN2;function Et(e){return e>>>=0,e===0?32:31-(ke(e)/Ne|0)|0}var ua=256,Ta=262144,nt=4194304;function pt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Da(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var l=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var u=n&134217727;return u!==0?(n=u&~i,n!==0?l=pt(n):(o&=u,o!==0?l=pt(o):a||(a=u&~e,a!==0&&(l=pt(a))))):(u=n&~i,u!==0?l=pt(u):o!==0?l=pt(o):a||(a=n&~e,a!==0&&(l=pt(a)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:l}function Ca(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ic(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ol(){var e=nt;return nt<<=1,(nt&62914560)===0&&(nt=4194304),e}function da(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function L(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function P(e,t,a,n,l,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var u=e.entanglements,y=e.expirationTimes,A=e.hiddenUpdates;for(a=o&~a;0<a;){var B=31-ye(a),Q=1<<B;u[B]=0,y[B]=-1;var z=A[B];if(z!==null)for(A[B]=null,B=0;B<z.length;B++){var O=z[B];O!==null&&(O.lane&=-536870913)}a&=~Q}n!==0&&ne(e,n,0),i!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function ne(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-ye(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function pe(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-ye(a),l=1<<n;l&t|e[n]&t&&(e[n]|=t),a&=~l}}function de(e,t){var a=t&-t;return a=(a&42)!==0?1:Je(a),(a&(e.suspendedLanes|t))!==0?0:a}function Je(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ze(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function It(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:km(e.type))}function At(e,t){var a=Y.p;try{return Y.p=e,t()}finally{Y.p=a}}var it=Math.random().toString(36).slice(2),Mt="__reactFiber$"+it,Xt="__reactProps$"+it,$n="__reactContainer$"+it,sc="__reactEvents$"+it,hh="__reactListeners$"+it,ph="__reactHandles$"+it,Gr="__reactResources$"+it,Ml="__reactMarker$"+it;function cc(e){delete e[Mt],delete e[Xt],delete e[sc],delete e[hh],delete e[ph]}function Xn(e){var t=e[Mt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[$n]||a[Mt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=rm(e);e!==null;){if(a=e[Mt])return a;e=rm(e)}return t}e=a,a=e.parentNode}return null}function Qn(e){if(e=e[Mt]||e[$n]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Rl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function Zn(e){var t=e[Gr];return t||(t=e[Gr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[Ml]=!0}var Yr=new Set,$r={};function _n(e,t){Vn(e,t),Vn(e+"Capture",t)}function Vn(e,t){for($r[e]=t,e=0;e<t.length;e++)Yr.add(t[e])}var yh=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]*$"),Xr={},Qr={};function gh(e){return jt.call(Qr,e)?!0:jt.call(Xr,e)?!1:yh.test(e)?Qr[e]=!0:(Xr[e]=!0,!1)}function Oi(e,t,a){if(gh(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Mi(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Oa(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function fa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bh(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){a=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oc(e){if(!e._valueTracker){var t=Zr(e)?"checked":"value";e._valueTracker=bh(e,t,""+e[t])}}function Vr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Zr(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Ri(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var vh=/[\n"\\]/g;function ma(e){return e.replace(vh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rc(e,t,a,n,l,i,o,u){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fa(t)):e.value!==""+fa(t)&&(e.value=""+fa(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?uc(e,o,fa(t)):a!=null?uc(e,o,fa(a)):n!=null&&e.removeAttribute("value"),l==null&&i!=null&&(e.defaultChecked=!!i),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.name=""+fa(u):e.removeAttribute("name")}function Jr(e,t,a,n,l,i,o,u){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){oc(e);return}a=a!=null?""+fa(a):"",t=t!=null?""+fa(t):a,u||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=u?e.checked:!!n,e.defaultChecked=!!n,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),oc(e)}function uc(e,t,a){t==="number"&&Ri(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Jn(e,t,a,n){if(e=e.options,t){t={};for(var l=0;l<a.length;l++)t["$"+a[l]]=!0;for(a=0;a<e.length;a++)l=t.hasOwnProperty("$"+e[a].value),e[a].selected!==l&&(e[a].selected=l),l&&n&&(e[a].defaultSelected=!0)}else{for(a=""+fa(a),t=null,l=0;l<e.length;l++){if(e[l].value===a){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Kr(e,t,a){if(t!=null&&(t=""+fa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+fa(a):""}function Fr(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(d(92));if(oe(n)){if(1<n.length)throw Error(d(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=fa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),oc(e)}function Kn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Sh=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 Wr(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||Sh.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ir(e,t,a){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var l in t)n=t[l],t.hasOwnProperty(l)&&a[l]!==n&&Wr(e,l,n)}else for(var i in t)t.hasOwnProperty(i)&&Wr(e,i,t[i])}function dc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wh=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"]]),xh=/^[\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 Ui(e){return xh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ma(){}var fc=null;function mc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fn=null,Wn=null;function Pr(e){var t=Qn(e);if(t&&(e=t.stateNode)){var a=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(rc(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ma(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var l=n[Xt]||null;if(!l)throw Error(d(90));rc(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Vr(n)}break e;case"textarea":Kr(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Jn(e,!!a.multiple,t,!1)}}}var hc=!1;function eu(e,t,a){if(hc)return e(t,a);hc=!0;try{var n=e(t);return n}finally{if(hc=!1,(Fn!==null||Wn!==null)&&(js(),Fn&&(t=Fn,e=Wn,Wn=Fn=null,Pr(t),e)))for(t=0;t<e.length;t++)Pr(e[t])}}function Ul(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Xt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(d(231,t,typeof a));return a}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pc=!1;if(Ra)try{var Hl={};Object.defineProperty(Hl,"passive",{get:function(){pc=!0}}),window.addEventListener("test",Hl,Hl),window.removeEventListener("test",Hl,Hl)}catch{pc=!1}var Wa=null,yc=null,Hi=null;function tu(){if(Hi)return Hi;var e,t=yc,a=t.length,n,l="value"in Wa?Wa.value:Wa.textContent,i=l.length;for(e=0;e<a&&t[e]===l[e];e++);var o=a-e;for(n=1;n<=o&&t[a-n]===l[i-n];n++);return Hi=l.slice(e,1<n?1-n:void 0)}function Bi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Li(){return!0}function au(){return!1}function Qt(e){function t(a,n,l,i,o){this._reactName=a,this._targetInst=l,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(a=e[u],this[u]=a?a(i):i[u]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Li:au,this.isPropagationStopped=au,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Li)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Li)},persist:function(){},isPersistent:Li}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qi=Qt(jn),Bl=T({},jn,{view:0,detail:0}),_h=Qt(Bl),gc,bc,Ll,Gi=T({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ll&&(Ll&&e.type==="mousemove"?(gc=e.screenX-Ll.screenX,bc=e.screenY-Ll.screenY):bc=gc=0,Ll=e),gc)},movementY:function(e){return"movementY"in e?e.movementY:bc}}),nu=Qt(Gi),jh=T({},Gi,{dataTransfer:0}),kh=Qt(jh),Th=T({},Bl,{relatedTarget:0}),vc=Qt(Th),Ch=T({},jn,{animationName:0,elapsedTime:0,pseudoElement:0}),Eh=Qt(Ch),Ah=T({},jn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nh=Qt(Ah),zh=T({},jn,{data:0}),lu=Qt(zh),Dh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oh={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"},Mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mh[e])?!!t[e]:!1}function Sc(){return Rh}var Uh=T({},Bl,{key:function(e){if(e.key){var t=Dh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sc,charCode:function(e){return e.type==="keypress"?Bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hh=Qt(Uh),Bh=T({},Gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iu=Qt(Bh),Lh=T({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sc}),qh=Qt(Lh),Gh=T({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yh=Qt(Gh),$h=T({},Gi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Xh=Qt($h),Qh=T({},jn,{newState:0,oldState:0}),Zh=Qt(Qh),Vh=[9,13,27,32],wc=Ra&&"CompositionEvent"in window,ql=null;Ra&&"documentMode"in document&&(ql=document.documentMode);var Jh=Ra&&"TextEvent"in window&&!ql,su=Ra&&(!wc||ql&&8<ql&&11>=ql),cu=" ",ou=!1;function ru(e,t){switch(e){case"keyup":return Vh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function Kh(e,t){switch(e){case"compositionend":return uu(t);case"keypress":return t.which!==32?null:(ou=!0,cu);case"textInput":return e=t.data,e===cu&&ou?null:e;default:return null}}function Fh(e,t){if(In)return e==="compositionend"||!wc&&ru(e,t)?(e=tu(),Hi=yc=Wa=null,In=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return su&&t.locale!=="ko"?null:t.data;default:return null}}var Wh={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 du(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Wh[e.type]:t==="textarea"}function fu(e,t,a,n){Fn?Wn?Wn.push(n):Wn=[n]:Fn=n,t=zs(t,"onChange"),0<t.length&&(a=new qi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Gl=null,Yl=null;function Ih(e){Kf(e,0)}function Yi(e){var t=Rl(e);if(Vr(t))return e}function mu(e,t){if(e==="change")return t}var hu=!1;if(Ra){var xc;if(Ra){var _c="oninput"in document;if(!_c){var pu=document.createElement("div");pu.setAttribute("oninput","return;"),_c=typeof pu.oninput=="function"}xc=_c}else xc=!1;hu=xc&&(!document.documentMode||9<document.documentMode)}function yu(){Gl&&(Gl.detachEvent("onpropertychange",gu),Yl=Gl=null)}function gu(e){if(e.propertyName==="value"&&Yi(Yl)){var t=[];fu(t,Yl,e,mc(e)),eu(Ih,t)}}function Ph(e,t,a){e==="focusin"?(yu(),Gl=t,Yl=a,Gl.attachEvent("onpropertychange",gu)):e==="focusout"&&yu()}function ep(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yi(Yl)}function tp(e,t){if(e==="click")return Yi(t)}function ap(e,t){if(e==="input"||e==="change")return Yi(t)}function np(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:np;function $l(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var l=a[n];if(!jt.call(t,l)||!Pt(e[l],t[l]))return!1}return!0}function bu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vu(e,t){var a=bu(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=bu(a)}}function Su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ri(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ri(e.document)}return t}function jc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lp=Ra&&"documentMode"in document&&11>=document.documentMode,Pn=null,kc=null,Xl=null,Tc=!1;function xu(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tc||Pn==null||Pn!==Ri(n)||(n=Pn,"selectionStart"in n&&jc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Xl&&$l(Xl,n)||(Xl=n,n=zs(kc,"onSelect"),0<n.length&&(t=new qi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Pn)))}function kn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var el={animationend:kn("Animation","AnimationEnd"),animationiteration:kn("Animation","AnimationIteration"),animationstart:kn("Animation","AnimationStart"),transitionrun:kn("Transition","TransitionRun"),transitionstart:kn("Transition","TransitionStart"),transitioncancel:kn("Transition","TransitionCancel"),transitionend:kn("Transition","TransitionEnd")},Cc={},_u={};Ra&&(_u=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function Tn(e){if(Cc[e])return Cc[e];if(!el[e])return e;var t=el[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in _u)return Cc[e]=t[a];return e}var ju=Tn("animationend"),ku=Tn("animationiteration"),Tu=Tn("animationstart"),ip=Tn("transitionrun"),sp=Tn("transitionstart"),cp=Tn("transitioncancel"),Cu=Tn("transitionend"),Eu=new Map,Ec="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(" ");Ec.push("scrollEnd");function xa(e,t){Eu.set(e,t),_n(t,[e])}var $i=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ha=[],tl=0,Ac=0;function Xi(){for(var e=tl,t=Ac=tl=0;t<e;){var a=ha[t];ha[t++]=null;var n=ha[t];ha[t++]=null;var l=ha[t];ha[t++]=null;var i=ha[t];if(ha[t++]=null,n!==null&&l!==null){var o=n.pending;o===null?l.next=l:(l.next=o.next,o.next=l),n.pending=l}i!==0&&Au(a,l,i)}}function Qi(e,t,a,n){ha[tl++]=e,ha[tl++]=t,ha[tl++]=a,ha[tl++]=n,Ac|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Nc(e,t,a,n){return Qi(e,t,a,n),Zi(e)}function Cn(e,t){return Qi(e,null,null,t),Zi(e)}function Au(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var l=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(l=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,l&&t!==null&&(l=31-ye(a),e=i.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=a|536870912),i):null}function Zi(e){if(50<fi)throw fi=0,qo=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var al={};function op(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(e,t,a,n){return new op(e,t,a,n)}function zc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ua(e,t){var a=e.alternate;return a===null?(a=ea(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Nu(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vi(e,t,a,n,l,i){var o=0;if(n=e,typeof e=="function")zc(e)&&(o=1);else if(typeof e=="string")o=my(e,a,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=ea(31,a,t,l),e.elementType=X,e.lanes=i,e;case R:return En(a.children,l,i,t);case U:o=8,l|=24;break;case F:return e=ea(12,a,t,l|2),e.elementType=F,e.lanes=i,e;case ce:return e=ea(13,a,t,l),e.elementType=ce,e.lanes=i,e;case te:return e=ea(19,a,t,l),e.elementType=te,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:o=10;break e;case Se:o=9;break e;case we:o=11;break e;case V:o=14;break e;case ae:o=16,n=null;break e}o=29,a=Error(d(130,e===null?"null":typeof e,"")),n=null}return t=ea(o,a,t,l),t.elementType=e,t.type=n,t.lanes=i,t}function En(e,t,a,n){return e=ea(7,e,n,t),e.lanes=a,e}function Dc(e,t,a){return e=ea(6,e,null,t),e.lanes=a,e}function zu(e){var t=ea(18,null,null,0);return t.stateNode=e,t}function Oc(e,t,a){return t=ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Du=new WeakMap;function pa(e,t){if(typeof e=="object"&&e!==null){var a=Du.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ra(t)},Du.set(e,t),t)}return{value:e,source:t,stack:ra(t)}}var nl=[],ll=0,Ji=null,Ql=0,ya=[],ga=0,Ia=null,Ea=1,Aa="";function Ha(e,t){nl[ll++]=Ql,nl[ll++]=Ji,Ji=e,Ql=t}function Ou(e,t,a){ya[ga++]=Ea,ya[ga++]=Aa,ya[ga++]=Ia,Ia=e;var n=Ea;e=Aa;var l=32-ye(n)-1;n&=~(1<<l),a+=1;var i=32-ye(t)+l;if(30<i){var o=l-l%5;i=(n&(1<<o)-1).toString(32),n>>=o,l-=o,Ea=1<<32-ye(t)+l|a<<l|n,Aa=i+e}else Ea=1<<i|a<<l|n,Aa=e}function Mc(e){e.return!==null&&(Ha(e,1),Ou(e,1,0))}function Rc(e){for(;e===Ji;)Ji=nl[--ll],nl[ll]=null,Ql=nl[--ll],nl[ll]=null;for(;e===Ia;)Ia=ya[--ga],ya[ga]=null,Aa=ya[--ga],ya[ga]=null,Ea=ya[--ga],ya[ga]=null}function Mu(e,t){ya[ga++]=Ea,ya[ga++]=Aa,ya[ga++]=Ia,Ea=t.id,Aa=t.overflow,Ia=e}var Rt=null,ot=null,Ge=!1,Pa=null,ba=!1,Uc=Error(d(519));function en(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zl(pa(t,e)),Uc}function Ru(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Mt]=e,t[Xt]=n,a){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(a=0;a<hi.length;a++)He(hi[a],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),Jr(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Fr(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Pf(t.textContent,a)?(n.popover!=null&&(He("beforetoggle",t),He("toggle",t)),n.onScroll!=null&&He("scroll",t),n.onScrollEnd!=null&&He("scrollend",t),n.onClick!=null&&(t.onclick=Ma),t=!0):t=!1,t||en(e,!0)}function Uu(e){for(Rt=e.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:Rt=Rt.return}}function il(e){if(e!==Rt)return!1;if(!Ge)return Uu(e),Ge=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||tr(e.type,e.memoizedProps)),a=!a),a&&ot&&en(e),Uu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));ot=om(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));ot=om(e)}else t===27?(t=ot,pn(e.type)?(e=sr,sr=null,ot=e):ot=t):ot=Rt?Sa(e.stateNode.nextSibling):null;return!0}function An(){ot=Rt=null,Ge=!1}function Hc(){var e=Pa;return e!==null&&(Kt===null?Kt=e:Kt.push.apply(Kt,e),Pa=null),e}function Zl(e){Pa===null?Pa=[e]:Pa.push(e)}var Bc=m(null),Nn=null,Ba=null;function tn(e,t,a){q(Bc,t._currentValue),t._currentValue=a}function La(e){e._currentValue=Bc.current,x(Bc)}function Lc(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function qc(e,t,a,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var i=l.dependencies;if(i!==null){var o=l.child;i=i.firstContext;e:for(;i!==null;){var u=i;i=l;for(var y=0;y<t.length;y++)if(u.context===t[y]){i.lanes|=a,u=i.alternate,u!==null&&(u.lanes|=a),Lc(i.return,a,e),n||(o=null);break e}i=u.next}}else if(l.tag===18){if(o=l.return,o===null)throw Error(d(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Lc(o,a,e),o=null}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===e){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}}function sl(e,t,a,n){e=null;for(var l=t,i=!1;l!==null;){if(!i){if((l.flags&524288)!==0)i=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var o=l.alternate;if(o===null)throw Error(d(387));if(o=o.memoizedProps,o!==null){var u=l.type;Pt(l.pendingProps.value,o.value)||(e!==null?e.push(u):e=[u])}}else if(l===me.current){if(o=l.alternate,o===null)throw Error(d(387));o.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(vi):e=[vi])}l=l.return}e!==null&&qc(t,e,a,n),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zn(e){Nn=e,Ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return Hu(Nn,e)}function Fi(e,t){return Nn===null&&zn(e),Hu(e,t)}function Hu(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ba===null){if(e===null)throw Error(d(308));Ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ba=Ba.next=t;return a}var rp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},up=c.unstable_scheduleCallback,dp=c.unstable_NormalPriority,St={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gc(){return{controller:new rp,data:new Map,refCount:0}}function Vl(e){e.refCount--,e.refCount===0&&up(dp,function(){e.controller.abort()})}var Jl=null,Yc=0,cl=0,ol=null;function fp(e,t){if(Jl===null){var a=Jl=[];Yc=0,cl=Zo(),ol={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Yc++,t.then(Bu,Bu),t}function Bu(){if(--Yc===0&&Jl!==null){ol!==null&&(ol.status="fulfilled");var e=Jl;Jl=null,cl=0,ol=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function mp(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(l){a.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<a.length;l++)(0,a[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<a.length;l++)(0,a[l])(void 0)}),n}var Lu=C.S;C.S=function(e,t){_f=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&fp(e,t),Lu!==null&&Lu(e,t)};var Dn=m(null);function $c(){var e=Dn.current;return e!==null?e:lt.pooledCache}function Wi(e,t){t===null?q(Dn,Dn.current):q(Dn,t.pool)}function qu(){var e=$c();return e===null?null:{parent:St._currentValue,pool:e}}var rl=Error(d(460)),Xc=Error(d(474)),Ii=Error(d(542)),Pi={then:function(){}};function Gu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yu(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ma,Ma),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xu(e),e;default:if(typeof t.status=="string")t.then(Ma,Ma);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Xu(e),e}throw Mn=t,rl}}function On(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Mn=a,rl):a}}var Mn=null;function $u(){if(Mn===null)throw Error(d(459));var e=Mn;return Mn=null,e}function Xu(e){if(e===rl||e===Ii)throw Error(d(483))}var ul=null,Kl=0;function es(e){var t=Kl;return Kl+=1,ul===null&&(ul=[]),Yu(ul,e,t)}function Fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ts(e,t){throw t.$$typeof===Z?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qu(e){function t(_,v){if(e){var E=_.deletions;E===null?(_.deletions=[v],_.flags|=16):E.push(v)}}function a(_,v){if(!e)return null;for(;v!==null;)t(_,v),v=v.sibling;return null}function n(_){for(var v=new Map;_!==null;)_.key!==null?v.set(_.key,_):v.set(_.index,_),_=_.sibling;return v}function l(_,v){return _=Ua(_,v),_.index=0,_.sibling=null,_}function i(_,v,E){return _.index=E,e?(E=_.alternate,E!==null?(E=E.index,E<v?(_.flags|=67108866,v):E):(_.flags|=67108866,v)):(_.flags|=1048576,v)}function o(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function u(_,v,E,$){return v===null||v.tag!==6?(v=Dc(E,_.mode,$),v.return=_,v):(v=l(v,E),v.return=_,v)}function y(_,v,E,$){var xe=E.type;return xe===R?B(_,v,E.props.children,$,E.key):v!==null&&(v.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ae&&On(xe)===v.type)?(v=l(v,E.props),Fl(v,E),v.return=_,v):(v=Vi(E.type,E.key,E.props,null,_.mode,$),Fl(v,E),v.return=_,v)}function A(_,v,E,$){return v===null||v.tag!==4||v.stateNode.containerInfo!==E.containerInfo||v.stateNode.implementation!==E.implementation?(v=Oc(E,_.mode,$),v.return=_,v):(v=l(v,E.children||[]),v.return=_,v)}function B(_,v,E,$,xe){return v===null||v.tag!==7?(v=En(E,_.mode,$,xe),v.return=_,v):(v=l(v,E),v.return=_,v)}function Q(_,v,E){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=Dc(""+v,_.mode,E),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case D:return E=Vi(v.type,v.key,v.props,null,_.mode,E),Fl(E,v),E.return=_,E;case J:return v=Oc(v,_.mode,E),v.return=_,v;case ae:return v=On(v),Q(_,v,E)}if(oe(v)||$e(v))return v=En(v,_.mode,E,null),v.return=_,v;if(typeof v.then=="function")return Q(_,es(v),E);if(v.$$typeof===le)return Q(_,Fi(_,v),E);ts(_,v)}return null}function z(_,v,E,$){var xe=v!==null?v.key:null;if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return xe!==null?null:u(_,v,""+E,$);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case D:return E.key===xe?y(_,v,E,$):null;case J:return E.key===xe?A(_,v,E,$):null;case ae:return E=On(E),z(_,v,E,$)}if(oe(E)||$e(E))return xe!==null?null:B(_,v,E,$,null);if(typeof E.then=="function")return z(_,v,es(E),$);if(E.$$typeof===le)return z(_,v,Fi(_,E),$);ts(_,E)}return null}function O(_,v,E,$,xe){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return _=_.get(E)||null,u(v,_,""+$,xe);if(typeof $=="object"&&$!==null){switch($.$$typeof){case D:return _=_.get($.key===null?E:$.key)||null,y(v,_,$,xe);case J:return _=_.get($.key===null?E:$.key)||null,A(v,_,$,xe);case ae:return $=On($),O(_,v,E,$,xe)}if(oe($)||$e($))return _=_.get(E)||null,B(v,_,$,xe,null);if(typeof $.then=="function")return O(_,v,E,es($),xe);if($.$$typeof===le)return O(_,v,E,Fi(v,$),xe);ts(v,$)}return null}function fe(_,v,E,$){for(var xe=null,Ze=null,ve=v,Oe=v=0,Le=null;ve!==null&&Oe<E.length;Oe++){ve.index>Oe?(Le=ve,ve=null):Le=ve.sibling;var Ve=z(_,ve,E[Oe],$);if(Ve===null){ve===null&&(ve=Le);break}e&&ve&&Ve.alternate===null&&t(_,ve),v=i(Ve,v,Oe),Ze===null?xe=Ve:Ze.sibling=Ve,Ze=Ve,ve=Le}if(Oe===E.length)return a(_,ve),Ge&&Ha(_,Oe),xe;if(ve===null){for(;Oe<E.length;Oe++)ve=Q(_,E[Oe],$),ve!==null&&(v=i(ve,v,Oe),Ze===null?xe=ve:Ze.sibling=ve,Ze=ve);return Ge&&Ha(_,Oe),xe}for(ve=n(ve);Oe<E.length;Oe++)Le=O(ve,_,Oe,E[Oe],$),Le!==null&&(e&&Le.alternate!==null&&ve.delete(Le.key===null?Oe:Le.key),v=i(Le,v,Oe),Ze===null?xe=Le:Ze.sibling=Le,Ze=Le);return e&&ve.forEach(function(Sn){return t(_,Sn)}),Ge&&Ha(_,Oe),xe}function Te(_,v,E,$){if(E==null)throw Error(d(151));for(var xe=null,Ze=null,ve=v,Oe=v=0,Le=null,Ve=E.next();ve!==null&&!Ve.done;Oe++,Ve=E.next()){ve.index>Oe?(Le=ve,ve=null):Le=ve.sibling;var Sn=z(_,ve,Ve.value,$);if(Sn===null){ve===null&&(ve=Le);break}e&&ve&&Sn.alternate===null&&t(_,ve),v=i(Sn,v,Oe),Ze===null?xe=Sn:Ze.sibling=Sn,Ze=Sn,ve=Le}if(Ve.done)return a(_,ve),Ge&&Ha(_,Oe),xe;if(ve===null){for(;!Ve.done;Oe++,Ve=E.next())Ve=Q(_,Ve.value,$),Ve!==null&&(v=i(Ve,v,Oe),Ze===null?xe=Ve:Ze.sibling=Ve,Ze=Ve);return Ge&&Ha(_,Oe),xe}for(ve=n(ve);!Ve.done;Oe++,Ve=E.next())Ve=O(ve,_,Oe,Ve.value,$),Ve!==null&&(e&&Ve.alternate!==null&&ve.delete(Ve.key===null?Oe:Ve.key),v=i(Ve,v,Oe),Ze===null?xe=Ve:Ze.sibling=Ve,Ze=Ve);return e&&ve.forEach(function(jy){return t(_,jy)}),Ge&&Ha(_,Oe),xe}function tt(_,v,E,$){if(typeof E=="object"&&E!==null&&E.type===R&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case D:e:{for(var xe=E.key;v!==null;){if(v.key===xe){if(xe=E.type,xe===R){if(v.tag===7){a(_,v.sibling),$=l(v,E.props.children),$.return=_,_=$;break e}}else if(v.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ae&&On(xe)===v.type){a(_,v.sibling),$=l(v,E.props),Fl($,E),$.return=_,_=$;break e}a(_,v);break}else t(_,v);v=v.sibling}E.type===R?($=En(E.props.children,_.mode,$,E.key),$.return=_,_=$):($=Vi(E.type,E.key,E.props,null,_.mode,$),Fl($,E),$.return=_,_=$)}return o(_);case J:e:{for(xe=E.key;v!==null;){if(v.key===xe)if(v.tag===4&&v.stateNode.containerInfo===E.containerInfo&&v.stateNode.implementation===E.implementation){a(_,v.sibling),$=l(v,E.children||[]),$.return=_,_=$;break e}else{a(_,v);break}else t(_,v);v=v.sibling}$=Oc(E,_.mode,$),$.return=_,_=$}return o(_);case ae:return E=On(E),tt(_,v,E,$)}if(oe(E))return fe(_,v,E,$);if($e(E)){if(xe=$e(E),typeof xe!="function")throw Error(d(150));return E=xe.call(E),Te(_,v,E,$)}if(typeof E.then=="function")return tt(_,v,es(E),$);if(E.$$typeof===le)return tt(_,v,Fi(_,E),$);ts(_,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,v!==null&&v.tag===6?(a(_,v.sibling),$=l(v,E),$.return=_,_=$):(a(_,v),$=Dc(E,_.mode,$),$.return=_,_=$),o(_)):a(_,v)}return function(_,v,E,$){try{Kl=0;var xe=tt(_,v,E,$);return ul=null,xe}catch(ve){if(ve===rl||ve===Ii)throw ve;var Ze=ea(29,ve,null,_.mode);return Ze.lanes=$,Ze.return=_,Ze}finally{}}}var Rn=Qu(!0),Zu=Qu(!1),an=!1;function Qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ln(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ke&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=Zi(e),Au(e,null,a),t}return Qi(e,n,t,a),Zi(e)}function Wl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,pe(e,a)}}function Vc(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var l=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?l=i=o:i=i.next=o,a=a.next}while(a!==null);i===null?l=i=t:i=i.next=t}else l=i=t;a={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Jc=!1;function Il(){if(Jc){var e=ol;if(e!==null)throw e}}function Pl(e,t,a,n){Jc=!1;var l=e.updateQueue;an=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var y=u,A=y.next;y.next=null,o===null?i=A:o.next=A,o=y;var B=e.alternate;B!==null&&(B=B.updateQueue,u=B.lastBaseUpdate,u!==o&&(u===null?B.firstBaseUpdate=A:u.next=A,B.lastBaseUpdate=y))}if(i!==null){var Q=l.baseState;o=0,B=A=y=null,u=i;do{var z=u.lane&-536870913,O=z!==u.lane;if(O?(Be&z)===z:(n&z)===z){z!==0&&z===cl&&(Jc=!0),B!==null&&(B=B.next={lane:0,tag:u.tag,payload:u.payload,callback:null,next:null});e:{var fe=e,Te=u;z=t;var tt=a;switch(Te.tag){case 1:if(fe=Te.payload,typeof fe=="function"){Q=fe.call(tt,Q,z);break e}Q=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=Te.payload,z=typeof fe=="function"?fe.call(tt,Q,z):fe,z==null)break e;Q=T({},Q,z);break e;case 2:an=!0}}z=u.callback,z!==null&&(e.flags|=64,O&&(e.flags|=8192),O=l.callbacks,O===null?l.callbacks=[z]:O.push(z))}else O={lane:z,tag:u.tag,payload:u.payload,callback:u.callback,next:null},B===null?(A=B=O,y=Q):B=B.next=O,o|=z;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;O=u,u=O.next,O.next=null,l.lastBaseUpdate=O,l.shared.pending=null}}while(!0);B===null&&(y=Q),l.baseState=y,l.firstBaseUpdate=A,l.lastBaseUpdate=B,i===null&&(l.shared.lanes=0),un|=o,e.lanes=o,e.memoizedState=Q}}function Vu(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function Ju(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Vu(a[e],t)}var dl=m(null),as=m(0);function Ku(e,t){e=Ja,q(as,e),q(dl,t),Ja=e|t.baseLanes}function Kc(){q(as,Ja),q(dl,dl.current)}function Fc(){Ja=as.current,x(dl),x(as)}var ta=m(null),va=null;function sn(e){var t=e.alternate;q(yt,yt.current&1),q(ta,e),va===null&&(t===null||dl.current!==null||t.memoizedState!==null)&&(va=e)}function Wc(e){q(yt,yt.current),q(ta,e),va===null&&(va=e)}function Fu(e){e.tag===22?(q(yt,yt.current),q(ta,e),va===null&&(va=e)):cn()}function cn(){q(yt,yt.current),q(ta,ta.current)}function aa(e){x(ta),va===e&&(va=null),x(yt)}var yt=m(0);function ns(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||lr(a)||ir(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qa=0,De=null,Pe=null,wt=null,ls=!1,fl=!1,Un=!1,is=0,ei=0,ml=null,hp=0;function ft(){throw Error(d(321))}function Ic(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pt(e[a],t[a]))return!1;return!0}function Pc(e,t,a,n,l,i){return qa=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Od:po,Un=!1,i=a(n,l),Un=!1,fl&&(i=Iu(t,a,n,l)),Wu(e),i}function Wu(e){C.H=ni;var t=Pe!==null&&Pe.next!==null;if(qa=0,wt=Pe=De=null,ls=!1,ei=0,ml=null,t)throw Error(d(300));e===null||xt||(e=e.dependencies,e!==null&&Ki(e)&&(xt=!0))}function Iu(e,t,a,n){De=e;var l=0;do{if(fl&&(ml=null),ei=0,fl=!1,25<=l)throw Error(d(301));if(l+=1,wt=Pe=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}C.H=Md,i=t(a,n)}while(fl);return i}function pp(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?ti(t):t,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(De.flags|=1024),t}function eo(){var e=is!==0;return is=0,e}function to(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function ao(e){if(ls){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ls=!1}qa=0,wt=Pe=De=null,fl=!1,ei=is=0,ml=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?De.memoizedState=wt=e:wt=wt.next=e,wt}function gt(){if(Pe===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=wt===null?De.memoizedState:wt.next;if(t!==null)wt=t,Pe=e;else{if(e===null)throw De.alternate===null?Error(d(467)):Error(d(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},wt===null?De.memoizedState=wt=e:wt=wt.next=e}return wt}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ti(e){var t=ei;return ei+=1,ml===null&&(ml=[]),e=Yu(ml,e,t),t=De,(wt===null?t.memoizedState:wt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Od:po),e}function cs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ti(e);if(e.$$typeof===le)return Ut(e)}throw Error(d(438,String(e)))}function no(e){var t=null,a=De.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=De.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ss(),De.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=je;return t.index++,a}function Ga(e,t){return typeof t=="function"?t(e):t}function os(e){var t=gt();return lo(t,Pe,e)}function lo(e,t,a){var n=e.queue;if(n===null)throw Error(d(311));n.lastRenderedReducer=a;var l=e.baseQueue,i=n.pending;if(i!==null){if(l!==null){var o=l.next;l.next=i.next,i.next=o}t.baseQueue=l=i,n.pending=null}if(i=e.baseState,l===null)e.memoizedState=i;else{t=l.next;var u=o=null,y=null,A=t,B=!1;do{var Q=A.lane&-536870913;if(Q!==A.lane?(Be&Q)===Q:(qa&Q)===Q){var z=A.revertLane;if(z===0)y!==null&&(y=y.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),Q===cl&&(B=!0);else if((qa&z)===z){A=A.next,z===cl&&(B=!0);continue}else Q={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},y===null?(u=y=Q,o=i):y=y.next=Q,De.lanes|=z,un|=z;Q=A.action,Un&&a(i,Q),i=A.hasEagerState?A.eagerState:a(i,Q)}else z={lane:Q,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},y===null?(u=y=z,o=i):y=y.next=z,De.lanes|=Q,un|=Q;A=A.next}while(A!==null&&A!==t);if(y===null?o=i:y.next=u,!Pt(i,e.memoizedState)&&(xt=!0,B&&(a=ol,a!==null)))throw a;e.memoizedState=i,e.baseState=o,e.baseQueue=y,n.lastRenderedState=i}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function io(e){var t=gt(),a=t.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=e;var n=a.dispatch,l=a.pending,i=t.memoizedState;if(l!==null){a.pending=null;var o=l=l.next;do i=e(i,o.action),o=o.next;while(o!==l);Pt(i,t.memoizedState)||(xt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function Pu(e,t,a){var n=De,l=gt(),i=Ge;if(i){if(a===void 0)throw Error(d(407));a=a()}else a=t();var o=!Pt((Pe||l).memoizedState,a);if(o&&(l.memoizedState=a,xt=!0),l=l.queue,oo(ad.bind(null,n,l,e),[e]),l.getSnapshot!==t||o||wt!==null&&wt.memoizedState.tag&1){if(n.flags|=2048,hl(9,{destroy:void 0},td.bind(null,n,l,a,t),null),lt===null)throw Error(d(349));i||(qa&127)!==0||ed(n,t,a)}return a}function ed(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=De.updateQueue,t===null?(t=ss(),De.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function td(e,t,a,n){t.value=a,t.getSnapshot=n,nd(t)&&ld(e)}function ad(e,t,a){return a(function(){nd(t)&&ld(e)})}function nd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pt(e,a)}catch{return!0}}function ld(e){var t=Cn(e,2);t!==null&&Ft(t,e,2)}function so(e){var t=Yt();if(typeof e=="function"){var a=e;if(e=a(),Un){se(!0);try{a()}finally{se(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:e},t}function id(e,t,a,n){return e.baseState=a,lo(e,Pe,typeof n=="function"?n:Ga)}function yp(e,t,a,n,l){if(ds(e))throw Error(d(485));if(e=t.action,e!==null){var i={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};C.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,sd(t,i)):(i.next=a.next,t.pending=a.next=i)}}function sd(e,t){var a=t.action,n=t.payload,l=e.state;if(t.isTransition){var i=C.T,o={};C.T=o;try{var u=a(l,n),y=C.S;y!==null&&y(o,u),cd(e,t,u)}catch(A){co(e,t,A)}finally{i!==null&&o.types!==null&&(i.types=o.types),C.T=i}}else try{i=a(l,n),cd(e,t,i)}catch(A){co(e,t,A)}}function cd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){od(e,t,n)},function(n){return co(e,t,n)}):od(e,t,a)}function od(e,t,a){t.status="fulfilled",t.value=a,rd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,sd(e,a)))}function co(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,rd(t),t=t.next;while(t!==n)}e.action=null}function rd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ud(e,t){return t}function dd(e,t){if(Ge){var a=lt.formState;if(a!==null){e:{var n=De;if(Ge){if(ot){t:{for(var l=ot,i=ba;l.nodeType!==8;){if(!i){l=null;break t}if(l=Sa(l.nextSibling),l===null){l=null;break t}}i=l.data,l=i==="F!"||i==="F"?l:null}if(l){ot=Sa(l.nextSibling),n=l.data==="F!";break e}}en(n)}n=!1}n&&(t=a[0])}}return a=Yt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:t},a.queue=n,a=Nd.bind(null,De,n),n.dispatch=a,n=so(!1),i=ho.bind(null,De,!1,n.queue),n=Yt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,a=yp.bind(null,De,l,i,a),l.dispatch=a,n.memoizedState=e,[t,a,!1]}function fd(e){var t=gt();return md(t,Pe,e)}function md(e,t,a){if(t=lo(e,t,ud)[0],e=os(Ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ti(t)}catch(o){throw o===rl?Ii:o}else n=t;t=gt();var l=t.queue,i=l.dispatch;return a!==t.memoizedState&&(De.flags|=2048,hl(9,{destroy:void 0},gp.bind(null,l,a),null)),[n,i,e]}function gp(e,t){e.action=t}function hd(e){var t=gt(),a=Pe;if(a!==null)return md(t,a,e);gt(),t=t.memoizedState,a=gt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function hl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=De.updateQueue,t===null&&(t=ss(),De.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function pd(){return gt().memoizedState}function rs(e,t,a,n){var l=Yt();De.flags|=e,l.memoizedState=hl(1|t,{destroy:void 0},a,n===void 0?null:n)}function us(e,t,a,n){var l=gt();n=n===void 0?null:n;var i=l.memoizedState.inst;Pe!==null&&n!==null&&Ic(n,Pe.memoizedState.deps)?l.memoizedState=hl(t,i,a,n):(De.flags|=e,l.memoizedState=hl(1|t,i,a,n))}function yd(e,t){rs(8390656,8,e,t)}function oo(e,t){us(2048,8,e,t)}function bp(e){De.flags|=4;var t=De.updateQueue;if(t===null)t=ss(),De.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function gd(e){var t=gt().memoizedState;return bp({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function bd(e,t){return us(4,2,e,t)}function vd(e,t){return us(4,4,e,t)}function Sd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wd(e,t,a){a=a!=null?a.concat([e]):null,us(4,4,Sd.bind(null,t,e),a)}function ro(){}function xd(e,t){var a=gt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Ic(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function _d(e,t){var a=gt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Ic(t,n[1]))return n[0];if(n=e(),Un){se(!0);try{e()}finally{se(!1)}}return a.memoizedState=[n,t],n}function uo(e,t,a){return a===void 0||(qa&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=kf(),De.lanes|=e,un|=e,a)}function jd(e,t,a,n){return Pt(a,t)?a:dl.current!==null?(e=uo(e,a,n),Pt(e,t)||(xt=!0),e):(qa&42)===0||(qa&1073741824)!==0&&(Be&261930)===0?(xt=!0,e.memoizedState=a):(e=kf(),De.lanes|=e,un|=e,t)}function kd(e,t,a,n,l){var i=Y.p;Y.p=i!==0&&8>i?i:8;var o=C.T,u={};C.T=u,ho(e,!1,t,a);try{var y=l(),A=C.S;if(A!==null&&A(u,y),y!==null&&typeof y=="object"&&typeof y.then=="function"){var B=mp(y,n);ai(e,t,B,ia(e))}else ai(e,t,n,ia(e))}catch(Q){ai(e,t,{then:function(){},status:"rejected",reason:Q},ia())}finally{Y.p=i,o!==null&&u.types!==null&&(o.types=u.types),C.T=o}}function vp(){}function fo(e,t,a,n){if(e.tag!==5)throw Error(d(476));var l=Td(e).queue;kd(e,l,t,H,a===null?vp:function(){return Cd(e),a(n)})}function Td(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:H},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cd(e){var t=Td(e);t.next===null&&(t=e.alternate.memoizedState),ai(e,t.next.queue,{},ia())}function mo(){return Ut(vi)}function Ed(){return gt().memoizedState}function Ad(){return gt().memoizedState}function Sp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ia();e=nn(a);var n=ln(t,e,a);n!==null&&(Ft(n,t,a),Wl(n,t,a)),t={cache:Gc()},e.payload=t;return}t=t.return}}function wp(e,t,a){var n=ia();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ds(e)?zd(t,a):(a=Nc(e,t,a,n),a!==null&&(Ft(a,e,n),Dd(a,t,n)))}function Nd(e,t,a){var n=ia();ai(e,t,a,n)}function ai(e,t,a,n){var l={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ds(e))zd(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,a);if(l.hasEagerState=!0,l.eagerState=u,Pt(u,o))return Qi(e,t,l,0),lt===null&&Xi(),!1}catch{}finally{}if(a=Nc(e,t,l,n),a!==null)return Ft(a,e,n),Dd(a,t,n),!0}return!1}function ho(e,t,a,n){if(n={lane:2,revertLane:Zo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ds(e)){if(t)throw Error(d(479))}else t=Nc(e,a,n,2),t!==null&&Ft(t,e,2)}function ds(e){var t=e.alternate;return e===De||t!==null&&t===De}function zd(e,t){fl=ls=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Dd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,pe(e,a)}}var ni={readContext:Ut,use:cs,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};ni.useEffectEvent=ft;var Od={readContext:Ut,use:cs,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:yd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,rs(4194308,4,Sd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var a=Yt();t=t===void 0?null:t;var n=e();if(Un){se(!0);try{e()}finally{se(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Yt();if(a!==void 0){var l=a(t);if(Un){se(!0);try{a(t)}finally{se(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=wp.bind(null,De,e),[n.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=so(e);var t=e.queue,a=Nd.bind(null,De,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:ro,useDeferredValue:function(e,t){var a=Yt();return uo(a,e,t)},useTransition:function(){var e=so(!1);return e=kd.bind(null,De,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=De,l=Yt();if(Ge){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),lt===null)throw Error(d(349));(Be&127)!==0||ed(n,t,a)}l.memoizedState=a;var i={value:a,getSnapshot:t};return l.queue=i,yd(ad.bind(null,n,i,e),[e]),n.flags|=2048,hl(9,{destroy:void 0},td.bind(null,n,i,a,t),null),a},useId:function(){var e=Yt(),t=lt.identifierPrefix;if(Ge){var a=Aa,n=Ea;a=(n&~(1<<32-ye(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=is++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=hp++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:mo,useFormState:dd,useActionState:dd,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ho.bind(null,De,!0,a),a.dispatch=t,[e,t]},useMemoCache:no,useCacheRefresh:function(){return Yt().memoizedState=Sp.bind(null,De)},useEffectEvent:function(e){var t=Yt(),a={impl:e};return t.memoizedState=a,function(){if((Ke&2)!==0)throw Error(d(440));return a.impl.apply(void 0,arguments)}}},po={readContext:Ut,use:cs,useCallback:xd,useContext:Ut,useEffect:oo,useImperativeHandle:wd,useInsertionEffect:bd,useLayoutEffect:vd,useMemo:_d,useReducer:os,useRef:pd,useState:function(){return os(Ga)},useDebugValue:ro,useDeferredValue:function(e,t){var a=gt();return jd(a,Pe.memoizedState,e,t)},useTransition:function(){var e=os(Ga)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:ti(e),t]},useSyncExternalStore:Pu,useId:Ed,useHostTransitionStatus:mo,useFormState:fd,useActionState:fd,useOptimistic:function(e,t){var a=gt();return id(a,Pe,e,t)},useMemoCache:no,useCacheRefresh:Ad};po.useEffectEvent=gd;var Md={readContext:Ut,use:cs,useCallback:xd,useContext:Ut,useEffect:oo,useImperativeHandle:wd,useInsertionEffect:bd,useLayoutEffect:vd,useMemo:_d,useReducer:io,useRef:pd,useState:function(){return io(Ga)},useDebugValue:ro,useDeferredValue:function(e,t){var a=gt();return Pe===null?uo(a,e,t):jd(a,Pe.memoizedState,e,t)},useTransition:function(){var e=io(Ga)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:ti(e),t]},useSyncExternalStore:Pu,useId:Ed,useHostTransitionStatus:mo,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var a=gt();return Pe!==null?id(a,Pe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:no,useCacheRefresh:Ad};Md.useEffectEvent=gd;function yo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:T({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var go={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=ia(),l=nn(n);l.payload=t,a!=null&&(l.callback=a),t=ln(e,l,n),t!==null&&(Ft(t,e,n),Wl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=ia(),l=nn(n);l.tag=1,l.payload=t,a!=null&&(l.callback=a),t=ln(e,l,n),t!==null&&(Ft(t,e,n),Wl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ia(),n=nn(a);n.tag=2,t!=null&&(n.callback=t),t=ln(e,n,a),t!==null&&(Ft(t,e,a),Wl(t,e,a))}};function Rd(e,t,a,n,l,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!$l(a,n)||!$l(l,i):!0}function Ud(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&go.enqueueReplaceState(t,t.state,null)}function Hn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=T({},a));for(var l in e)a[l]===void 0&&(a[l]=e[l])}return a}function Hd(e){$i(e)}function Bd(e){console.error(e)}function Ld(e){$i(e)}function fs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function qd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function bo(e,t,a){return a=nn(a),a.tag=3,a.payload={element:null},a.callback=function(){fs(e,t)},a}function Gd(e){return e=nn(e),e.tag=3,e}function Yd(e,t,a,n){var l=a.type.getDerivedStateFromError;if(typeof l=="function"){var i=n.value;e.payload=function(){return l(i)},e.callback=function(){qd(t,a,n)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){qd(t,a,n),typeof l!="function"&&(dn===null?dn=new Set([this]):dn.add(this));var u=n.stack;this.componentDidCatch(n.value,{componentStack:u!==null?u:""})})}function xp(e,t,a,n,l){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&sl(t,a,l,!0),a=ta.current,a!==null){switch(a.tag){case 31:case 13:return va===null?ks():a.alternate===null&&mt===0&&(mt=3),a.flags&=-257,a.flags|=65536,a.lanes=l,n===Pi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),$o(e,n,l)),!1;case 22:return a.flags|=65536,n===Pi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),$o(e,n,l)),!1}throw Error(d(435,a.tag))}return $o(e,n,l),ks(),!1}if(Ge)return t=ta.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==Uc&&(e=Error(d(422),{cause:n}),Zl(pa(e,a)))):(n!==Uc&&(t=Error(d(423),{cause:n}),Zl(pa(t,a))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=pa(n,a),l=bo(e.stateNode,n,l),Vc(e,l),mt!==4&&(mt=2)),!1;var i=Error(d(520),{cause:n});if(i=pa(i,a),di===null?di=[i]:di.push(i),mt!==4&&(mt=2),t===null)return!0;n=pa(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=l&-l,a.lanes|=e,e=bo(a.stateNode,n,e),Vc(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(dn===null||!dn.has(i))))return a.flags|=65536,l&=-l,a.lanes|=l,l=Gd(l),Yd(l,e,a,n),Vc(a,l),!1}a=a.return}while(a!==null);return!1}var vo=Error(d(461)),xt=!1;function Ht(e,t,a,n){t.child=e===null?Zu(t,null,a,n):Rn(t,e.child,a,n)}function $d(e,t,a,n,l){a=a.render;var i=t.ref;if("ref"in n){var o={};for(var u in n)u!=="ref"&&(o[u]=n[u])}else o=n;return zn(t),n=Pc(e,t,a,o,i,l),u=eo(),e!==null&&!xt?(to(e,t,l),Ya(e,t,l)):(Ge&&u&&Mc(t),t.flags|=1,Ht(e,t,n,l),t.child)}function Xd(e,t,a,n,l){if(e===null){var i=a.type;return typeof i=="function"&&!zc(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Qd(e,t,i,n,l)):(e=Vi(a.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Co(e,l)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:$l,a(o,n)&&e.ref===t.ref)return Ya(e,t,l)}return t.flags|=1,e=Ua(i,n),e.ref=t.ref,e.return=t,t.child=e}function Qd(e,t,a,n,l){if(e!==null){var i=e.memoizedProps;if($l(i,n)&&e.ref===t.ref)if(xt=!1,t.pendingProps=n=i,Co(e,l))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,Ya(e,t,l)}return So(e,t,a,n,l)}function Zd(e,t,a,n){var l=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(n=t.child=e.child,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~i}else n=0,t.child=null;return Vd(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wi(t,i!==null?i.cachePool:null),i!==null?Ku(t,i):Kc(),Fu(t);else return n=t.lanes=536870912,Vd(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Wi(t,i.cachePool),Ku(t,i),cn(),t.memoizedState=null):(e!==null&&Wi(t,null),Kc(),cn());return Ht(e,t,l,a),t.child}function li(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vd(e,t,a,n,l){var i=$c();return i=i===null?null:{parent:St._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Wi(t,null),Kc(),Fu(t),e!==null&&sl(e,t,n,!0),t.childLanes=l,null}function ms(e,t){return t=ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jd(e,t,a){return Rn(t,e.child,null,a),e=ms(t,t.pendingProps),e.flags|=2,aa(t),t.memoizedState=null,e}function _p(e,t,a){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(n.mode==="hidden")return e=ms(t,n),t.lanes=536870912,li(null,e);if(Wc(t),(e=ot)?(e=cm(e,ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ia!==null?{id:Ea,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},a=zu(e),a.return=t,t.child=a,Rt=t,ot=null)):e=null,e===null)throw en(t);return t.lanes=536870912,null}return ms(t,n)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Wc(t),l)if(t.flags&256)t.flags&=-257,t=Jd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(xt||sl(e,t,a,!1),l=(a&e.childLanes)!==0,xt||l){if(n=lt,n!==null&&(o=de(n,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,Cn(e,o),Ft(n,e,o),vo;ks(),t=Jd(e,t,a)}else e=i.treeContext,ot=Sa(o.nextSibling),Rt=t,Ge=!0,Pa=null,ba=!1,e!==null&&Mu(t,e),t=ms(t,n),t.flags|=4096;return t}return e=Ua(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(d(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function So(e,t,a,n,l){return zn(t),a=Pc(e,t,a,n,void 0,l),n=eo(),e!==null&&!xt?(to(e,t,l),Ya(e,t,l)):(Ge&&n&&Mc(t),t.flags|=1,Ht(e,t,a,l),t.child)}function Kd(e,t,a,n,l,i){return zn(t),t.updateQueue=null,a=Iu(t,n,a,l),Wu(e),n=eo(),e!==null&&!xt?(to(e,t,i),Ya(e,t,i)):(Ge&&n&&Mc(t),t.flags|=1,Ht(e,t,a,i),t.child)}function Fd(e,t,a,n,l){if(zn(t),t.stateNode===null){var i=al,o=a.contextType;typeof o=="object"&&o!==null&&(i=Ut(o)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=go,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Qc(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Ut(o):al,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(yo(t,a,o,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&go.enqueueReplaceState(i,i.state,null),Pl(t,n,i,l),Il(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var u=t.memoizedProps,y=Hn(a,u);i.props=y;var A=i.context,B=a.contextType;o=al,typeof B=="object"&&B!==null&&(o=Ut(B));var Q=a.getDerivedStateFromProps;B=typeof Q=="function"||typeof i.getSnapshotBeforeUpdate=="function",u=t.pendingProps!==u,B||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u||A!==o)&&Ud(t,i,n,o),an=!1;var z=t.memoizedState;i.state=z,Pl(t,n,i,l),Il(),A=t.memoizedState,u||z!==A||an?(typeof Q=="function"&&(yo(t,a,Q,n),A=t.memoizedState),(y=an||Rd(t,a,y,n,z,A,o))?(B||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=A),i.props=n,i.state=A,i.context=o,n=y):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Zc(e,t),o=t.memoizedProps,B=Hn(a,o),i.props=B,Q=t.pendingProps,z=i.context,A=a.contextType,y=al,typeof A=="object"&&A!==null&&(y=Ut(A)),u=a.getDerivedStateFromProps,(A=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==Q||z!==y)&&Ud(t,i,n,y),an=!1,z=t.memoizedState,i.state=z,Pl(t,n,i,l),Il();var O=t.memoizedState;o!==Q||z!==O||an||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof u=="function"&&(yo(t,a,u,n),O=t.memoizedState),(B=an||Rd(t,a,B,n,z,O,y)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(A||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,O,y),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,O,y)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=O),i.props=n,i.state=O,i.context=y,n=B):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,hs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=Rn(t,e.child,null,l),t.child=Rn(t,null,a,l)):Ht(e,t,a,l),t.memoizedState=i.state,e=t.child):e=Ya(e,t,l),e}function Wd(e,t,a,n){return An(),t.flags|=256,Ht(e,t,a,n),t.child}var wo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xo(e){return{baseLanes:e,cachePool:qu()}}function _o(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=la),e}function Id(e,t,a){var n=t.pendingProps,l=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),o&&(l=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(l?sn(t):cn(),(e=ot)?(e=cm(e,ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ia!==null?{id:Ea,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},a=zu(e),a.return=t,t.child=a,Rt=t,ot=null)):e=null,e===null)throw en(t);return ir(e)?t.lanes=32:t.lanes=536870912,null}var u=n.children;return n=n.fallback,l?(cn(),l=t.mode,u=ps({mode:"hidden",children:u},l),n=En(n,l,a,null),u.return=t,n.return=t,u.sibling=n,t.child=u,n=t.child,n.memoizedState=xo(a),n.childLanes=_o(e,o,a),t.memoizedState=wo,li(null,n)):(sn(t),jo(t,u))}var y=e.memoizedState;if(y!==null&&(u=y.dehydrated,u!==null)){if(i)t.flags&256?(sn(t),t.flags&=-257,t=ko(e,t,a)):t.memoizedState!==null?(cn(),t.child=e.child,t.flags|=128,t=null):(cn(),u=n.fallback,l=t.mode,n=ps({mode:"visible",children:n.children},l),u=En(u,l,a,null),u.flags|=2,n.return=t,u.return=t,n.sibling=u,t.child=n,Rn(t,e.child,null,a),n=t.child,n.memoizedState=xo(a),n.childLanes=_o(e,o,a),t.memoizedState=wo,t=li(null,n));else if(sn(t),ir(u)){if(o=u.nextSibling&&u.nextSibling.dataset,o)var A=o.dgst;o=A,n=Error(d(419)),n.stack="",n.digest=o,Zl({value:n,source:null,stack:null}),t=ko(e,t,a)}else if(xt||sl(e,t,a,!1),o=(a&e.childLanes)!==0,xt||o){if(o=lt,o!==null&&(n=de(o,a),n!==0&&n!==y.retryLane))throw y.retryLane=n,Cn(e,n),Ft(o,e,n),vo;lr(u)||ks(),t=ko(e,t,a)}else lr(u)?(t.flags|=192,t.child=e.child,t=null):(e=y.treeContext,ot=Sa(u.nextSibling),Rt=t,Ge=!0,Pa=null,ba=!1,e!==null&&Mu(t,e),t=jo(t,n.children),t.flags|=4096);return t}return l?(cn(),u=n.fallback,l=t.mode,y=e.child,A=y.sibling,n=Ua(y,{mode:"hidden",children:n.children}),n.subtreeFlags=y.subtreeFlags&65011712,A!==null?u=Ua(A,u):(u=En(u,l,a,null),u.flags|=2),u.return=t,n.return=t,n.sibling=u,t.child=n,li(null,n),n=t.child,u=e.child.memoizedState,u===null?u=xo(a):(l=u.cachePool,l!==null?(y=St._currentValue,l=l.parent!==y?{parent:y,pool:y}:l):l=qu(),u={baseLanes:u.baseLanes|a,cachePool:l}),n.memoizedState=u,n.childLanes=_o(e,o,a),t.memoizedState=wo,li(e.child,n)):(sn(t),a=e.child,e=a.sibling,a=Ua(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function jo(e,t){return t=ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ps(e,t){return e=ea(22,e,null,t),e.lanes=0,e}function ko(e,t,a){return Rn(t,e.child,null,a),e=jo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pd(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Lc(e.return,t,a)}function To(e,t,a,n,l,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:l,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=a,o.tailMode=l,o.treeForkCount=i)}function ef(e,t,a){var n=t.pendingProps,l=n.revealOrder,i=n.tail;n=n.children;var o=yt.current,u=(o&2)!==0;if(u?(o=o&1|2,t.flags|=128):o&=1,q(yt,o),Ht(e,t,n,a),n=Ge?Ql:0,!u&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pd(e,a,t);else if(e.tag===19)Pd(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(l){case"forwards":for(a=t.child,l=null;a!==null;)e=a.alternate,e!==null&&ns(e)===null&&(l=a),a=a.sibling;a=l,a===null?(l=t.child,t.child=null):(l=a.sibling,a.sibling=null),To(t,!1,l,a,i,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&ns(e)===null){t.child=l;break}e=l.sibling,l.sibling=a,a=l,l=e}To(t,!0,a,null,i,n);break;case"together":To(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ya(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),un|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(sl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,a=Ua(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ua(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Co(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ki(e)))}function jp(e,t,a){switch(t.tag){case 3:Qe(t,t.stateNode.containerInfo),tn(t,St,e.memoizedState.cache),An();break;case 27:case 5:Gt(t);break;case 4:Qe(t,t.stateNode.containerInfo);break;case 10:tn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(sn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Id(e,t,a):(sn(t),e=Ya(e,t,a),e!==null?e.sibling:null);sn(t);break;case 19:var l=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(sl(e,t,a,!1),n=(a&t.childLanes)!==0),l){if(n)return ef(e,t,a);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),q(yt,yt.current),n)break;return null;case 22:return t.lanes=0,Zd(e,t,a,t.pendingProps);case 24:tn(t,St,e.memoizedState.cache)}return Ya(e,t,a)}function tf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!Co(e,a)&&(t.flags&128)===0)return xt=!1,jp(e,t,a);xt=(e.flags&131072)!==0}else xt=!1,Ge&&(t.flags&1048576)!==0&&Ou(t,Ql,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=On(t.elementType),t.type=e,typeof e=="function")zc(e)?(n=Hn(e,n),t.tag=1,t=Fd(null,t,e,n,a)):(t.tag=0,t=So(null,t,e,n,a));else{if(e!=null){var l=e.$$typeof;if(l===we){t.tag=11,t=$d(null,t,e,n,a);break e}else if(l===V){t.tag=14,t=Xd(null,t,e,n,a);break e}}throw t=Xe(e)||e,Error(d(306,t,""))}}return t;case 0:return So(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,l=Hn(n,t.pendingProps),Fd(e,t,n,l,a);case 3:e:{if(Qe(t,t.stateNode.containerInfo),e===null)throw Error(d(387));n=t.pendingProps;var i=t.memoizedState;l=i.element,Zc(e,t),Pl(t,n,null,a);var o=t.memoizedState;if(n=o.cache,tn(t,St,n),n!==i.cache&&qc(t,[St],a,!0),Il(),n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Wd(e,t,n,a);break e}else if(n!==l){l=pa(Error(d(424)),t),Zl(l),t=Wd(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ot=Sa(e.firstChild),Rt=t,Ge=!0,Pa=null,ba=!0,a=Zu(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(An(),n===l){t=Ya(e,t,a);break e}Ht(e,t,n,a)}t=t.child}return t;case 26:return hs(e,t),e===null?(a=mm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ge||(a=t.type,e=t.pendingProps,n=Ds(ge.current).createElement(a),n[Mt]=t,n[Xt]=e,Bt(n,a,e),Nt(n),t.stateNode=n):t.memoizedState=mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Gt(t),e===null&&Ge&&(n=t.stateNode=um(t.type,t.pendingProps,ge.current),Rt=t,ba=!0,l=ot,pn(t.type)?(sr=l,ot=Sa(n.firstChild)):ot=l),Ht(e,t,t.pendingProps.children,a),hs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((l=n=ot)&&(n=ey(n,t.type,t.pendingProps,ba),n!==null?(t.stateNode=n,Rt=t,ot=Sa(n.firstChild),ba=!1,l=!0):l=!1),l||en(t)),Gt(t),l=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,n=i.children,tr(l,i)?n=null:o!==null&&tr(l,o)&&(t.flags|=32),t.memoizedState!==null&&(l=Pc(e,t,pp,null,null,a),vi._currentValue=l),hs(e,t),Ht(e,t,n,a),t.child;case 6:return e===null&&Ge&&((e=a=ot)&&(a=ty(a,t.pendingProps,ba),a!==null?(t.stateNode=a,Rt=t,ot=null,e=!0):e=!1),e||en(t)),null;case 13:return Id(e,t,a);case 4:return Qe(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Rn(t,null,n,a):Ht(e,t,n,a),t.child;case 11:return $d(e,t,t.type,t.pendingProps,a);case 7:return Ht(e,t,t.pendingProps,a),t.child;case 8:return Ht(e,t,t.pendingProps.children,a),t.child;case 12:return Ht(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,tn(t,t.type,n.value),Ht(e,t,n.children,a),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,zn(t),l=Ut(l),n=n(l),t.flags|=1,Ht(e,t,n,a),t.child;case 14:return Xd(e,t,t.type,t.pendingProps,a);case 15:return Qd(e,t,t.type,t.pendingProps,a);case 19:return ef(e,t,a);case 31:return _p(e,t,a);case 22:return Zd(e,t,a,t.pendingProps);case 24:return zn(t),n=Ut(St),e===null?(l=$c(),l===null&&(l=lt,i=Gc(),l.pooledCache=i,i.refCount++,i!==null&&(l.pooledCacheLanes|=a),l=i),t.memoizedState={parent:n,cache:l},Qc(t),tn(t,St,l)):((e.lanes&a)!==0&&(Zc(e,t),Pl(t,null,null,a),Il()),l=e.memoizedState,i=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),tn(t,St,n)):(n=i.cache,tn(t,St,n),n!==l.cache&&qc(t,[St],a,!0))),Ht(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function $a(e){e.flags|=4}function Eo(e,t,a,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Af())e.flags|=8192;else throw Mn=Pi,Xc}else e.flags&=-16777217}function af(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!bm(t))if(Af())e.flags|=8192;else throw Mn=Pi,Xc}function ys(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ol():536870912,e.lanes|=t,bl|=t)}function ii(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)a|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function kp(e,t,a){var n=t.pendingProps;switch(Rc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return rt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),La(St),Me(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(il(t)?$a(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Hc())),rt(t),null;case 26:var l=t.type,i=t.memoizedState;return e===null?($a(t),i!==null?(rt(t),af(t,i)):(rt(t),Eo(t,l,null,n,a))):i?i!==e.memoizedState?($a(t),rt(t),af(t,i)):(rt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&$a(t),rt(t),Eo(t,l,e,n,a)),null;case 27:if(ct(t),a=ge.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$a(t);else{if(!n){if(t.stateNode===null)throw Error(d(166));return rt(t),null}e=K.current,il(t)?Ru(t):(e=um(l,n,a),t.stateNode=e,$a(t))}return rt(t),null;case 5:if(ct(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&$a(t);else{if(!n){if(t.stateNode===null)throw Error(d(166));return rt(t),null}if(i=K.current,il(t))Ru(t);else{var o=Ds(ge.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?o.createElement(l,{is:n.is}):o.createElement(l)}}i[Mt]=t,i[Xt]=n;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(Bt(i,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&$a(t)}}return rt(t),Eo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&$a(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(d(166));if(e=ge.current,il(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,l=Rt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Pf(e.nodeValue,a)),e||en(t,!0)}else e=Ds(e).createTextNode(n),e[Mt]=t,t.stateNode=e}return rt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=il(t),a!==null){if(e===null){if(!n)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[Mt]=t}else An(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),e=!1}else a=Hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(aa(t),t):(aa(t),null);if((t.flags&128)!==0)throw Error(d(558))}return rt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=il(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(317));l[Mt]=t}else An(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),l=!1}else l=Hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(aa(t),t):(aa(t),null)}return aa(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==l&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),ys(t,t.updateQueue),rt(t),null);case 4:return Me(),e===null&&Fo(t.stateNode.containerInfo),rt(t),null;case 10:return La(t.type),rt(t),null;case 19:if(x(yt),n=t.memoizedState,n===null)return rt(t),null;if(l=(t.flags&128)!==0,i=n.rendering,i===null)if(l)ii(n,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ns(e),i!==null){for(t.flags|=128,ii(n,!1),e=i.updateQueue,t.updateQueue=e,ys(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Nu(a,e),a=a.sibling;return q(yt,yt.current&1|2),Ge&&Ha(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ht()>xs&&(t.flags|=128,l=!0,ii(n,!1),t.lanes=4194304)}else{if(!l)if(e=ns(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,ys(t,e),ii(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!Ge)return rt(t),null}else 2*ht()-n.renderingStartTime>xs&&a!==536870912&&(t.flags|=128,l=!0,ii(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ht(),e.sibling=null,a=yt.current,q(yt,l?a&1|2:a&1),Ge&&Ha(t,n.treeForkCount),e):(rt(t),null);case 22:case 23:return aa(t),Fc(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),a=t.updateQueue,a!==null&&ys(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&x(Dn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),La(St),rt(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function Tp(e,t){switch(Rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return La(St),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ct(t),null;case 31:if(t.memoizedState!==null){if(aa(t),t.alternate===null)throw Error(d(340));An()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));An()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return x(yt),null;case 4:return Me(),null;case 10:return La(t.type),null;case 22:case 23:return aa(t),Fc(),e!==null&&x(Dn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return La(St),null;case 25:return null;default:return null}}function nf(e,t){switch(Rc(t),t.tag){case 3:La(St),Me();break;case 26:case 27:case 5:ct(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&aa(t);break;case 13:aa(t);break;case 19:x(yt);break;case 10:La(t.type);break;case 22:case 23:aa(t),Fc(),e!==null&&x(Dn);break;case 24:La(St)}}function si(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var l=n.next;a=l;do{if((a.tag&e)===e){n=void 0;var i=a.create,o=a.inst;n=i(),o.destroy=n}a=a.next}while(a!==l)}}catch(u){Ie(t,t.return,u)}}function on(e,t,a){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){var o=n.inst,u=o.destroy;if(u!==void 0){o.destroy=void 0,l=t;var y=a,A=u;try{A()}catch(B){Ie(l,y,B)}}}n=n.next}while(n!==i)}}catch(B){Ie(t,t.return,B)}}function lf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Ju(t,a)}catch(n){Ie(e,e.return,n)}}}function sf(e,t,a){a.props=Hn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ie(e,t,n)}}function ci(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(l){Ie(e,t,l)}}function Na(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(l){Ie(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(l){Ie(e,t,l)}else a.current=null}function cf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(l){Ie(e,e.return,l)}}function Ao(e,t,a){try{var n=e.stateNode;Jp(n,e.type,a,t),n[Xt]=t}catch(l){Ie(e,e.return,l)}}function of(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pn(e.type)||e.tag===4}function No(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||of(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&pn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zo(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ma));else if(n!==4&&(n===27&&pn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(zo(e,t,a),e=e.sibling;e!==null;)zo(e,t,a),e=e.sibling}function gs(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&pn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(gs(e,t,a),e=e.sibling;e!==null;)gs(e,t,a),e=e.sibling}function rf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Bt(t,n,a),t[Mt]=e,t[Xt]=a}catch(i){Ie(e,e.return,i)}}var Xa=!1,_t=!1,Do=!1,uf=typeof WeakSet=="function"?WeakSet:Set,zt=null;function Cp(e,t){if(e=e.containerInfo,Po=Ls,e=wu(e),jc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var l=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var o=0,u=-1,y=-1,A=0,B=0,Q=e,z=null;t:for(;;){for(var O;Q!==a||l!==0&&Q.nodeType!==3||(u=o+l),Q!==i||n!==0&&Q.nodeType!==3||(y=o+n),Q.nodeType===3&&(o+=Q.nodeValue.length),(O=Q.firstChild)!==null;)z=Q,Q=O;for(;;){if(Q===e)break t;if(z===a&&++A===l&&(u=o),z===i&&++B===n&&(y=o),(O=Q.nextSibling)!==null)break;Q=z,z=Q.parentNode}Q=O}a=u===-1||y===-1?null:{start:u,end:y}}else a=null}a=a||{start:0,end:0}}else a=null;for(er={focusedElem:e,selectionRange:a},Ls=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)l=e[a],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,l=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var fe=Hn(a.type,l);e=n.getSnapshotBeforeUpdate(fe,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(Te){Ie(a,a.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)nr(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(d(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function df(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Za(e,a),n&4&&si(5,a);break;case 1:if(Za(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Ie(a,a.return,o)}else{var l=Hn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Ie(a,a.return,o)}}n&64&&lf(a),n&512&&ci(a,a.return);break;case 3:if(Za(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Ju(e,t)}catch(o){Ie(a,a.return,o)}}break;case 27:t===null&&n&4&&rf(a);case 26:case 5:Za(e,a),t===null&&n&4&&cf(a),n&512&&ci(a,a.return);break;case 12:Za(e,a);break;case 31:Za(e,a),n&4&&hf(e,a);break;case 13:Za(e,a),n&4&&pf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Up.bind(null,a),ay(e,a))));break;case 22:if(n=a.memoizedState!==null||Xa,!n){t=t!==null&&t.memoizedState!==null||_t,l=Xa;var i=_t;Xa=n,(_t=t)&&!i?Va(e,a,(a.subtreeFlags&8772)!==0):Za(e,a),Xa=l,_t=i}break;case 30:break;default:Za(e,a)}}function ff(e){var t=e.alternate;t!==null&&(e.alternate=null,ff(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ut=null,Zt=!1;function Qa(e,t,a){for(a=a.child;a!==null;)mf(e,t,a),a=a.sibling}function mf(e,t,a){if(he&&typeof he.onCommitFiberUnmount=="function")try{he.onCommitFiberUnmount(W,a)}catch{}switch(a.tag){case 26:_t||Na(a,t),Qa(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_t||Na(a,t);var n=ut,l=Zt;pn(a.type)&&(ut=a.stateNode,Zt=!1),Qa(e,t,a),yi(a.stateNode),ut=n,Zt=l;break;case 5:_t||Na(a,t);case 6:if(n=ut,l=Zt,ut=null,Qa(e,t,a),ut=n,Zt=l,ut!==null)if(Zt)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(a.stateNode)}catch(i){Ie(a,t,i)}else try{ut.removeChild(a.stateNode)}catch(i){Ie(a,t,i)}break;case 18:ut!==null&&(Zt?(e=ut,im(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Tl(e)):im(ut,a.stateNode));break;case 4:n=ut,l=Zt,ut=a.stateNode.containerInfo,Zt=!0,Qa(e,t,a),ut=n,Zt=l;break;case 0:case 11:case 14:case 15:on(2,a,t),_t||on(4,a,t),Qa(e,t,a);break;case 1:_t||(Na(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&sf(a,t,n)),Qa(e,t,a);break;case 21:Qa(e,t,a);break;case 22:_t=(n=_t)||a.memoizedState!==null,Qa(e,t,a),_t=n;break;default:Qa(e,t,a)}}function hf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Tl(e)}catch(a){Ie(t,t.return,a)}}}function pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Tl(e)}catch(a){Ie(t,t.return,a)}}function Ep(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uf),t;default:throw Error(d(435,e.tag))}}function bs(e,t){var a=Ep(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var l=Hp.bind(null,e,n);n.then(l,l)}})}function Vt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var l=a[n],i=e,o=t,u=o;e:for(;u!==null;){switch(u.tag){case 27:if(pn(u.type)){ut=u.stateNode,Zt=!1;break e}break;case 5:ut=u.stateNode,Zt=!1;break e;case 3:case 4:ut=u.stateNode.containerInfo,Zt=!0;break e}u=u.return}if(ut===null)throw Error(d(160));mf(i,o,l),ut=null,Zt=!1,i=l.alternate,i!==null&&(i.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yf(t,e),t=t.sibling}var _a=null;function yf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Jt(e),n&4&&(on(3,e,e.return),si(3,e),on(5,e,e.return));break;case 1:Vt(t,e),Jt(e),n&512&&(_t||a===null||Na(a,a.return)),n&64&&Xa&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var l=_a;if(Vt(t,e),Jt(e),n&512&&(_t||a===null||Na(a,a.return)),n&4){var i=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,l=l.ownerDocument||l;t:switch(n){case"title":i=l.getElementsByTagName("title")[0],(!i||i[Ml]||i[Mt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=l.createElement(n),l.head.insertBefore(i,l.querySelector("head > title"))),Bt(i,n,a),i[Mt]=e,Nt(i),n=i;break e;case"link":var o=ym("link","href",l).get(n+(a.href||""));if(o){for(var u=0;u<o.length;u++)if(i=o[u],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(u,1);break t}}i=l.createElement(n),Bt(i,n,a),l.head.appendChild(i);break;case"meta":if(o=ym("meta","content",l).get(n+(a.content||""))){for(u=0;u<o.length;u++)if(i=o[u],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(u,1);break t}}i=l.createElement(n),Bt(i,n,a),l.head.appendChild(i);break;default:throw Error(d(468,n))}i[Mt]=e,Nt(i),n=i}e.stateNode=n}else gm(l,e.type,e.stateNode);else e.stateNode=pm(l,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?gm(l,e.type,e.stateNode):pm(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ao(e,e.memoizedProps,a.memoizedProps)}break;case 27:Vt(t,e),Jt(e),n&512&&(_t||a===null||Na(a,a.return)),a!==null&&n&4&&Ao(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Vt(t,e),Jt(e),n&512&&(_t||a===null||Na(a,a.return)),e.flags&32){l=e.stateNode;try{Kn(l,"")}catch(fe){Ie(e,e.return,fe)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,Ao(e,l,a!==null?a.memoizedProps:l)),n&1024&&(Do=!0);break;case 6:if(Vt(t,e),Jt(e),n&4){if(e.stateNode===null)throw Error(d(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(fe){Ie(e,e.return,fe)}}break;case 3:if(Rs=null,l=_a,_a=Os(t.containerInfo),Vt(t,e),_a=l,Jt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Tl(t.containerInfo)}catch(fe){Ie(e,e.return,fe)}Do&&(Do=!1,gf(e));break;case 4:n=_a,_a=Os(e.stateNode.containerInfo),Vt(t,e),Jt(e),_a=n;break;case 12:Vt(t,e),Jt(e);break;case 31:Vt(t,e),Jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 13:Vt(t,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ss=ht()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 22:l=e.memoizedState!==null;var y=a!==null&&a.memoizedState!==null,A=Xa,B=_t;if(Xa=A||l,_t=B||y,Vt(t,e),_t=B,Xa=A,Jt(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(a===null||y||Xa||_t||Bn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){y=a=t;try{if(i=y.stateNode,l)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{u=y.stateNode;var Q=y.memoizedProps.style,z=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;u.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(fe){Ie(y,y.return,fe)}}}else if(t.tag===6){if(a===null){y=t;try{y.stateNode.nodeValue=l?"":y.memoizedProps}catch(fe){Ie(y,y.return,fe)}}}else if(t.tag===18){if(a===null){y=t;try{var O=y.stateNode;l?sm(O,!0):sm(y.stateNode,!1)}catch(fe){Ie(y,y.return,fe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,bs(e,a))));break;case 19:Vt(t,e),Jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 30:break;case 21:break;default:Vt(t,e),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(of(n)){a=n;break}n=n.return}if(a==null)throw Error(d(160));switch(a.tag){case 27:var l=a.stateNode,i=No(e);gs(e,i,l);break;case 5:var o=a.stateNode;a.flags&32&&(Kn(o,""),a.flags&=-33);var u=No(e);gs(e,u,o);break;case 3:case 4:var y=a.stateNode.containerInfo,A=No(e);zo(e,A,y);break;default:throw Error(d(161))}}catch(B){Ie(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)df(e,t.alternate,t),t=t.sibling}function Bn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:on(4,t,t.return),Bn(t);break;case 1:Na(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&sf(t,t.return,a),Bn(t);break;case 27:yi(t.stateNode);case 26:case 5:Na(t,t.return),Bn(t);break;case 22:t.memoizedState===null&&Bn(t);break;case 30:Bn(t);break;default:Bn(t)}e=e.sibling}}function Va(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Va(l,i,a),si(4,i);break;case 1:if(Va(l,i,a),n=i,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(A){Ie(n,n.return,A)}if(n=i,l=n.updateQueue,l!==null){var u=n.stateNode;try{var y=l.shared.hiddenCallbacks;if(y!==null)for(l.shared.hiddenCallbacks=null,l=0;l<y.length;l++)Vu(y[l],u)}catch(A){Ie(n,n.return,A)}}a&&o&64&&lf(i),ci(i,i.return);break;case 27:rf(i);case 26:case 5:Va(l,i,a),a&&n===null&&o&4&&cf(i),ci(i,i.return);break;case 12:Va(l,i,a);break;case 31:Va(l,i,a),a&&o&4&&hf(l,i);break;case 13:Va(l,i,a),a&&o&4&&pf(l,i);break;case 22:i.memoizedState===null&&Va(l,i,a),ci(i,i.return);break;case 30:break;default:Va(l,i,a)}t=t.sibling}}function Oo(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Vl(a))}function Mo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vl(e))}function ja(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bf(e,t,a,n),t=t.sibling}function bf(e,t,a,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ja(e,t,a,n),l&2048&&si(9,t);break;case 1:ja(e,t,a,n);break;case 3:ja(e,t,a,n),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vl(e)));break;case 12:if(l&2048){ja(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,u=i.onPostCommit;typeof u=="function"&&u(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(y){Ie(t,t.return,y)}}else ja(e,t,a,n);break;case 31:ja(e,t,a,n);break;case 13:ja(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?ja(e,t,a,n):oi(e,t):i._visibility&2?ja(e,t,a,n):(i._visibility|=2,pl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&Oo(o,t);break;case 24:ja(e,t,a,n),l&2048&&Mo(t.alternate,t);break;default:ja(e,t,a,n)}}function pl(e,t,a,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,u=a,y=n,A=o.flags;switch(o.tag){case 0:case 11:case 15:pl(i,o,u,y,l),si(8,o);break;case 23:break;case 22:var B=o.stateNode;o.memoizedState!==null?B._visibility&2?pl(i,o,u,y,l):oi(i,o):(B._visibility|=2,pl(i,o,u,y,l)),l&&A&2048&&Oo(o.alternate,o);break;case 24:pl(i,o,u,y,l),l&&A&2048&&Mo(o.alternate,o);break;default:pl(i,o,u,y,l)}t=t.sibling}}function oi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,l=n.flags;switch(n.tag){case 22:oi(a,n),l&2048&&Oo(n.alternate,n);break;case 24:oi(a,n),l&2048&&Mo(n.alternate,n);break;default:oi(a,n)}t=t.sibling}}var ri=8192;function yl(e,t,a){if(e.subtreeFlags&ri)for(e=e.child;e!==null;)vf(e,t,a),e=e.sibling}function vf(e,t,a){switch(e.tag){case 26:yl(e,t,a),e.flags&ri&&e.memoizedState!==null&&hy(a,_a,e.memoizedState,e.memoizedProps);break;case 5:yl(e,t,a);break;case 3:case 4:var n=_a;_a=Os(e.stateNode.containerInfo),yl(e,t,a),_a=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ri,ri=16777216,yl(e,t,a),ri=n):yl(e,t,a));break;default:yl(e,t,a)}}function Sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,xf(n,e)}Sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wf(e),e=e.sibling}function wf(e){switch(e.tag){case 0:case 11:case 15:ui(e),e.flags&2048&&on(9,e,e.return);break;case 3:ui(e);break;case 12:ui(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vs(e)):ui(e);break;default:ui(e)}}function vs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];zt=n,xf(n,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:on(8,t,t.return),vs(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,vs(t));break;default:vs(t)}e=e.sibling}}function xf(e,t){for(;zt!==null;){var a=zt;switch(a.tag){case 0:case 11:case 15:on(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Vl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,zt=n;else e:for(a=e;zt!==null;){n=zt;var l=n.sibling,i=n.return;if(ff(n),n===a){zt=null;break e}if(l!==null){l.return=i,zt=l;break e}zt=i}}}var Ap={getCacheForType:function(e){var t=Ut(St),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ut(St).controller.signal}},Np=typeof WeakMap=="function"?WeakMap:Map,Ke=0,lt=null,Ue=null,Be=0,We=0,na=null,rn=!1,gl=!1,Ro=!1,Ja=0,mt=0,un=0,Ln=0,Uo=0,la=0,bl=0,di=null,Kt=null,Ho=!1,Ss=0,_f=0,xs=1/0,_s=null,dn=null,Tt=0,fn=null,vl=null,Ka=0,Bo=0,Lo=null,jf=null,fi=0,qo=null;function ia(){return(Ke&2)!==0&&Be!==0?Be&-Be:C.T!==null?Zo():It()}function kf(){if(la===0)if((Be&536870912)===0||Ge){var e=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),la=e}else la=536870912;return e=ta.current,e!==null&&(e.flags|=32),la}function Ft(e,t,a){(e===lt&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Sl(e,0),mn(e,Be,la,!1)),L(e,a),((Ke&2)===0||e!==lt)&&(e===lt&&((Ke&2)===0&&(Ln|=a),mt===4&&mn(e,Be,la,!1)),za(e))}function Tf(e,t,a){if((Ke&6)!==0)throw Error(d(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ca(e,t),l=n?Op(e,t):Yo(e,t,!0),i=n;do{if(l===0){gl&&!n&&mn(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!zp(a)){l=Yo(e,t,!1),i=!1;continue}if(l===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var u=e;l=di;var y=u.current.memoizedState.isDehydrated;if(y&&(Sl(u,o).flags|=256),o=Yo(u,o,!1),o!==2){if(Ro&&!y){u.errorRecoveryDisabledLanes|=i,Ln|=i,l=4;break e}i=Kt,Kt=l,i!==null&&(Kt===null?Kt=i:Kt.push.apply(Kt,i))}l=o}if(i=!1,l!==2)continue}}if(l===1){Sl(e,0),mn(e,t,0,!0);break}e:{switch(n=e,i=l,i){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:mn(n,t,la,!rn);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(l=Ss+300-ht(),10<l)){if(mn(n,t,la,!rn),Da(n,0,!0)!==0)break e;Ka=t,n.timeoutHandle=nm(Cf.bind(null,n,a,Kt,_s,Ho,t,la,Ln,bl,rn,i,"Throttled",-0,0),l);break e}Cf(n,a,Kt,_s,Ho,t,la,Ln,bl,rn,i,null,-0,0)}}break}while(!0);za(e)}function Cf(e,t,a,n,l,i,o,u,y,A,B,Q,z,O){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ma},vf(t,i,Q);var fe=(i&62914560)===i?Ss-ht():(i&4194048)===i?_f-ht():0;if(fe=py(Q,fe),fe!==null){Ka=i,e.cancelPendingCommit=fe(Rf.bind(null,e,t,i,a,n,l,o,u,y,B,Q,null,z,O)),mn(e,i,o,!A);return}}Rf(e,t,i,a,n,l,o,u,y)}function zp(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var l=a[n],i=l.getSnapshot;l=l.value;try{if(!Pt(i(),l))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function mn(e,t,a,n){t&=~Uo,t&=~Ln,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var i=31-ye(l),o=1<<i;n[i]=-1,l&=~o}a!==0&&ne(e,a,t)}function js(){return(Ke&6)===0?(mi(0),!1):!0}function Go(){if(Ue!==null){if(We===0)var e=Ue.return;else e=Ue,Ba=Nn=null,ao(e),ul=null,Kl=0,e=Ue;for(;e!==null;)nf(e.alternate,e),e=e.return;Ue=null}}function Sl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Wp(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ka=0,Go(),lt=e,Ue=a=Ua(e.current,null),Be=t,We=0,na=null,rn=!1,gl=Ca(e,t),Ro=!1,bl=la=Uo=Ln=un=mt=0,Kt=di=null,Ho=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-ye(n),i=1<<l;t|=e[l],n&=~i}return Ja=t,Xi(),a}function Ef(e,t){De=null,C.H=ni,t===rl||t===Ii?(t=$u(),We=3):t===Xc?(t=$u(),We=4):We=t===vo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,na=t,Ue===null&&(mt=1,fs(e,pa(t,e.current)))}function Af(){var e=ta.current;return e===null?!0:(Be&4194048)===Be?va===null:(Be&62914560)===Be||(Be&536870912)!==0?e===va:!1}function Nf(){var e=C.H;return C.H=ni,e===null?ni:e}function zf(){var e=C.A;return C.A=Ap,e}function ks(){mt=4,rn||(Be&4194048)!==Be&&ta.current!==null||(gl=!0),(un&134217727)===0&&(Ln&134217727)===0||lt===null||mn(lt,Be,la,!1)}function Yo(e,t,a){var n=Ke;Ke|=2;var l=Nf(),i=zf();(lt!==e||Be!==t)&&(_s=null,Sl(e,t)),t=!1;var o=mt;e:do try{if(We!==0&&Ue!==null){var u=Ue,y=na;switch(We){case 8:Go(),o=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(t=!0);var A=We;if(We=0,na=null,wl(e,u,y,A),a&&gl){o=0;break e}break;default:A=We,We=0,na=null,wl(e,u,y,A)}}Dp(),o=mt;break}catch(B){Ef(e,B)}while(!0);return t&&e.shellSuspendCounter++,Ba=Nn=null,Ke=n,C.H=l,C.A=i,Ue===null&&(lt=null,Be=0,Xi()),o}function Dp(){for(;Ue!==null;)Df(Ue)}function Op(e,t){var a=Ke;Ke|=2;var n=Nf(),l=zf();lt!==e||Be!==t?(_s=null,xs=ht()+500,Sl(e,t)):gl=Ca(e,t);e:do try{if(We!==0&&Ue!==null){t=Ue;var i=na;t:switch(We){case 1:We=0,na=null,wl(e,t,i,1);break;case 2:case 9:if(Gu(i)){We=0,na=null,Of(t);break}t=function(){We!==2&&We!==9||lt!==e||(We=7),za(e)},i.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Gu(i)?(We=0,na=null,Of(t)):(We=0,na=null,wl(e,t,i,7));break;case 5:var o=null;switch(Ue.tag){case 26:o=Ue.memoizedState;case 5:case 27:var u=Ue;if(o?bm(o):u.stateNode.complete){We=0,na=null;var y=u.sibling;if(y!==null)Ue=y;else{var A=u.return;A!==null?(Ue=A,Ts(A)):Ue=null}break t}}We=0,na=null,wl(e,t,i,5);break;case 6:We=0,na=null,wl(e,t,i,6);break;case 8:Go(),mt=6;break e;default:throw Error(d(462))}}Mp();break}catch(B){Ef(e,B)}while(!0);return Ba=Nn=null,C.H=n,C.A=l,Ke=a,Ue!==null?0:(lt=null,Be=0,Xi(),mt)}function Mp(){for(;Ue!==null&&!kt();)Df(Ue)}function Df(e){var t=tf(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?Ts(e):Ue=t}function Of(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Kd(a,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=Kd(a,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:ao(t);default:nf(a,t),t=Ue=Nu(t,Ja),t=tf(a,t,Ja)}e.memoizedProps=e.pendingProps,t===null?Ts(e):Ue=t}function wl(e,t,a,n){Ba=Nn=null,ao(t),ul=null,Kl=0;var l=t.return;try{if(xp(e,l,t,a,Be)){mt=1,fs(e,pa(a,e.current)),Ue=null;return}}catch(i){if(l!==null)throw Ue=l,i;mt=1,fs(e,pa(a,e.current)),Ue=null;return}t.flags&32768?(Ge||n===1?e=!0:gl||(Be&536870912)!==0?e=!1:(rn=e=!0,(n===2||n===9||n===3||n===6)&&(n=ta.current,n!==null&&n.tag===13&&(n.flags|=16384))),Mf(t,e)):Ts(t)}function Ts(e){var t=e;do{if((t.flags&32768)!==0){Mf(t,rn);return}e=t.return;var a=kp(t.alternate,t,Ja);if(a!==null){Ue=a;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);mt===0&&(mt=5)}function Mf(e,t){do{var a=Tp(e.alternate,e);if(a!==null){a.flags&=32767,Ue=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=a}while(e!==null);mt=6,Ue=null}function Rf(e,t,a,n,l,i,o,u,y){e.cancelPendingCommit=null;do Cs();while(Tt!==0);if((Ke&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(i=t.lanes|t.childLanes,i|=Ac,P(e,a,i,o,u,y),e===lt&&(Ue=lt=null,Be=0),vl=t,fn=e,Ka=a,Bo=i,Lo=l,jf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Bp(ue,function(){return qf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null,l=Y.p,Y.p=2,o=Ke,Ke|=4;try{Cp(e,t,a)}finally{Ke=o,Y.p=l,C.T=n}}Tt=1,Uf(),Hf(),Bf()}}function Uf(){if(Tt===1){Tt=0;var e=fn,t=vl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null;var n=Y.p;Y.p=2;var l=Ke;Ke|=4;try{yf(t,e);var i=er,o=wu(e.containerInfo),u=i.focusedElem,y=i.selectionRange;if(o!==u&&u&&u.ownerDocument&&Su(u.ownerDocument.documentElement,u)){if(y!==null&&jc(u)){var A=y.start,B=y.end;if(B===void 0&&(B=A),"selectionStart"in u)u.selectionStart=A,u.selectionEnd=Math.min(B,u.value.length);else{var Q=u.ownerDocument||document,z=Q&&Q.defaultView||window;if(z.getSelection){var O=z.getSelection(),fe=u.textContent.length,Te=Math.min(y.start,fe),tt=y.end===void 0?Te:Math.min(y.end,fe);!O.extend&&Te>tt&&(o=tt,tt=Te,Te=o);var _=vu(u,Te),v=vu(u,tt);if(_&&v&&(O.rangeCount!==1||O.anchorNode!==_.node||O.anchorOffset!==_.offset||O.focusNode!==v.node||O.focusOffset!==v.offset)){var E=Q.createRange();E.setStart(_.node,_.offset),O.removeAllRanges(),Te>tt?(O.addRange(E),O.extend(v.node,v.offset)):(E.setEnd(v.node,v.offset),O.addRange(E))}}}}for(Q=[],O=u;O=O.parentNode;)O.nodeType===1&&Q.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<Q.length;u++){var $=Q[u];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Ls=!!Po,er=Po=null}finally{Ke=l,Y.p=n,C.T=a}}e.current=t,Tt=2}}function Hf(){if(Tt===2){Tt=0;var e=fn,t=vl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=C.T,C.T=null;var n=Y.p;Y.p=2;var l=Ke;Ke|=4;try{df(e,t.alternate,t)}finally{Ke=l,Y.p=n,C.T=a}}Tt=3}}function Bf(){if(Tt===4||Tt===3){Tt=0,Ct();var e=fn,t=vl,a=Ka,n=jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,vl=fn=null,Lf(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(dn=null),ze(a),t=t.stateNode,he&&typeof he.onCommitFiberRoot=="function")try{he.onCommitFiberRoot(W,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=C.T,l=Y.p,Y.p=2,C.T=null;try{for(var i=e.onRecoverableError,o=0;o<n.length;o++){var u=n[o];i(u.value,{componentStack:u.stack})}}finally{C.T=t,Y.p=l}}(Ka&3)!==0&&Cs(),za(e),l=e.pendingLanes,(a&261930)!==0&&(l&42)!==0?e===qo?fi++:(fi=0,qo=e):fi=0,mi(0)}}function Lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Vl(t)))}function Cs(){return Uf(),Hf(),Bf(),qf()}function qf(){if(Tt!==5)return!1;var e=fn,t=Bo;Bo=0;var a=ze(Ka),n=C.T,l=Y.p;try{Y.p=32>a?32:a,C.T=null,a=Lo,Lo=null;var i=fn,o=Ka;if(Tt=0,vl=fn=null,Ka=0,(Ke&6)!==0)throw Error(d(331));var u=Ke;if(Ke|=4,wf(i.current),bf(i,i.current,o,a),Ke=u,mi(0,!1),he&&typeof he.onPostCommitFiberRoot=="function")try{he.onPostCommitFiberRoot(W,i)}catch{}return!0}finally{Y.p=l,C.T=n,Lf(e,t)}}function Gf(e,t,a){t=pa(a,t),t=bo(e.stateNode,t,2),e=ln(e,t,2),e!==null&&(L(e,2),za(e))}function Ie(e,t,a){if(e.tag===3)Gf(e,e,a);else for(;t!==null;){if(t.tag===3){Gf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(dn===null||!dn.has(n))){e=pa(a,e),a=Gd(2),n=ln(t,a,2),n!==null&&(Yd(a,n,t,e),L(n,2),za(n));break}}t=t.return}}function $o(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Np;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(a)||(Ro=!0,l.add(a),e=Rp.bind(null,e,t,a),t.then(e,e))}function Rp(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,lt===e&&(Be&a)===a&&(mt===4||mt===3&&(Be&62914560)===Be&&300>ht()-Ss?(Ke&2)===0&&Sl(e,0):Uo|=a,bl===Be&&(bl=0)),za(e)}function Yf(e,t){t===0&&(t=Ol()),e=Cn(e,t),e!==null&&(L(e,t),za(e))}function Up(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Yf(e,a)}function Hp(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(a=l.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(d(314))}n!==null&&n.delete(t),Yf(e,a)}function Bp(e,t){return Ot(e,t)}var Es=null,xl=null,Xo=!1,As=!1,Qo=!1,hn=0;function za(e){e!==xl&&e.next===null&&(xl===null?Es=xl=e:xl=xl.next=e),As=!0,Xo||(Xo=!0,qp())}function mi(e,t){if(!Qo&&As){Qo=!0;do for(var a=!1,n=Es;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var i=0;else{var o=n.suspendedLanes,u=n.pingedLanes;i=(1<<31-ye(42|e)+1)-1,i&=l&~(o&~u),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Zf(n,i))}else i=Be,i=Da(n,n===lt?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Ca(n,i)||(a=!0,Zf(n,i));n=n.next}while(a);Qo=!1}}function Lp(){$f()}function $f(){As=Xo=!1;var e=0;hn!==0&&Fp()&&(e=hn);for(var t=ht(),a=null,n=Es;n!==null;){var l=n.next,i=Xf(n,t);i===0?(n.next=null,a===null?Es=l:a.next=l,l===null&&(xl=a)):(a=n,(e!==0||(i&3)!==0)&&(As=!0)),n=l}Tt!==0&&Tt!==5||mi(e),hn!==0&&(hn=0)}function Xf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-ye(i),u=1<<o,y=l[o];y===-1?((u&a)===0||(u&n)!==0)&&(l[o]=ic(u,t)):y<=t&&(e.expiredLanes|=u),i&=~u}if(t=lt,a=Be,a=Da(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&ka(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ca(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&ka(n),ze(a)){case 2:case 8:a=re;break;case 32:a=ue;break;case 268435456:a=Ee;break;default:a=ue}return n=Qf.bind(null,e),a=Ot(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&ka(n),e.callbackPriority=2,e.callbackNode=null,2}function Qf(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Cs()&&e.callbackNode!==a)return null;var n=Be;return n=Da(e,e===lt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Tf(e,n,t),Xf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Qf.bind(null,e):null)}function Zf(e,t){if(Cs())return null;Tf(e,t,!0)}function qp(){Ip(function(){(Ke&6)!==0?Ot(be,Lp):$f()})}function Zo(){if(hn===0){var e=cl;e===0&&(e=ua,ua<<=1,(ua&261888)===0&&(ua=256)),hn=e}return hn}function Vf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ui(""+e)}function Jf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Gp(e,t,a,n,l){if(t==="submit"&&a&&a.stateNode===l){var i=Vf((l[Xt]||null).action),o=n.submitter;o&&(t=(t=o[Xt]||null)?Vf(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var u=new qi("action","action",null,n,l);e.push({event:u,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(hn!==0){var y=o?Jf(l,o):new FormData(l);fo(a,{pending:!0,data:y,method:l.method,action:i},null,y)}}else typeof i=="function"&&(u.preventDefault(),y=o?Jf(l,o):new FormData(l),fo(a,{pending:!0,data:y,method:l.method,action:i},i,y))},currentTarget:l}]})}}for(var Vo=0;Vo<Ec.length;Vo++){var Jo=Ec[Vo],Yp=Jo.toLowerCase(),$p=Jo[0].toUpperCase()+Jo.slice(1);xa(Yp,"on"+$p)}xa(ju,"onAnimationEnd"),xa(ku,"onAnimationIteration"),xa(Tu,"onAnimationStart"),xa("dblclick","onDoubleClick"),xa("focusin","onFocus"),xa("focusout","onBlur"),xa(ip,"onTransitionRun"),xa(sp,"onTransitionStart"),xa(cp,"onTransitionCancel"),xa(Cu,"onTransitionEnd"),Vn("onMouseEnter",["mouseout","mouseover"]),Vn("onMouseLeave",["mouseout","mouseover"]),Vn("onPointerEnter",["pointerout","pointerover"]),Vn("onPointerLeave",["pointerout","pointerover"]),_n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_n("onBeforeInput",["compositionend","keypress","textInput","paste"]),_n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="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(" "),Xp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hi));function Kf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],l=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var u=n[o],y=u.instance,A=u.currentTarget;if(u=u.listener,y!==i&&l.isPropagationStopped())break e;i=u,l.currentTarget=A;try{i(l)}catch(B){$i(B)}l.currentTarget=null,i=y}else for(o=0;o<n.length;o++){if(u=n[o],y=u.instance,A=u.currentTarget,u=u.listener,y!==i&&l.isPropagationStopped())break e;i=u,l.currentTarget=A;try{i(l)}catch(B){$i(B)}l.currentTarget=null,i=y}}}}function He(e,t){var a=t[sc];a===void 0&&(a=t[sc]=new Set);var n=e+"__bubble";a.has(n)||(Ff(t,e,2,!1),a.add(n))}function Ko(e,t,a){var n=0;t&&(n|=4),Ff(a,e,n,t)}var Ns="_reactListening"+Math.random().toString(36).slice(2);function Fo(e){if(!e[Ns]){e[Ns]=!0,Yr.forEach(function(a){a!=="selectionchange"&&(Xp.has(a)||Ko(a,!1,e),Ko(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ns]||(t[Ns]=!0,Ko("selectionchange",!1,t))}}function Ff(e,t,a,n){switch(km(t)){case 2:var l=by;break;case 8:l=vy;break;default:l=dr}a=l.bind(null,t,a,e),l=void 0,!pc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,a,{capture:!0,passive:l}):e.addEventListener(t,a,!0):l!==void 0?e.addEventListener(t,a,{passive:l}):e.addEventListener(t,a,!1)}function Wo(e,t,a,n,l){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var u=n.stateNode.containerInfo;if(u===l)break;if(o===4)for(o=n.return;o!==null;){var y=o.tag;if((y===3||y===4)&&o.stateNode.containerInfo===l)return;o=o.return}for(;u!==null;){if(o=Xn(u),o===null)return;if(y=o.tag,y===5||y===6||y===26||y===27){n=i=o;continue e}u=u.parentNode}}n=n.return}eu(function(){var A=i,B=mc(a),Q=[];e:{var z=Eu.get(e);if(z!==void 0){var O=qi,fe=e;switch(e){case"keypress":if(Bi(a)===0)break e;case"keydown":case"keyup":O=Hh;break;case"focusin":fe="focus",O=vc;break;case"focusout":fe="blur",O=vc;break;case"beforeblur":case"afterblur":O=vc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=qh;break;case ju:case ku:case Tu:O=Eh;break;case Cu:O=Yh;break;case"scroll":case"scrollend":O=_h;break;case"wheel":O=Xh;break;case"copy":case"cut":case"paste":O=Nh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=iu;break;case"toggle":case"beforetoggle":O=Zh}var Te=(t&4)!==0,tt=!Te&&(e==="scroll"||e==="scrollend"),_=Te?z!==null?z+"Capture":null:z;Te=[];for(var v=A,E;v!==null;){var $=v;if(E=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||E===null||_===null||($=Ul(v,_),$!=null&&Te.push(pi(v,$,E))),tt)break;v=v.return}0<Te.length&&(z=new O(z,fe,null,a,B),Q.push({event:z,listeners:Te}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",z&&a!==fc&&(fe=a.relatedTarget||a.fromElement)&&(Xn(fe)||fe[$n]))break e;if((O||z)&&(z=B.window===B?B:(z=B.ownerDocument)?z.defaultView||z.parentWindow:window,O?(fe=a.relatedTarget||a.toElement,O=A,fe=fe?Xn(fe):null,fe!==null&&(tt=w(fe),Te=fe.tag,fe!==tt||Te!==5&&Te!==27&&Te!==6)&&(fe=null)):(O=null,fe=A),O!==fe)){if(Te=nu,$="onMouseLeave",_="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(Te=iu,$="onPointerLeave",_="onPointerEnter",v="pointer"),tt=O==null?z:Rl(O),E=fe==null?z:Rl(fe),z=new Te($,v+"leave",O,a,B),z.target=tt,z.relatedTarget=E,$=null,Xn(B)===A&&(Te=new Te(_,v+"enter",fe,a,B),Te.target=E,Te.relatedTarget=tt,$=Te),tt=$,O&&fe)t:{for(Te=Qp,_=O,v=fe,E=0,$=_;$;$=Te($))E++;$=0;for(var xe=v;xe;xe=Te(xe))$++;for(;0<E-$;)_=Te(_),E--;for(;0<$-E;)v=Te(v),$--;for(;E--;){if(_===v||v!==null&&_===v.alternate){Te=_;break t}_=Te(_),v=Te(v)}Te=null}else Te=null;O!==null&&Wf(Q,z,O,Te,!1),fe!==null&&tt!==null&&Wf(Q,tt,fe,Te,!0)}}e:{if(z=A?Rl(A):window,O=z.nodeName&&z.nodeName.toLowerCase(),O==="select"||O==="input"&&z.type==="file")var Ze=mu;else if(du(z))if(hu)Ze=ap;else{Ze=ep;var ve=Ph}else O=z.nodeName,!O||O.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?A&&dc(A.elementType)&&(Ze=mu):Ze=tp;if(Ze&&(Ze=Ze(e,A))){fu(Q,Ze,a,B);break e}ve&&ve(e,z,A),e==="focusout"&&A&&z.type==="number"&&A.memoizedProps.value!=null&&uc(z,"number",z.value)}switch(ve=A?Rl(A):window,e){case"focusin":(du(ve)||ve.contentEditable==="true")&&(Pn=ve,kc=A,Xl=null);break;case"focusout":Xl=kc=Pn=null;break;case"mousedown":Tc=!0;break;case"contextmenu":case"mouseup":case"dragend":Tc=!1,xu(Q,a,B);break;case"selectionchange":if(lp)break;case"keydown":case"keyup":xu(Q,a,B)}var Oe;if(wc)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else In?ru(e,a)&&(Le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Le="onCompositionStart");Le&&(su&&a.locale!=="ko"&&(In||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&In&&(Oe=tu()):(Wa=B,yc="value"in Wa?Wa.value:Wa.textContent,In=!0)),ve=zs(A,Le),0<ve.length&&(Le=new lu(Le,e,null,a,B),Q.push({event:Le,listeners:ve}),Oe?Le.data=Oe:(Oe=uu(a),Oe!==null&&(Le.data=Oe)))),(Oe=Jh?Kh(e,a):Fh(e,a))&&(Le=zs(A,"onBeforeInput"),0<Le.length&&(ve=new lu("onBeforeInput","beforeinput",null,a,B),Q.push({event:ve,listeners:Le}),ve.data=Oe)),Gp(Q,e,A,a,B)}Kf(Q,t)})}function pi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function zs(e,t){for(var a=t+"Capture",n=[];e!==null;){var l=e,i=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||i===null||(l=Ul(e,a),l!=null&&n.unshift(pi(e,l,i)),l=Ul(e,t),l!=null&&n.push(pi(e,l,i))),e.tag===3)return n;e=e.return}return[]}function Qp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wf(e,t,a,n,l){for(var i=t._reactName,o=[];a!==null&&a!==n;){var u=a,y=u.alternate,A=u.stateNode;if(u=u.tag,y!==null&&y===n)break;u!==5&&u!==26&&u!==27||A===null||(y=A,l?(A=Ul(a,i),A!=null&&o.unshift(pi(a,A,y))):l||(A=Ul(a,i),A!=null&&o.push(pi(a,A,y)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var Zp=/\r\n?/g,Vp=/\u0000|\uFFFD/g;function If(e){return(typeof e=="string"?e:""+e).replace(Zp,`
|
|
49
|
+
`).replace(Vp,"")}function Pf(e,t){return t=If(t),If(e)===t}function et(e,t,a,n,l,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Kn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Kn(e,""+n);break;case"className":Mi(e,"class",n);break;case"tabIndex":Mi(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(e,a,n);break;case"style":Ir(e,n,i);break;case"data":if(t!=="object"){Mi(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ui(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 i=="function"&&(a==="formAction"?(t!=="input"&&et(e,t,"name",l.name,l,null),et(e,t,"formEncType",l.formEncType,l,null),et(e,t,"formMethod",l.formMethod,l,null),et(e,t,"formTarget",l.formTarget,l,null)):(et(e,t,"encType",l.encType,l,null),et(e,t,"method",l.method,l,null),et(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ui(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Ma);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(d(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Ui(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":He("beforetoggle",e),He("toggle",e),Oi(e,"popover",n);break;case"xlinkActuate":Oa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Oa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Oa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Oa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Oa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Oa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Oa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Oa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Oa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Oi(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=wh.get(a)||a,Oi(e,a,n))}}function Io(e,t,a,n,l,i){switch(a){case"style":Ir(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(d(61));if(a=n.__html,a!=null){if(l.children!=null)throw Error(d(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Kn(e,n):(typeof n=="number"||typeof n=="bigint")&&Kn(e,""+n);break;case"onScroll":n!=null&&He("scroll",e);break;case"onScrollEnd":n!=null&&He("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$r.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(l=a.endsWith("Capture"),t=a.slice(2,l?a.length-7:void 0),i=e[Xt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,l),typeof n=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,l);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Oi(e,a,n)}}}function Bt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var n=!1,l=!1,i;for(i in a)if(a.hasOwnProperty(i)){var o=a[i];if(o!=null)switch(i){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:et(e,t,i,o,a,null)}}l&&et(e,t,"srcSet",a.srcSet,a,null),n&&et(e,t,"src",a.src,a,null);return;case"input":He("invalid",e);var u=i=o=l=null,y=null,A=null;for(n in a)if(a.hasOwnProperty(n)){var B=a[n];if(B!=null)switch(n){case"name":l=B;break;case"type":o=B;break;case"checked":y=B;break;case"defaultChecked":A=B;break;case"value":i=B;break;case"defaultValue":u=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(d(137,t));break;default:et(e,t,n,B,a,null)}}Jr(e,i,u,y,A,o,l,!1);return;case"select":He("invalid",e),n=o=i=null;for(l in a)if(a.hasOwnProperty(l)&&(u=a[l],u!=null))switch(l){case"value":i=u;break;case"defaultValue":o=u;break;case"multiple":n=u;default:et(e,t,l,u,a,null)}t=i,a=o,e.multiple=!!n,t!=null?Jn(e,!!n,t,!1):a!=null&&Jn(e,!!n,a,!0);return;case"textarea":He("invalid",e),i=l=n=null;for(o in a)if(a.hasOwnProperty(o)&&(u=a[o],u!=null))switch(o){case"value":n=u;break;case"defaultValue":l=u;break;case"children":i=u;break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(d(91));break;default:et(e,t,o,u,a,null)}Fr(e,n,l,i);return;case"option":for(y in a)if(a.hasOwnProperty(y)&&(n=a[y],n!=null))switch(y){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:et(e,t,y,n,a,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(n=0;n<hi.length;n++)He(hi[n],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in a)if(a.hasOwnProperty(A)&&(n=a[A],n!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:et(e,t,A,n,a,null)}return;default:if(dc(t)){for(B in a)a.hasOwnProperty(B)&&(n=a[B],n!==void 0&&Io(e,t,B,n,a,void 0));return}}for(u in a)a.hasOwnProperty(u)&&(n=a[u],n!=null&&et(e,t,u,n,a,null))}function Jp(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,i=null,o=null,u=null,y=null,A=null,B=null;for(O in a){var Q=a[O];if(a.hasOwnProperty(O)&&Q!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":y=Q;default:n.hasOwnProperty(O)||et(e,t,O,null,n,Q)}}for(var z in n){var O=n[z];if(Q=a[z],n.hasOwnProperty(z)&&(O!=null||Q!=null))switch(z){case"type":i=O;break;case"name":l=O;break;case"checked":A=O;break;case"defaultChecked":B=O;break;case"value":o=O;break;case"defaultValue":u=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(d(137,t));break;default:O!==Q&&et(e,t,z,O,n,Q)}}rc(e,o,u,y,A,B,i,l);return;case"select":O=o=u=z=null;for(i in a)if(y=a[i],a.hasOwnProperty(i)&&y!=null)switch(i){case"value":break;case"multiple":O=y;default:n.hasOwnProperty(i)||et(e,t,i,null,n,y)}for(l in n)if(i=n[l],y=a[l],n.hasOwnProperty(l)&&(i!=null||y!=null))switch(l){case"value":z=i;break;case"defaultValue":u=i;break;case"multiple":o=i;default:i!==y&&et(e,t,l,i,n,y)}t=u,a=o,n=O,z!=null?Jn(e,!!a,z,!1):!!n!=!!a&&(t!=null?Jn(e,!!a,t,!0):Jn(e,!!a,a?[]:"",!1));return;case"textarea":O=z=null;for(u in a)if(l=a[u],a.hasOwnProperty(u)&&l!=null&&!n.hasOwnProperty(u))switch(u){case"value":break;case"children":break;default:et(e,t,u,null,n,l)}for(o in n)if(l=n[o],i=a[o],n.hasOwnProperty(o)&&(l!=null||i!=null))switch(o){case"value":z=l;break;case"defaultValue":O=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(d(91));break;default:l!==i&&et(e,t,o,l,n,i)}Kr(e,z,O);return;case"option":for(var fe in a)if(z=a[fe],a.hasOwnProperty(fe)&&z!=null&&!n.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:et(e,t,fe,null,n,z)}for(y in n)if(z=n[y],O=a[y],n.hasOwnProperty(y)&&z!==O&&(z!=null||O!=null))switch(y){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:et(e,t,y,z,n,O)}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 Te in a)z=a[Te],a.hasOwnProperty(Te)&&z!=null&&!n.hasOwnProperty(Te)&&et(e,t,Te,null,n,z);for(A in n)if(z=n[A],O=a[A],n.hasOwnProperty(A)&&z!==O&&(z!=null||O!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(d(137,t));break;default:et(e,t,A,z,n,O)}return;default:if(dc(t)){for(var tt in a)z=a[tt],a.hasOwnProperty(tt)&&z!==void 0&&!n.hasOwnProperty(tt)&&Io(e,t,tt,void 0,n,z);for(B in n)z=n[B],O=a[B],!n.hasOwnProperty(B)||z===O||z===void 0&&O===void 0||Io(e,t,B,z,n,O);return}}for(var _ in a)z=a[_],a.hasOwnProperty(_)&&z!=null&&!n.hasOwnProperty(_)&&et(e,t,_,null,n,z);for(Q in n)z=n[Q],O=a[Q],!n.hasOwnProperty(Q)||z===O||z==null&&O==null||et(e,t,Q,z,n,O)}function em(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var l=a[n],i=l.transferSize,o=l.initiatorType,u=l.duration;if(i&&u&&em(o)){for(o=0,u=l.responseEnd,n+=1;n<a.length;n++){var y=a[n],A=y.startTime;if(A>u)break;var B=y.transferSize,Q=y.initiatorType;B&&em(Q)&&(y=y.responseEnd,o+=B*(y<u?1:(u-A)/(y-A)))}if(--n,t+=8*(i+o)/(l.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Po=null,er=null;function Ds(e){return e.nodeType===9?e:e.ownerDocument}function tm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function am(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function tr(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ar=null;function Fp(){var e=window.event;return e&&e.type==="popstate"?e===ar?!1:(ar=e,!0):(ar=null,!1)}var nm=typeof setTimeout=="function"?setTimeout:void 0,Wp=typeof clearTimeout=="function"?clearTimeout:void 0,lm=typeof Promise=="function"?Promise:void 0,Ip=typeof queueMicrotask=="function"?queueMicrotask:typeof lm<"u"?function(e){return lm.resolve(null).then(e).catch(Pp)}:nm;function Pp(e){setTimeout(function(){throw e})}function pn(e){return e==="head"}function im(e,t){var a=t,n=0;do{var l=a.nextSibling;if(e.removeChild(a),l&&l.nodeType===8)if(a=l.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(l),Tl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")yi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,yi(a);for(var i=a.firstChild;i;){var o=i.nextSibling,u=i.nodeName;i[Ml]||u==="SCRIPT"||u==="STYLE"||u==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&yi(e.ownerDocument.body);a=l}while(a);Tl(t)}function sm(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function nr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":nr(a),cc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function ey(e,t,a,n){for(;e.nodeType===1;){var l=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ml])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Sa(e.nextSibling),e===null)break}return null}function ty(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Sa(e.nextSibling),e===null))return null;return e}function cm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Sa(e.nextSibling),e===null))return null;return e}function lr(e){return e.data==="$?"||e.data==="$~"}function ir(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ay(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Sa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var sr=null;function om(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Sa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function rm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function um(e,t,a){switch(t=Ds(a),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function yi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cc(e)}var wa=new Map,dm=new Set;function Os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Fa=Y.d;Y.d={f:ny,r:ly,D:iy,C:sy,L:cy,m:oy,X:uy,S:ry,M:dy};function ny(){var e=Fa.f(),t=js();return e||t}function ly(e){var t=Qn(e);t!==null&&t.tag===5&&t.type==="form"?Cd(t):Fa.r(e)}var _l=typeof document>"u"?null:document;function fm(e,t,a){var n=_l;if(n&&typeof t=="string"&&t){var l=ma(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof a=="string"&&(l+='[crossorigin="'+a+'"]'),dm.has(l)||(dm.add(l),e={rel:e,crossOrigin:a,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),Bt(t,"link",e),Nt(t),n.head.appendChild(t)))}}function iy(e){Fa.D(e),fm("dns-prefetch",e,null)}function sy(e,t){Fa.C(e,t),fm("preconnect",e,t)}function cy(e,t,a){Fa.L(e,t,a);var n=_l;if(n&&e&&t){var l='link[rel="preload"][as="'+ma(t)+'"]';t==="image"&&a&&a.imageSrcSet?(l+='[imagesrcset="'+ma(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(l+='[imagesizes="'+ma(a.imageSizes)+'"]')):l+='[href="'+ma(e)+'"]';var i=l;switch(t){case"style":i=jl(e);break;case"script":i=kl(e)}wa.has(i)||(e=T({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),wa.set(i,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(gi(i))||t==="script"&&n.querySelector(bi(i))||(t=n.createElement("link"),Bt(t,"link",e),Nt(t),n.head.appendChild(t)))}}function oy(e,t){Fa.m(e,t);var a=_l;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+ma(n)+'"][href="'+ma(e)+'"]',i=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=kl(e)}if(!wa.has(i)&&(e=T({rel:"modulepreload",href:e},t),wa.set(i,e),a.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bi(i)))return}n=a.createElement("link"),Bt(n,"link",e),Nt(n),a.head.appendChild(n)}}}function ry(e,t,a){Fa.S(e,t,a);var n=_l;if(n&&e){var l=Zn(n).hoistableStyles,i=jl(e);t=t||"default";var o=l.get(i);if(!o){var u={loading:0,preload:null};if(o=n.querySelector(gi(i)))u.loading=5;else{e=T({rel:"stylesheet",href:e,"data-precedence":t},a),(a=wa.get(i))&&cr(e,a);var y=o=n.createElement("link");Nt(y),Bt(y,"link",e),y._p=new Promise(function(A,B){y.onload=A,y.onerror=B}),y.addEventListener("load",function(){u.loading|=1}),y.addEventListener("error",function(){u.loading|=2}),u.loading|=4,Ms(o,t,n)}o={type:"stylesheet",instance:o,count:1,state:u},l.set(i,o)}}}function uy(e,t){Fa.X(e,t);var a=_l;if(a&&e){var n=Zn(a).hoistableScripts,l=kl(e),i=n.get(l);i||(i=a.querySelector(bi(l)),i||(e=T({src:e,async:!0},t),(t=wa.get(l))&&or(e,t),i=a.createElement("script"),Nt(i),Bt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(l,i))}}function dy(e,t){Fa.M(e,t);var a=_l;if(a&&e){var n=Zn(a).hoistableScripts,l=kl(e),i=n.get(l);i||(i=a.querySelector(bi(l)),i||(e=T({src:e,async:!0,type:"module"},t),(t=wa.get(l))&&or(e,t),i=a.createElement("script"),Nt(i),Bt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(l,i))}}function mm(e,t,a,n){var l=(l=ge.current)?Os(l):null;if(!l)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=jl(a.href),a=Zn(l).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=jl(a.href);var i=Zn(l).hoistableStyles,o=i.get(e);if(o||(l=l.ownerDocument||l,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=l.querySelector(gi(e)))&&!i._p&&(o.instance=i,o.state.loading=5),wa.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},wa.set(e,a),i||fy(l,e,a,o.state))),t&&n===null)throw Error(d(528,""));return o}if(t&&n!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kl(a),a=Zn(l).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function jl(e){return'href="'+ma(e)+'"'}function gi(e){return'link[rel="stylesheet"]['+e+"]"}function hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function fy(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Bt(t,"link",a),Nt(t),e.head.appendChild(t))}function kl(e){return'[src="'+ma(e)+'"]'}function bi(e){return"script[async]"+e}function pm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ma(a.href)+'"]');if(n)return t.instance=n,Nt(n),n;var l=T({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Nt(n),Bt(n,"style",l),Ms(n,a.precedence,e),t.instance=n;case"stylesheet":l=jl(a.href);var i=e.querySelector(gi(l));if(i)return t.state.loading|=4,t.instance=i,Nt(i),i;n=hm(a),(l=wa.get(l))&&cr(n,l),i=(e.ownerDocument||e).createElement("link"),Nt(i);var o=i;return o._p=new Promise(function(u,y){o.onload=u,o.onerror=y}),Bt(i,"link",n),t.state.loading|=4,Ms(i,a.precedence,e),t.instance=i;case"script":return i=kl(a.src),(l=e.querySelector(bi(i)))?(t.instance=l,Nt(l),l):(n=a,(l=wa.get(i))&&(n=T({},a),or(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),Nt(l),Bt(l,"link",n),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ms(n,a.precedence,e));return t.instance}function Ms(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,i=l,o=0;o<n.length;o++){var u=n[o];if(u.dataset.precedence===t)i=u;else if(i!==l)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function cr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function or(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Rs=null;function ym(e,t,a){if(Rs===null){var n=new Map,l=Rs=new Map;l.set(a,n)}else l=Rs,n=l.get(a),n||(n=new Map,l.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),l=0;l<a.length;l++){var i=a[l];if(!(i[Ml]||i[Mt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var u=n.get(o);u?u.push(i):n.set(o,[i])}}return n}function gm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function my(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function bm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hy(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var l=jl(n.href),i=t.querySelector(gi(l));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Us.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Nt(i);return}i=t.ownerDocument||t,n=hm(n),(l=wa.get(l))&&cr(n,l),i=i.createElement("link"),Nt(i);var o=i;o._p=new Promise(function(u,y){o.onload=u,o.onerror=y}),Bt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Us.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var rr=0;function py(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&rr===0&&(rr=62500*Kp());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>rr?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function Us(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,t.forEach(yy,e),Hs=null,Us.call(e))}function yy(e,t){if(!(t.state.loading&4)){var a=Hs.get(e);if(a)var n=a.get(null);else{a=new Map,Hs.set(e,a);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<l.length;i++){var o=l[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),n=o)}n&&a.set(null,n)}l=t.instance,o=l.getAttribute("data-precedence"),i=a.get(o)||n,i===n&&a.set(null,l),a.set(o,l),this.count++,n=Us.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),i?i.parentNode.insertBefore(l,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var vi={$$typeof:le,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function gy(e,t,a,n,l,i,o,u,y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.hiddenUpdates=da(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=y,this.incompleteTransitions=new Map}function vm(e,t,a,n,l,i,o,u,y,A,B,Q){return e=new gy(e,t,a,o,y,A,B,Q,u),t=1,i===!0&&(t|=24),i=ea(3,null,null,t),e.current=i,i.stateNode=e,t=Gc(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},Qc(i),e}function Sm(e){return e?(e=al,e):al}function wm(e,t,a,n,l,i){l=Sm(l),n.context===null?n.context=l:n.pendingContext=l,n=nn(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=ln(e,n,t),a!==null&&(Ft(a,e,t),Wl(a,e,t))}function xm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function ur(e,t){xm(e,t),(e=e.alternate)&&xm(e,t)}function _m(e){if(e.tag===13||e.tag===31){var t=Cn(e,67108864);t!==null&&Ft(t,e,67108864),ur(e,67108864)}}function jm(e){if(e.tag===13||e.tag===31){var t=ia();t=Je(t);var a=Cn(e,t);a!==null&&Ft(a,e,t),ur(e,t)}}var Ls=!0;function by(e,t,a,n){var l=C.T;C.T=null;var i=Y.p;try{Y.p=2,dr(e,t,a,n)}finally{Y.p=i,C.T=l}}function vy(e,t,a,n){var l=C.T;C.T=null;var i=Y.p;try{Y.p=8,dr(e,t,a,n)}finally{Y.p=i,C.T=l}}function dr(e,t,a,n){if(Ls){var l=fr(n);if(l===null)Wo(e,t,n,qs,a),Tm(e,n);else if(wy(l,e,t,a,n))n.stopPropagation();else if(Tm(e,n),t&4&&-1<Sy.indexOf(e)){for(;l!==null;){var i=Qn(l);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=pt(i.pendingLanes);if(o!==0){var u=i;for(u.pendingLanes|=2,u.entangledLanes|=2;o;){var y=1<<31-ye(o);u.entanglements[1]|=y,o&=~y}za(i),(Ke&6)===0&&(xs=ht()+500,mi(0))}}break;case 31:case 13:u=Cn(i,2),u!==null&&Ft(u,i,2),js(),ur(i,2)}if(i=fr(n),i===null&&Wo(e,t,n,qs,a),i===l)break;l=i}l!==null&&n.stopPropagation()}else Wo(e,t,n,null,a)}}function fr(e){return e=mc(e),mr(e)}var qs=null;function mr(e){if(qs=null,e=Xn(e),e!==null){var t=w(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=b(t),e!==null)return e;e=null}else if(a===31){if(e=M(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qs=e,null}function km(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(G()){case be:return 2;case re:return 8;case ue:case Re:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var hr=!1,yn=null,gn=null,bn=null,Si=new Map,wi=new Map,vn=[],Sy="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 Tm(e,t){switch(e){case"focusin":case"focusout":yn=null;break;case"dragenter":case"dragleave":gn=null;break;case"mouseover":case"mouseout":bn=null;break;case"pointerover":case"pointerout":Si.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wi.delete(t.pointerId)}}function xi(e,t,a,n,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[l]},t!==null&&(t=Qn(t),t!==null&&_m(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function wy(e,t,a,n,l){switch(t){case"focusin":return yn=xi(yn,e,t,a,n,l),!0;case"dragenter":return gn=xi(gn,e,t,a,n,l),!0;case"mouseover":return bn=xi(bn,e,t,a,n,l),!0;case"pointerover":var i=l.pointerId;return Si.set(i,xi(Si.get(i)||null,e,t,a,n,l)),!0;case"gotpointercapture":return i=l.pointerId,wi.set(i,xi(wi.get(i)||null,e,t,a,n,l)),!0}return!1}function Cm(e){var t=Xn(e.target);if(t!==null){var a=w(t);if(a!==null){if(t=a.tag,t===13){if(t=b(a),t!==null){e.blockedOn=t,At(e.priority,function(){jm(a)});return}}else if(t===31){if(t=M(a),t!==null){e.blockedOn=t,At(e.priority,function(){jm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=fr(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);fc=n,a.target.dispatchEvent(n),fc=null}else return t=Qn(a),t!==null&&_m(t),e.blockedOn=a,!1;t.shift()}return!0}function Em(e,t,a){Gs(e)&&a.delete(t)}function xy(){hr=!1,yn!==null&&Gs(yn)&&(yn=null),gn!==null&&Gs(gn)&&(gn=null),bn!==null&&Gs(bn)&&(bn=null),Si.forEach(Em),wi.forEach(Em)}function Ys(e,t){e.blockedOn===t&&(e.blockedOn=null,hr||(hr=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,xy)))}var $s=null;function Am(e){$s!==e&&($s=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){$s===e&&($s=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(mr(n||a)===null)continue;break}var i=Qn(a);i!==null&&(e.splice(t,3),t-=3,fo(i,{pending:!0,data:l,method:a.method,action:n},n,l))}}))}function Tl(e){function t(y){return Ys(y,e)}yn!==null&&Ys(yn,e),gn!==null&&Ys(gn,e),bn!==null&&Ys(bn,e),Si.forEach(t),wi.forEach(t);for(var a=0;a<vn.length;a++){var n=vn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<vn.length&&(a=vn[0],a.blockedOn===null);)Cm(a),a.blockedOn===null&&vn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var l=a[n],i=a[n+1],o=l[Xt]||null;if(typeof i=="function")o||Am(a);else if(o){var u=null;if(i&&i.hasAttribute("formAction")){if(l=i,o=i[Xt]||null)u=o.formAction;else if(mr(l)!==null)continue}else u=o.action;typeof u=="function"?a[n+1]=u:(a.splice(n,3),n-=3),Am(a)}}}function Nm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return l=o})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function pr(e){this._internalRoot=e}Xs.prototype.render=pr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var a=t.current,n=ia();wm(a,n,e,t,null,null)},Xs.prototype.unmount=pr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wm(e.current,2,null,e,null,null),js(),t[$n]=null}};function Xs(e){this._internalRoot=e}Xs.prototype.unstable_scheduleHydration=function(e){if(e){var t=It();e={blockedOn:null,target:e,priority:t};for(var a=0;a<vn.length&&t!==0&&t<vn[a].priority;a++);vn.splice(a,0,e),a===0&&Cm(e)}};var zm=f.version;if(zm!=="19.2.6")throw Error(d(527,zm,"19.2.6"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=p(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var _y={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qs.isDisabled&&Qs.supportsFiber)try{W=Qs.inject(_y),he=Qs}catch{}}return ji.createRoot=function(e,t){if(!S(e))throw Error(d(299));var a=!1,n="",l=Hd,i=Bd,o=Ld;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=vm(e,1,!1,null,null,a,n,null,l,i,o,Nm),e[$n]=t.current,Fo(e),new pr(t)},ji.hydrateRoot=function(e,t,a){if(!S(e))throw Error(d(299));var n=!1,l="",i=Hd,o=Bd,u=Ld,y=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(u=a.onRecoverableError),a.formState!==void 0&&(y=a.formState)),t=vm(e,1,!0,t,a??null,n,l,y,i,o,u,Nm),t.context=Sm(null),a=t.current,n=ia(),n=Je(n),l=nn(n),l.callback=null,ln(a,l,n),a=n,t.current.lanes=a,L(t,a),za(t),e[$n]=t.current,Fo(e),new Xs(t)},ji.version="19.2.6",ji}var Gm;function Dy(){if(Gm)return gr.exports;Gm=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(f){console.error(f)}}return c(),gr.exports=zy(),gr.exports}var Oy=Dy(),g=Hr(),sa=sh();const ch="0.2";function My(c){let f=Ym[c]||Ym.en;for(const h of[`
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
> **实施备注`,`
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
> **Implementation notes`]){const d=f.indexOf(h);d!==-1&&(f=f.slice(0,d))}return f=f.replace(/\n>\s*(首次启动展示|Shown on first launch)[\s\S]*?\n---\n/,`
|
|
56
|
+
|
|
57
|
+
`),f=f.replace(/\n##\s*(一眼看懂|At a glance)[\s\S]*?\n---\n/,`
|
|
58
|
+
`),f.trim()}const Ym={"zh-CN":`# CiCy Desktop 用户协议与授权说明
|
|
59
|
+
|
|
60
|
+
> 首次启动展示 · 草案 v0.2 · 2026-06-07
|
|
61
|
+
> **本协议为使用本软件的前提:你必须阅读并点击"同意并继续"后,方可使用 CiCy Desktop。**
|
|
62
|
+
> (内部草案,非最终法律文本;正式发布前须经中、欧两地持牌律师审定。本文同时作为应用内首启条款的内容源。)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 一眼看懂(你点"同意"即代表接受以下要点)
|
|
67
|
+
|
|
68
|
+
1. **CiCy Desktop 是在你自己电脑上运行的 AI Agent 编排工具**,帮你调度第三方 AI 助手(Claude Code、Codex、Gemini 等)完成工作。
|
|
69
|
+
2. **第三方 AI 与账号是你和对应厂商之间的事**:用哪个 AI、用谁的账号、产生的用量与费用,由你决定并承担,与 CiCy 无关。
|
|
70
|
+
3. **为完成工作,本软件需要一系列对你电脑的授权**(运行程序、执行脚本、控制浏览器、访问文件等)。下面第 3 条逐项讲清,**你对经本软件发起的操作负全部责任**。
|
|
71
|
+
4. **你的数据默认留在本机**,CiCy 不以运营为目的上传你的工作内容。
|
|
72
|
+
5. **两项高风险能力需要你单独、额外授权**,默认关闭:**(a) HTTPS 流量本地审计(需装证书、需管理员)**、**(b) 本机命令/脚本执行**。整体同意本协议**不等于**开启它们。
|
|
73
|
+
6. **严禁**用本软件控制未授权设备、违法多账号/刷量、绕过平台风控、违规抓取等。
|
|
74
|
+
|
|
75
|
+
> 不接受以上任一条,请点击"不同意并退出"。**未同意则无法使用本软件。**
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 1. 关于 CiCy Desktop
|
|
80
|
+
|
|
81
|
+
1.1 CiCy Desktop(下称"本软件")是一款在你本地设备运行的 AI Agent 编排与自动化工具,用于组织、调度第三方 AI 命令行/客户端(如 Claude Code、OpenAI Codex、Google Gemini CLI 等,下称"第三方 Agent")协同完成任务。
|
|
82
|
+
|
|
83
|
+
1.2 本软件本身**不提供大模型推理服务**,也不内置任何用于规避地域限制的跨境网络通道。模型能力由你选择的后端提供。
|
|
84
|
+
|
|
85
|
+
## 2. 第三方 Agent 与账号(免责)
|
|
86
|
+
|
|
87
|
+
2.1 你可在本软件中接入第三方 Agent。**你与第三方 Agent 及其模型/服务提供商之间的关系(账号注册、登录、授权、用量、计费、合规)由你与该提供商直接建立并承担,与 CiCy 无关。**
|
|
88
|
+
|
|
89
|
+
2.2 **官方登录责任自负**:若你以第三方提供商的官方账号登录其 Agent,该行为及其后果(包括是否符合该提供商所在地与你所在地的可用性政策)由你自行负责。CiCy 不引导、不代理、不内置任何专用于规避地域限制的网络通道。
|
|
90
|
+
|
|
91
|
+
2.3 你须遵守你所接入的每一个第三方 Agent 与模型服务的用户协议与使用政策。
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 3. 授权说明(本软件需要你授予的权限)
|
|
96
|
+
|
|
97
|
+
> 为让 AI Agent 替你完成工作,本软件需要下列对你设备的授权。我们按风险高低分为三类,并说明每项的**用途、作用范围、风险、能否撤销**。**透明披露是本协议的核心。**
|
|
98
|
+
|
|
99
|
+
### 3A. 基础授权(同意本协议即授予,为软件运行所必需)
|
|
100
|
+
|
|
101
|
+
| 授权 | 用途 | 范围与限制 | 可否撤销 |
|
|
102
|
+
|---|---|---|---|
|
|
103
|
+
| **本地文件读写** | 读写工作区、配置、任务历史 | 限于本软件工作目录及你在任务中明确指向的文件 | 卸载软件即终止 |
|
|
104
|
+
| **运行第三方 Agent** | 在你电脑上启动 claude/codex/gemini 等子进程 | 仅运行你已接入的 Agent | 移除对应 Agent |
|
|
105
|
+
| **本地数据存储** | 保存审计/历史/配置于本机 | 数据留本机,不上传 | 可在设置清除 |
|
|
106
|
+
| **读取系统与窗口信息** | 调度、展示运行状态 | OS/硬件概要、窗口列表;不含文件内容 | 卸载即终止 |
|
|
107
|
+
| **本机网络访问** | 代表你向你选择的模型后端/服务发起请求 | 按你的配置出网;不内置规避地域限制的通道 | 可在设置关闭联网功能 |
|
|
108
|
+
|
|
109
|
+
### 3B. 高风险授权(默认关闭,需你**单独、额外**同意后才启用)
|
|
110
|
+
|
|
111
|
+
> 整体同意本协议**不会**自动开启以下任何一项。每项都需要你在应用内单独操作开启,并可随时关闭。
|
|
112
|
+
|
|
113
|
+
**① 本机命令与脚本执行**
|
|
114
|
+
- **用途**:让 AI Agent 能在你电脑上执行 shell / Python / Node 脚本,以完成自动化任务。
|
|
115
|
+
- **风险(请认真阅读)**:这等同于授予程序在你电脑上**运行代码的能力**。请仅在你信任的任务场景启用。
|
|
116
|
+
- **门控与保护**:仅作用于**本机**;全部执行写入本地审计留痕;对高危命令可设二次确认。
|
|
117
|
+
- **撤销**:可在设置中关闭执行能力。
|
|
118
|
+
|
|
119
|
+
**② 远程编排配对**
|
|
120
|
+
- **用途**:允许你**显式配对**的编排端(可能运行在云端或另一台设备)通过安全信道驱动本机 Agent,实现远程协作调度。
|
|
121
|
+
- **风险**:配对后,远程编排端可触发上述本机能力。
|
|
122
|
+
- **门控与保护**:**仅连接你显式配对、授权令牌可随时吊销**的编排端;绝不静默安装、绝不自我传播;你可解除配对立即断开。
|
|
123
|
+
- **撤销**:解除配对 / 吊销令牌。
|
|
124
|
+
|
|
125
|
+
**③ 系统根证书信任库写入(需管理员授权)**
|
|
126
|
+
- **用途**:为下方第 4 条的 HTTPS 流量本地审计所必需——将一张**仅属于本机**的审计证书装入系统信任库。
|
|
127
|
+
- **风险**:写入系统信任根是高敏感操作,故需管理员授权,且本软件**绝不**预置或分发统一证书(详见第 4 条)。
|
|
128
|
+
- **撤销**:\`uninstall-ca\` 一键卸载并清除同意标记。
|
|
129
|
+
|
|
130
|
+
**④ HTTPS 流量本地审计** —— 见第 4 条专章。
|
|
131
|
+
|
|
132
|
+
### 3C. 任务执行中按需使用的授权(可在设置中逐项关闭)
|
|
133
|
+
|
|
134
|
+
| 授权 | 用途 | 范围与限制 |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| **浏览器控制** | 打开/导航网页、在你授权的浏览器会话中读取页面或注入脚本、读写 Cookie | 仅作用于本软件管理或你授权的浏览器会话 |
|
|
137
|
+
| **剪贴板读写** | 在自动化流程中传递文本 | 按任务需要;可关闭 |
|
|
138
|
+
| **屏幕/窗口截图** | 让 Agent"看见"界面以完成操作 | 截图留本机,不上传 |
|
|
139
|
+
| **多账号隔离 + 每账号代理** | 为不同身份隔离 Cookie/存储/出口 IP(如多店运营、多客户隔离交付) | **仅供合法的多账号管理;不得用于违法养号、刷量或对抗平台风控**(见第 5 条) |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 4. HTTPS 流量本地审计(可选 · 默认关闭 · 需显式同意 · 需管理员)
|
|
144
|
+
|
|
145
|
+
4.1 本软件提供可选的"HTTPS 流量本地审计"功能,用于对**你本机**发往 AI 厂商(如 Claude / OpenAI / DeepSeek / Gemini)的加密请求进行本地安全审计、敏感信息脱敏与策略治理。
|
|
146
|
+
|
|
147
|
+
4.2 **该功能默认关闭。** 仅当你在应用内主动点击启用、并完成管理员授权后才生效。启用时:
|
|
148
|
+
- 本软件在你本机生成一张**仅属于本机、独一无二**的审计证书(绝不使用预置或跨设备共用的证书),并请求装入本机系统信任库;
|
|
149
|
+
- 安装后,你本机到上述 **AI 厂商域名**的 HTTPS 流量将被本地解密以供审计;**解密范围严格限于这些 AI 厂商域名;其余一切流量(网银、社交、其他网站等)不被解密、不被读取**;
|
|
150
|
+
- **解密后的数据仅保存在你本机**,不上传至任何服务器。
|
|
151
|
+
|
|
152
|
+
4.3 **可随时撤销**:你可在设置中关闭该功能并卸载证书(\`uninstall-ca\`),撤销后不再解密任何流量,同意标记一并清除。
|
|
153
|
+
|
|
154
|
+
4.4 **多用户/团队场景的告知义务**:若你将本软件部署于供多人使用的设备或环境,并对他人流量启用审计,则你(部署方)须自行、事先向相关人员明确告知并取得同意,且仅限经营管理之必要范围。该告知与同意义务由你承担。
|
|
155
|
+
|
|
156
|
+
## 5. 自动化与设备控制的合法使用(用户责任)
|
|
157
|
+
|
|
158
|
+
5.1 本软件第 3 条所述能力均为通用自动化/RPA 工具能力。
|
|
159
|
+
|
|
160
|
+
5.2 **授权边界**:这些能力仅可作用于**你本人拥有或已获明确授权**的设备与账号。**严禁**访问或控制你无权限的计算机系统。
|
|
161
|
+
|
|
162
|
+
5.3 **禁止用途**,包括但不限于:
|
|
163
|
+
- (a) 入侵、非法控制、干扰他人计算机信息系统;
|
|
164
|
+
- (b) 违反平台规则的批量注册、刷量、刷单、薅羊毛及其他违法多账号行为;
|
|
165
|
+
- (c) 绕过、对抗目标平台的风控或技术保护措施;
|
|
166
|
+
- (d) 违反目标网站 robots 协议、用户条款或法律的数据抓取;
|
|
167
|
+
- (e) 无合法依据抓取或处理他人个人信息;
|
|
168
|
+
- (f) 任何违反你所在地或目标对象所在地法律法规的行为。
|
|
169
|
+
|
|
170
|
+
5.4 **你对经由本软件发起的全部操作及其后果承担全部责任。** CiCy 仅提供通用工具能力,不对你的具体使用方式负责;若你的使用导致第三方索赔或行政/刑事追究,由你承担并使 CiCy 免责。
|
|
171
|
+
|
|
172
|
+
## 6. 个人信息与隐私
|
|
173
|
+
|
|
174
|
+
6.1 本软件遵循本地优先、最小必要原则处理数据,不以运营为目的收集上传你的工作内容。
|
|
175
|
+
|
|
176
|
+
6.2 当你在涉及个人信息的场景使用本软件(对含个人信息的流量审计、抓取或处理),在适用《个人信息保护法》(中国)、GDPR(欧盟)等法律时,**你或你所属组织可能构成个人信息处理者 / 数据控制者**,须自行履行相应义务(告知同意、处理记录、数据主体权利响应、必要时的数据保护影响评估与泄露通报等)。
|
|
177
|
+
|
|
178
|
+
6.3 涉及欧盟个人数据出境的,须具备 GDPR 第五章要求的合法传输机制(如标准合同条款 SCC)与你的明确同意。
|
|
179
|
+
|
|
180
|
+
6.4 **按地区选择模型后端**:为符合不同司法辖区法律,本软件按你所在地区选择默认模型后端(例如中国大陆用户默认使用已在中国境内备案的模型服务);跨境传输个人数据须经你单独明确同意。
|
|
181
|
+
|
|
182
|
+
## 7. AI 生成内容
|
|
183
|
+
|
|
184
|
+
7.1 你使用本软件及第三方 Agent 生成的内容,须遵守你所在地关于 AI 生成合成内容标识的法律义务(如中国《人工智能生成合成内容标识办法》、欧盟 AI Act 的透明度要求)。CiCy 在适用范围内提供标识/披露能力,但合规使用责任在你。
|
|
185
|
+
|
|
186
|
+
## 8. 合规与适用法域
|
|
187
|
+
|
|
188
|
+
8.1 你须遵守你所在地、以及你的操作所指向对象所在地的全部适用法律、法规与平台条款,**尤其包括中国与欧盟的相关规定**。
|
|
189
|
+
|
|
190
|
+
8.2 本软件按"法域感知"原则对不同地区适用不同默认与限制,但这不免除你自行确保合规的责任。
|
|
191
|
+
|
|
192
|
+
## 9. 免责声明与责任限制
|
|
193
|
+
|
|
194
|
+
9.1 本软件按"现状"提供,在适用法律允许的最大范围内,不作适销性、特定用途适用性的默示担保。
|
|
195
|
+
|
|
196
|
+
9.2 在适用法律允许的最大范围内,对于你违反本条款,或因你使用第三方 Agent / 自动化能力 / 审计功能产生的任何直接或间接损失、第三方索赔、行政或刑事责任,CiCy 不承担责任,且你应使 CiCy 免受相关追偿。
|
|
197
|
+
|
|
198
|
+
9.3 本条款不排除或限制依强制性法律不可排除的责任(如人身伤害或欺诈责任)。
|
|
199
|
+
|
|
200
|
+
## 10. 同意与生效
|
|
201
|
+
|
|
202
|
+
10.1 **本协议是使用本软件的前提。** 点击"同意并继续",即表示你已阅读、理解并接受本协议全部条款;点击"不同意并退出"或不作选择的,**无法使用本软件**。
|
|
203
|
+
|
|
204
|
+
10.2 第 3B 条高风险授权(本机命令/脚本执行、远程编排配对、根证书写入)与第 4 条 HTTPS 审计,**需你在应用内单独操作开启**;你对本协议的整体同意**不构成**对这些功能的启用。
|
|
205
|
+
|
|
206
|
+
10.3 你可随时在设置中查看、关闭或撤销第 3 条所列各项授权。
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
> **实施备注(非条款,给产品/法务):**
|
|
211
|
+
> - 首启 = 阻断式条款:展示"一眼看懂"6 条 + "同意并继续 / 不同意并退出";未同意不进主界面。完整条款可展开/外链。
|
|
212
|
+
> - **第二道独立同意**:第 4 条审计 = w-10026 的同意卡片三态(未授权/已授权/处理中);第 3B① 执行能力、3B② 远程配对建议也各设独立开关与首用确认。
|
|
213
|
+
> - 后端门控:第 4 条对应 w-10084 的 \`~/cicy-ai/mitm/ca-trust-consent\` flag + \`exec cicy-code mitm install-ca/uninstall-ca\`。
|
|
214
|
+
> - 容器/无头部署:\`CICY_CA_TRUST_CONSENT=1\` 逃生门 = "设置该环境变量即代表部署方代表其环境作出第 4.4 条告知同意",责任落部署方;须写入部署文档。
|
|
215
|
+
> - 正式版:中文 + 英文(欧盟)双语;按法域分版本可能调整第 3C/6/8 条措辞;高风险授权建议保留**用户可撤销的审计日志**作为同意证据。
|
|
216
|
+
`,en:`# CiCy Desktop — Terms of Use & Authorization Notice
|
|
217
|
+
|
|
218
|
+
> Shown on first launch · Draft v0.2 · 2026-06-07
|
|
219
|
+
> **Acceptance of these Terms is a precondition to using the software: you must read and click "Agree and continue" before you can use CiCy Desktop.**
|
|
220
|
+
> (Internal draft, not final legal text; must be reviewed by licensed counsel in both China and the EU before public release. This document also serves as the content source for the in-app first-launch terms.)
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## At a glance (clicking "Agree" means you accept the following)
|
|
225
|
+
|
|
226
|
+
1. **CiCy Desktop is an AI agent orchestration tool that runs on your own computer**, helping you coordinate third-party AI assistants (Claude Code, Codex, Gemini, etc.) to get work done.
|
|
227
|
+
2. **Third-party AI and accounts are between you and the respective provider**: which AI you use, whose account you log in with, and the resulting usage and fees are your decision and your responsibility — not CiCy's.
|
|
228
|
+
3. **To do the work, the software needs a range of authorizations on your computer** (running programs, executing scripts, controlling the browser, accessing files, etc.). These are explained item by item in Section 3. **You are fully responsible for the operations initiated through the software.**
|
|
229
|
+
4. **Your data stays on your machine by default.** CiCy does not upload your work content for operational purposes.
|
|
230
|
+
5. **Two high-risk capabilities require your separate, additional authorization and are off by default**: **(a) local HTTPS traffic auditing (installs a certificate, requires administrator)** and **(b) local command/script execution**. Accepting these Terms as a whole does **not** turn them on.
|
|
231
|
+
6. **You must not** use the software to control unauthorized devices, conduct unlawful multi-accounting / traffic faking, circumvent platform risk controls, or scrape in violation of terms.
|
|
232
|
+
|
|
233
|
+
> If you do not accept any of the above, please click "Decline and exit." **Without acceptance, you cannot use the software.**
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 1. About CiCy Desktop
|
|
238
|
+
|
|
239
|
+
1.1 CiCy Desktop (the "Software") is an AI agent orchestration and automation tool that runs on your local device, used to organize and coordinate third-party AI command-line tools / clients (such as Claude Code, OpenAI Codex, Google Gemini CLI, etc., the "Third-Party Agents") to complete tasks collaboratively.
|
|
240
|
+
|
|
241
|
+
1.2 The Software itself **does not provide large-model inference services**, nor does it embed any cross-border network channel designed to circumvent regional restrictions. Model capabilities are provided by the backend you choose.
|
|
242
|
+
|
|
243
|
+
## 2. Third-Party Agents and Accounts (Disclaimer)
|
|
244
|
+
|
|
245
|
+
2.1 You may connect Third-Party Agents within the Software. **The relationship between you and a Third-Party Agent and its model/service provider (registration, login, authorization, usage, billing, compliance) is established directly between you and that provider and borne by you — it is unrelated to CiCy.**
|
|
246
|
+
|
|
247
|
+
2.2 **You are solely responsible for official logins.** If you log in to a Third-Party Agent using that provider's official account, that act and its consequences (including whether it complies with the availability policies of the provider's jurisdiction and your own) are your responsibility. CiCy does not steer you toward, proxy, or embed any channel dedicated to circumventing regional restrictions.
|
|
248
|
+
|
|
249
|
+
2.3 You must comply with the user agreement, usage policies, and acceptable-use scope of every Third-Party Agent and model service you connect.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 3. Authorization Notice (permissions the Software requires from you)
|
|
254
|
+
|
|
255
|
+
> To let AI agents do work on your behalf, the Software needs the following authorizations on your device. We group them by risk level and explain each one's **purpose, scope, risk, and whether it can be revoked**. **Transparent disclosure is at the heart of these Terms.**
|
|
256
|
+
|
|
257
|
+
### 3A. Basic authorizations (granted by accepting these Terms; required for the Software to run)
|
|
258
|
+
|
|
259
|
+
| Authorization | Purpose | Scope & limits | Revocable |
|
|
260
|
+
|---|---|---|---|
|
|
261
|
+
| **Local file read/write** | Read/write the workspace, configuration, task history | Limited to the Software's working directory and files you explicitly target in a task | Uninstall to end |
|
|
262
|
+
| **Run Third-Party Agents** | Launch sub-processes such as claude/codex/gemini on your computer | Only the Agents you have connected | Remove the Agent |
|
|
263
|
+
| **Local data storage** | Store audit/history/configuration locally | Data stays on your machine; not uploaded | Clear in settings |
|
|
264
|
+
| **Read system & window info** | Scheduling and status display | OS/hardware summary, window list; no file contents | Uninstall to end |
|
|
265
|
+
| **Local network access** | Make requests to the model backend/service you chose, on your behalf | Outbound per your configuration; no embedded circumvention channel | Disable networking in settings |
|
|
266
|
+
|
|
267
|
+
### 3B. High-risk authorizations (off by default; enabled only after your **separate, explicit** consent)
|
|
268
|
+
|
|
269
|
+
> Accepting these Terms as a whole will **not** automatically enable any of the following. Each requires a separate action in the app to turn on, and can be turned off at any time.
|
|
270
|
+
|
|
271
|
+
**① Local command and script execution**
|
|
272
|
+
- **Purpose**: Allow AI agents to execute shell / Python / Node scripts on your computer to complete automation tasks.
|
|
273
|
+
- **Risk (please read carefully)**: This is equivalent to granting a program the **ability to run code** on your computer. Enable it only in tasks you trust.
|
|
274
|
+
- **Controls**: Acts on the **local machine** only; all executions are written to a local audit trail; high-risk commands can require secondary confirmation.
|
|
275
|
+
- **Revoke**: Disable execution in settings.
|
|
276
|
+
|
|
277
|
+
**② Remote orchestration pairing**
|
|
278
|
+
- **Purpose**: Allow an orchestrator you have **explicitly paired** (which may run in the cloud or on another device) to drive the local Agents over a secure channel, enabling remote collaborative scheduling.
|
|
279
|
+
- **Risk**: Once paired, the remote orchestrator can trigger the local capabilities above.
|
|
280
|
+
- **Controls**: Connects **only to orchestrators you have explicitly paired, with a token you can revoke at any time**; never installs silently, never self-propagates; you can unpair to disconnect immediately.
|
|
281
|
+
- **Revoke**: Unpair / revoke the token.
|
|
282
|
+
|
|
283
|
+
**③ System root certificate trust store write (requires administrator)**
|
|
284
|
+
- **Purpose**: Required for the HTTPS traffic auditing in Section 4 — installing a **machine-specific** audit certificate into the system trust store.
|
|
285
|
+
- **Risk**: Writing to the system trust root is a highly sensitive operation, so it requires administrator authorization, and the Software **never** pre-installs or distributes a shared certificate (see Section 4).
|
|
286
|
+
- **Revoke**: \`uninstall-ca\` removes it and clears the consent flag in one step.
|
|
287
|
+
|
|
288
|
+
**④ Local HTTPS traffic auditing** — see the dedicated Section 4.
|
|
289
|
+
|
|
290
|
+
### 3C. Authorizations used on demand during tasks (each can be disabled in settings)
|
|
291
|
+
|
|
292
|
+
| Authorization | Purpose | Scope & limits |
|
|
293
|
+
|---|---|---|
|
|
294
|
+
| **Browser control** | Open/navigate pages, read pages or inject scripts in browser sessions you authorize, read/write cookies | Only browser sessions managed by the Software or authorized by you |
|
|
295
|
+
| **Clipboard read/write** | Pass text within automation flows | As needed by the task; can be disabled |
|
|
296
|
+
| **Screen/window capture** | Let an Agent "see" the interface to complete an operation | Screenshots stay local; not uploaded |
|
|
297
|
+
| **Multi-account isolation + per-account proxy** | Isolate cookies/storage/egress IP per identity (e.g. multi-store operations, multi-client isolated delivery) | **For lawful multi-account management only; must not be used for unlawful account farming, traffic faking, or defeating platform risk controls** (see Section 5) |
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 4. Local HTTPS Traffic Auditing (optional · off by default · requires explicit consent · requires administrator)
|
|
302
|
+
|
|
303
|
+
4.1 The Software offers an optional "Local HTTPS Traffic Auditing" feature, used to perform local security auditing, sensitive-data redaction, and policy governance on encrypted requests sent from **your machine** to AI providers (such as Claude / OpenAI / DeepSeek / Gemini).
|
|
304
|
+
|
|
305
|
+
4.2 **This feature is off by default.** It takes effect only when you actively click to enable it in the app and complete administrator authorization. When enabled:
|
|
306
|
+
- The Software generates a **machine-specific, unique** audit certificate on your machine (never a pre-installed or cross-device shared certificate) and requests to install it into your system trust store;
|
|
307
|
+
- Once installed, HTTPS traffic from your machine to the **AI provider domains** above is decrypted locally for auditing; **the scope of decryption is strictly limited to those AI provider domains; all other traffic (banking, social, other websites, etc.) is never decrypted or read**;
|
|
308
|
+
- **Decrypted data is stored only on your machine** and is not uploaded to any server.
|
|
309
|
+
|
|
310
|
+
4.3 **Revocable at any time**: You can disable the feature and uninstall the certificate (\`uninstall-ca\`) in settings; after revocation no traffic is decrypted, and the consent flag is cleared.
|
|
311
|
+
|
|
312
|
+
4.4 **Disclosure obligation in multi-user/team settings**: If you deploy the Software on a device or environment used by multiple people and enable auditing on others' traffic, then you (the deployer) must, on your own and in advance, clearly inform the affected persons and obtain their consent, limited to what is necessary for business management. This disclosure-and-consent obligation rests with you.
|
|
313
|
+
|
|
314
|
+
## 5. Lawful Use of Automation and Device Control (User Responsibility)
|
|
315
|
+
|
|
316
|
+
5.1 The capabilities described in Section 3 are general-purpose automation/RPA tool capabilities.
|
|
317
|
+
|
|
318
|
+
5.2 **Authorization boundary**: These capabilities may act only on devices and accounts **you own or are expressly authorized to use**. Accessing or controlling computer systems you are not authorized for is **strictly prohibited**.
|
|
319
|
+
|
|
320
|
+
5.3 **Prohibited uses**, including but not limited to:
|
|
321
|
+
- (a) intruding into, unlawfully controlling, or interfering with others' computer information systems;
|
|
322
|
+
- (b) bulk registration, traffic/order faking, "wool-pulling," and other unlawful multi-accounting in violation of platform rules;
|
|
323
|
+
- (c) circumventing or defeating a target platform's risk controls or technical protection measures;
|
|
324
|
+
- (d) data scraping in violation of a target site's robots protocol, terms of use, or applicable law;
|
|
325
|
+
- (e) collecting or processing others' personal information without a lawful basis;
|
|
326
|
+
- (f) any act that violates the laws and regulations of your jurisdiction or that of the target.
|
|
327
|
+
|
|
328
|
+
5.4 **You bear full responsibility for all operations initiated through the Software and their consequences.** CiCy provides only general-purpose tool capabilities and is not responsible for your specific manner of use; if your use leads to third-party claims or administrative/criminal liability, you shall bear it and hold CiCy harmless.
|
|
329
|
+
|
|
330
|
+
## 6. Personal Information and Privacy
|
|
331
|
+
|
|
332
|
+
6.1 The Software processes data on a local-first, minimum-necessary basis and does not collect or upload your work content for operational purposes.
|
|
333
|
+
|
|
334
|
+
6.2 When you use the Software in scenarios involving personal information (auditing, scraping, or processing traffic that contains personal information), under applicable laws such as the Personal Information Protection Law (China) and the GDPR (EU), **you or your organization may constitute a personal-information processor / data controller** and must fulfill the corresponding obligations on your own (notice and consent, records of processing, responding to data-subject rights, and where necessary data protection impact assessments and breach notifications).
|
|
335
|
+
|
|
336
|
+
6.3 Where EU personal data is transferred out of the EU, a lawful transfer mechanism required by Chapter V of the GDPR (such as Standard Contractual Clauses) and your explicit consent are required.
|
|
337
|
+
|
|
338
|
+
6.4 **Region-based backend selection**: To comply with the laws of different jurisdictions, the Software selects a default model backend based on your region (for example, users in mainland China default to model services filed/registered within China); cross-border transfer of personal data requires your separate, explicit consent.
|
|
339
|
+
|
|
340
|
+
## 7. AI-Generated Content
|
|
341
|
+
|
|
342
|
+
7.1 Content you generate using the Software and Third-Party Agents is subject to the AI-generated-content labeling obligations of your jurisdiction (such as China's Measures for Labeling AI-Generated Synthetic Content and the transparency requirements of the EU AI Act). CiCy provides labeling/disclosure capabilities where applicable, but the responsibility for compliant use rests with you.
|
|
343
|
+
|
|
344
|
+
## 8. Compliance and Applicable Jurisdictions
|
|
345
|
+
|
|
346
|
+
8.1 You must comply with all applicable laws, regulations, and platform terms of your jurisdiction and of the jurisdiction your operations target, **including in particular those of China and the EU**.
|
|
347
|
+
|
|
348
|
+
8.2 The Software applies different defaults and restrictions to different regions on a "jurisdiction-aware" basis, but this does not relieve you of your own responsibility to ensure compliance.
|
|
349
|
+
|
|
350
|
+
## 9. Disclaimer and Limitation of Liability
|
|
351
|
+
|
|
352
|
+
9.1 The Software is provided "as is"; to the maximum extent permitted by applicable law, no implied warranties of merchantability or fitness for a particular purpose are made.
|
|
353
|
+
|
|
354
|
+
9.2 To the maximum extent permitted by applicable law, CiCy is not liable for any direct or indirect loss, third-party claim, or administrative or criminal liability arising from your breach of these Terms or from your use of Third-Party Agents / automation capabilities / the auditing feature, and you shall hold CiCy harmless against related claims.
|
|
355
|
+
|
|
356
|
+
9.3 Nothing in these Terms excludes or limits liability that cannot be excluded under mandatory law (such as liability for personal injury or fraud).
|
|
357
|
+
|
|
358
|
+
## 10. Consent and Effect
|
|
359
|
+
|
|
360
|
+
10.1 **These Terms are a precondition to using the Software.** Clicking "Agree and continue" means you have read, understood, and accepted all of these Terms; if you click "Decline and exit" or make no choice, you **cannot use the Software**.
|
|
361
|
+
|
|
362
|
+
10.2 The high-risk authorizations in Section 3B (local command/script execution, remote orchestration pairing, root certificate write) and the HTTPS auditing in Section 4 **must be enabled by you through separate actions in the app**; your overall acceptance of these Terms does **not** constitute enabling those features.
|
|
363
|
+
|
|
364
|
+
10.3 You may review, disable, or revoke each authorization listed in Section 3 at any time in settings.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
> **Implementation notes (not part of the Terms; for product/legal):**
|
|
369
|
+
> - First launch = blocking terms: show the 6 "at a glance" points + "Agree and continue / Decline and exit"; no entry to the main UI without acceptance. Full Terms expandable/linked.
|
|
370
|
+
> - **Second, separate consent**: Section 4 auditing = the three-state consent card (not-granted / granted / processing); the Section 3B① execution and 3B② remote-pairing capabilities should likewise have their own switches and first-use confirmation.
|
|
371
|
+
> - Backend gating: Section 4 corresponds to the \`~/cicy-ai/mitm/ca-trust-consent\` flag + \`exec cicy-code mitm install-ca/uninstall-ca\`.
|
|
372
|
+
> - Container/headless deployment: if using the \`CICY_CA_TRUST_CONSENT=1\` escape hatch, "setting this environment variable means the deployer has, on behalf of its environment, given the notice and consent under Section 4.4"; responsibility rests with the deployer and this must be documented.
|
|
373
|
+
> - Production: zh + en (EU) bilingual; wording of Sections 3C/6/8 may be adjusted per jurisdiction; high-risk authorizations should retain a user-revocable audit log as evidence of consent.
|
|
374
|
+
`};function Ry(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function qn(c){return Ry(c).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function $m(c){return c.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(f=>f.trim())}function Uy(c){const f=String(c||"").replace(/\r\n/g,`
|
|
375
|
+
`).split(`
|
|
376
|
+
`),h=[];let d=0;for(;d<f.length;){const S=f[d];if(!S.trim()){d++;continue}if(/^---+\s*$/.test(S)){h.push("<hr/>"),d++;continue}const w=/^(#{1,6})\s+(.*)$/.exec(S);if(w){const b=Math.min(w[1].length,6);h.push(`<h${b}>${qn(w[2])}</h${b}>`),d++;continue}if(S.trim().startsWith("|")&&d+1<f.length&&/^\s*\|?[\s:|-]+\|?\s*$/.test(f[d+1])&&f[d+1].includes("-")){const b=$m(S);d+=2;const M=[];for(;d<f.length&&f[d].trim().startsWith("|");)M.push($m(f[d])),d++;let j="<table><thead><tr>";j+=b.map(p=>`<th>${qn(p)}</th>`).join(""),j+="</tr></thead><tbody>";for(const p of M)j+="<tr>"+p.map(N=>`<td>${qn(N)}</td>`).join("")+"</tr>";j+="</tbody></table>",h.push(j);continue}if(S.trim().startsWith(">")){const b=[];for(;d<f.length&&f[d].trim().startsWith(">");)b.push(f[d].replace(/^\s*>\s?/,"")),d++;h.push(`<blockquote>${b.map(qn).join("<br/>")}</blockquote>`);continue}if(/^\s*-\s+/.test(S)){const b=[];for(;d<f.length&&/^\s*-\s+/.test(f[d]);)b.push(`<li>${qn(f[d].replace(/^\s*-\s+/,""))}</li>`),d++;h.push(`<ul>${b.join("")}</ul>`);continue}if(/^\s*\d+\.\s+/.test(S)){const b=[];for(;d<f.length&&/^\s*\d+\.\s+/.test(f[d]);)b.push(`<li>${qn(f[d].replace(/^\s*\d+\.\s+/,""))}</li>`),d++;h.push(`<ol>${b.join("")}</ol>`);continue}h.push(`<p>${qn(S)}</p>`),d++}return h.join(`
|
|
377
|
+
`)}function Hy({title:c,url:f}={}){const h=String(c||"").trim();return h?{ok:!0,patch:{name:h,base_url:String(f||"").trim()}}:{ok:!1,error:"title_required"}}const r=(c,f,h)=>{var S,w;const d=b=>h&&typeof b=="string"?b.replace(/\{\{\s*(\w+)\s*\}\}/g,(M,j)=>h[j]!=null?String(h[j]):M):b;try{const b=(w=(S=window.cicyI18n)==null?void 0:S.t)==null?void 0:w.call(S,c,h);return d(b&&b!==c?b:f)}catch{return d(f)}},Cl="cicy_token",Zs="cicy_access_token",ki="cicy_user_id",By="cicy_guest",El="https://cicy-ai.com",Er=new Set;let Ly=0,xn=[];const Ti=new Map;function Xm(){Er.forEach(c=>c(xn))}const _e={show(c={}){const f=c.id||`t${++Ly}`,h=xn.find(w=>w.id===f),d={id:f,status:"running",...h,...c};xn=h?xn.map(w=>w.id===f?d:w):[...xn,d],Xm();const S=Ti.get(f);return S&&(clearTimeout(S),Ti.delete(f)),c.ttl&&Ti.set(f,setTimeout(()=>_e.dismiss(f),c.ttl)),f},dismiss(c){xn=xn.filter(h=>h.id!==c);const f=Ti.get(c);f&&(clearTimeout(f),Ti.delete(c)),Xm()}};function qy(){const[c,f]=g.useState(xn);return g.useEffect(()=>(Er.add(f),()=>{Er.delete(f)}),[]),c.length?s.jsx("div",{className:"toast-host","data-id":"ToastHost",children:c.map(h=>s.jsxs("div",{className:"toast","data-id":`Toast-${h.id}`,"data-status":h.status||"running",children:[s.jsx("button",{type:"button",className:"toast__x","data-id":"Toast-dismiss",onClick:()=>_e.dismiss(h.id),"aria-label":"dismiss",children:"×"}),s.jsxs("span",{className:"toast__msg",children:[h.message,Number.isFinite(h.progress)?` ${h.progress}%`:""]}),Number.isFinite(h.progress)&&s.jsx("span",{className:"toast__bar",children:s.jsx("span",{style:{width:`${Math.min(100,h.progress)}%`}})})]},h.id))}):null}const Ar=new Set;let xr=0,Fe=null;function wn(){Ar.forEach(c=>c(Fe))}function Ei(){return new Date().toTimeString().slice(0,8)}const dt={open({teamId:c,fromVer:f,toVer:h,onRetry:d,title:S,kind:w}={}){Fe={teamId:c,title:S||null,fromVer:f||null,toVer:h||null,kind:w||"sidecar",status:"running",phase:"download",progress:null,onInstall:null,logs:[],onRetry:d||null,lastAt:Date.now()},wn()},setProgress(c){Fe&&(Fe={...Fe,status:"running",progress:c||Fe.progress,lastAt:Date.now()},wn())},ready({onInstall:c,message:f}={}){if(!Fe)return;const h={id:++xr,t:Ei(),phase:"done",status:"done",message:f||r("updateBanner.readyDrawer","下载完成,点「安装」重启更新")};Fe={...Fe,status:"ready",phase:"done",progress:{...Fe.progress||{},percent:100},onInstall:c||null,minimized:!1,logs:[...Fe.logs,h],lastAt:Date.now()},wn()},push(c={}){if(!Fe)return;const f={id:++xr,t:Ei(),phase:c.phase||Fe.phase,status:c.status||"running",message:c.message||""};Fe={...Fe,phase:c.phase||Fe.phase,toVer:c.toVer||Fe.toVer,logs:[...Fe.logs,f],lastAt:Date.now()},wn()},minimize(){Fe&&(Fe={...Fe,minimized:!0},wn())},restore(){Fe&&(Fe={...Fe,minimized:!1},wn())},finish({ok:c,message:f}={}){if(!Fe)return;const h=c?"done":"error",d={id:++xr,t:Ei(),phase:"done",status:h,message:f||(c?r("updateDrawer.done","更新完成"):r("updateDrawer.failed","更新失败"))};Fe={...Fe,status:h,phase:"done",minimized:!1,logs:[...Fe.logs,d],lastAt:Date.now()},wn()},close(){Fe=null,wn()}},_r=["download","swap","done"],Qm=c=>({download:r("updateDrawer.phaseDownload","下载"),swap:r("updateDrawer.phaseSwap","切换"),done:r("updateDrawer.phaseDone","完成")})[c]||c;function Gy(){var M;const[c,f]=g.useState(Fe);g.useEffect(()=>(Ar.add(f),()=>{Ar.delete(f)}),[]);const h=g.useRef(null);g.useEffect(()=>{const j=h.current;j&&(j.scrollTop=j.scrollHeight)},[(M=c==null?void 0:c.logs)==null?void 0:M.length]);const[d,S]=g.useState(!1);if(g.useEffect(()=>{if(!c||c.status!=="running"){S(!1);return}const j=setInterval(()=>S(Date.now()-(c.lastAt||0)>25e3),3e3);return()=>clearInterval(j)},[c==null?void 0:c.lastAt,c==null?void 0:c.status]),!c)return null;const w=c.status==="running",b=_r.findIndex(j=>j===c.phase);return c.minimized?s.jsxs("button",{type:"button",className:`drawer-min drawer-min--${c.status}`,"data-id":"UpdateDrawer-restore",onClick:()=>dt.restore(),children:[s.jsx("span",{className:"drawer-min__spark",children:w?s.jsx(Lt,{}):c.status==="done"?"✓":c.status==="reboot"?"⟳":"!"}),s.jsxs("span",{className:"drawer-min__label",children:[c.title||r("updateDrawer.title","更新 cicy-code"),c.toVer?` · v${c.toVer}`:""]})]}):s.jsx("div",{className:"drawer-scrim","data-id":"UpdateDrawer-scrim",onClick:()=>w?dt.minimize():dt.close(),children:s.jsxs("div",{className:"drawer","data-id":"UpdateDrawer","data-status":c.status,onClick:j=>j.stopPropagation(),children:[s.jsxs("div",{className:"drawer__head",children:[s.jsxs("div",{className:"drawer__title",children:[s.jsx("span",{className:`drawer__spark drawer__spark--${c.status}`,children:w?s.jsx(Lt,{}):c.status==="done"?"✓":c.status==="reboot"?"⟳":"!"}),s.jsxs("div",{children:[s.jsx("div",{className:"drawer__h",children:c.title||r("updateDrawer.title","更新 cicy-code")}),s.jsxs("div",{className:"drawer__sub",children:[c.fromVer?`v${c.fromVer}`:r("updateDrawer.current","当前")," → ",c.toVer?`v${c.toVer}`:r("updateDrawer.latest","最新版")]})]})]}),s.jsx("div",{className:"drawer__headbtns",children:s.jsx("button",{type:"button",className:"drawer__x","data-id":"UpdateDrawer-min",title:r("updateDrawer.minimize","最小化"),onClick:()=>dt.minimize(),"aria-label":"minimize",children:"‒"})})]}),c.kind!=="app"&&s.jsx("div",{className:"drawer__steps","data-id":"UpdateDrawer-steps",children:_r.map((j,p)=>{const N=Qm(j),T=c.status==="done"||p<b,Z=p===b&&w,D=c.status==="error"&&p===b;return s.jsxs("div",{className:`drawer__step${Z?" is-active":""}${T?" is-done":""}${D?" is-error":""}`,children:[s.jsx("span",{className:"drawer__step-dot",children:T?"✓":D?"!":p+1}),s.jsx("span",{className:"drawer__step-label",children:N}),p<_r.length-1&&s.jsx("span",{className:"drawer__step-bar"})]},j)})}),c.progress&&(()=>{const j=c.progress,p=N=>N?(N/1048576).toFixed(1):"0";return s.jsxs("div",{className:"drawer__dl","data-id":"UpdateDrawer-dl",children:[s.jsxs("div",{className:"drawer__dl-head",children:[s.jsxs("span",{className:"drawer__dl-pct",children:[j.percent||0,"%"]}),s.jsxs("span",{className:"drawer__dl-stats",children:[j.total?`${p(j.transferred)} / ${p(j.total)} MB`:`${p(j.transferred)} MB`,j.bytesPerSec?` · ${p(j.bytesPerSec)} MB/s`:"",j.etaSec?` · ${r("updateBanner.eta","剩 {{s}}s",{s:j.etaSec})}`:""]})]}),s.jsx("div",{className:"drawer__dl-track",children:s.jsx("span",{className:"drawer__dl-fill",style:{width:`${j.percent||0}%`}})})]})})(),s.jsx("div",{className:"drawer__log","data-id":"UpdateDrawer-log",ref:h,children:c.logs.length===0?s.jsx("div",{className:"drawer__log-empty",children:r("updateDrawer.preparing","准备中…")}):c.logs.map(j=>s.jsxs("div",{className:"drawer__line","data-status":j.status,children:[s.jsx("span",{className:"drawer__t",children:j.t}),s.jsx("span",{className:`drawer__badge drawer__badge--${j.phase}`,children:Qm(j.phase)}),s.jsx("span",{className:"drawer__linemsg",children:j.message})]},j.id))}),d&&w&&s.jsx("div",{className:"drawer__hint","data-id":"UpdateDrawer-stuck",children:r("updateDrawer.stuckHint","正在等待新版本就绪,耗时比平常久。可以放到后台继续,完成或失败都会提示。")}),s.jsx("div",{className:"drawer__foot",children:w?s.jsx(s.Fragment,{children:s.jsx("span",{className:"drawer__foot-status",children:c.kind==="app"?r("updateBanner.downloading","正在下载更新")+"…":r("updateDrawer.inProgress","更新进行中…")})}):c.status==="ready"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-done",children:r("updateBanner.readyShort","下载完成")}),s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-install",onClick:()=>c.onInstall&&c.onInstall(),children:r("updateBanner.installBtn","立即安装")}),s.jsx("button",{type:"button",className:"drawer__btn","data-id":"UpdateDrawer-later",onClick:()=>dt.close(),children:r("updateBanner.later","稍后")})]}):c.status==="error"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-error",children:r("updateDrawer.failed","更新失败")}),c.onRetry&&s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-retry",onClick:()=>c.onRetry(),children:r("common.retry","重试")}),s.jsx("button",{type:"button",className:"drawer__btn","data-id":"UpdateDrawer-dismiss",onClick:()=>dt.close(),children:r("common.close","关闭")})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-done",children:r("updateDrawer.updatedLatest","已更新到最新")}),s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"UpdateDrawer-finish",onClick:()=>dt.close(),children:r("common.done","完成")})]})})]})})}const oh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Yn="desktop-",rh="limeng9088@gmail.com",Dl=c=>c&&!c.startsWith(Yn)?Yn+c:c||"",Gn=c=>String(c||"").replace(new RegExp("^"+Yn),""),Zm={flex:"1 1 0%",minWidth:0,maxWidth:"100%",font:"inherit",boxSizing:"border-box",height:22,lineHeight:"20px",padding:"0 6px",borderRadius:6,border:"1px solid transparent"};async function zi(c){var w,b;const f=await((w=window.electronRPC)==null?void 0:w.call(window,"get_windows",{})),h=(f&&f.content||[]).map(M=>M&&M.text).join("");let d=1;try{const M=JSON.parse(h);M&&M.length&&(d=M[0].id)}catch{}const S=await((b=window.electronRPC)==null?void 0:b.call(window,"control_electron_BrowserWindow",{win_id:d,code:c}));return(S&&S.content||[]).map(M=>M&&M.text).join("")}const Yy=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
|
|
378
|
+
const os=r("os"),fs=r("fs"),path=r("path");
|
|
379
|
+
try{const c=JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8"));
|
|
380
|
+
return String((c.hubAuth||{}).token||"")}catch(e){return ""}})()`,$y=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
|
|
381
|
+
const os=r("os"),fs=r("fs"),path=r("path");
|
|
382
|
+
// Identity source, in order:
|
|
383
|
+
// 1) a numeric txt on the operator's Desktop (C:/Users/xs/Desktop/1007.txt) —
|
|
384
|
+
// the machine's number, dropped there by whoever set the box up. This is the
|
|
385
|
+
// ground truth; its filename is the id. Forward slashes only, so this string
|
|
386
|
+
// survives a second eval (a backslash path breaks with "invalid hex escape").
|
|
387
|
+
// 2) ~/cicy-ai/team.txt, 3) global.json desktopTeam.
|
|
388
|
+
const home=os.homedir().replace(/\\\\/g,"/");
|
|
389
|
+
const deskDirs=["C:/Users/xs/Desktop","C:/Users/Intel/Desktop","C:/Users/Administrator/Desktop",home+"/Desktop"];
|
|
390
|
+
for(const d of deskDirs){try{for(const f of fs.readdirSync(d)){const m=/^(\\d{3,5})\\.txt$/i.exec(f);if(m)return "xs-"+m[1];}}catch(e){}}
|
|
391
|
+
const txts=[path.join(os.homedir(),"cicy-ai","team.txt")];
|
|
392
|
+
for(const f of txts){try{const t=String(fs.readFileSync(f,"utf8")).trim();if(t)return t}catch(e){}}
|
|
393
|
+
try{const c=JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8"));
|
|
394
|
+
return String(c.desktopTeam||"")}catch(e){return ""}})()`;function Ps(){const c="23456789ABCDEFGHJKMNPQRSTUVWXYZ",f=()=>Array.from({length:5},()=>c[Math.floor(Math.random()*c.length)]).join("");try{let h=localStorage.getItem("cicy-short-id");return/^[2-9A-HJ-NP-Z]{5}$/.test(h||"")||(h=f(),localStorage.setItem("cicy-short-id",h)),h}catch{return f()}}function uh(){const c=()=>"code-desktop-"+(typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID().replace(/-/g,""):(Math.random().toString(16).slice(2)+Date.now().toString(16)+Math.random().toString(16).slice(2)).slice(0,32));try{let f=localStorage.getItem("cicy-desktop-id");return/^code-desktop-[A-Za-z0-9]{16,}$/.test(f||"")||(f=c(),localStorage.setItem("cicy-desktop-id",f)),f}catch{return c()}}async function Di(){try{return Dl((await zi($y)).trim())}catch{return""}}async function Nr(c){c=Dl(String(c||"").trim());const f=`(()=>{const r=process.mainModule.require.bind(process.mainModule);
|
|
395
|
+
const os=r("os"),fs=r("fs"),path=r("path");
|
|
396
|
+
const home=os.homedir();
|
|
397
|
+
const dir=path.join(home,"cicy-ai");
|
|
398
|
+
try{fs.mkdirSync(dir,{recursive:true})}catch(e){}
|
|
399
|
+
const want=${JSON.stringify(c)};
|
|
400
|
+
// 2) team.txt —— 优先级比 global.json 高,不写这个就等于没改
|
|
401
|
+
const tf=path.join(dir,"team.txt");
|
|
402
|
+
try{ if(want){fs.writeFileSync(tf,want)}else{try{fs.unlinkSync(tf)}catch(e){}} }catch(e){}
|
|
403
|
+
// 3) global.json
|
|
404
|
+
const p=path.join(dir,"global.json");
|
|
405
|
+
let c={};try{c=JSON.parse(fs.readFileSync(p,"utf8"))}catch(e){}
|
|
406
|
+
c.desktopTeam=want;
|
|
407
|
+
try{fs.writeFileSync(p,JSON.stringify(c,null,2))}catch(e){}
|
|
408
|
+
// 回读:按 readTeam 的真实优先级算出这台机器现在到底叫什么
|
|
409
|
+
const home2=home.replace(/\\\\/g,"/");
|
|
410
|
+
const deskDirs=["C:/Users/xs/Desktop","C:/Users/Intel/Desktop","C:/Users/Administrator/Desktop",home2+"/Desktop"];
|
|
411
|
+
for(const d of deskDirs){try{for(const f of fs.readdirSync(d)){const m=/^(\\d{3,5})\\.txt$/i.exec(f);if(m)return "xs-"+m[1];}}catch(e){}}
|
|
412
|
+
try{const t=String(fs.readFileSync(tf,"utf8")).trim();if(t)return t}catch(e){}
|
|
413
|
+
try{const c2=JSON.parse(fs.readFileSync(p,"utf8"));return String(c2.desktopTeam||"")}catch(e){return ""}
|
|
414
|
+
})()`;return Dl((await zi(f)).trim())}function Xy(){ag(),Wy(),Fy(),tg(),eg();const[c,f]=g.useState(void 0);g.useEffect(()=>{var L,P;if(!((P=(L=window.cicy)==null?void 0:L.terms)!=null&&P.status)){f(!0);return}window.cicy.terms.status(ch).then(ne=>f(!!(ne!=null&&ne.accepted))).catch(()=>f(!0))},[]),g.useEffect(()=>{var ne,pe,de,Je;const L=document.documentElement;try{L.setAttribute("data-platform",((ne=window.cicy)==null?void 0:ne.platform)||"linux")}catch{}L.setAttribute("data-fullscreen","0");let P;try{P=(Je=(de=(pe=window.cicy)==null?void 0:pe.window)==null?void 0:de.onFullscreen)==null?void 0:Je.call(de,ze=>L.setAttribute("data-fullscreen",ze?"1":"0"))}catch{}return()=>{try{P&&P()}catch{}}},[]),g.useEffect(()=>{var P,ne;if(!((ne=(P=window.cicy)==null?void 0:P.docker)!=null&&ne.onAppProgress))return;const L=window.cicy.docker.onAppProgress(pe=>{!pe||pe.phase==="open"||(Ye||Ce.open({source:"auto"}),(Ye==null?void 0:Ye.source)==="auto"&&(pe.phase==="done"&&(pe.status==="done"||pe.status==="reboot")?Ce.finish({ok:pe.status==="done",status:pe.status==="reboot"?"reboot":void 0,message:pe.message}):pe.status==="error"?Ce.finish({ok:!1,message:pe.message}):Ce.push(pe)))});return()=>{try{L&&L()}catch{}}},[]);const[h,d]=g.useState(()=>Nl(Cl)),[S,w]=g.useState(()=>Nl(Zs)),[b,M]=g.useState(()=>Nl(ki)),[j,p]=g.useState(()=>!Nl(Cl)),[N,T]=g.useState(!0),Z=()=>T(!0),[D,J]=g.useState(!1),[R,U]=g.useState(!1),[F,Se]=g.useState(""),[le,we]=g.useState(rh),[ce,te]=g.useState(null);g.useEffect(()=>{let L=!0;return Di().then(P=>L&&te(P||"")),()=>{L=!1}},[]);const[V,ae]=g.useState(!1),[X,je]=g.useState(""),[qe,$e]=g.useState(""),[st,Xe]=g.useState(null),[oe,C]=g.useState(null),[Y,H]=g.useState(!1),[ie,ee]=g.useState(""),m=g.useRef(!1),[x,q]=g.useState(null),[K,I]=g.useState(!1),[ge,me]=g.useState(!1),[Qe,Me]=g.useState({}),Gt=g.useCallback(async()=>{var L,P,ne;try{const pe=await((ne=(P=(L=window.cicy)==null?void 0:L.localTeams)==null?void 0:P.avatars)==null?void 0:ne.call(P));Me(pe&&typeof pe=="object"?pe:{})}catch{}},[]),[ct,Dt]=g.useState(!1),[ca,bt]=g.useState(!1),[$t,vt]=g.useState(""),[oa,ra]=g.useState(""),[jt,Ot]=g.useState(!1),[ka,kt]=g.useState(""),[Ct,ht]=g.useState("all"),G=Eg(),be=g.useCallback(async(L,P)=>{var pe,de,Je,ze;if(!L)return;if(!((de=(pe=window.cicy)==null?void 0:pe.cloud)!=null&&de.fetch)){ee("cloud fetch bridge missing");return}H(!0),ee("");const ne={Authorization:`Bearer ${L}`};try{const[It,At]=await Promise.all([window.cicy.cloud.fetch(`${El}/api/user/self`,{headers:ne}),window.cicy.cloud.fetch(`${El}/api/teams`,{headers:ne})]);if((At==null?void 0:At.status)===401){if(!m.current&&((ze=(Je=window.cicy)==null?void 0:Je.auth)!=null&&ze.loginStart)){m.current=!0,ee(r("auth.sessionExpired","会话已过期,正在重新登录…"));try{await window.cicy.auth.loginStart()}catch{}}return}if(At!=null&&At.ok){const it=JSON.parse(At.body||"{}");C(Array.isArray(it==null?void 0:it.teams)?it.teams:[])}else C(it=>it===null?[]:it);if(It!=null&&It.ok)try{const it=JSON.parse(It.body||"{}");Xe((it==null?void 0:it.success)===!1?null:(it==null?void 0:it.data)||null)}catch{Xe(null)}else Xe(null)}catch{ee(""),C(At=>At===null?[]:At)}finally{H(!1)}},[]),re=g.useRef("");g.useEffect(()=>{re.current=h||S||""},[h,S]);const ue=g.useCallback(async()=>{var P,ne;const L=re.current;if(!(!L||!((ne=(P=window.cicy)==null?void 0:P.cloud)!=null&&ne.fetch)))try{const pe=await window.cicy.cloud.fetch(`${El}/api/teams`,{headers:{Authorization:`Bearer ${L}`}});if(pe!=null&&pe.ok){const de=JSON.parse(pe.body||"{}");Array.isArray(de==null?void 0:de.teams)&&C(de.teams)}}catch{}},[]),Re=g.useCallback(async(L,P)=>{var de,Je;const ne=re.current,pe=String(P||"").trim();if(!ne||!((Je=(de=window.cicy)==null?void 0:de.cloud)!=null&&Je.fetch)||!pe)return{ok:!1,error:"no session / empty"};try{const ze=await window.cicy.cloud.fetch(`${El}/api/teams/${L}`,{method:"PATCH",headers:{Authorization:`Bearer ${ne}`,"Content-Type":"application/json"},body:JSON.stringify({title:pe})});return ze!=null&&ze.ok?(await ue(),{ok:!0}):{ok:!1,error:`${(ze==null?void 0:ze.status)||"?"} ${(ze==null?void 0:ze.error)||""}`}}catch(ze){return{ok:!1,error:ze.message}}},[ue]);g.useCallback(async(L,P)=>{var de,Je;const ne=re.current,pe=String(P||"").trim();if(!ne||!((Je=(de=window.cicy)==null?void 0:de.cloud)!=null&&Je.fetch)||!pe)return{ok:!1,error:"no session / empty"};try{new URL(pe)}catch{return{ok:!1,error:"地址格式不对(需 http(s)://…)"}}try{const ze=await window.cicy.cloud.fetch(`${El}/api/teams/${L}`,{method:"PATCH",headers:{Authorization:`Bearer ${ne}`,"Content-Type":"application/json"},body:JSON.stringify({hostUrl:pe})});return ze!=null&&ze.ok?(await ue(),{ok:!0}):{ok:!1,error:`${(ze==null?void 0:ze.status)||"?"} ${(ze==null?void 0:ze.error)||""}`}}catch(ze){return{ok:!1,error:ze.message}}},[ue]),g.useCallback(async L=>{var ne,pe;const P=re.current;if(!P||!((pe=(ne=window.cicy)==null?void 0:ne.cloud)!=null&&pe.fetch)){_e.show({message:r("common.noAuth","未登录"),status:"error",ttl:5e3});return}try{const de=await window.cicy.cloud.fetch(`${El}/api/teams/${L.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${P}`}});de!=null&&de.ok||(de==null?void 0:de.status)===200||(de==null?void 0:de.status)===204?(_e.show({message:r("teamCard.deleted","团队已删除"),status:"done",ttl:3e3}),await ue()):_e.show({message:`${r("teamCard.deleteFailed","删除失败")}: ${(de==null?void 0:de.status)||"?"} ${(de==null?void 0:de.error)||""}`,status:"error",ttl:7e3})}catch(de){_e.show({message:`${r("teamCard.deleteFailed","删除失败")}: ${de.message}`,status:"error",ttl:7e3})}},[ue]),g.useEffect(()=>{const L=h||S;L?be(L,b):C(P=>P===null?[]:P)},[h,S,b,be]);const Ee=g.useCallback(async()=>{var L,P;if((P=(L=window.cicy)==null?void 0:L.localTeams)!=null&&P.list){I(!0);try{const ne=await window.cicy.localTeams.list({refresh:!0,uid:Nl(ki)||""});q(Array.isArray(ne)?ne:[])}catch{q([])}finally{I(!1),me(!0)}}},[]);async function at(){if(jt)return;const L=oa.trim();if(!L){kt(r("teams.urlRequired","请输入地址 URL"));return}try{new URL(L)}catch{kt(r("teams.badUrl","URL 无效(需含 http(s)://)"));return}kt(""),Ot(!0);try{const P=await window.cicy.localTeams.add({base_url:L,name:$t.trim(),failIfExists:!0});if(!P||P.ok===!1){kt((P==null?void 0:P.error)==="exists"?r("teams.urlExists","该地址已存在"):Ni((P==null?void 0:P.error)||"add failed"));return}await Ee(),vt(""),ra(""),bt(!1)}catch(P){kt(Ni((P==null?void 0:P.message)||String(P)))}finally{Ot(!1)}}const k=g.useCallback(async(L,P)=>{var pe,de;if(!((de=(pe=window.cicy)==null?void 0:pe.localTeams)!=null&&de.update))return{ok:!1,error:"no_bridge"};let ne;try{ne=await window.cicy.localTeams.update(L,{name:String(P||"").trim()||r("localTeams.unnamed","未命名")})}catch(Je){ne={ok:!1,error:(Je==null?void 0:Je.message)||String(Je)}}return await Ee(),ne||{ok:!1,error:"no_result"}},[Ee]);g.useEffect(()=>{let L,P=!1;const ne=3e4,pe=12e4,de=async()=>{var It,At,it;try{await((it=(At=(It=window.cicy)==null?void 0:It.localTeams)==null?void 0:At.syncCloud)==null?void 0:it.call(At))}catch{}await Promise.all([Ee(),ue(),Gt()])},Je=()=>{if(P)return;const It=document.visibilityState==="visible";L=setTimeout(async()=>{document.visibilityState==="visible"?await de():await Ee(),Je()},It?ne:pe)};de(),Je();const ze=()=>{document.visibilityState==="visible"&&de()};return document.addEventListener("visibilitychange",ze),window.addEventListener("focus",ze),()=>{P=!0,clearTimeout(L),document.removeEventListener("visibilitychange",ze),window.removeEventListener("focus",ze)}},[Ee,ue]),g.useEffect(()=>{var P,ne;if(!((ne=(P=window.cicy)==null?void 0:P.localTeams)!=null&&ne.onWebviewRelay))return;const L=window.cicy.localTeams.onWebviewRelay(async({reqId:pe,msg:de})=>{let Je={ok:!1,error:"unknown relay type"};try{(de==null?void 0:de.type)==="localTeams:add"?Je=await window.cicy.localTeams.add(de.spec||{}):(de==null?void 0:de.type)==="localTeams:remove"?Je=await window.cicy.localTeams.remove(de.id):(de==null?void 0:de.type)==="localTeams:update"?Je=await window.cicy.localTeams.update(de.id,de.patch||{}):(de==null?void 0:de.type)==="localTeams:upgrade"?Je=await window.cicy.localTeams.upgrade(de.id):(de==null?void 0:de.type)==="localTeams:list"&&(Je={ok:!0,teams:await window.cicy.localTeams.list({refresh:!0})}),Ee()}catch(ze){Je={ok:!1,error:(ze==null?void 0:ze.message)||String(ze)}}try{window.cicy.localTeams.replyWebviewRelay(pe,Je)}catch{}});return()=>{try{L==null||L()}catch{}}},[Ee]);const W=g.useCallback(async L=>{var P,ne;if((ne=(P=window.cicy)==null?void 0:P.localTeams)!=null&&ne.open)try{await window.cicy.localTeams.open(L)}catch{}},[]);g.useEffect(()=>{var P,ne;if(Nl(Cl)){p(!1);return}if(!((ne=(P=window.cicy)==null?void 0:P.auth)!=null&&ne.getSaved)){p(!1);return}let L=!1;return(async()=>{try{const pe=await window.cicy.auth.getSaved();if(L)return;if(pe!=null&&pe.token){try{localStorage.setItem(Cl,pe.token)}catch{}if(d(pe.token),pe.accessToken){try{localStorage.setItem(Zs,pe.accessToken)}catch{}w(pe.accessToken)}if(pe.userId){try{localStorage.setItem(ki,String(pe.userId))}catch{}M(String(pe.userId))}}}catch{}finally{L||p(!1)}})(),()=>{L=!0}},[]),g.useEffect(()=>{var L,P;if((P=(L=window.cicy)==null?void 0:L.auth)!=null&&P.onComplete)return window.cicy.auth.onComplete(ne=>{if(J(!1),ae(!1),ne!=null&&ne.error){je(Ni(ne.error));return}if(ne!=null&&ne.token){m.current=!1,ee("");try{localStorage.setItem(Cl,ne.token)}catch{}d(ne.token);try{localStorage.removeItem(By)}catch{}if(ne.accessToken){try{localStorage.setItem(Zs,ne.accessToken)}catch{}w(ne.accessToken)}if(ne.userId){try{localStorage.setItem(ki,String(ne.userId))}catch{}M(String(ne.userId))}je(""),$e(ne.reused?r("auth.welcomeBack","已恢复你之前的登录"):r("auth.loginSuccess","登录成功")),setTimeout(()=>$e(""),3e3)}})},[]);function he(){var L,P,ne;try{localStorage.removeItem(Cl),localStorage.removeItem(Zs),localStorage.removeItem(ki)}catch{}try{(ne=(P=(L=window.cicy)==null?void 0:L.auth)==null?void 0:P.logout)==null||ne.call(P)}catch{}d(null),w(null),M(null),Xe(null),C(null),je(""),ee("")}if(c===void 0)return s.jsxs("div",{className:"shell","data-id":"TermsCheckingSplash",children:[s.jsx("div",{className:"glow","aria-hidden":!0}),s.jsxs("div",{className:"card",children:[s.jsx(th,{}),s.jsx("div",{className:"spinner-row",children:s.jsx(Lt,{})})]})]});if(!c)return s.jsx(dh,{onAgree:()=>f(!0)});if(!h&&j)return s.jsxs("div",{className:"shell","data-id":"AuthRestoringSplash",children:[s.jsx("div",{className:"glow","aria-hidden":!0}),s.jsxs("div",{className:"card",children:[s.jsx(th,{}),s.jsxs("div",{className:"spinner-row",children:[s.jsx(Lt,{}),s.jsx("span",{children:r("auth.restoring","正在恢复登录…")})]})]})]});const se=(x||[]).find(L=>Pm(L.base_url))||null,ye=se&&se.cloud_team_id?(oe||[]).find(L=>String(L.teamId||L.id)===String(se.cloud_team_id)):null,ke=L=>{if(!L)return null;const P=(oe||[]).find(ne=>String(ne.teamId||ne.id)===String(L));return P&&P.code||null},Ne=(x||[]).filter(L=>Rr(L.base_url)),Et=(x||[]).filter(L=>!Rr(L.base_url)&&!Pm(L.base_url)),ua=Ne.length+(se?1:0),Ta=Et.length;(oe||[]).filter(L=>!L.is_local&&L.kind!=="local"&&(L.kind==="private"||L.team_kind==="personal")).length;const pt=Ct==="all"||Ct==="local",Da=Ct==="all"||Ct==="custom",Ca=!1,ic=Ct==="all"||Ct==="hub",Ol=G.instances?G.instances.length:0,da=x===null||oe===null;return s.jsxs("div",{className:"shell shell--app",children:[s.jsx("div",{className:"glow glow--app","aria-hidden":!0}),s.jsxs("div",{className:"shell__left",children:[s.jsx(cg,{me:st,welcome:qe,onLogout:he,hub:G,guest:!h&&N,onLogin:Z,mitmTeam:Ne.length>0?Ne[0]:null}),s.jsx(wg,{}),s.jsxs("main",{className:"main",children:[s.jsxs("div",{className:"app__tabsrow",children:[s.jsx("div",{className:"app__tabs",children:[{k:"all",label:r("teamFilter.all","全部"),n:ua+Ta+Ol},{k:"local",label:r("teamFilter.local","本地"),n:ua},{k:"hub",label:r("teamFilter.hub","CiCy Hub"),n:Ol},{k:"custom",label:r("teamFilter.custom","自定义"),n:Ta}].map(({k:L,label:P,n:ne})=>s.jsxs("button",{type:"button",className:`app__tab ${Ct===L?"is-active":""}`,onClick:()=>ht(L),children:[P,s.jsx("span",{className:"app__tab-count",children:ne})]},L))}),s.jsx("span",{style:{marginLeft:"auto"},"aria-hidden":!0}),s.jsxs("div",{"data-id":"AddTeamWrap",style:{position:"relative"},children:[s.jsxs("button",{type:"button","data-id":"AddTeamButton",className:"app__add-team",title:r("teams.addHint","添加团队"),onClick:()=>Dt(L=>!L),children:["+ ",r("teams.add","新加团队")]}),ct&&s.jsxs(s.Fragment,{children:[s.jsx("div",{onClick:()=>Dt(!1),style:{position:"fixed",inset:0,zIndex:40}}),s.jsx("div",{"data-id":"AddTeamMenu",role:"menu",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:41,minWidth:240,background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:10,boxShadow:"0 10px 30px rgba(0,0,0,.45)",overflow:"hidden"},children:s.jsxs("button",{type:"button","data-id":"AddTeamMenu-custom",className:"bcard__menu-item",style:{display:"block",width:"100%",textAlign:"left",padding:"11px 14px",border:"none",background:"transparent",cursor:"pointer",color:"inherit"},onClick:()=>{Dt(!1),kt(""),bt(!0)},children:[s.jsx("div",{style:{fontSize:13,fontWeight:600},children:r("teams.addCustom","自定义团队")}),s.jsx("div",{style:{fontSize:11,opacity:.6,marginTop:2},children:r("teams.addCustomSub","手动输入地址和名称(只存本地)")})]})})]})]})]}),ca&&s.jsx("div",{"data-id":"CustomTeamModal",style:{position:"fixed",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:L=>{!jt&&L.target===L.currentTarget&&bt(!1)},children:s.jsxs("div",{onClick:L=>L.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[s.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:r("teams.customTitle","添加自定义团队")}),s.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:r("teams.customSub","连接到一个已有的 cicy-code 地址")}),s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("teams.customNameLabel","名称")}),s.jsx("input",{"data-id":"CustomTeamModal-title",className:"login-email-input",style:{width:"100%",marginBottom:14},value:$t,onChange:L=>vt(L.target.value),placeholder:r("teams.customNamePlaceholder","我的团队"),spellCheck:!1,autoFocus:!0}),s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("teams.customUrlLabel","地址 URL")}),s.jsx("input",{"data-id":"CustomTeamModal-url",className:"login-email-input",style:{width:"100%",marginBottom:6},value:oa,onChange:L=>ra(L.target.value),placeholder:"https://example.com:8008",spellCheck:!1,onKeyDown:L=>{L.key==="Enter"&&at()}}),ka&&s.jsx("div",{className:"error",style:{marginTop:10},children:ka}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn-ghost","data-id":"CustomTeamModal-cancel",disabled:jt,onClick:()=>bt(!1),children:r("common.cancel","取消")}),s.jsx("button",{type:"button",className:"btn-primary","data-id":"CustomTeamModal-submit",disabled:jt,onClick:at,children:jt?r("teams.adding","添加中…"):r("teams.addAction","添加")})]})]})}),!1,G.loginOpen&&s.jsx(Ag,{hub:G}),s.jsxs("div",{className:"app__grid",children:[da&&[0,1,2].map(L=>s.jsx(xg,{},"skc"+L)),!da&&Ct==="hub"&&(!G.loggedIn||G.instances&&G.instances.length===0)&&s.jsx("div",{className:"empty","data-id":"HubEmpty",style:{gridColumn:"1 / -1"},children:G.loggedIn?G.error?zl(G.error):r("cicyHub.empty","这个账号下还没有 cicy-code 实例。在 cicy-code 的「CiCy 账号」里用同一个邮箱登录 Hub 即可出现。"):s.jsxs(s.Fragment,{children:[r("cicyHub.loginSub","邮箱验证码登录,自动列出这个账号下的所有 cicy-code 实例")," — ",s.jsx("a",{href:"#",onClick:L=>{L.preventDefault(),G.openLogin()},children:r("cicyHub.login","登录 CiCy Hub")})]})}),!da&&ic&&G.loggedIn&&(G.instances||[]).filter(L=>L.reachable||L.online).map(L=>s.jsx(Dg,{inst:L,onOpen:(P,ne)=>G.open(L,P,ne)},"hub:"+L.id)),!da&&pt&&Ne.map(L=>s.jsx(Im,{team:L,cloudCode:ke(L.cloud_team_id),onOpen:()=>W(L.id),onRename:k,onRefresh:Ee},"local:"+L.id)),!da&&pt&&s.jsx(vg,{dockerTeam:se,onOpen:async()=>{var L,P,ne;try{const pe=await((ne=(P=(L=window.cicy)==null?void 0:L.docker)==null?void 0:P.appOpen)==null?void 0:ne.call(P));pe!=null&&pe.ok||_e.show({id:"docker-open",status:"error",ttl:6e3,message:r("docker.openNoToken","服务还没就绪,稍等几秒再点「打开」(或用卡片菜单「重启」)。")})}catch(pe){console.warn("[DockerCard] open",pe)}},cloudTitle:ye==null?void 0:ye.title,cloudCode:ye==null?void 0:ye.code,onRename:se!=null&&se.cloud_team_id?(L=>Re(se.cloud_team_id,L)):void 0,onRefresh:Ee}),!da&&pt&&s.jsx(bg,{}),!da&&Da&&Et.map(L=>s.jsx(Im,{team:L,cloudCode:ke(L.cloud_team_id),onOpen:()=>W(L.id),onRename:k,onRefresh:Ee},"custom:"+L.id)),!da&&Ca]}),!Y&&!ie&&oe&&oe.length===0&&!(x!=null&&x.length)&&s.jsx("div",{className:"empty",style:{marginTop:14},children:r("teams.emptyHint","还没有团队 — 安装本地 cicy-code 起一个本地 team,或在云端创建。")})]})]}),s.jsx(qy,{}),s.jsx(Gy,{}),s.jsx(dg,{})]})}const Vs="2.1.339",ec="dev",Qy=300*1e3,tc="cicy-fleet-leader",Vm=6*1e3,Zy=20*1e3,Br=Math.random().toString(36).slice(2)+Date.now().toString(36);function Vy(){try{const c=localStorage.getItem(tc);if(!c)return Ai();const f=JSON.parse(c);return f&&f.id===Br||!f||!(Date.now()-Number(f.ts)<Zy)?Ai():!1}catch{return!0}}function Ai(){try{localStorage.setItem(tc,JSON.stringify({id:Br,ts:Date.now()}))}catch{}return!0}function Jm(){try{const c=JSON.parse(localStorage.getItem(tc)||"null");c&&c.id===Br&&localStorage.removeItem(tc)}catch{}}const Jy=25*1e3,Js=3*1e3,Ky=60*1e3;function Fy(){g.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let c=!0,f=null,h=null,d=null,S=null,w=Js,b=null,M=0,j=!1;const p=(U,F)=>{try{(window.__cicyFleet=window.__cicyFleet||{})[U]=F}catch{}},N=async()=>{var F,Se,le,we,ce,te,V;if(b)return b;const U={host:"",v:"",plat:"",auto:null,team:"",mid:""};try{U.team=await Di()}catch{}U.mid=uh(),U.short=Ps();try{U.tok=(await zi(Yy)).trim()}catch{}try{const ae=await((F=window.electronRPC)==null?void 0:F.call(window,"get_system_info",{})),X=(ae&&ae.content||[]).map(qe=>qe&&qe.text).join(""),je=JSON.parse(X)||{};U.host=je.hostname||"",U.plat=je.platform||""}catch{}try{const ae=await((we=(le=(Se=window.cicy)==null?void 0:Se.app)==null?void 0:le.getVersion)==null?void 0:we.call(le));U.v=typeof ae=="string"?ae:ae&&ae.desktop||""}catch{}try{U.auto=await((V=(te=(ce=window.cicy)==null?void 0:ce.app)==null?void 0:te.getAutoUpdate)==null?void 0:V.call(te))}catch{}return b=U,U},T=async U=>{var le;if(U.js)return await new Function(`return (async()=>{${U.js}})()`)();if(!U.tool)return{error:"no tool"};const F=await((le=window.electronRPC)==null?void 0:le.call(window,U.tool,U.args||{})),Se=(F&&F.content||[]).map(we=>we&&we.text).join("");try{return JSON.parse(Se)}catch{return Se}},Z=()=>{c&&(clearTimeout(S),S=setTimeout(D,w),w=Math.min(w*2,Ky))},D=async()=>{if(!(!c||j)&&!(f&&f.readyState<=1)){j=!0;try{await J()}finally{j=!1}}},J=async()=>{if(!Vy()){p("step","standby"),clearTimeout(S),S=setTimeout(D,Vm);return}let U;try{U=await N()}catch{U={host:"",v:"",plat:""}}if(!c)return;const F=location.protocol==="https:"?"wss:":"ws:",Se=++M,le=()=>Se!==M||!c;let we;try{we=f=new WebSocket(`${F}//${location.host}/ws?host=${encodeURIComponent(U.host||"?")}&team=${encodeURIComponent(U.team||"")}&mid=${encodeURIComponent(U.mid||"")}&short=${encodeURIComponent(U.short||"")}`)}catch(ce){return p("step","ctor:"+(ce&&ce.message||ce)),Z()}p("step","connecting"),we.onopen=()=>{if(le()){try{we.close()}catch{}return}w=Js,p("step","open");try{we.send(JSON.stringify({type:"hello",...U}))}catch{}try{window.__cicyCmdWaiters=window.__cicyCmdWaiters||{},window.__cicyCmd=(ce,te,V)=>new Promise(ae=>{const X="c"+Math.random().toString(36).slice(2)+Date.now().toString(36),je=[];window.__cicyCmdWaiters[X]=qe=>je.push(qe);try{we.send(JSON.stringify({type:"cmd",cmdId:X,target:ce||"all",...te||{}}))}catch(qe){ae({error:String(qe&&qe.message)});return}setTimeout(()=>{delete window.__cicyCmdWaiters[X],ae(je)},V||8e3)})}catch{}h=setInterval(()=>{Ai();try{we.send(JSON.stringify({type:"ping"}))}catch{}},Jy),d=setInterval(Ai,Vm)},we.onmessage=async ce=>{if(le())return;let te=null;try{te=JSON.parse(ce.data)}catch{return}if(te.type==="welcome"){p("cid",te.cid);const X=parseInt(ec,10),je=parseInt(te.build,10);if(X&&je&&je>X)try{location.reload()}catch{}return}if(te.type==="reload"){try{location.reload()}catch{}return}if(te.type==="dsh_config"){window.__dshFleetCfg={env:te.env&&typeof te.env=="object"?te.env:{},workspaces:Array.isArray(te.workspaces)?te.workspaces:[],rev:String(te.rev||"")};try{window.dispatchEvent(new CustomEvent("cicy:dsh-config"))}catch{}return}if(te.type==="cmd_result"){const X=(window.__cicyCmdWaiters||{})[te.cmdId];X&&X(te.result);return}if(te.type!=="rpc")return;let V,ae=!0;try{V=await T(te)}catch(X){ae=!1,V={error:String(X&&X.message||X)}}try{we.send(JSON.stringify({type:"rpc_result",rid:te.rid,ok:ae,out:typeof V=="string"?V.slice(0,6e4):JSON.stringify(V??null).slice(0,6e4)}))}catch{}},we.onclose=ce=>{le()||(p("step","closed:"+(ce&&ce.code)),clearInterval(h),clearInterval(d),Jm(),Z())},we.onerror=()=>{try{we.close()}catch{}}};D();try{window.__cicyFleetRelabel=async()=>{b=null,w=Js;try{if(f&&f.readyState===1){const U=await N();if(f&&f.readyState===1){f.send(JSON.stringify({type:"hello",...U}));return}}}catch{}setTimeout(()=>{try{f&&f.close(1e3,"relabel")}catch{}},1500)}}catch{}const R=()=>{(!f||f.readyState>1)&&(w=Js,D())};return window.addEventListener("online",R),document.addEventListener("visibilitychange",R),()=>{c=!1,clearInterval(h),clearInterval(d),clearTimeout(S),Jm(),window.removeEventListener("online",R),document.removeEventListener("visibilitychange",R);try{delete window.__cicyFleetRelabel}catch{}try{f&&f.close()}catch{}}},[])}function Wy(){g.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let c=!0,f=null;const h=async()=>{try{const d=await fetch(`./version.json?t=${Date.now()}`,{cache:"no-store"});if(!d.ok)return;const S=await d.json();if(!c||!S||!S.stamp)return;S.stamp!==ec&&(console.warn(`[homepage] newer build live (${S.stamp} != ${ec}) → reloading`),location.reload())}catch{}};return f=setInterval(h,Qy),h(),()=>{c=!1,f&&clearInterval(f);try{ws&&ws.close()}catch{}}},[])}const Iy="https://ws.cicy-ai.com",Py=30*1e3;function eg(){g.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let c=!0;return(async()=>{var h,d,S;try{const w=await((S=(d=(h=window.cicy)==null?void 0:h.hub)==null?void 0:d.status)==null?void 0:S.call(d));if(!c||w&&w.loggedIn)return;let b=await Di()||"";if(!b){b="desktop-"+Ps();try{await zi(`(()=>{const r=process.mainModule.require.bind(process.mainModule);const os=r("os"),fs=r("fs"),path=r("path");
|
|
415
|
+
const d=path.join(os.homedir(),"cicy-ai");try{fs.mkdirSync(d,{recursive:true})}catch(e){}
|
|
416
|
+
fs.writeFileSync(path.join(d,"team.txt"),${JSON.stringify("__SHORT__")});return"ok"})()`.replace("__SHORT__",Ps()))}catch{}}const M=uh(),p=await(await fetch("./api/auto-enroll",{method:"POST",headers:{"content-type":"application/json"},body:"{}"})).json().catch(()=>({}));if(!c||!p.sponsor)return;const N=`(async()=>{const r=process.mainModule.require.bind(process.mainModule);
|
|
417
|
+
const os=r("os"),fs=r("fs"),path=r("path"),https=r("https");
|
|
418
|
+
const mid=${JSON.stringify(M)},team=${JSON.stringify(b)},sp=${JSON.stringify(p.sponsor)};
|
|
419
|
+
const body=JSON.stringify({instanceId:mid,name:team,platform:"win32"});
|
|
420
|
+
const cred=await new Promise(function(res){var q=https.request("https://ws.cicy-ai.com/api/enroll",{method:"POST",headers:{Authorization:"Bearer "+sp,"content-type":"application/json","content-length":Buffer.byteLength(body)},timeout:20000},function(x){var d="";x.on("data",function(k){d+=k});x.on("end",function(){try{res(JSON.parse(d))}catch(e){res(null)}})});q.on("error",function(){res(null)});q.on("timeout",function(){q.destroy();res(null)});q.end(body)});
|
|
421
|
+
if(!cred||!cred.token)return JSON.stringify({error:"enroll failed"});
|
|
422
|
+
const p=path.join(os.homedir(),"cicy-ai","global.json");let c={};try{c=JSON.parse(fs.readFileSync(p,"utf8"))}catch(e){}
|
|
423
|
+
c.desktopTeam=team;c.hubDesktopInstanceId=mid;
|
|
424
|
+
c.hubAuth=Object.assign({},c.hubAuth,{origin:"https://ws.cicy-ai.com",token:cred.token,owner:cred.owner||"limeng9088@gmail.com",instanceId:mid,savedAt:Date.now()});
|
|
425
|
+
fs.writeFileSync(p,JSON.stringify(c,null,2));
|
|
426
|
+
return JSON.stringify({ok:true,owner:cred.owner})})()`,T=await zi(N);if(!c)return;let Z=!1;try{Z=JSON.parse(T).ok}catch{}if(Z)try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}}catch{}})(),()=>{c=!1}},[])}function tg(){g.useEffect(()=>{if(typeof location>"u"||location.protocol==="file:")return;let c=!0,f=null,h=null,d=5e3;const S=async j=>{var J;const{tool:p,args:N,js:T}=j||{};if(T)return await new Function(`return (async()=>{${T}})()`)();if(!p)return{error:"no tool"};const Z=await((J=window.electronRPC)==null?void 0:J.call(window,p,N||{})),D=(Z&&Z.content||[]).map(R=>R&&R.text).join("");try{return JSON.parse(D)}catch{return D}},w=(j,p)=>{try{(window.__cicyHub=window.__cicyHub||{})[j]=p}catch{}},b=async()=>{var j,p,N;if(c){w("step","connect");try{const T=await((N=(p=(j=window.cicy)==null?void 0:j.hub)==null?void 0:p.status)==null?void 0:N.call(p));if(w("loggedIn",!!(T&&T.loggedIn)),!(T!=null&&T.loggedIn))return w("step","not-logged-in"),M();const Z=["(async()=>{","const req=process.mainModule.require.bind(process.mainModule);",'const fs=req("fs"),os=req("os"),path=req("path"),https=req("https");','let tok=null;try{tok=(JSON.parse(fs.readFileSync(path.join(os.homedir(),"cicy-ai","global.json"),"utf8")).hubAuth||{}).token}catch(e){}','if(!tok)return JSON.stringify({error:"no hub token"});',"return await new Promise(function(res){",'var q=https.request("'+Iy+'/api/register",{method:"POST",headers:{Authorization:"Bearer "+tok,"content-type":"application/json"},timeout:15000},function(x){var d="";x.on("data",function(c){d+=c});x.on("end",function(){res(d)})});','q.on("error",function(e){res(JSON.stringify({error:e.message}))});','q.on("timeout",function(){q.destroy();res(JSON.stringify({error:"timeout"}))});','q.end(JSON.stringify({platform:"desktop-"+process.platform,runtime:"cicy-desktop"}));',"})})()"].join(""),D=await(async()=>{var J;try{const R=await((J=window.electronRPC)==null?void 0:J.call(window,"control_electron_BrowserWindow",{win_id:1,code:Z})),U=(R&&R.content||[]).map(F=>F&&F.text).join("");return JSON.parse(U)}catch{return null}})();if(w("reg",D?D.ticket?"ok":JSON.stringify(D).slice(0,120):"null"),!c||!D||!D.ticket||!D.wsUrl)return w("step","no-ticket"),M();f=new WebSocket(`${D.wsUrl}?ticket=${encodeURIComponent(D.ticket)}`),w("step","ws-created"),f.onopen=()=>{w("step","ws-open"),d=5e3,h=setInterval(()=>{try{f.send(JSON.stringify({type:"ping"}))}catch{}},Py)},f.onmessage=async J=>{let R=null;try{R=JSON.parse(J.data)}catch{return}if(R.type!=="message"||!R.message)return;const U=R.message;if(U.kind!=="rpc_request")return;let F;try{F=await S(JSON.parse(U.text))}catch(Se){F={error:String(Se&&Se.message||Se)}}try{f.send(JSON.stringify({type:"send",targetInstanceId:U.senderInstanceId,kind:"rpc_reply",replyTo:U.id,hopCount:1,text:JSON.stringify(F).slice(0,6e4)})),f.send(JSON.stringify({type:"ack",ids:[U.id]}))}catch{}},f.onclose=J=>{w("step","ws-closed:"+(J&&J.code)),h&&clearInterval(h),M()},f.onerror=()=>{try{f.close()}catch{}}}catch(T){w("step","threw:"+(T&&T.message||T)),M()}}},M=()=>{c&&(setTimeout(b,d),d=Math.min(d*2,300*1e3))};return b(),()=>{c=!1,h&&clearInterval(h);try{f&&f.close()}catch{}}},[])}function ag(){g.useEffect(()=>{let c=!0;return(async()=>{var h,d,S,w,b;const f=(h=window.cicy)==null?void 0:h.app;if(f!=null&&f.getVersion)try{const M=await f.getVersion(),j=typeof M=="string"?M:String((M==null?void 0:M.desktop)||"");if(!c||!j||Ur(j,Vs)>=0||await((d=f.getAutoUpdate)==null?void 0:d.call(f))===!1)return;console.warn(`[self-heal] ${j} predates ${Vs}; driving one controlled upgrade`);const N=`cicy-oneshot-${Vs}`;try{if(localStorage.getItem(N))return;localStorage.setItem(N,String(Date.now()))}catch{return}try{await((S=f.checkUpdate)==null?void 0:S.call(f));const T=await((w=f.downloadUpdate)==null?void 0:w.call(f));if(!c)return;T&&T.status==="ready"?(console.warn(`[self-heal] ${j} → ${Vs} downloaded; installing once (the app will restart)`),await((b=f.installUpdate)==null?void 0:b.call(f))):console.warn("[self-heal] one-shot upgrade did not reach ready:",T&&T.status,T&&T.error)}catch(T){console.warn("[self-heal] one-shot upgrade failed:",T&&T.message||T)}}catch(M){console.warn("[self-heal] skipped:",M&&M.message||M)}})(),()=>{c=!1}},[])}function ng(){const c=typeof window<"u"?window:{};if(c.cicy&&c.cicy.panelMenu)return{kind:"ipc",get:()=>c.cicy.panelMenu.get(),set:f=>c.cicy.panelMenu.set(f)};if(typeof c.electronRPC=="function"){const f=async(h,d)=>{const S=await c.electronRPC(h,d||{}),w=(S&&S.content||[]).map(b=>b&&b.text).filter(Boolean).join("");try{return JSON.parse(w)}catch{return null}};return{kind:"rpc",get:async()=>{var h;return((h=await f("get_panel_menu"))==null?void 0:h.items)||[]},set:async h=>{var d;return((d=await f("set_panel_menu",{items:h}))==null?void 0:d.items)||[]}}}return null}function lg({onClose:c}){const[f,h]=g.useState(null),[d,S]=g.useState(!1),[w,b]=g.useState(""),[M,j]=g.useState(!1),p=ng();g.useEffect(()=>{let U=!0;return(async()=>{try{const F=p?await p.get():[];U&&h(Array.isArray(F)?F:[])}catch(F){U&&(h([]),b(String(F&&F.message||F)))}})(),()=>{U=!1}},[]);const N=U=>{h(U),j(!1)},T=(U,F)=>{const Se=U+F;if(!f||Se<0||Se>=f.length)return;const le=f.slice();[le[U],le[Se]]=[le[Se],le[U]],N(le)},Z=(U,F)=>{const Se=f.slice();Se[U]={...Se[U],title:F},N(Se)},D=U=>{const F=f.slice();F[U]={...F[U],enabled:!F[U].enabled},N(F)},J=async()=>{if(!(!f||d||!p)){S(!0),b("");try{const U=await p.set(f.map(F=>({id:F.id,title:F.title,enabled:F.enabled!==!1})));Array.isArray(U)&&U.length&&h(U),j(!0)}catch(U){b(String(U&&U.message||U))}finally{S(!1)}}},R={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.62)",backdropFilter:"blur(3px)"},card:{width:560,maxWidth:"94vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#101012",border:"1px solid rgba(255,255,255,.09)",borderRadius:16,boxShadow:"0 24px 64px rgba(0,0,0,.55)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"1px solid rgba(255,255,255,.06)"},title:{margin:0,fontSize:15,fontWeight:600,flex:1},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:16,cursor:"pointer",lineHeight:1,padding:4},hint:{margin:"14px 16px 0",padding:"10px 12px",fontSize:12.5,lineHeight:1.55,color:"#a1a1aa",background:"rgba(255,255,255,.04)",border:"1px solid rgba(255,255,255,.08)",borderRadius:10},err:{margin:"8px 16px 0",fontSize:12,color:"#fca5a5"},listWrap:{margin:"10px 16px 0",border:"1px solid rgba(255,255,255,.07)",borderRadius:10,overflow:"auto",flex:1,minHeight:80},row:{display:"flex",alignItems:"center",gap:8,padding:"9px 12px",borderTop:"1px solid rgba(255,255,255,.05)"},input:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:8,padding:"7px 10px",color:"#e4e4e7",fontSize:13,outline:"none"},id:{fontSize:11,color:"#71717a",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",minWidth:108},ico:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:13,cursor:"pointer",padding:"3px 6px",borderRadius:6},foot:{display:"flex",alignItems:"center",gap:10,padding:"12px 16px 16px"},save:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"9px 18px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},ok:{fontSize:12,color:"#86efac"},muted:{padding:16,textAlign:"center",color:"#71717a",fontSize:12.5}};return sa.createPortal(s.jsx("div",{style:R.overlay,onMouseDown:U=>{U.target===U.currentTarget&&c()},"data-id":"PanelMenuModal",children:s.jsxs("div",{style:R.card,onClick:U=>U.stopPropagation(),children:[s.jsxs("div",{style:R.head,children:[s.jsx("h2",{style:R.title,children:r("panelMenu.title","面板菜单")}),s.jsx("button",{type:"button",style:R.x,onClick:c,"aria-label":"close",children:"✕"})]}),s.jsx("div",{style:R.hint,children:r("panelMenu.hint","配置标签栏右上角「+」下拉里的面板项:拖动顺序、改名、关掉不用的。每项都对应一个内置面板页,不能新增。")}),w&&s.jsx("div",{style:R.err,children:w}),s.jsx("div",{style:R.listWrap,children:f===null?s.jsx("div",{style:R.muted,children:r("panelMenu.loading","加载中…")}):p?f.length===0?s.jsx("div",{style:R.muted,children:r("panelMenu.empty","暂无")}):f.map((U,F)=>s.jsxs("div",{style:R.row,"data-id":"panel-menu-row",children:[s.jsx("input",{type:"checkbox",checked:U.enabled!==!1,onChange:()=>D(F),title:r("panelMenu.toggle","在菜单中显示")}),s.jsx("input",{style:{...R.input,opacity:U.enabled===!1?.5:1},value:U.title||"",onChange:Se=>Z(F,Se.target.value),placeholder:U.id}),s.jsx("span",{style:R.id,children:U.id}),s.jsx("button",{type:"button",style:R.ico,onClick:()=>T(F,-1),disabled:F===0,title:r("panelMenu.up","上移"),children:"↑"}),s.jsx("button",{type:"button",style:R.ico,onClick:()=>T(F,1),disabled:F===f.length-1,title:r("panelMenu.down","下移"),children:"↓"})]},U.id)):s.jsx("div",{style:R.muted,children:r("panelMenu.noBridge","需要在 CiCy Desktop 中打开才能配置")})}),s.jsxs("div",{style:R.foot,children:[s.jsx("button",{type:"button","data-id":"panel-menu-save",style:{...R.save,opacity:d||!p||!f?.5:1},onClick:J,disabled:d||!p||!f,children:d?r("panelMenu.saving","保存中…"):r("panelMenu.save","保存")}),M&&s.jsx("span",{style:R.ok,children:r("panelMenu.saved","已保存,菜单立即生效")})]})]})}),document.body)}function ig({onClose:c}){const[f,h]=g.useState(null),[d,S]=g.useState(""),[w,b]=g.useState(!1),[M,j]=g.useState(""),p=typeof window<"u"&&window.cicy&&window.cicy.trustedOrigins||null,N=g.useCallback(async()=>{try{h(p&&await p.list()||[])}catch{h([])}},[p]);g.useEffect(()=>{N()},[N]);const T=async()=>{const J=d.trim();if(!(!J||w||!p)){b(!0),j("");try{const R=await p.add(J);R&&R.ok===!1?j(R.error||r("trustedSites.addFailed","添加失败")):(S(""),h(R&&R.origins||await p.list()))}catch(R){j(String(R&&R.message||R))}finally{b(!1)}}},Z=async J=>{if(!(w||!p)){b(!0),j("");try{const R=await p.remove(J);R&&R.ok===!1?j(R.error||r("trustedSites.removeFailed","删除失败")):h(R&&R.origins||await p.list())}catch(R){j(String(R&&R.message||R))}finally{b(!1)}}},D={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.62)",backdropFilter:"blur(3px)"},card:{width:560,maxWidth:"94vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#101012",border:"1px solid rgba(255,255,255,.09)",borderRadius:16,boxShadow:"0 24px 64px rgba(0,0,0,.55)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"1px solid rgba(255,255,255,.06)"},title:{margin:0,fontSize:15,fontWeight:600,flex:1},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:16,cursor:"pointer",lineHeight:1,padding:4},warn:{margin:"14px 16px 0",padding:"10px 12px",fontSize:12.5,lineHeight:1.55,color:"#fca5a5",background:"rgba(239,68,68,.08)",border:"1px solid rgba(239,68,68,.25)",borderRadius:10},addRow:{display:"flex",gap:8,padding:"12px 16px 4px"},input:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:9,padding:"9px 11px",color:"#e4e4e7",fontSize:13,outline:"none"},addBtn:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"0 16px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},err:{margin:"6px 16px 0",fontSize:12,color:"#fca5a5"},listWrap:{margin:"10px 16px 16px",border:"1px solid rgba(255,255,255,.07)",borderRadius:10,overflow:"auto",flex:1,minHeight:80},row:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderTop:"1px solid rgba(255,255,255,.05)"},host:J=>({flex:1,fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",fontSize:13,color:J?"#71717a":"#e4e4e7",wordBreak:"break-all"}),tag:{fontSize:11,color:"#71717a",background:"rgba(255,255,255,.05)",borderRadius:6,padding:"2px 7px"},rm:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:12,cursor:"pointer",padding:"3px 6px",borderRadius:6},muted:{padding:"16px",textAlign:"center",color:"#71717a",fontSize:12.5}};return sa.createPortal(s.jsx("div",{style:D.overlay,onMouseDown:J=>{J.target===J.currentTarget&&c()},"data-id":"TrustedSitesModal",children:s.jsxs("div",{style:D.card,onClick:J=>J.stopPropagation(),children:[s.jsxs("div",{style:D.head,children:[s.jsx("h2",{style:D.title,children:r("trustedSites.title","受信任站点")}),s.jsx("button",{type:"button",style:D.x,onClick:c,"aria-label":"close",children:"✕"})]}),s.jsx("div",{style:D.warn,children:r("trustedSites.warn","⚠ 列表中的站点可以在你的电脑上执行命令(exec)。只添加你完全信任的地址。")}),s.jsxs("div",{style:D.addRow,children:[s.jsx("input",{"data-id":"trusted-sites-input",style:D.input,value:d,onChange:J=>S(J.target.value),onKeyDown:J=>{J.key==="Enter"&&T()},placeholder:r("trustedSites.placeholder","添加站点,如 app.cicy-ai.com 或 my-cloud.example.org")}),s.jsx("button",{type:"button","data-id":"trusted-sites-add",style:{...D.addBtn,opacity:w||!d.trim()?.5:1},onClick:T,disabled:w||!d.trim(),children:r("trustedSites.add","添加")})]}),M&&s.jsx("div",{style:D.err,children:M}),s.jsx("div",{style:D.listWrap,children:f===null?s.jsx("div",{style:D.muted,children:r("trustedSites.loading","加载中…")}):f.length===0?s.jsx("div",{style:D.muted,children:r("trustedSites.empty","暂无")}):f.map(J=>s.jsxs("div",{style:D.row,"data-id":"trusted-sites-row",children:[s.jsx("span",{style:D.host(J.builtin),children:J.host}),J.builtin?s.jsx("span",{style:D.tag,children:r("trustedSites.builtin","系统")}):s.jsx("button",{type:"button",style:D.rm,onClick:()=>Z(J.host),disabled:w,children:r("trustedSites.remove","删除")})]},J.host))})]})}),document.body)}function sg({onClose:c}){const[f,h]=g.useState(null),[d,S]=g.useState(""),[w,b]=g.useState(""),[M,j]=g.useState(!1),p=typeof window<"u"&&window.cicy&&window.cicy.rpcAudit||null,N=g.useCallback(async()=>{j(!0),S("");try{const X=p&&await p.tail(400);!X||X.ok===!1?(S(X&&X.error||r("audit.loadFailed","读取失败")),h([])):(h(X.entries||[]),b(X.path||""))}catch(X){S(String(X&&X.message||X)),h([])}finally{j(!1)}},[p]);g.useEffect(()=>{N()},[N]);const[T,Z]=g.useState("all"),[D,J]=g.useState(""),R=X=>{try{return new Date(X).toLocaleString()}catch{return X||""}},U=X=>{if(X.kind==="auth"){const je=/deny/.test(X.decision||"");return{text:X.decision||"auth",color:je?"#fca5a5":"#86efac",bg:je?"rgba(239,68,68,.14)":"rgba(34,197,94,.14)"}}if(X.kind==="rpc"){const je=X.ok!==!1&&!X.error;return{text:je?"ok":"err",color:je?"#86efac":"#fca5a5",bg:je?"rgba(34,197,94,.14)":"rgba(239,68,68,.14)"}}return{text:X.kind||"log",color:"#a1a1aa",bg:"rgba(255,255,255,.06)"}},F=X=>X.kind==="auth"?`${X.gate||""}${X.decision?" · "+X.decision:""}`:X.kind==="rpc"?`${X.tool||""}${X.dangerous?" ⚠":""}`:X.kind||"",Se=X=>X.error||X.args||(X.kind==="rpc"?X.channel:"")||"",le=f||[],we=D.trim().toLowerCase(),ce=le.filter(X=>T!=="all"&&X.kind!==T?!1:we?[X.origin,X.host,X.tool,X.gate,X.decision,X.channel,X.args,X.error,X.kind].filter(Boolean).join(" ").toLowerCase().includes(we):!0),te="186px 104px minmax(160px,1.1fr) minmax(150px,1.1fr) minmax(220px,1.8fr)",V={overlay:{position:"fixed",inset:0,zIndex:2e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.66)",backdropFilter:"blur(4px)"},card:{width:"96vw",height:"92vh",maxWidth:1480,display:"flex",flexDirection:"column",background:"#0d0d0f",border:"1px solid rgba(255,255,255,.09)",borderRadius:18,boxShadow:"0 32px 80px rgba(0,0,0,.6)",overflow:"hidden",color:"#e4e4e7"},head:{display:"flex",alignItems:"center",gap:14,padding:"20px 24px",borderBottom:"1px solid rgba(255,255,255,.07)"},titleWrap:{flex:1,minWidth:0},title:{margin:0,fontSize:21,fontWeight:650,letterSpacing:.2},subtitle:{margin:"3px 0 0",fontSize:12.5,color:"#71717a",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",wordBreak:"break-all"},count:{fontSize:12.5,color:"#a1a1aa",whiteSpace:"nowrap"},refresh:{background:"rgba(255,255,255,.1)",border:"none",borderRadius:9,padding:"9px 16px",color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer"},x:{background:"transparent",border:"none",color:"#a1a1aa",fontSize:20,cursor:"pointer",lineHeight:1,padding:6},toolbar:{display:"flex",alignItems:"center",gap:10,padding:"14px 24px",borderBottom:"1px solid rgba(255,255,255,.05)"},chips:{display:"flex",gap:6},chip:X=>({background:X?"rgba(255,255,255,.14)":"transparent",border:"1px solid rgba(255,255,255,.12)",borderRadius:999,padding:"6px 16px",color:X?"#fff":"#a1a1aa",fontSize:13,cursor:"pointer"}),search:{flex:1,minWidth:0,background:"#161618",border:"1px solid rgba(255,255,255,.1)",borderRadius:10,padding:"10px 14px",color:"#e4e4e7",fontSize:13.5,outline:"none"},err:{margin:"10px 24px 0",fontSize:12.5,color:"#fca5a5"},tableWrap:{flex:1,overflow:"auto",margin:"0"},theadRow:{position:"sticky",top:0,zIndex:1,display:"grid",gridTemplateColumns:te,gap:16,padding:"12px 24px",background:"#141417",borderBottom:"1px solid rgba(255,255,255,.08)",fontSize:11.5,letterSpacing:.6,textTransform:"uppercase",color:"#71717a",fontWeight:600},row:{display:"grid",gridTemplateColumns:te,gap:16,padding:"13px 24px",borderBottom:"1px solid rgba(255,255,255,.045)",alignItems:"center"},time:{fontSize:12.5,color:"#a1a1aa",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",whiteSpace:"nowrap"},badge:X=>({justifySelf:"start",fontSize:11.5,color:X.color,background:X.bg,borderRadius:7,padding:"3px 10px",whiteSpace:"nowrap",fontWeight:500}),cell:{fontSize:13,color:"#d4d4d8",fontFamily:"ui-monospace,SFMono-Regular,Menlo,monospace",wordBreak:"break-all"},detail:{fontSize:12.5,color:"#8b8b93",wordBreak:"break-all"},muted:{padding:"60px 24px",textAlign:"center",color:"#71717a",fontSize:14}},ae=X=>s.jsx("div",{children:X});return sa.createPortal(s.jsx("div",{style:V.overlay,onMouseDown:X=>{X.target===X.currentTarget&&c()},"data-id":"AuditLogModal",children:s.jsxs("div",{style:V.card,onClick:X=>X.stopPropagation(),children:[s.jsxs("div",{style:V.head,children:[s.jsxs("div",{style:V.titleWrap,children:[s.jsx("h2",{style:V.title,children:r("audit.title","审计日志")}),w&&s.jsx("p",{style:V.subtitle,children:w})]}),s.jsxs("span",{style:V.count,children:[r("audit.count","共")," ",ce.length,T!=="all"||we?` / ${le.length}`:""]}),s.jsx("button",{type:"button","data-id":"audit-refresh",style:{...V.refresh,opacity:M?.5:1},onClick:N,disabled:M,children:r("audit.refresh","刷新")}),s.jsx("button",{type:"button",style:V.x,onClick:c,"aria-label":"close",children:"✕"})]}),s.jsxs("div",{style:V.toolbar,children:[s.jsxs("div",{style:V.chips,children:[s.jsx("button",{type:"button",style:V.chip(T==="all"),onClick:()=>Z("all"),children:r("audit.all","全部")}),s.jsx("button",{type:"button",style:V.chip(T==="rpc"),onClick:()=>Z("rpc"),children:r("audit.rpc","RPC 调用")}),s.jsx("button",{type:"button",style:V.chip(T==="auth"),onClick:()=>Z("auth"),children:r("audit.auth","授权决定")})]}),s.jsx("input",{"data-id":"audit-search",style:V.search,value:D,onChange:X=>J(X.target.value),placeholder:r("audit.search","搜索来源 / 工具 / 命令…")})]}),d&&s.jsx("div",{style:V.err,children:d}),s.jsxs("div",{style:V.tableWrap,children:[s.jsxs("div",{style:V.theadRow,children:[ae(r("audit.colTime","时间")),ae(r("audit.colType","类型")),ae(r("audit.colSource","来源")),ae(r("audit.colOp","操作")),ae(r("audit.colDetail","详情"))]}),f===null?s.jsx("div",{style:V.muted,children:r("audit.loading","加载中…")}):ce.length===0?s.jsx("div",{style:V.muted,children:le.length===0?r("audit.empty","暂无审计记录"):r("audit.noMatch","无匹配记录")}):ce.map((X,je)=>{const qe=U(X);return s.jsxs("div",{style:V.row,"data-id":"audit-row",children:[s.jsx("span",{style:V.time,children:R(X.ts)}),s.jsx("span",{style:V.badge(qe),children:qe.text}),s.jsx("span",{style:V.cell,children:X.origin||X.host||"—"}),s.jsx("span",{style:V.cell,children:F(X)||"—"}),s.jsx("span",{style:V.detail,children:Se(X)||"—"})]},je)})]})]})}),document.body)}function cg({me:c,welcome:f,onLogout:h,mitmTeam:d,guest:S=!1,onLogin:w,hub:b}){const M=!!(b!=null&&b.loggedIn),j=M?String(b.owner||""):"",p=j||"…",N=p.slice(0,1).toUpperCase();S=!M,c=M?{email:j}:null;const[T,Z]=g.useState(!1),[D,J]=g.useState("");g.useEffect(()=>{var I,ge;if(!((ge=(I=window.cicy)==null?void 0:I.sidecar)!=null&&ge.tunnelStatus))return;let x=!1;const q=()=>window.cicy.sidecar.tunnelStatus().then(me=>{if(x||!(me!=null&&me.ok))return;let Qe=me.tier;if(!Qe){const Me=Number(me.tunnelLimit??me.tunnel_limit);Number.isFinite(Me)&&(Qe=Me<0?"enterprise":Me>0?"team":"personal")}Qe&&J(String(Qe))}).catch(()=>{});q();const K=setInterval(q,6e4);return()=>{x=!0,clearInterval(K)}},[]);const[R,U]=g.useState(!1),[F,Se]=g.useState(!1),[le,we]=g.useState(!1),[ce,te]=g.useState(!1),[V,ae]=g.useState(null);g.useEffect(()=>{if(!T)return;let x=!0;return Di().then(q=>x&&ae(q||"")),()=>{x=!1}},[M,T]),g.useEffect(()=>{b!=null&&b.available&&b.status&&!M&&V&&Nr("").then(()=>ae("")).catch(()=>{})},[b==null?void 0:b.available,b==null?void 0:b.status,M,V]);const[X,je]=g.useState(!1),[qe,$e]=g.useState(!1),st=g.useCallback(async x=>{je(!1);const q=Gn(String(x||"").trim()),K=Gn(V||"");if(q===K)return;const I=me=>_e.show({id:"team-rename",status:"error",ttl:6e3,message:me});if(q&&!oh.test(q)){I(r("machineName.badFormat","机器名只能用字母、数字和 . _ -"));return}const ge=(b==null?void 0:b.takenNames)||[];if(q&&ge.length){const me=Dl(q).toLowerCase(),Qe=Dl(K).toLowerCase();if(ge.some(Gt=>{const ct=String(Gt||"").trim().toLowerCase();return ct.startsWith(Yn)?ct!==Qe&&ct===me:!1})){I(r("machineName.taken","「{{n}}」已经被另一台机器用了,换一个",{n:q}));return}}$e(!0);try{const me=await Nr(q);ae(me||""),q&&Gn(me||"")!==q&&I(r("machineName.overridden","改名没生效:这台机器的名字由桌面上的「{{n}}.txt」决定,当前仍是「{{cur}}」",{n:Gn(me||"").replace(/^xs-/,""),cur:Gn(me||"")}));try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}try{b!=null&&b.refresh&&b.refresh()}catch{}}catch{I(r("machineName.failed","机器名没保存成功"))}finally{$e(!1)}},[V,b]),[Xe,oe]=g.useState(!1),[C,Y]=g.useState(""),H=g.useRef(null);g.useEffect(()=>{var q,K,I;let x=!0;return(I=(K=(q=window.cicy)==null?void 0:q.app)==null?void 0:K.getVersion)==null||I.call(K).then(ge=>{x&&Y(typeof ge=="string"?ge:String((ge==null?void 0:ge.desktop)||""))}).catch(()=>{}),()=>{x=!1}},[]),g.useEffect(()=>{if(!T)return;const x=q=>{H.current&&!H.current.contains(q.target)&&Z(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[T]);const ie=async()=>{var q,K;const x=String(j||"").trim();if(x)try{(K=(q=window.cicy)==null?void 0:q.clipboard)!=null&&K.write?await window.cicy.clipboard.write(x):await navigator.clipboard.writeText(x),Z(!1),_e.show({message:r("userMenu.emailCopied","邮箱已复制"),status:"done",ttl:2500})}catch{_e.show({message:r("userMenu.emailCopyFailed","邮箱复制失败"),status:"error",ttl:3500})}},ee=async()=>{var x,q,K;Z(!1),oe(!0),_e.show({id:"app-update",message:r("updateBanner.checking","正在检查更新…"),status:"running"});try{const I=await((K=(q=(x=window.cicy)==null?void 0:x.app)==null?void 0:q.checkUpdate)==null?void 0:K.call(q));(I==null?void 0:I.status)==="available"?_e.show({id:"app-update",message:r("updateBanner.available","发现新版本 v{{v}}",{v:I.version}),status:"done",ttl:4e3}):(I==null?void 0:I.status)==="up-to-date"?_e.show({id:"app-update",message:r("updateBanner.upToDate","已是最新版本 v{{v}}",{v:I.version||I.current}),status:"done",ttl:3e3}):_e.show({id:"app-update",message:r("updateBanner.error","更新失败")+(I!=null&&I.error?`:${I.error}`:""),status:"error",ttl:5e3})}catch(I){_e.show({id:"app-update",message:I.message,status:"error",ttl:5e3})}finally{oe(!1)}},m=(()=>{const x=String(D||"").toLowerCase().trim();return x?{personal:r("plan.personal","个人版"),team:r("plan.team","团队版"),enterprise:r("plan.enterprise","企业版")}[x]||x:""})();return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"topbar",children:s.jsxs("div",{className:"user-chip","data-id":"UserChip",ref:H,children:[f&&s.jsx("span",{className:"welcome",children:f}),m&&s.jsx("span",{"data-id":"UserChip-plan",className:"plan-badge",title:r("plan.hint","当前账号版本"),style:{fontSize:11,fontWeight:600,lineHeight:1.6,padding:"2px 9px",borderRadius:999,whiteSpace:"nowrap",background:"var(--accent-soft, rgba(120,140,255,.16))",color:"var(--accent, #9db0ff)"},children:m}),S?s.jsxs("button",{type:"button","data-id":"UserChip-trigger",className:`user-chip__trigger${T?" is-open":""}`,onClick:()=>Z(x=>!x),children:[s.jsx("div",{className:"avatar",style:{background:"var(--border, #2c2f36)",color:"var(--muted, #8b8b92)"},children:"?"}),s.jsx("span",{className:"user-name",children:r("cicyHub.login","登录 CiCy Hub")}),s.jsx("span",{className:"user-chip__caret","aria-hidden":!0,children:"▾"})]}):c?s.jsxs("button",{type:"button","data-id":"UserChip-trigger",className:`user-chip__trigger${T?" is-open":""}`,onClick:()=>Z(x=>!x),children:[s.jsx("div",{className:"avatar",children:N}),s.jsx("span",{className:"user-name",children:p}),s.jsx("span",{className:"user-chip__caret","aria-hidden":!0,children:"▾"})]}):s.jsxs("div",{className:"user-chip__trigger user-chip__trigger--skel","data-id":"UserChip-skeleton","aria-hidden":!0,children:[s.jsx("div",{className:"skel skel--avatar"}),s.jsx("div",{className:"skel skel--name"})]}),T&&s.jsxs("div",{className:"user-chip__menu","data-id":"UserChip-menu",role:"menu",children:[!S&&(c==null?void 0:c.email)&&s.jsx("button",{type:"button","data-id":"UserChip-email-copy",className:"user-chip__menu-item",title:r("userMenu.copyEmail","点击复制邮箱"),onClick:ie,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.email}),M&&V!==null&&s.jsxs("div",{"data-id":"UserChip-team",title:r("machineName.hint","这台机器在车队里的名字,点一下就能改"),style:{padding:"0 14px 8px",marginTop:-4,fontSize:12,display:"flex",alignItems:"center",gap:6,minHeight:30,maxWidth:"100%",overflow:"hidden"},children:[s.jsx("span",{style:{opacity:.5,flex:"none"},children:r("machineName.label","机器名")}),X?s.jsx("input",{"data-id":"UserChip-team-input",autoFocus:!0,size:1,defaultValue:Gn(V),placeholder:r("machineName.ph","例如 xs-1009"),spellCheck:!1,onClick:x=>x.stopPropagation(),onBlur:x=>st(x.target.value),onKeyDown:x=>{x.nativeEvent.isComposing||x.keyCode===229||(x.key==="Enter"?st(x.currentTarget.value):x.key==="Escape"&&je(!1))},style:{...Zm,borderColor:"#3b82f6",background:"#0d1117",color:"#e6edf3"}}):s.jsx("button",{type:"button","data-id":"UserChip-team-edit",onClick:x=>{x.stopPropagation(),je(!0)},style:{...Zm,textAlign:"left",cursor:"text",background:"transparent",color:V?"inherit":"#58a6ff",opacity:V?.7:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:qe?r("machineName.saving","保存中…"):V?Gn(V):r("machineName.unset","未命名 · 点击设置")})]}),(b==null?void 0:b.available)&&!M&&s.jsx("button",{type:"button","data-id":"UserChip-hub-login",className:"user-chip__menu-item",onClick:()=>{Z(!1),b.openLogin()},children:r("cicyHub.login","登录 CiCy Hub")}),(()=>{let x="";try{x=Ps()}catch{}return x?s.jsxs("div",{"data-id":"UserChip-machine-id",title:r("deviceId.hint","本机 ID"),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 14px 8px",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"},children:[s.jsx("span",{style:{opacity:.5,fontSize:12},children:"ID"}),s.jsx("span",{style:{fontSize:16,fontWeight:700,letterSpacing:1.5},children:x})]}):null})(),s.jsx("div",{className:"user-chip__menu-sep","aria-hidden":!0}),s.jsx("button",{type:"button","data-id":"UserChip-trusted-sites",className:"user-chip__menu-item",onClick:()=>{Z(!1),U(!0)},children:r("trustedSites.menu","受信任站点")}),s.jsx("button",{type:"button","data-id":"UserChip-panel-menu",className:"user-chip__menu-item",onClick:()=>{Z(!1),te(!0)},children:r("panelMenu.menu","面板菜单")}),s.jsx("button",{type:"button","data-id":"UserChip-audit-log",className:"user-chip__menu-item",onClick:()=>{Z(!1),Se(!0)},children:r("audit.menu","审计日志")}),s.jsx("button",{type:"button","data-id":"UserChip-terms",className:"user-chip__menu-item",onClick:()=>{Z(!1),we(!0)},children:r("firstRunTerms.menu","用户协议")}),s.jsx("button",{type:"button","data-id":"UserChip-check-update",className:"user-chip__menu-item",disabled:Xe,onClick:ee,children:Xe?r("updateBanner.checkingShort","检查中…"):r("updateBanner.checkBtn","检查更新")}),!1,s.jsx("div",{className:"user-chip__menu-sep","aria-hidden":!0}),M&&s.jsx("button",{type:"button","data-id":"UserChip-hub-logout",className:"user-chip__menu-item is-danger",onClick:()=>{Z(!1),b.logout()},children:r("userMenu.logout","退出")}),s.jsxs("div",{className:"user-chip__menu-version","data-id":"UserChip-version",children:["CiCy Desktop ",C?`v${C}`:"…"]})]})]})}),R&&s.jsx(ig,{onClose:()=>U(!1)}),F&&s.jsx(sg,{onClose:()=>Se(!1)}),ce&&s.jsx(lg,{onClose:()=>te(!1)}),le&&s.jsx(dh,{onClose:()=>we(!1)})]})}function dh({onAgree:c,onClose:f}){var J;const[h,d]=g.useState(!1),[S,w]=g.useState(!1),b=(((J=window.cicyI18n)==null?void 0:J.locale)||"en").startsWith("zh")?"zh-CN":"en",M=(R,U)=>r(`firstRunTerms.${R}`,U),j=!!f,p=g.useMemo(()=>Uy(My(b)),[b]),N=R=>{const U=R.currentTarget;U.scrollHeight-U.scrollTop-U.clientHeight<24&&d(!0)},T=g.useRef(null);g.useEffect(()=>{const R=T.current;R&&R.scrollHeight<=R.clientHeight+24&&d(!0)},[]);const Z=async()=>{var R,U,F;if(!(S||!h)){w(!0);try{await((F=(U=(R=window.cicy)==null?void 0:R.terms)==null?void 0:U.agree)==null?void 0:F.call(U,ch)),c==null||c()}catch{c==null||c()}}},D=()=>{var R,U,F;try{(F=(U=(R=window.cicy)==null?void 0:R.terms)==null?void 0:U.decline)==null||F.call(U)}catch{}};return s.jsxs("div",{className:j?"terms-gate terms-gate--review":"shell terms-gate","data-id":"FirstRunTermsGate",style:j?{position:"fixed",inset:0,zIndex:1e3,background:"rgba(8,9,14,.72)",backdropFilter:"blur(4px)"}:void 0,onClick:j?R=>{R.target===R.currentTarget&&f()}:void 0,children:[s.jsx("div",{className:"glow","aria-hidden":!0}),s.jsxs("div",{className:"terms-gate__panel",children:[s.jsx("h1",{className:"terms-gate__title","data-id":"FirstRunTermsGate-title",children:M("title","用户协议与授权说明")}),s.jsx("p",{className:"terms-gate__subtitle",children:M("subtitle","使用 CiCy Desktop 前,请阅读并同意以下条款")}),s.jsx("div",{className:"terms-gate__body",ref:T,onScroll:N,"data-id":"FirstRunTermsGate-body",children:s.jsx("div",{className:"terms-md","data-id":"FirstRunTermsGate-md",dangerouslySetInnerHTML:{__html:p}})}),j?s.jsx("div",{className:"terms-gate__actions",children:s.jsx("button",{"data-id":"FirstRunTermsGate-close",className:"terms-gate__btn",onClick:f,children:M("close","关闭")})}):s.jsxs(s.Fragment,{children:[!h&&s.jsx("div",{className:"terms-gate__scrollhint","data-id":"FirstRunTermsGate-scrollhint",children:M("scrollHint","请阅读至底部以继续")}),s.jsxs("div",{className:"terms-gate__actions",children:[s.jsx("button",{"data-id":"FirstRunTermsGate-decline",className:"terms-gate__btn terms-gate__btn--ghost",onClick:D,children:M("decline","不同意并退出")}),s.jsx("button",{"data-id":"FirstRunTermsGate-agree",className:"terms-gate__btn",disabled:!h||S,title:h?"":M("mustAgree","未同意则无法使用本软件。"),onClick:Z,children:M("agree","同意并继续")})]})]})]})]})}const zr=new Set;let Km=0,Ye=null;function Al(){zr.forEach(c=>c(Ye))}const Ce={open({onRetry:c,kind:f,source:h,title:d,sub:S}={}){Ye={status:"running",phase:"install-docker",kind:f||"install",source:h||"op",title:d||"",sub:S||"",logs:[],bars:{},minimized:!1,onRetry:c||null,lastAt:Date.now()},Al()},minimize(){Ye&&(Ye={...Ye,minimized:!0},Al())},restore(){Ye&&(Ye={...Ye,minimized:!1},Al())},push(c={}){var b;if(!Ye)return;const f=c.phase==="health"?"container":c.phase||Ye.phase,h={...Ye,phase:f,lastAt:Date.now()},d=Number.isFinite(c.progress),S=f==="install-docker"||f==="image";if(S&&(d||c.dest||c.url)){const M=((b=Ye.bars)==null?void 0:b[f])||{},j=d?c.progress:c.status==="skip"||c.status==="done"?100:M.progress;h.bars={...Ye.bars,[f]:{progress:j,received:c.received??M.received,total:c.total??M.total,url:c.url||M.url,dest:c.dest||M.dest,label:c.label||M.label}}}if(!(c.status==="running"&&d&&S)){const M=Ye.logs[Ye.logs.length-1],j=c.status||"running",p=c.message||"";if(!(M&&M.phase===f&&M.status===j&&M.message===p)){const N={id:++Km,t:Ei(),phase:f,status:j,message:p};h.logs=[...Ye.logs,N]}}Ye=h,Al()},finish({ok:c,message:f,status:h}={}){if(!Ye||Ye.status!=="running")return;const d=h||(c?"done":"error"),S=d==="error"?Ye.phase:"done",w={id:++Km,t:Ei(),phase:S,status:d,message:f||(c?"完成":"失败")};Ye={...Ye,status:d,phase:S,minimized:!1,logs:[...Ye.logs,w],lastAt:Date.now()},Al()},close(){Ye=null,Al()}},jr=[["install-docker","准备环境"],["image","下载运行环境"],["container","启动服务"],["done","完成"]],og={"install-docker":"准备",image:"下载",container:"启动",health:"启动",done:"完成",open:"打开"},rg={"install-docker":"Docker Desktop",image:"基础镜像"};function Fm(c){return Number.isFinite(c)?c<1024?c+" B":c<1048576?(c/1024).toFixed(0)+" KB":c<1073741824?(c/1048576).toFixed(1)+" MB":(c/1073741824).toFixed(2)+" GB":"?"}function ug({phaseKey:c,bar:f}){const h=Number.isFinite(f==null?void 0:f.progress)?Math.max(0,Math.min(100,f.progress)):0,d=h>=100;return s.jsxs("div",{className:"dlbar","data-id":`DockerDrawer-dlbar-${c}`,children:[s.jsxs("div",{className:"dlbar__head",children:[s.jsx("span",{className:"dlbar__name",children:(f==null?void 0:f.label)||rg[c]||c}),s.jsxs("span",{className:"dlbar__pct",children:[h,"%",f!=null&&f.total?` · ${Fm(f.received)} / ${Fm(f.total)}`:""]})]}),s.jsx("div",{className:"dlbar__track",children:s.jsx("div",{className:`dlbar__fill${d?" is-done":""}`,style:{width:`${h}%`}})}),(f==null?void 0:f.url)&&s.jsxs("div",{className:"dlbar__url",title:f.url,children:[s.jsx("span",{className:"dlbar__urlk",children:"源"})," ",f.url]}),(f==null?void 0:f.dest)&&s.jsxs("div",{className:"dlbar__url",title:f.dest,children:[s.jsx("span",{className:"dlbar__urlk",children:"存"})," ",f.dest]})]})}function dg(){var p;const[c,f]=g.useState(Ye);g.useEffect(()=>(zr.add(f),()=>{zr.delete(f)}),[]);const h=g.useRef(null);if(g.useEffect(()=>{const N=h.current;N&&(N.scrollTop=N.scrollHeight)},[(p=c==null?void 0:c.logs)==null?void 0:p.length]),!c)return null;const d=c.status==="running",S=c.kind==="open",w=jr.findIndex(([N])=>N===c.phase),b=S?[]:["install-docker","image"].filter(N=>{var T;return(T=c.bars)==null?void 0:T[N]}),M=c.title||(S?r("docker.openTitle","打开 Docker 团队"):r("docker.setupTitle","安装 Docker cicy-code")),j=c.sub||"127.0.0.1:8008";if(c.minimized){const N=b.map(Z=>{var D;return(D=c.bars[Z])==null?void 0:D.progress}).filter(Number.isFinite),T=N.length?Math.round(N.reduce((Z,D)=>Z+D,0)/N.length):null;return s.jsxs("button",{type:"button",className:`drawer-min drawer-min--${c.status}`,"data-id":"DockerDrawer-restore",onClick:()=>Ce.restore(),children:[s.jsx("span",{className:"drawer-min__spark",children:d?s.jsx(Lt,{}):c.status==="done"?"✓":c.status==="reboot"?"⟳":"!"}),s.jsxs("span",{className:"drawer-min__label",children:[M,T!=null?` · ${T}%`:""]})]})}return s.jsx("div",{className:"drawer-scrim","data-id":"DockerDrawer-scrim",onClick:()=>d?Ce.minimize():Ce.close(),children:s.jsxs("div",{className:"drawer","data-id":"DockerDrawer","data-status":c.status,onClick:N=>N.stopPropagation(),children:[s.jsxs("div",{className:"drawer__head",children:[s.jsxs("div",{className:"drawer__title",children:[s.jsx("span",{className:`drawer__spark drawer__spark--${c.status}`,children:d?s.jsx(Lt,{}):c.status==="done"?"✓":c.status==="reboot"?"⟳":"!"}),s.jsxs("div",{children:[s.jsx("div",{className:"drawer__h",children:M}),s.jsx("div",{className:"drawer__sub",children:j})]})]}),s.jsx("div",{className:"drawer__headbtns",children:s.jsx("button",{type:"button",className:"drawer__x","data-id":"DockerDrawer-min",title:r("common.minimize","最小化"),onClick:()=>Ce.minimize(),"aria-label":"minimize",children:"‒"})})]}),!S&&s.jsx("div",{className:"drawer__steps","data-id":"DockerDrawer-steps",children:jr.map(([N,T],Z)=>{const D=c.status==="done"||w>=0&&Z<w,J=Z===w&&d,R=c.status==="error"&&Z===w;return s.jsxs("div",{className:`drawer__step${J?" is-active":""}${D?" is-done":""}${R?" is-error":""}`,children:[s.jsx("span",{className:"drawer__step-dot",children:D?"✓":R?"!":Z+1}),s.jsx("span",{className:"drawer__step-label",children:T}),Z<jr.length-1&&s.jsx("span",{className:"drawer__step-bar"})]},N)})}),b.length>0&&s.jsx("div",{className:"drawer__dlbars","data-id":"DockerDrawer-dlbars",children:b.map(N=>s.jsx(ug,{phaseKey:N,bar:c.bars[N]},N))}),d&&c.logs.length>0&&s.jsxs("div",{className:"drawer__now","data-id":"DockerDrawer-now",children:[s.jsx(Lt,{}),s.jsx("span",{children:c.logs[c.logs.length-1].message})]}),s.jsx("div",{className:"drawer__log drawer__log--scroll","data-id":"DockerDrawer-log",ref:h,children:c.logs.length===0?s.jsx("div",{className:"drawer__log-empty",children:r("docker.preparing","准备中…")}):c.logs.map(N=>s.jsxs("div",{className:"drawer__line","data-status":N.status,children:[s.jsx("span",{className:"drawer__t",children:N.t}),s.jsx("span",{className:`drawer__badge drawer__badge--${N.phase}`,children:r(`dockerBadge.${N.phase}`,og[N.phase]||N.phase)}),s.jsx("span",{className:"drawer__linemsg",children:N.message})]},N.id))}),s.jsx("div",{className:"drawer__foot",children:d?s.jsx(s.Fragment,{children:s.jsx("span",{className:"drawer__foot-status",children:S?r("docker.opening","打开中…"):r("docker.installing2","安装进行中…")})}):c.status==="reboot"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-reboot",children:r("docker.rebootAuto","需重启 Windows(90 秒后自动重启,登录后自动继续)")}),s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-reboot-now",onClick:()=>{var N,T,Z;return(Z=(T=(N=window.cicy)==null?void 0:N.docker)==null?void 0:T.rebootNow)==null?void 0:Z.call(T)},children:r("docker.rebootNow","立即重启")}),s.jsx("button",{type:"button",className:"drawer__btn","data-id":"DockerDrawer-reboot-cancel",onClick:()=>{var N,T,Z;(Z=(T=(N=window.cicy)==null?void 0:N.docker)==null?void 0:T.rebootCancel)==null||Z.call(T),Ce.close()},children:r("docker.rebootCancel","取消自动重启")})]}):c.status==="error"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-error",children:S?r("docker.openFailed","打开失败"):r("docker.failed","安装失败")}),c.onRetry&&s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-retry",onClick:()=>c.onRetry(),children:r("common.retry","重试")}),s.jsx("button",{type:"button",className:"drawer__btn","data-id":"DockerDrawer-dismiss",onClick:()=>Ce.close(),children:r("common.close","关闭")})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"drawer__foot-status is-done",children:r("docker.ready","已就绪")}),s.jsx("button",{type:"button",className:"drawer__btn is-accent","data-id":"DockerDrawer-finish",onClick:()=>Ce.close(),children:r("common.done","完成")})]})})]})})}const fh="@deepseek-ai/dsh",Dr="0.1.2-rc.1",Ws=3080,Wm="#4d6bfe",Or="v24.19.0",Ks=37304352,kr="dsh.auto",fg=360*60*1e3,Tr=()=>`dsh.installFailAt.${ec}`,mg=['"%LOCALAPPDATA%\\cicy-node\\node.exe"','"%ProgramFiles%\\nodejs\\node.exe"','"%LOCALAPPDATA%\\Programs\\nodejs\\node.exe"','"%APPDATA%\\nvm\\current\\node.exe"'].map(c=>`(${c} --version 2>nul && echo NODE=${c.slice(1,-1)})`).join(" || ")+" & echo HOME=%USERPROFILE%";function hg(){return`$ErrorActionPreference = 'SilentlyContinue'; $ProgressPreference = 'SilentlyContinue'
|
|
427
|
+
$ver = '${Or}'; $name = "node-$ver-win-x64"
|
|
428
|
+
$dir = "$env:LOCALAPPDATA\\cicy-node"; $tmp = "$env:LOCALAPPDATA\\cicy-node-dl"; $zip = "$tmp\\$name.zip"; $ex = "$tmp\\$name"; $lock = "$tmp\\install.lock"
|
|
429
|
+
$curl = "$env:SystemRoot\\System32\\curl.exe"; $tar = "$env:SystemRoot\\System32\\tar.exe"
|
|
430
|
+
New-Item -ItemType Directory -Force -Path $tmp | Out-Null
|
|
431
|
+
function Good($p) { if (-not (Test-Path "$p\\node.exe")) { return $false }; $v = & "$p\\node.exe" --version 2>$null; return ($v -match '^v(\\d+)\\.' -and [int]$matches[1] -ge 22) }
|
|
432
|
+
# file ops retry: Defender / 360 scan a fresh 37MB zip and hold it for seconds, so tar/move/delete fail with sharing violations
|
|
433
|
+
function Retry($n, $sb) { for ($k = 0; $k -lt $n; $k++) { $ok = $false; try { $ok = [bool](& $sb) } catch { $ok = $false }; if ($ok) { return $true }; Start-Sleep -Seconds 2 }; return $false }
|
|
434
|
+
function ZipOk($z) { if (-not (Test-Path $z)) { return $false }; if ((Get-Item $z).Length -lt 30000000) { return $false }; if (Test-Path $tar) { return (Retry 6 { & $tar -tf $z 2>$null | Out-Null; $LASTEXITCODE -eq 0 }) }; return $true }
|
|
435
|
+
function LockAlive { if (-not (Test-Path $lock)) { return $false }; $id = 0; try { $id = [int](Get-Content $lock -Raw) } catch { return $false }; if ($id -le 0) { return $false }; return ($null -ne (Get-Process -Id $id -ErrorAction SilentlyContinue)) }
|
|
436
|
+
function Main {
|
|
437
|
+
$t0 = Get-Date
|
|
438
|
+
if (Good $dir) { return "NODE=$dir\\node.exe" }
|
|
439
|
+
if (-not (Good $ex)) {
|
|
440
|
+
$urls = @("https://nodejs.org/dist/$ver/$name.zip", "https://cdn.npmmirror.com/binaries/node/$ver/$name.zip", "https://npmmirror.com/mirrors/node/$ver/$name.zip")
|
|
441
|
+
$have = ZipOk $zip
|
|
442
|
+
if (-not $have) {
|
|
443
|
+
Remove-Item $zip -Force
|
|
444
|
+
if (Test-Path $curl) {
|
|
445
|
+
$procs = @(); $i = 0
|
|
446
|
+
foreach ($u in $urls[0..1]) { $i++; $f = "$tmp\\spd$i.txt"; Remove-Item $f -Force; $procs += ,@($u, $f, (Start-Process -FilePath $curl -ArgumentList @('-s','-L','-o','NUL','-w','%{size_download}','--max-time','5',$u) -RedirectStandardOutput $f -WindowStyle Hidden -PassThru)) }
|
|
447
|
+
Start-Sleep -Seconds 6
|
|
448
|
+
$score = @{}
|
|
449
|
+
foreach ($p in $procs) { if (-not $p[2].HasExited) { $p[2].Kill() }; $n = 0; try { $n = [int64]((Get-Content $p[1] -Raw) -replace '[^0-9]', '') } catch { }; $score[$p[0]] = $n; Write-Output "SPD=$n $($p[0])" }
|
|
450
|
+
$urls = @($urls | Sort-Object { $s = 0; if ($score.ContainsKey($_)) { $s = $score[$_] }; -$s })
|
|
451
|
+
foreach ($u in $urls) {
|
|
452
|
+
Write-Output "SRC=$u"
|
|
453
|
+
# resume .part with -C - (same zip on every mirror); give up a source once it drops under 80KB/s for 30s
|
|
454
|
+
& $curl -L -s -S -o "$zip.part" -C - --speed-limit 80000 --speed-time 30 --max-time 900 $u 2>$null
|
|
455
|
+
$code = $LASTEXITCODE; $n = 0; if (Test-Path "$zip.part") { $n = (Get-Item "$zip.part").Length }
|
|
456
|
+
Write-Output "CURL=$code bytes=$n"
|
|
457
|
+
if ($code -eq 0 -and (ZipOk "$zip.part")) { Retry 8 { Move-Item "$zip.part" $zip -Force; (Test-Path $zip) -and -not (Test-Path "$zip.part") } | Out-Null; if (ZipOk $zip) { $have = $true; break } }
|
|
458
|
+
if ($code -eq 0 -or $n -gt 40000000) { Remove-Item "$zip.part" -Force }
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
if (-not $have) {
|
|
462
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
463
|
+
foreach ($u in $urls) { try { Remove-Item $zip -Force; Write-Output "SRC=$u"; Write-Output "IWR=$u"; Invoke-WebRequest -Uri $u -OutFile $zip -UseBasicParsing -TimeoutSec 300; if (ZipOk $zip) { $have = $true; break } } catch { } }
|
|
464
|
+
}
|
|
465
|
+
if (-not $have) { return 'ERR=download' }
|
|
466
|
+
}
|
|
467
|
+
Retry 5 { Remove-Item $ex -Recurse -Force; -not (Test-Path $ex) } | Out-Null
|
|
468
|
+
if (Test-Path $tar) { Retry 3 { & $tar -xf $zip -C $tmp 2>$null; Good $ex } | Out-Null }
|
|
469
|
+
if (-not (Good $ex)) { Remove-Item $ex -Recurse -Force; Expand-Archive -Path $zip -DestinationPath $tmp -Force }
|
|
470
|
+
if (-not (Good $ex)) { return 'ERR=extract' }
|
|
471
|
+
}
|
|
472
|
+
if (Test-Path $dir) { Retry 8 { Remove-Item $dir -Recurse -Force; -not (Test-Path $dir) } | Out-Null }
|
|
473
|
+
Retry 10 { Move-Item $ex $dir; Good $dir } | Out-Null
|
|
474
|
+
if (-not (Good $dir)) { Copy-Item $ex $dir -Recurse -Force }
|
|
475
|
+
Retry 5 { Remove-Item $zip -Force; Remove-Item "$zip.part" -Force; Remove-Item "$tmp\\spd*.txt" -Force; Remove-Item $ex -Recurse -Force; -not (Test-Path $ex) } | Out-Null
|
|
476
|
+
Write-Output ("SECS=" + [int]((Get-Date) - $t0).TotalSeconds)
|
|
477
|
+
if (Good $dir) { return "NODE=$dir\\node.exe" } else { return 'ERR=move' }
|
|
478
|
+
}
|
|
479
|
+
# install lock: a page reload / second window re-triggers setup; two extractors would trample each other, so wait for the live one
|
|
480
|
+
if (LockAlive) { for ($i = 0; $i -lt 450; $i++) { Start-Sleep -Seconds 2; if (Good $dir) { break }; if (-not (LockAlive)) { break } } }
|
|
481
|
+
if (Good $dir) { Write-Output "NODE=$dir\\node.exe"; exit 0 }
|
|
482
|
+
Set-Content -Path $lock -Value $PID
|
|
483
|
+
$r = @(Main)
|
|
484
|
+
Remove-Item $lock -Force
|
|
485
|
+
$r | ForEach-Object { Write-Output $_ }
|
|
486
|
+
if ($r.Count -gt 0 -and "$($r[-1])" -like 'NODE=*') { exit 0 } else { exit 1 }
|
|
487
|
+
`}const pg='for p in /usr/local/bin/node /opt/homebrew/bin/node /usr/bin/node "$HOME"/.nvm/versions/node/*/bin/node "$HOME"/.volta/bin/node; do if [ -x "$p" ]; then v=$("$p" --version 2>/dev/null); case "$v" in v2[2-9].*|v[3-9][0-9].*) echo "NODE=$p"; break;; esac; fi; done; echo "HOME=$HOME"',yg=String.raw`
|
|
488
|
+
const fs = require("fs"), path = require("path"), os = require("os"), cp = require("child_process");
|
|
489
|
+
const OP = process.argv[2] || "status", NPM = process.argv[3] || "npm";
|
|
490
|
+
const PORT = ${Ws}, PKG = "${fh}", VER = "${Dr}";
|
|
491
|
+
const home = os.homedir();
|
|
492
|
+
const dbDir = path.join(home, "cicy-ai", "db"), logDir = path.join(home, "cicy-ai", "logs");
|
|
493
|
+
for (const d of [dbDir, logDir]) { try { fs.mkdirSync(d, { recursive: true }); } catch {} }
|
|
494
|
+
const logFile = path.join(logDir, "dsh.log"), pidFile = path.join(dbDir, "dsh.pid"), rootCache = path.join(dbDir, "dsh-npm-root.txt");
|
|
495
|
+
const lockFile = path.join(dbDir, "dsh-install.lock"), okMarker = path.join(dbDir, "dsh-ok-" + VER + ".txt");
|
|
496
|
+
// 车队级启动环境(hub 下发,DshCard 写的 dsh-env.json):并进 dsh 子进程 env。启动环境在 dsh 里优先级最高且只读。
|
|
497
|
+
const envFile = path.join(dbDir, "dsh-env.json"), envApplied = path.join(dbDir, "dsh-env.applied");
|
|
498
|
+
function fleetEnv() { try { const j = JSON.parse(fs.readFileSync(envFile, "utf8")); const src = (j && j.env) || {}; const out = {}; for (const [k, v] of Object.entries(src)) { if (/^[A-Z][A-Z0-9_]*$/.test(k) && typeof v === "string" && v) out[k] = v; } return out; } catch { return {}; } }
|
|
499
|
+
function envHash() { const e = fleetEnv(); const ks = Object.keys(e).sort(); return ks.length ? require("crypto").createHash("sha1").update(JSON.stringify(ks.map((k) => [k, e[k]]))).digest("hex").slice(0, 12) : ""; }
|
|
500
|
+
function appliedHash() { try { return fs.readFileSync(envApplied, "utf8").trim(); } catch { return ""; } }
|
|
501
|
+
// 默认工作区:hub 下发 [{path,title}],路径支持 ~ 和 %VAR%。dsh 的 workspace.json 是 single 布局、内存为准,
|
|
502
|
+
// 所以只在 dsh 没跑的时候(start 之前)种记录;status 只报哪些还缺,让 DshCard 决定重启。
|
|
503
|
+
const wsFile = path.join(home, ".dsh", "storages", "workspace.json");
|
|
504
|
+
function expandPath(p) { let s = String(p || "").trim(); if (!s) return ""; if (s === "~" || s.startsWith("~/") || s.startsWith("~\\")) s = home + s.slice(1); s = s.replace(/%([A-Za-z_][A-Za-z0-9_]*)%/g, (m, k) => process.env[k] || m).replace(/\$([A-Z_][A-Z0-9_]*)/g, (m, k) => process.env[k] || m); return path.resolve(s); }
|
|
505
|
+
function fleetWorkspaces() { try { const j = JSON.parse(fs.readFileSync(envFile, "utf8")); return (Array.isArray(j.workspaces) ? j.workspaces : []).map((w) => ({ path: expandPath(typeof w === "string" ? w : w && w.path), title: (w && w.title) || "" })).filter((w) => w.path); } catch { return []; } }
|
|
506
|
+
function canon(p) { try { p = fs.realpathSync.native(p); } catch {} return process.platform === "win32" ? p.toLowerCase() : p; }
|
|
507
|
+
function readWs() { try { return JSON.parse(fs.readFileSync(wsFile, "utf8")); } catch { return null; } }
|
|
508
|
+
function wsMissing() { const cfg = fleetWorkspaces(); if (!cfg.length) return []; const j = readWs(); const have = new Set(Object.values((j && j.tables && j.tables.workspaces) || {}).map((r) => canon(r.path))); return cfg.filter((w) => !have.has(canon(w.path))).map((w) => w.path); }
|
|
509
|
+
function seedWorkspaces() {
|
|
510
|
+
const cfg = fleetWorkspaces(); if (!cfg.length) return { seeded: [] };
|
|
511
|
+
let j = readWs(); if (!j || !j.tables || !j.global) j = { unit: { name: "workspace", version: 2 }, global: { initialized: true, workspaceIds: [], archivedSessionIds: [] }, tables: { workspaces: {} } };
|
|
512
|
+
const have = new Map(Object.values(j.tables.workspaces).map((r) => [canon(r.path), r])); const seeded = [];
|
|
513
|
+
for (const w of cfg) {
|
|
514
|
+
try { fs.mkdirSync(w.path, { recursive: true }); } catch {}
|
|
515
|
+
let real = w.path; try { real = fs.realpathSync.native(w.path); } catch { continue; }
|
|
516
|
+
if (have.has(canon(real))) continue;
|
|
517
|
+
const id = require("crypto").randomUUID(), now = new Date().toISOString();
|
|
518
|
+
j.tables.workspaces[id] = { path: real, title: w.title || path.basename(real) || real, sessionIds: [], createdAt: now, updatedAt: now };
|
|
519
|
+
j.global.workspaceIds.push(id); j.global.initialized = true; have.set(canon(real), j.tables.workspaces[id]); seeded.push(real);
|
|
520
|
+
}
|
|
521
|
+
if (seeded.length) { try { fs.mkdirSync(path.dirname(wsFile), { recursive: true }); const tmp = wsFile + ".tmp-" + process.pid; fs.writeFileSync(tmp, JSON.stringify(j, null, 2)); fs.renameSync(tmp, wsFile); } catch (e) { return { seeded: [], error: String(e.message) }; } }
|
|
522
|
+
return { seeded };
|
|
523
|
+
}
|
|
524
|
+
// 子进程 PATH:node 所在目录 + System32(矩阵机 Electron 的 PATH 里没有 node)
|
|
525
|
+
process.env.PATH = [path.dirname(process.execPath), process.platform === "win32" ? path.join(process.env.SystemRoot || "C:\\Windows", "System32") : "/usr/local/bin", process.env.PATH || ""].join(path.delimiter);
|
|
526
|
+
const out = (o) => { process.stdout.write(JSON.stringify(o)); };
|
|
527
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
528
|
+
const q = (s) => '"' + s + '"';
|
|
529
|
+
function run(cmd, opts) { return cp.execSync(cmd, Object.assign({ encoding: "utf8", windowsHide: true, timeout: 60000, stdio: ["ignore", "pipe", "pipe"], maxBuffer: 10 * 1024 * 1024 }, opts || {})); }
|
|
530
|
+
function npmRoot() { try { return run(q(NPM) + " root -g").trim().split(/\r?\n/).pop(); } catch { return ""; } }
|
|
531
|
+
// 选 registry:两个源并行各拉 5 秒同一个大 tarball,谁字节多先用谁。矩阵机实测 npmjs 2.5~7MB/s、
|
|
532
|
+
// npmmirror 只有 13~36KB/s(装 200MB 要几十分钟,必超时);但换到国内机器就反过来,所以每次装前实测。
|
|
533
|
+
const REGS = ["https://registry.npmjs.org", "https://registry.npmmirror.com"];
|
|
534
|
+
const regFile = path.join(dbDir, "dsh-registry.txt");
|
|
535
|
+
async function pickRegistry() {
|
|
536
|
+
const meas = await Promise.all(REGS.map(async (r) => {
|
|
537
|
+
let n = 0;
|
|
538
|
+
try { const res = await fetch(r + "/node-pty/-/node-pty-1.1.0.tgz", { signal: AbortSignal.timeout(5000) }); const rd = res.body.getReader(); for (;;) { const { done, value } = await rd.read(); if (done) break; n += value.length; } } catch {}
|
|
539
|
+
return n;
|
|
540
|
+
}));
|
|
541
|
+
const order = REGS.map((r, i) => [r, meas[i]]).sort((a, b) => b[1] - a[1]);
|
|
542
|
+
try { fs.writeFileSync(regFile, order[0][0]); } catch {}
|
|
543
|
+
return { order: order.map((x) => x[0]), speed: Object.fromEntries(order.map(([r, n]) => [r, Math.round(n / 5 / 1024) + "KB/s"])) };
|
|
544
|
+
}
|
|
545
|
+
function savedRegistry() { try { return fs.readFileSync(regFile, "utf8").trim(); } catch { return ""; } }
|
|
546
|
+
function pidAlive(n) { if (!n) return false; try { process.kill(n, 0); return true; } catch { return false; } }
|
|
547
|
+
function readPidFile(f) { try { const n = Number(fs.readFileSync(f, "utf8").trim()); return n > 0 ? n : 0; } catch { return 0; } }
|
|
548
|
+
// 已装 = 目录在 + bin 在 + 真能跑(--version 对得上;结果记 marker,以后不再每次 spawn)。
|
|
549
|
+
// 并发安装/下到一半会留下缺文件的目录,只看 package.json 会把坏包当好包(Mac 上实测)。
|
|
550
|
+
function pkgAt(root) {
|
|
551
|
+
if (!root) return null;
|
|
552
|
+
const dir = path.join(root, "@deepseek-ai", "dsh"), bin = path.join(dir, "lib", "bin.js");
|
|
553
|
+
let v = ""; try { v = JSON.parse(fs.readFileSync(path.join(dir, "package.json"), "utf8")).version; } catch { return null; }
|
|
554
|
+
if (!fs.existsSync(bin)) return { root, dir, bin, version: v, broken: true };
|
|
555
|
+
if (v === VER && fs.existsSync(okMarker)) return { root, dir, bin, version: v };
|
|
556
|
+
try {
|
|
557
|
+
const got = run(q(process.execPath) + " " + q(bin) + " --version", { timeout: 90000 }).trim();
|
|
558
|
+
if (got && got.split(/\r?\n/).pop().trim() === v) { if (v === VER) { try { fs.writeFileSync(okMarker, String(Date.now())); } catch {} } return { root, dir, bin, version: v }; }
|
|
559
|
+
} catch {}
|
|
560
|
+
return { root, dir, bin, version: v, broken: true };
|
|
561
|
+
}
|
|
562
|
+
function pkgInfo() {
|
|
563
|
+
let cached = ""; try { cached = fs.readFileSync(rootCache, "utf8").trim(); } catch {}
|
|
564
|
+
let p = pkgAt(cached);
|
|
565
|
+
if (!p) { const root = npmRoot(); p = pkgAt(root); if (root) { try { fs.writeFileSync(rootCache, root); } catch {} } }
|
|
566
|
+
return p;
|
|
567
|
+
}
|
|
568
|
+
function lastToken() { try { const s = fs.readFileSync(logFile, "utf8"); const all = [...s.matchAll(/[?&]token=([A-Za-z0-9_-]+)/g)]; return all.length ? all[all.length - 1][1] : ""; } catch { return ""; } }
|
|
569
|
+
// 端口探测:up = 有东西在听;dsh = 确认是 dsh web(未登录 401 + "dsh web authentication required",登录后 index 带 __DSH_BOOT__)
|
|
570
|
+
async function probe() {
|
|
571
|
+
try {
|
|
572
|
+
const r = await fetch("http://127.0.0.1:" + PORT + "/", { signal: AbortSignal.timeout(2500), redirect: "manual" });
|
|
573
|
+
let body = ""; try { body = (await r.text()).slice(0, 4000); } catch {}
|
|
574
|
+
const dsh = /dsh web/i.test(body) || /__DSH_BOOT__/.test(body) || /dsh-auth-/.test(r.headers.get("set-cookie") || "");
|
|
575
|
+
return { up: true, dsh };
|
|
576
|
+
} catch { return { up: false, dsh: false }; }
|
|
577
|
+
}
|
|
578
|
+
async function httpUp() { return (await probe()).dsh; }
|
|
579
|
+
function installing() { return pidAlive(readPidFile(lockFile)); }
|
|
580
|
+
async function status() {
|
|
581
|
+
const p = pkgInfo(); const pid = readPidFile(pidFile); const pr = await probe();
|
|
582
|
+
const eh = envHash(), ea = appliedHash(), wm = wsMissing();
|
|
583
|
+
return { ok: true, installed: !!p && !p.broken, broken: !!(p && p.broken), version: p ? p.version : null, installing: installing(), running: pr.dsh, occupied: pr.up && !pr.dsh, pid, pidAlive: pidAlive(pid), hasToken: !!lastToken(), node: process.version, logFile, envKeys: Object.keys(fleetEnv()), envHash: eh, envStale: pr.dsh && ea !== eh, wsMissing: wm, wsStale: pr.dsh && wm.length > 0 };
|
|
584
|
+
}
|
|
585
|
+
async function install() {
|
|
586
|
+
// 安装锁:首页刷新/多开会再次触发安装,两个 npm -g 同时写全局目录会把包写坏。有锁就等它完。
|
|
587
|
+
if (installing()) {
|
|
588
|
+
for (let i = 0; i < 600 && installing(); i++) await sleep(2000);
|
|
589
|
+
const p = pkgInfo(); return p && !p.broken ? { ok: true, version: p.version, waited: true } : { ok: false, error: "install_failed_elsewhere" };
|
|
590
|
+
}
|
|
591
|
+
try { fs.writeFileSync(lockFile, String(process.pid)); } catch {}
|
|
592
|
+
try {
|
|
593
|
+
try { fs.unlinkSync(okMarker); } catch {}
|
|
594
|
+
const root = npmRoot();
|
|
595
|
+
if (!root) return { ok: false, error: "npm_unavailable", tail: NPM };
|
|
596
|
+
const scope = path.join(root, "@deepseek-ai");
|
|
597
|
+
// 清掉坏包和 npm 中断留下的 .dsh-xxxx 临时目录,让 npm 干净地重装
|
|
598
|
+
try { for (const e of fs.readdirSync(scope)) { if (e === "dsh" || /^\.dsh-/.test(e)) fs.rmSync(path.join(scope, e), { recursive: true, force: true }); } } catch {}
|
|
599
|
+
// 先实测哪个 registry 快再装(不再固定先走 npmmirror:在这批矩阵机上它只有几十 KB/s,200MB 必超时)。
|
|
600
|
+
const regs = await pickRegistry();
|
|
601
|
+
let outp = "", lastErr = "", used = "", t0 = Date.now();
|
|
602
|
+
for (const reg of regs.order) {
|
|
603
|
+
try { outp = run(q(NPM) + " i -g " + PKG + "@" + VER + " --no-audit --no-fund --no-progress --loglevel=error --fetch-timeout=90000 --fetch-retries=2 --registry=" + reg, { timeout: 12 * 60 * 1000 }); lastErr = ""; used = reg; break; }
|
|
604
|
+
catch (e) { lastErr = String((e.stderr || "") + (e.stdout || "") + (e.message || "")).trim().slice(-600); }
|
|
605
|
+
}
|
|
606
|
+
if (lastErr) return { ok: false, error: "npm_install_failed", tail: lastErr, speed: regs.speed };
|
|
607
|
+
try { fs.writeFileSync(rootCache, root); } catch {}
|
|
608
|
+
const p = pkgAt(root);
|
|
609
|
+
if (!p || p.broken) return { ok: false, error: "install_incomplete", tail: (outp || "").slice(-300) };
|
|
610
|
+
return { ok: true, version: p.version, registry: used, speed: regs.speed, secs: Math.round((Date.now() - t0) / 1000) };
|
|
611
|
+
} finally { try { fs.unlinkSync(lockFile); } catch {} }
|
|
612
|
+
}
|
|
613
|
+
async function start() {
|
|
614
|
+
const p = pkgInfo(); if (!p || p.broken) return { ok: false, error: "not_installed" };
|
|
615
|
+
const pr = await probe();
|
|
616
|
+
if (pr.dsh) return { ok: true, already: true, token: lastToken() };
|
|
617
|
+
if (pr.up) return { ok: false, error: "port_in_use", tail: "127.0.0.1:" + PORT + " is used by another program" };
|
|
618
|
+
const seeded = seedWorkspaces(); // dsh 此刻没在跑,可以安全改 workspace.json
|
|
619
|
+
const fd = fs.openSync(logFile, "w");
|
|
620
|
+
const child = cp.spawn(process.execPath, [p.bin, "web", "--no-open", "--port", String(PORT)], { detached: true, windowsHide: true, stdio: ["ignore", fd, fd], cwd: home, env: Object.assign({}, process.env, { NO_COLOR: "1" }, savedRegistry() ? { npm_config_registry: savedRegistry() } : {}, fleetEnv()) }); // dsh 首次运行会用 pnpm 自举 ~/.dsh/profiles,沿用实测最快的源;fleetEnv = hub 下发的 API Key 等
|
|
621
|
+
try { fs.writeFileSync(envApplied, envHash()); } catch {}
|
|
622
|
+
child.unref(); try { fs.closeSync(fd); } catch {}
|
|
623
|
+
try { fs.writeFileSync(pidFile, String(child.pid)); } catch {}
|
|
624
|
+
// dsh web 冷启动在矩阵机上实测常超过 30s(加载 ~200MB 依赖);只要进程还活着就等到 120s,别误报 start_failed
|
|
625
|
+
for (let i = 0; i < 240; i++) { await sleep(500); if (await httpUp()) return { ok: true, pid: child.pid, token: lastToken(), seededWorkspaces: seeded.seeded }; if (!pidAlive(child.pid)) break; }
|
|
626
|
+
let tail = ""; try { tail = fs.readFileSync(logFile, "utf8").slice(-1500); } catch {}
|
|
627
|
+
return { ok: false, error: "start_failed", pid: child.pid, tail };
|
|
628
|
+
}
|
|
629
|
+
async function stop() {
|
|
630
|
+
const pid = readPidFile(pidFile); let killed = false;
|
|
631
|
+
if (pid && pidAlive(pid)) { try { process.kill(pid); killed = true; } catch {} }
|
|
632
|
+
if (!killed) {
|
|
633
|
+
// pid 文件丢了/不是我们拉起的:按端口找(powershell 用绝对路径,别指望 PATH)
|
|
634
|
+
try {
|
|
635
|
+
if (process.platform === "win32") run(q(path.join(process.env.SystemRoot || "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe")) + ' -NoProfile -Command "Get-NetTCPConnection -LocalPort ' + PORT + ' -State Listen -ErrorAction SilentlyContinue | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }"', { timeout: 20000 });
|
|
636
|
+
else run("lsof -ti tcp:" + PORT + " | xargs kill 2>/dev/null", { timeout: 20000 });
|
|
637
|
+
killed = true;
|
|
638
|
+
} catch {}
|
|
639
|
+
}
|
|
640
|
+
for (let i = 0; i < 10; i++) { if (!(await httpUp())) break; await sleep(500); }
|
|
641
|
+
try { fs.unlinkSync(pidFile); } catch {}
|
|
642
|
+
return { ok: true, killed, running: await httpUp() };
|
|
643
|
+
}
|
|
644
|
+
async function open() {
|
|
645
|
+
const up = await httpUp(); const t = lastToken();
|
|
646
|
+
return { ok: up, url: "http://127.0.0.1:" + PORT + "/" + (t ? "?token=" + t : "") };
|
|
647
|
+
}
|
|
648
|
+
(async () => {
|
|
649
|
+
try { out(OP === "install" ? await install() : OP === "start" ? await start() : OP === "stop" ? await stop() : OP === "open" ? await open() : await status()); }
|
|
650
|
+
catch (e) { out({ ok: false, error: String((e && e.message) || e) }); }
|
|
651
|
+
})();
|
|
652
|
+
`;function nc(c){if(!c)return{ok:!1,stdout:"",stderr:"no response",code:1};const f=(c.content||[]).map(S=>S.text).filter(Boolean).join(`
|
|
653
|
+
`);let h=null;try{h=JSON.parse(f)}catch{}if(!h||typeof h!="object")return{ok:!c.isError,stdout:f,stderr:"",code:c.isError?1:0};const d=Number(h.exitCode??(c.isError?1:0));return{ok:!c.isError&&d===0,stdout:h.stdout||"",stderr:h.stderr||"",code:d}}async function ac(c){var f;return nc(await((f=window.electronRPC)==null?void 0:f.call(window,"exec_shell",{command:c})))}const Mr=()=>{var c;return(((c=window.cicy)==null?void 0:c.platform)||"")==="win32"};let Ci=null;async function Is({installNode:c=!1}={}){var D;if(Ci&&Ci.node)return Ci;const f=Mr(),h=J=>{var R,U,F;return{node:((R=(J.match(/^NODE=(.+)$/m)||[])[1])==null?void 0:R.trim())||"",home:((U=(J.match(/^HOME=(.+)$/m)||[])[1])==null?void 0:U.trim())||"",err:((F=(J.match(/^ERR=(.+)$/m)||[])[1])==null?void 0:F.trim())||"",major:Number((J.match(/^v(\d+)\./m)||[])[1]||0),src:[...J.matchAll(/^SRC=(.+)$/mg)].map(Se=>Se[1].trim()).pop()||"",secs:Number((J.match(/^SECS=(\d+)/m)||[])[1]||0)}};let d=await ac(f?mg:pg),S=h((d.stdout||"")+`
|
|
654
|
+
`+(d.stderr||"")),w=S.node,b=S.home,M="",j="",p=0;if(f&&w&&S.major&&S.major<22&&(w=""),!w&&f&&c){const J=`${b}\\cicy-ai\\db\\dsh-node.ps1`;if(!nc(await((D=window.electronRPC)==null?void 0:D.call(window,"file_write",{path:J,content:"\uFEFF"+hg()}))).ok)return{node:"",home:b,error:"ps1_write_failed"};d=await ac(`"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "${J}"`);const U=h((d.stdout||"")+`
|
|
655
|
+
`+(d.stderr||""));w=U.node,M=U.err,j=U.src,p=U.secs,!w&&!M&&(M=(d.stderr||d.stdout||"").trim().slice(-300))}if(!w)return{node:"",home:b,error:M};const N=w.replace(/[\\/][^\\/]+$/,""),T=f?`${N}\\npm.cmd`:`${N}/npm`,Z=f?`${b}\\cicy-ai\\db\\dsh-ctl.js`:`${b}/cicy-ai/db/dsh-ctl.js`;return Ci={node:w,npm:T,home:b,ctl:Z,written:!1,src:j,secs:p},Ci}async function Wt(c,f={}){var w;const h=await Is(f);if(!h.node)return{ok:!1,error:"no_node",detail:h.error||""};if(!h.written){const b=nc(await((w=window.electronRPC)==null?void 0:w.call(window,"file_write",{path:h.ctl,content:yg})));if(!b.ok)return{ok:!1,error:"ctl_write_failed",detail:b.stderr||b.stdout};h.written=!0}const d=await ac(`"${h.node}" "${h.ctl}" ${c} "${h.npm}"`),S=String(d.stdout||"").trim().match(/\{[\s\S]*\}$/);if(S)try{return JSON.parse(S[0])}catch{}return{ok:!1,error:"ctl_no_output",detail:(d.stderr||d.stdout||"").trim().slice(-400)}}function gg(){return s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[s.jsx("path",{d:"M4 17c3.5 0 4.5-3 8-3s4.5 3 8 3"}),s.jsx("path",{d:"M4 12c3.5 0 4.5-3 8-3s4.5 3 8 3"}),s.jsx("path",{d:"M4 7c3.5 0 4.5-3 8-3s4.5 3 8 3"})]})}function bg(){const[c,f]=g.useState(null),[h,d]=g.useState(""),[S,w]=g.useState(!1),[b,M]=g.useState({top:0,left:0}),[j,p]=g.useState(()=>{try{return localStorage.getItem(kr)!=="off"}catch{return!0}}),N=g.useRef(null),T=g.useRef(null),Z=g.useRef(!1),D=g.useRef("");g.useEffect(()=>{D.current=h},[h]);const J=184,R=g.useCallback(async()=>{try{const oe=await Wt("status");return f(oe),oe}catch(oe){return console.warn("[DshCard] status",oe),null}},[]);g.useEffect(()=>{R();const oe=setInterval(()=>{D.current||R()},2e4);return()=>clearInterval(oe)},[R]);const U=g.useRef(""),F=g.useCallback(async()=>{var C;const oe=window.__dshFleetCfg;if(!(!oe||D.current)&&oe.rev!==U.current)try{const Y=await Is();if(!Y.home)return;const H=Mr()?`${Y.home}\\cicy-ai\\db\\dsh-env.json`:`${Y.home}/cicy-ai/db/dsh-env.json`;if(!nc(await((C=window.electronRPC)==null?void 0:C.call(window,"file_write",{path:H,content:JSON.stringify({rev:oe.rev,env:oe.env,workspaces:oe.workspaces||[]},null,2)}))).ok||(U.current=oe.rev,!Y.node))return;const ee=await Wt("status");if(ee.error)return;if(ee.running&&(ee.envStale||ee.wsStale)){d("start");try{await Wt("stop"),await Wt("start")}finally{d("")}}else if(!ee.running&&ee.installed){d("start");try{await Wt("start")}finally{d("")}}R()}catch(Y){console.warn("[DshCard] fleet cfg",Y)}},[R]);g.useEffect(()=>(F(),window.addEventListener("cicy:dsh-config",F),()=>window.removeEventListener("cicy:dsh-config",F)),[F]);const Se=g.useCallback(async(oe={})=>{if(D.current)return;d("install"),Ce.open({kind:"dsh",title:r("dsh.setupTitle","安装 DeepSeek Harness"),sub:`127.0.0.1:${Ws}`,onRetry:()=>Se(oe)});const C=(m,x,q)=>Ce.push({phase:m,message:x,status:q||"running"}),Y=m=>{try{localStorage.setItem(Tr(),String(Date.now()))}catch{}Ce.finish({ok:!1,message:m})};let H=null;const ie=(m,x)=>{C(m,x),H=setInterval(()=>C(m,x),1e4)},ee=()=>{H&&(clearInterval(H),H=null)};try{C("install-docker",r("dsh.checkNode","检查 Node.js…"));let m=await Is();if(!m.node){if(!Mr()){Y(r("dsh.needNode","需要 Node.js 22+,请先安装:{{url}}",{url:"https://nodejs.org/en/download"}));return}ie("install-docker",r("dsh.installingNode","这台机器没有 Node.js,下载便携版 {{v}}(约 37MB,免管理员)…",{v:Or}));const ge=`for %I in ("%LOCALAPPDATA%\\cicy-node-dl\\node-${Or}-win-x64.zip.part") do @echo %~zI`,me=r("dsh.nodeZip","Node.js 便携版");let Qe=!1;const Me=setInterval(async()=>{if(!Qe){Qe=!0;try{const Gt=await ac(ge),ct=Number(String(Gt.stdout||"").trim());ct>0&&Ce.push({phase:"install-docker",status:"running",progress:Math.min(99,Math.round(ct*100/Ks)),received:ct,total:Ks,label:me})}catch{}finally{Qe=!1}}},3e3);try{m=await Is({installNode:!0})}finally{clearInterval(Me),ee()}if(!m.node){Y(r("dsh.nodeFailed","Node.js 便携版安装失败:{{why}}",{why:m.error||"download"}));return}m.src&&Ce.push({phase:"install-docker",status:"done",progress:100,received:Ks,total:Ks,url:m.src,label:me,message:r("dsh.nodeDownloaded","Node.js 便携版下载完成({{s}}s)",{s:m.secs})})}const x=m.src?` (${m.src.replace(/^https?:\/\//,"").split("/")[0]}, ${m.secs}s)`:"";C("install-docker",r("dsh.nodeReady","Node.js 就绪:{{p}}",{p:m.node})+x,"done");let q=await Wt("status"),K="";if(q.error){Y(r("dsh.ctlFailed","控制脚本无法运行:{{why}}",{why:q.error+(q.detail?" · "+q.detail:"")}));return}if(!q.installed||oe.reinstall){const ge=`${fh}@${Dr}`;ie("image",q.installing?r("dsh.installingElsewhere","另一个安装进程正在进行,等待它完成…"):r("dsh.installing","npm 安装 {{pkg}}…(视网络 1~3 分钟)",{pkg:ge}));const me=await Wt("install");if(ee(),me.ok&&me.registry&&(K=` (${me.registry.replace(/^https?:\/\//,"")}, ${me.secs}s)`),!me.ok){Y(r("dsh.installFailed","安装失败:{{why}}",{why:[me.error,me.tail,me.detail].filter(Boolean).join(" · ").split(/\r?\n/).filter(Boolean).slice(-3).join(" · ")}));return}q=await Wt("status")}C("image",r("dsh.installed","已安装 v{{v}}",{v:q.version})+(K||""),"done"),C("container",r("dsh.starting","启动 dsh web(:{{port}})…",{port:Ws}));const I=await Wt("start");if(!I.ok){const ge=String(I.tail||"").trim().split(/\r?\n/).filter(Boolean).slice(-2).join(" · ");Y(r("dsh.startFailed","启动失败:{{why}}",{why:ge||I.error||"start_failed"}));return}try{localStorage.removeItem(Tr())}catch{}Ce.finish({ok:!0,message:r("dsh.ready","DeepSeek Harness 已就绪")})}catch(m){Ce.finish({ok:!1,message:m.message})}finally{ee(),d(""),R()}},[R]),le=g.useCallback(async()=>{if(!D.current){d("start");try{const oe=await Wt("start");oe.ok||_e.show({id:"dsh-op",status:"error",ttl:6e3,message:r("dsh.startFailed","启动失败:{{why}}",{why:oe.error||"start_failed"})})}catch(oe){_e.show({id:"dsh-op",status:"error",ttl:6e3,message:oe.message})}finally{d(""),R()}}},[R]);g.useEffect(()=>{if(Z.current||!c||c.installing||c.error&&c.error!=="no_node"||(Z.current=!0,!j||c.running))return;if(c.installed){le();return}let oe=0;try{oe=Number(localStorage.getItem(Tr())||0)}catch{}Date.now()-oe<fg||Se()},[c,j,Se,le]);const we=async(oe,C,Y)=>{if(!D.current){w(!1),d(oe);try{const H=await C();H&&H.ok===!1?_e.show({id:"dsh-op",status:"error",ttl:6e3,message:H.error||r("docker.opFailed","操作失败")}):Y&&_e.show({id:"dsh-op",status:"ok",ttl:3e3,message:Y})}catch(H){_e.show({id:"dsh-op",status:"error",ttl:6e3,message:H.message})}finally{d(""),R()}}},ce=async()=>{var oe,C,Y;if(!D.current){d("open");try{const H=await Wt("open");if(!H.ok){_e.show({id:"dsh-open",status:"error",ttl:6e3,message:r("dsh.notRunning","dsh 还没运行,先点「启动」")});return}await((Y=(C=(oe=window.cicy)==null?void 0:oe.tabs)==null?void 0:C.open)==null?void 0:Y.call(C,H.url,"DeepSeek Harness","",!0))}catch(H){_e.show({id:"dsh-open",status:"error",ttl:6e3,message:H.message})}finally{d("")}}},te=()=>{const oe=!j;p(oe),w(!1);try{oe?localStorage.removeItem(kr):localStorage.setItem(kr,"off")}catch{}},V=oe=>{if(oe.stopPropagation(),!S&&N.current){const C=N.current.getBoundingClientRect(),Y=Math.max(8,Math.min(C.right-J,window.innerWidth-J-8));M({top:Math.round(C.bottom+4),left:Math.round(Y)})}w(C=>!C)};if(g.useEffect(()=>{if(!S)return;const oe=Y=>{var H,ie;(H=N.current)!=null&&H.contains(Y.target)||(ie=T.current)!=null&&ie.contains(Y.target)||w(!1)},C=Y=>{Y.key==="Escape"&&w(!1)};return document.addEventListener("mousedown",oe),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",oe),document.removeEventListener("keydown",C)}},[S]),typeof window<"u"&&!window.electronRPC)return null;const ae=!!(c!=null&&c.running),X=!!(c!=null&&c.installed),je=!!h,qe=ae?"ok":X?"warn":"off",$e=h==="open"?r("docker.opening","打开中…"):h==="install"?r("dsh.installingShort","安装中…"):h==="start"?r("dsh.startingShort","启动中…"):je?r("docker.working","处理中…"):c?ae?r("localTeams.open","打开"):X?r("docker.start","启动"):r("dsh.install","安装"):r("docker.probing","检测中…"),st=()=>{if(!(je||!c))return ae?ce():X&&!c.error?le():Se()},Xe=c?c.error?r("dsh.stateNoNode","未就绪:{{why}}",{why:c.error==="no_node"?r("dsh.noNodeShort","没有 Node.js(点「安装」自动装便携版)"):c.error}):c.installing?r("dsh.stateInstalling","另一个安装进程进行中…"):ae?r("dsh.stateRunning","运行中"):c.broken?r("dsh.stateBroken","安装不完整(点「安装」修复)"):X?r("dsh.stateStopped","已安装,未运行"):r("dsh.stateMissing","未安装"):"";return s.jsxs("div",{"data-id":"DshCard",className:`bcard bcard--dsh${ae?" bcard--online":""}`,children:[s.jsx("div",{className:"bcard__accent"}),s.jsxs("div",{className:"bcard__top",children:[s.jsxs("div",{className:"bcard__pill",style:{color:Wm},children:[s.jsx("span",{className:"bcard__dot","data-tone":qe}),s.jsx(gg,{})]}),X&&s.jsxs("div",{className:"bcard__menuwrap",onClick:oe=>oe.stopPropagation(),children:[s.jsx("button",{type:"button",ref:N,"data-id":"DshCard-menu-btn",className:"bcard__kebab",title:r("dsh.manage","管理 DeepSeek Harness"),disabled:je,onClick:V,children:je?s.jsx(Lt,{}):s.jsx(qr,{})}),S&&sa.createPortal(s.jsxs("div",{className:"bcard__menu bcard__menu--portal","data-id":"DshCard-menu",role:"menu",ref:T,style:{position:"fixed",top:b.top,left:b.left,width:J},onClick:oe=>oe.stopPropagation(),children:[s.jsx("button",{type:"button","data-id":"DshCard-restart",className:"bcard__menu-item is-accent",onClick:()=>we("start",async()=>(await Wt("stop"),Wt("start")),r("dsh.restarted","已重启 dsh")),children:r("dsh.restart","重启 dsh")}),s.jsx("button",{type:"button","data-id":"DshCard-stop",className:"bcard__menu-item is-danger",onClick:()=>we("stop",()=>Wt("stop"),r("dsh.stopped","已停止 dsh")),children:r("dsh.stop","停止 dsh")}),s.jsx("button",{type:"button","data-id":"DshCard-reload",className:"bcard__menu-item",onClick:oe=>{var C,Y,H;oe.stopPropagation(),w(!1),(H=(Y=(C=window.cicy)==null?void 0:C.tabs)==null?void 0:Y.reloadIfOpen)==null||H.call(Y,`http://127.0.0.1:${Ws}`,"DeepSeek Harness")},children:r("docker.reloadWindow","刷新窗口")}),s.jsx("div",{className:"bcard__menu-sep",role:"separator","aria-hidden":!0}),s.jsx("button",{type:"button","data-id":"DshCard-auto",className:"bcard__menu-item",onClick:te,children:j?r("dsh.autoOn","✓ 开机自动启动"):r("dsh.autoOff","开机自动启动:关")}),s.jsx("button",{type:"button","data-id":"DshCard-reinstall",className:"bcard__menu-item",title:r("dsh.reinstallHint","重新 npm 安装锁定版本 {{v}} 并重启",{v:Dr}),onClick:()=>{w(!1),Se({reinstall:!0})},children:r("dsh.reinstall","重新安装")})]}),document.body)]})]}),s.jsxs("div",{className:"bcard__body",children:[s.jsx("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:s.jsx("h3",{className:"bcard__name",title:"DeepSeek Harness",style:{margin:0,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:"DeepSeek Harness"})}),s.jsxs("div",{className:"bcard__meta",children:[s.jsx("span",{className:"bcard__chip",children:"dsh"}),(c==null?void 0:c.version)&&s.jsxs("span",{className:"bcard__ver","data-id":"DshCard-ver",style:{marginLeft:8,fontSize:11,opacity:.6},children:["v",c.version]})]}),Xe&&s.jsx("div",{"data-id":"DshCard-state",title:Xe,style:{marginTop:6,fontSize:12,color:ae?"#8b949e":"#9aa4b2",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Xe})]}),s.jsxs("button",{type:"button",className:"bcard__cta","data-id":"DshCard-cta",disabled:je||!c,onClick:st,style:ae?void 0:{background:Wm,color:"white"},children:[je?s.jsx(Lt,{}):s.jsx(lc,{}),s.jsx("span",{children:$e})]})]})}function vg({dockerTeam:c,cloudTitle:f,cloudCode:h,onOpen:d,onRename:S,onRefresh:w}){var ht;const[b,M]=g.useState(null),[j,p]=g.useState(""),[N,T]=g.useState(!1),[Z,D]=g.useState(!1),[J,R]=g.useState(!1),[U,F]=g.useState(!1),[Se,le]=g.useState([]),[we,ce]=g.useState(!1),[te,V]=g.useState(""),[ae,X]=g.useState(!1),[je,qe]=g.useState(""),$e=f||"Docker 团队",st=G=>{var be;(be=G==null?void 0:G.stopPropagation)==null||be.call(G),qe($e),X(!0)},Xe=async()=>{X(!1);const G=String(je||"").trim();if(!(!G||G===$e||!S))try{await S(G),w==null||w()}catch{}},[oe,C]=g.useState({top:0,left:0}),Y=g.useRef(null),H=g.useRef(null),ie=184,ee="#2496ed",m=g.useCallback(async()=>{var G,be,re;try{const ue=await((re=(be=(G=window.cicy)==null?void 0:G.docker)==null?void 0:be.appStatus)==null?void 0:re.call(be));M(ue);const Re=Date.now()-((Ye==null?void 0:Ye.lastAt)||0)>3e4;ue!=null&&ue.running&&Ye&&Ye.status==="running"&&(Ye.kind||"install")==="install"&&Re&&Ce.finish({ok:!0,message:"Docker cicy-code 已就绪"})}catch(ue){console.warn("[DockerCard]",ue)}},[]);g.useEffect(()=>{m();const G=setInterval(()=>{j||m()},12e3);return()=>clearInterval(G)},[m,j]);const x=g.useCallback(async()=>{var G,be,re;T(!1),V("");try{const ue=await((re=(be=(G=window.cicy)==null?void 0:G.docker)==null?void 0:be.getPorts)==null?void 0:re.call(be));le(((ue==null?void 0:ue.ports)||[]).map(String))}catch{le([])}F(!0)},[]),q=g.useCallback(async()=>{var ue,Re,Ee,at,k,W,he,se,ye;const G=new Set,be=[];for(const ke of Se){const Ne=String(ke).trim();if(!Ne)continue;const Et=Number(Ne);if(!Number.isInteger(Et)||Et<1||Et>65535||Et===8008||G.has(Et)){V(r("docker.ports.invalid","有端口无效(1-65535,不能是 8008,不能重复)"));return}G.add(Et),be.push(Et)}V(""),ce(!0),F(!1),p("recreate"),Ce.open({onRetry:q});const re=(Ee=(Re=(ue=window.cicy)==null?void 0:ue.docker)==null?void 0:Re.onAppProgress)==null?void 0:Ee.call(Re,ke=>Ce.push(ke));try{const ke=await((W=(k=(at=window.cicy)==null?void 0:at.docker)==null?void 0:k.setPorts)==null?void 0:W.call(k,be));if(Ce.finish({ok:!!(ke!=null&&ke.ok),message:ke!=null&&ke.ok?r("docker.ports.save","保存并重建")+" ✅":(ke==null?void 0:ke.error)||r("docker.opFailed","操作失败")}),ke!=null&&ke.ok)try{const Ne=await((ye=(se=(he=window.cicy)==null?void 0:he.docker)==null?void 0:se.appRedetect)==null?void 0:ye.call(se));Ne&&M(Ne)}catch{}}catch(ke){Ce.finish({ok:!1,message:ke.message})}finally{try{re&&re()}catch{}ce(!1),p(""),m()}},[Se,m]);g.useEffect(()=>{if(!N)return;const G=re=>{var ue,Re;(ue=Y.current)!=null&&ue.contains(re.target)||(Re=H.current)!=null&&Re.contains(re.target)||T(!1)},be=re=>{re.key==="Escape"&&T(!1)};return document.addEventListener("mousedown",G),document.addEventListener("keydown",be),()=>{document.removeEventListener("mousedown",G),document.removeEventListener("keydown",be)}},[N]);const K=()=>{if(!N&&Y.current){const G=Y.current.getBoundingClientRect(),be=Math.max(8,Math.min(G.right-ie,window.innerWidth-ie-8));C({top:Math.round(G.bottom+4),left:Math.round(be)})}T(G=>!G)},I=g.useCallback(async()=>{var be,re,ue,Re,Ee,at;p("bootstrap"),Ce.open({onRetry:I});const G=(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.onAppProgress)==null?void 0:ue.call(re,k=>Ce.push(k));try{const k=await((at=(Ee=(Re=window.cicy)==null?void 0:Re.docker)==null?void 0:Ee.appBootstrap)==null?void 0:at.call(Ee));(k==null?void 0:k.reason)==="installer_launched"?Ce.finish({status:"reboot",message:r("docker.installerLaunched","已打开 Docker 安装程序——请完成安装(会装 WSL2、可能需重启),装好后点「重试」")}):(k==null?void 0:k.reason)==="wsl_reboot_required"?Ce.finish({status:"reboot",message:r("docker.rebootNeeded","WSL2 已安装,请【重启 Windows】后回来点「重试」继续")}):Ce.finish({ok:!!(k!=null&&k.ok),message:k!=null&&k.ok?r("docker.ready","Docker cicy-code 已就绪"):(k==null?void 0:k.error)||r("docker.failed","安装失败")}),k!=null&&k.ok&&(w==null||w())}catch(k){Ce.finish({ok:!1,message:k.message})}finally{try{G&&G()}catch{}p(""),m()}},[m,w]),ge=g.useCallback(async()=>{var be,re,ue,Re,Ee,at;p("repair"),Ce.open({onRetry:ge});const G=(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.onAppProgress)==null?void 0:ue.call(re,k=>Ce.push(k));try{const k=await((at=(Ee=(Re=window.cicy)==null?void 0:Re.docker)==null?void 0:Ee.appRepairWsl)==null?void 0:at.call(Ee));k!=null&&k.needsReboot?Ce.finish({status:"reboot",message:r("docker.wslNeedReboot","WSL 服务卡死,请【重启 Windows】;重启后打开 CiCy 会自动修复(旧数据已改名备份,不删)。")}):k!=null&&k.ok?(Ce.finish({ok:!0,message:r("docker.wslRepaired","WSL 已修复 ✅")}),w==null||w()):Ce.finish({ok:!1,message:(k==null?void 0:k.error)||r("docker.repairFailed","修复失败")})}catch(k){Ce.finish({ok:!1,message:k.message})}finally{try{G&&G()}catch{}p(""),m()}},[m,w]),me=g.useCallback(async()=>{var be,re,ue,Re,Ee,at;T(!1),p("upgrade"),Ce.open({onRetry:me});const G=(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.onAppProgress)==null?void 0:ue.call(re,k=>Ce.push(k));try{const k=await((at=(Ee=(Re=window.cicy)==null?void 0:Re.docker)==null?void 0:Ee.appUpgrade)==null?void 0:at.call(Ee));(k==null?void 0:k.reason)==="wsl_reboot_required"?Ce.finish({status:"reboot",message:r("docker.rebootNeeded","WSL2 已安装,请【重启 Windows】后回来点「重试」继续")}):Ce.finish({ok:!!(k!=null&&k.ok),message:k!=null&&k.ok?r("docker.upgraded","已升级到最新"):(k==null?void 0:k.error)||r("docker.upgradeFailed","升级失败")}),k!=null&&k.ok&&(w==null||w())}catch(k){Ce.finish({ok:!1,message:k.message})}finally{try{G&&G()}catch{}p(""),m()}},[m,w]),Qe=g.useCallback(async()=>{var be,re,ue,Re,Ee,at,k,W,he,se,ye,ke;T(!1),p("update"),Ce.open({onRetry:Qe});const G=(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.onAppProgress)==null?void 0:ue.call(re,Ne=>Ce.push(Ne));try{const Ne=await((at=(Ee=(Re=window.cicy)==null?void 0:Re.docker)==null?void 0:Ee.appUpdate)==null?void 0:at.call(Ee));if(Ce.finish({ok:!!(Ne!=null&&Ne.ok),message:Ne!=null&&Ne.ok?r("docker.updated","cicy-code 已更新到最新"):(Ne==null?void 0:Ne.error)||r("docker.updateFailed","更新失败")}),Ne!=null&&Ne.ok){w==null||w();try{(he=(W=(k=window.cicy)==null?void 0:k.tabs)==null?void 0:W.reloadIfOpen)==null||he.call(W,"http://127.0.0.1:8008",r("docker.teamTab","Docker 团队"))}catch{}try{const Et=await((ke=(ye=(se=window.cicy)==null?void 0:se.docker)==null?void 0:ye.appRedetect)==null?void 0:ke.call(ye));Et&&M(Et)}catch{}}}catch(Ne){Ce.finish({ok:!1,message:Ne.message})}finally{try{G&&G()}catch{}p(""),m()}},[m,w]),Me=g.useCallback(async(G,be,re)=>{T(!1),p(G),_e.show({id:"docker-op",message:r(`docker.${G}ing`,G==="restart"?"重启中…":G==="reload"?"刷新中…":"停止中…"),status:"running"});try{const ue=await be();ue!=null&&ue.ok?_e.show({id:"docker-op",message:re,status:"done",ttl:2500}):_e.show({id:"docker-op",message:(ue==null?void 0:ue.error)||r("docker.opFailed","操作失败"),status:"error",ttl:6e3})}catch(ue){_e.show({id:"docker-op",message:ue.message,status:"error",ttl:6e3})}finally{p(""),m()}},[m]),Gt=g.useCallback(async()=>{T(!1),p("authssh"),_e.show({id:"docker-op",message:r("docker.authorizingHost","授权容器访问 Mac(配置 SSH)…"),status:"running"});try{const G=await window.cicy.docker.appAuthorizeHostSsh();G!=null&&G.ok?_e.show({id:"docker-op",message:G.verified?r("docker.authorizedHostOk","已授权:容器内 `ssh mac` 可访问 Mac ✅"):r("docker.authorizedHostPartial","公钥已写入 Mac(未验证成功,可在容器内手动 `ssh mac` 试)"),status:G.verified?"done":"error",ttl:5e3}):_e.show({id:"docker-op",message:(G==null?void 0:G.error)||r("docker.opFailed","操作失败"),status:"error",ttl:6e3})}catch(G){_e.show({id:"docker-op",message:G.message,status:"error",ttl:6e3})}finally{p(""),m()}},[m]),ct=((ht=window.cicy)==null?void 0:ht.platform)||(b==null?void 0:b.platform);if(ct!=="win32")return null;const Dt=b?!!b.running:(c==null?void 0:c.status)==="running",ca=!!(b!=null&&b.dockerRunning),bt=!!(b!=null&&b.installed),$t=!!(b!=null&&b.unknown)&&!Dt&&!ca&&!bt,vt=!!(b!=null&&b.wslUnmanaged),oa=!!(b!=null&&b.wslWedged),ra=Dt&&!vt,jt=ra?"ok":oa||vt||ca||bt||$t?"warn":"off",Ot=!!j;oa?r("docker.wslWedged","WSL 卡死 · 点「修复 WSL」"):vt?r("docker.wslBrokenRepair","WSL 管理异常 · 点「修复 WSL」重装"):Dt?r("docker.running","运行中"):ca?r("docker.notRunning","未启动 · 点「启动」"):bt?r("docker.engineDown","Docker 未运行 · 点启动"):$t?r("docker.wslUnresponsive","WSL 未响应 · 点「重试检测」"):r("docker.notInstalled","Docker Desktop 未安装");const ka=j==="open"?r("docker.opening","打开中…"):j==="probe"?r("docker.probing","检测中…"):Ot?r("docker.working","处理中…"):ra?r("localTeams.open","打开"):oa||vt?r("docker.repairWsl","修复 WSL"):ca?r("docker.start","启动"):bt?r("docker.startDocker","启动 Docker"):$t?r("docker.retryProbe","重试检测"):r("docker.install","下载安装"),kt=async()=>{var G,be,re,ue,Re,Ee,at,k,W,he,se,ye;if(!Ot){if(oa){ge();return}if(vt){I();return}if(ra){try{const Ne=await((re=(be=(G=window.cicy)==null?void 0:G.tabs)==null?void 0:be.activateIfOpen)==null?void 0:re.call(be,"http://127.0.0.1:8008"));if(Ne!=null&&Ne.active)return}catch{}p("open");let ke=null;try{ke=await((Ee=(Re=(ue=window.cicy)==null?void 0:ue.docker)==null?void 0:Re.appOpen)==null?void 0:Ee.call(Re))}catch(Ne){ke={ok:!1,hint:(Ne==null?void 0:Ne.message)||r("docker.openFailed","打开失败"),log:[]}}p(""),ke&&ke.ok===!1&&(Ce.open({onRetry:kt,kind:"open"}),(ke.log||[]).forEach(Ne=>Ce.push(Ne)),Ce.finish({ok:!1,message:ke.hint||ke.error||r("docker.openFailed","打开失败")}));return}if($t){p("probe");try{const ke=await(((W=(k=(at=window.cicy)==null?void 0:at.docker)==null?void 0:k.appRedetect)==null?void 0:W.call(k))??((ye=(se=(he=window.cicy)==null?void 0:he.docker)==null?void 0:se.appStatus)==null?void 0:ye.call(se)));ke&&M(ke),ke!=null&&ke.unknown&&_e.show({id:"docker-probe",status:"error",message:r("docker.wslStillStuck","WSL 仍无响应 —— 多半要重启 Windows 后再试"),ttl:6e3})}catch{_e.show({id:"docker-probe",status:"error",message:r("docker.probeFailed","检测失败,请重试"),ttl:5e3})}finally{p("")}return}I()}},Ct=Dt;return s.jsxs("div",{"data-id":"DockerCard",className:`bcard bcard--docker${Dt?" bcard--online":""}`,children:[s.jsx("div",{className:"bcard__accent",style:{background:ee}}),s.jsxs("div",{className:"bcard__top",children:[s.jsxs("div",{className:"bcard__pill",style:{color:ee},children:[s.jsx("span",{className:"bcard__dot","data-tone":jt}),s.jsx("svg",{style:{width:18,height:18},viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:s.jsx("path",{d:"M21.81 10.25c-.06-.05-.67-.51-1.95-.51-.34 0-.68.03-1.01.09-.25-1.69-1.64-2.51-1.7-2.55l-.34-.2-.22.32a4.5 4.5 0 0 0-.59 1.4c-.23.94-.09 1.83.39 2.59-.58.32-1.51.4-1.7.41H2.62a.61.61 0 0 0-.61.61 9.32 9.32 0 0 0 .57 3.35 4.9 4.9 0 0 0 1.95 2.53c.92.52 2.42.82 4.12.82.77 0 1.54-.07 2.3-.21a9.6 9.6 0 0 0 3-1.09 8.3 8.3 0 0 0 2.05-1.68c.98-1.11 1.56-2.35 1.99-3.45h.17c1.36 0 2.2-.55 2.66-1l.13-.16zM4.7 11.33h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H4.7a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.46 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H7.16a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.5 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16H9.66a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.47 0h1.78a.16.16 0 0 0 .16-.16V9.58a.16.16 0 0 0-.16-.16h-1.78a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16M7.16 9.06h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16H7.16a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.5 0h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16H9.66a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16m2.47 0h1.78a.16.16 0 0 0 .16-.16V7.31a.16.16 0 0 0-.16-.16h-1.78a.16.16 0 0 0-.16.16v1.59c0 .09.07.16.16.16"})})]}),Ct&&s.jsxs("div",{className:"bcard__menuwrap",onClick:G=>G.stopPropagation(),children:[s.jsx("button",{type:"button",ref:Y,"data-id":"DockerCard-menu-btn",className:"bcard__kebab",title:r("docker.manage","管理 Docker cicy-code"),disabled:Ot,onClick:K,children:Ot?s.jsx(Lt,{}):s.jsx(qr,{})}),N&&sa.createPortal(s.jsxs("div",{className:"bcard__menu bcard__menu--portal","data-id":"DockerCard-menu",role:"menu",ref:H,style:{position:"fixed",top:oe.top,left:oe.left,width:ie},onClick:G=>G.stopPropagation(),children:[s.jsx("button",{type:"button","data-id":"DockerCard-update",className:"bcard__menu-item is-accent",onClick:Qe,children:r("docker.update","更新 cicy-code")}),s.jsx("button",{type:"button","data-id":"DockerCard-restart",className:"bcard__menu-item",onClick:()=>Me("restart",()=>window.cicy.docker.appRestart(),r("docker.restarted","已重启 cicy-code")),children:r("docker.restart","重启 cicy-code")}),s.jsx("button",{type:"button","data-id":"DockerCard-stop",className:"bcard__menu-item is-danger",onClick:()=>Me("stop",()=>window.cicy.docker.appStop(),r("docker.stopped","已停止 cicy-code")),children:r("docker.stop","停止 cicy-code")}),s.jsx("button",{type:"button","data-id":"DockerCard-reload",className:"bcard__menu-item",onClick:G=>{var be,re,ue;G.stopPropagation(),T(!1),(ue=(re=(be=window.cicy)==null?void 0:be.tabs)==null?void 0:re.reloadIfOpen)==null||ue.call(re,"http://127.0.0.1:8008","Docker 团队")},children:r("docker.reloadWindow","刷新窗口")}),s.jsx("button",{type:"button","data-id":"DockerCard-open-dir",className:"bcard__menu-item",onClick:G=>{var be,re,ue;G.stopPropagation(),T(!1),(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.openDir)==null||ue.call(re)},children:r("docker.openWslDir","打开 WSL 目录")}),s.jsx("button",{type:"button","data-id":"DockerCard-open-projects",className:"bcard__menu-item",onClick:G=>{var be,re,ue;G.stopPropagation(),T(!1),(ue=(re=(be=window.cicy)==null?void 0:be.docker)==null?void 0:re.openDir)==null||ue.call(re,"projects")},children:r("docker.openProjectsDir","打开项目目录")}),s.jsx("button",{type:"button","data-id":"DockerCard-dood",className:"bcard__menu-item",title:r("dood.hint","把宿主 Docker + docker 客户端挂进容器,容器内 agent 能直接跑 docker(切换会重建容器,秒生效、无需下载)"),onClick:G=>{G.stopPropagation(),T(!1),D(!0)},children:r("dood.menu","容器内使用 Docker")}),s.jsx("div",{className:"bcard__menu-sep","data-id":"DockerCard-menu-sep",role:"separator","aria-hidden":!0}),ct==="darwin"&&s.jsx("button",{type:"button","data-id":"DockerCard-authorize-host-ssh",className:"bcard__menu-item",title:r("docker.authorizeHostHint","把容器公钥加到 Mac 的 authorized_keys,容器内 `ssh mac` 即可访问本机"),onClick:Gt,children:r("docker.authorizeHost","授权容器访问 Mac")}),s.jsx("button",{type:"button","data-id":"DockerCard-docker-restart",className:"bcard__menu-item",onClick:()=>Me("restart",()=>window.cicy.docker.appDockerRestart(),r("docker.dockerRestarted","已重启 Docker 容器")),children:r("docker.dockerRestart","重启 Docker")}),s.jsx("button",{type:"button","data-id":"DockerCard-ports",className:"bcard__menu-item",onClick:G=>{G.stopPropagation(),x()},children:r("docker.ports.menu","端口设置")}),s.jsx("button",{type:"button","data-id":"DockerCard-recreate",className:"bcard__menu-item is-danger",onClick:G=>{G.stopPropagation(),T(!1),R(!0)},children:r("docker.recreate","重建 Docker")})]}),document.body)]})]}),s.jsxs("div",{className:"bcard__body",children:[s.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[s.jsx(Lr,{size:24,avatar:c==null?void 0:c.avatar,name:$e,teamId:c==null?void 0:c.id,onChanged:w}),ae?s.jsx("input",{"data-id":"DockerCard-rename-input",autoFocus:!0,value:je,onChange:G=>qe(G.target.value),onFocus:G=>G.target.select(),onBlur:Xe,onClick:G=>G.stopPropagation(),onKeyDown:G=>{G.nativeEvent.isComposing||G.keyCode===229||(G.key==="Enter"?Xe():G.key==="Escape"&&X(!1))},style:{flex:1,width:"100%",font:"inherit",fontWeight:600,padding:"2px 6px",border:"1px solid #3b82f6",borderRadius:6,background:"#0d1117",color:"#e6edf3",boxSizing:"border-box"}}):s.jsxs("h3",{className:"bcard__name",title:S?r("localTeams.renameHint","点名字或 ✎ 改名"):$e,style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,margin:0},onDoubleClick:S?st:void 0,children:[s.jsx("span",{onClick:S?st:void 0,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:S?"text":"default"},children:$e}),S&&s.jsx("button",{type:"button","data-id":"DockerCard-rename-btn",title:r("localTeams.rename","重命名"),onClick:st,style:{flex:"none",cursor:"pointer",border:"none",background:"transparent",color:"#8b949e",fontSize:13,padding:0,lineHeight:1},children:"✎"})]})]}),s.jsxs("div",{className:"bcard__meta",children:[s.jsx("span",{className:"bcard__chip",children:"Docker"}),(b==null?void 0:b.version)&&s.jsxs("span",{className:"bcard__ver","data-id":"DockerCard-ver",style:{marginLeft:8,fontSize:11,opacity:.6},children:["v",b.version]})]})]}),s.jsxs("button",{type:"button",className:"bcard__cta","data-id":"DockerCard-cta",disabled:Ot,onClick:kt,style:Dt?void 0:{background:ee,color:"white"},children:[Ot?s.jsx(Lt,{}):s.jsx(lc,{}),s.jsx("span",{children:ka})]}),s.jsx(kg,{open:Z,onClose:()=>D(!1),toastId:"docker-op"}),J&&sa.createPortal(s.jsx("div",{"data-id":"DockerCard-recreate-modal",style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:G=>{G.target===G.currentTarget&&R(!1)},children:s.jsxs("div",{onClick:G=>G.stopPropagation(),style:{width:360,maxWidth:"90vw",background:"#161b22",border:"1px solid #30363d",borderRadius:12,padding:"20px 22px",boxShadow:"0 12px 40px rgba(0,0,0,0.5)"},children:[s.jsx("h3",{style:{margin:"0 0 8px",fontSize:16,color:"#e6edf3"},children:r("docker.recreate","重建 Docker")}),s.jsx("p",{style:{margin:"0 0 18px",fontSize:13,lineHeight:1.6,color:"#9aa4b2"},children:r("docker.recreateConfirm","会删除当前容器并重新创建(volume 数据保留),用于切换为独立 team 的网关 key。确定重建?")}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[s.jsx("button",{type:"button","data-id":"DockerCard-recreate-cancel",onClick:()=>R(!1),style:{padding:"7px 16px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:13},children:r("common.cancel","取消")}),s.jsx("button",{type:"button","data-id":"DockerCard-recreate-confirm",onClick:()=>{R(!1),Me("restart",()=>window.cicy.docker.appRecreate(),r("docker.recreated","已重建 Docker 容器"))},style:{padding:"7px 16px",borderRadius:8,border:"none",background:"#da3633",color:"white",cursor:"pointer",fontSize:13,fontWeight:600},children:r("docker.recreateOk","确定重建")})]})]})}),document.body),U&&sa.createPortal(s.jsx("div",{"data-id":"DockerCard-ports-modal",style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:G=>{G.target===G.currentTarget&&F(!1)},children:s.jsxs("div",{onClick:G=>G.stopPropagation(),style:{width:420,maxWidth:"92vw",background:"#161b22",border:"1px solid #30363d",borderRadius:12,padding:"20px 22px",boxShadow:"0 12px 40px rgba(0,0,0,0.5)"},children:[s.jsx("h3",{style:{margin:"0 0 6px",fontSize:16,color:"#e6edf3"},children:r("docker.ports.title","端口设置")}),s.jsx("p",{style:{margin:"0 0 14px",fontSize:12.5,lineHeight:1.6,color:"#9aa4b2"},children:r("docker.ports.sub","除 :8008 外,额外发布、可从 Windows 直达容器内服务的端口")}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",marginBottom:10,borderRadius:8,background:"#0d1117",border:"1px solid #21262d",color:"#7d8590",fontSize:13},children:["🔒 ",r("docker.ports.mainFixed",":8008 · cicy-code(固定)")]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,maxHeight:220,overflowY:"auto"},children:[Se.length===0&&s.jsx("div",{style:{fontSize:12.5,color:"#6e7681",padding:"4px 2px"},children:r("docker.ports.none","暂无额外端口")}),Se.map((G,be)=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("input",{"data-id":`DockerCard-port-input-${be}`,type:"text",inputMode:"numeric",value:G,placeholder:r("docker.ports.ph","端口号 1-65535"),onChange:re=>{const ue=re.target.value.replace(/[^0-9]/g,"");le(Re=>Re.map((Ee,at)=>at===be?ue:Ee)),V("")},style:{flex:1,padding:"7px 10px",borderRadius:8,border:"1px solid #30363d",background:"#0d1117",color:"#e6edf3",fontSize:13,fontFamily:"var(--mono)"}}),s.jsx("button",{type:"button","data-id":`DockerCard-port-remove-${be}`,title:r("docker.ports.remove","移除"),onClick:()=>{le(re=>re.filter((ue,Re)=>Re!==be)),V("")},style:{padding:"6px 10px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#da3633",cursor:"pointer",fontSize:14},children:"✕"})]},be))]}),s.jsx("button",{type:"button","data-id":"DockerCard-port-add",onClick:()=>le(G=>[...G,""]),style:{marginTop:10,padding:"7px 12px",borderRadius:8,border:"1px dashed #30363d",background:"transparent",color:"#58a6ff",cursor:"pointer",fontSize:13,width:"100%"},children:r("docker.ports.add","+ 添加端口")}),te&&s.jsx("div",{style:{marginTop:10,fontSize:12.5,color:"#f85149"},children:te}),s.jsx("p",{style:{margin:"12px 0 16px",fontSize:11.5,lineHeight:1.5,color:"#6e7681"},children:r("docker.ports.hint","保存会重建容器(volume 数据保留),会有短暂中断")}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[s.jsx("button",{type:"button","data-id":"DockerCard-ports-cancel",disabled:we,onClick:()=>F(!1),style:{padding:"7px 16px",borderRadius:8,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:13},children:r("docker.ports.cancel","取消")}),s.jsx("button",{type:"button","data-id":"DockerCard-ports-save",disabled:we,onClick:q,style:{padding:"7px 16px",borderRadius:8,border:"none",background:"#238636",color:"white",cursor:"pointer",fontSize:13,fontWeight:600},children:we?r("docker.ports.saving","保存中…"):r("docker.ports.save","保存并重建")})]})]})}),document.body)]})}function Im({team:c,cloudCode:f,onOpen:h,onRename:d,onRefresh:S}){var ue,Re,Ee,at;const b=(eh[c.status]||eh.error).tone,[M,j]=g.useState(!1),[p,N]=g.useState(c.name||""),[T,Z]=g.useState(null),[D,J]=g.useState(""),R=T??c.name;g.useEffect(()=>{T!=null&&c.name===T&&Z(null)},[c.name,T]);const U=k=>{var W;(W=k==null?void 0:k.stopPropagation)==null||W.call(k),N(R||""),j(!0)},F=async()=>{j(!1);const k=String(p||"").trim();if(!d||!k||k===R)return;Z(k),J("saving");let W;try{W=await d(c.id,k)}catch(he){W={ok:!1,error:he==null?void 0:he.message}}Z(null),W&&W.ok?(J("saved"),setTimeout(()=>J(he=>he==="saved"?"":he),1500)):(J(""),_e.show({message:r("localTeams.renameFailed","改名没保存,已恢复"),status:"error",ttl:4e3}))},le=!!((Re=(ue=window.cicy)==null?void 0:ue.sidecar)!=null&&Re.restart)&&Rr(c.base_url),we=c.status==="running",[ce,te]=g.useState(""),[V,ae]=g.useState(!1),[X,je]=g.useState(!1);g.useEffect(()=>{var k,W;!le||!((W=(k=window.cicy)==null?void 0:k.sidecar)!=null&&W.getPublic)||window.cicy.sidecar.getPublic().then(he=>je(!!(he!=null&&he.public))).catch(()=>{})},[le]);const[qe,$e]=g.useState({running:void 0,latest:null,installed:null}),st=qe.latest,Xe=qe.running,[oe,C]=g.useState(!1),Y=g.useRef(null),H=g.useRef(null),ie=g.useRef(null),[ee,m]=g.useState({top:0,left:0}),x=184,q=()=>{if(!V&&H.current){const k=H.current.getBoundingClientRect(),W=Math.max(8,Math.min(k.right-x,window.innerWidth-x-8));m({top:Math.round(k.bottom+4),left:Math.round(W)})}ae(k=>!k)},K=g.useCallback(async(k=!1)=>{var W,he;if(!(!le||!((he=(W=window.cicy)==null?void 0:W.sidecar)!=null&&he.versions))){k&&C(!0);try{const se=await window.cicy.sidecar.versions();$e({running:(se==null?void 0:se.running)??null,latest:(se==null?void 0:se.latest)??null,installed:(se==null?void 0:se.installed)??null}),k&&(se!=null&&se.running&&(se!=null&&se.latest)&&Ur(se.latest,se.running)>0?_e.show({message:`${r("sidecar.found","发现新版本")} v${se.latest}`,status:"done",ttl:2500}):se!=null&&se.running?_e.show({message:`${r("sidecar.upToDate","已是最新")} v${se.running}`,status:"done",ttl:2500}):_e.show({message:r("sidecar.notRunning","cicy-code 未运行"),status:"error",ttl:4e3}))}catch{k&&_e.show({message:r("sidecar.checkFailed","检查更新失败"),status:"error",ttl:5e3})}finally{k&&C(!1)}}},[le]);g.useEffect(()=>{K(!1)},[K]),g.useEffect(()=>{we&&K(!1)},[we,K]);const I=!!(le&&st&&Xe&&Ur(st,Xe)>0),ge=!le&&!!((at=(Ee=window.cicy)==null?void 0:Ee.localTeams)!=null&&at.remove),me=le||ge,[Qe,Me]=g.useState(!1),[Gt,ct]=g.useState(!1),[Dt,ca]=g.useState(""),[bt,$t]=g.useState(""),[vt,oa]=g.useState(!1),[ra,jt]=g.useState("");g.useEffect(()=>{if(!V)return;const k=W=>{var he,se;(he=H.current)!=null&&he.contains(W.target)||(se=ie.current)!=null&&se.contains(W.target)||ae(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[V]);const Ot=async()=>{var W,he,se;if(vt)return;const k=Hy({title:Dt,url:bt});if(!k.ok){jt(r("teams.titleRequired","请输入自定义标题"));return}if(!k.patch.base_url){jt(r("teams.urlRequired","请输入地址 URL"));return}try{new URL(k.patch.base_url)}catch{jt(r("teams.badUrl","URL 无效(需含 http(s)://)"));return}if(k.patch.name===(c.name||"")&&k.patch.base_url===(c.base_url||"")){ct(!1);return}jt(""),oa(!0);try{const ye=await((se=(he=(W=window.cicy)==null?void 0:W.localTeams)==null?void 0:he.update)==null?void 0:se.call(he,c.id,k.patch));ye!=null&&ye.ok?(ct(!1),S==null||S()):jt(Ni((ye==null?void 0:ye.error)||"update failed"))}catch(ye){jt(Ni((ye==null?void 0:ye.message)||String(ye)))}oa(!1)},ka=async()=>{var W,he,se;if(ce)return;Me(!1),te("remove");const k="op-"+Date.now();_e.show({id:k,message:r("localTeams.removing","删除中…"),status:"running"});try{const ye=await((se=(he=(W=window.cicy)==null?void 0:W.localTeams)==null?void 0:he.remove)==null?void 0:se.call(he,c.id));ye!=null&&ye.ok?_e.show({id:k,message:r("localTeams.removed","已删除"),status:"done",ttl:3e3}):_e.show({id:k,message:r("localTeams.removeFailed","删除失败")+(ye!=null&&ye.error?": "+ye.error:""),status:"error",ttl:7e3})}catch(ye){_e.show({id:k,message:r("localTeams.removeFailed","删除失败")+": "+((ye==null?void 0:ye.message)||ye),status:"error",ttl:7e3})}te(""),S==null||S()},kt=`sidecar-op:${c.id}`,Ct=async(k,W,he)=>{var ke,Ne,Et,ua,Ta;if(ae(!1),ce)return;te(k);const se=k==="update";let ye=null;se?(dt.open({teamId:c.id,fromVer:Xe,toVer:st,onRetry:()=>Ct("update",W,he)}),(Ne=(ke=window.cicy)==null?void 0:ke.sidecar)!=null&&Ne.onOpProgress&&(ye=window.cicy.sidecar.onOpProgress(nt=>{(nt==null?void 0:nt.op)==="update"&&dt.push(nt)}))):_e.show({id:kt,message:ht[k]||`${k}…`,status:"running",progress:void 0});try{const nt=await W(),pt=!!(nt!=null&&nt.ok),Da=nt!=null&&nt.warning?`${he}(${nt.warning})`:he,Ca=r("sidecar.failed","操作失败")+(nt!=null&&nt.error?`: ${nt.error}`:"");if(se){if(dt.finish({ok:pt,message:pt?Da:Ca}),pt)try{await((Ta=(ua=(Et=window.cicy)==null?void 0:Et.localTeams)==null?void 0:ua.reload)==null?void 0:Ta.call(ua,c.id,{ignoreCache:!0}))}catch{}}else _e.show({id:kt,message:pt?Da:Ca,progress:void 0,status:pt?"done":"error",ttl:pt?4e3:8e3})}catch(nt){const pt=r("sidecar.failed","操作失败")+`: ${(nt==null?void 0:nt.message)||nt}`;se?dt.finish({ok:!1,message:pt}):_e.show({id:kt,message:pt,progress:void 0,status:"error",ttl:8e3})}finally{try{ye&&ye()}catch{}te(""),S==null||S(),(k==="update"||k==="restart"||k==="start")&&K(!1)}},ht={start:r("busy.start","启动中…"),restart:r("busy.restart","重启中…"),update:r("busy.update","更新中…"),stop:r("busy.stop","停止中…")},G=async()=>{var he,se,ye;te("start"),dt.open({teamId:c.id,title:r("sidecar.startTitle","启动 cicy-code"),onRetry:G}),dt.push({phase:"download",status:"running",message:r("sidecar.starting","启动 cicy-code(首次需安装 Node + 依赖,日志见下)…")});const k=(ye=(se=(he=window.cicy)==null?void 0:he.sidecar)==null?void 0:se.onOpProgress)==null?void 0:ye.call(se,ke=>dt.push(ke));let W;try{W=await window.cicy.sidecar.start()}catch(ke){W={ok:!1,error:(ke==null?void 0:ke.message)||String(ke)}}try{k==null||k()}catch{}return te(""),S==null||S(),!(W!=null&&W.ok)||W!=null&&W.warning?(dt.finish({ok:!1,message:r("sidecar.startFailed","启动失败")+(W!=null&&W.error?`: ${W.error}`:W!=null&&W.warning?`: ${W.warning}`:"")}),!1):(dt.finish({ok:!0,message:r("sidecar.startedOk","cicy-code 已就绪")}),!0)},be=async()=>{var k,W;ce||!we&&le&&((W=(k=window.cicy)==null?void 0:k.sidecar)!=null&&W.start)&&!await G()||h()},re=we?r("localTeams.open","打开"):le?r("localTeams.startOpen","启动并打开"):r("localTeams.open","打开");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-id":"LocalTeamCard",className:`bcard ${le?"bcard--local":"bcard--custom"}${b==="ok"?" bcard--online":""}`,children:[s.jsx("div",{className:"bcard__accent"}),s.jsxs("div",{className:"bcard__top",children:[s.jsxs("div",{className:"bcard__pill",children:[s.jsx("span",{className:"bcard__dot","data-tone":b}),s.jsx(mh,{})]}),me&&s.jsxs("div",{className:"bcard__menuwrap",ref:Y,onClick:k=>k.stopPropagation(),children:[s.jsx("button",{type:"button",ref:H,"data-id":"LocalTeamCard-menu-btn",className:`bcard__kebab${I?" has-dot":""}`,title:le?r("localTeams.manage","管理本地 cicy-code"):r("localTeams.more","更多"),disabled:!!ce,onClick:q,children:ce?s.jsx(Lt,{}):s.jsx(qr,{})}),V&&sa.createPortal(s.jsxs("div",{className:"bcard__menu bcard__menu--portal","data-id":"LocalTeamCard-menu",role:"menu",ref:ie,style:{position:"fixed",top:ee.top,left:ee.left,width:x},onClick:k=>k.stopPropagation(),children:[le&&s.jsx("button",{type:"button","data-id":"LocalTeamCard-check-update",className:"bcard__menu-item",disabled:oe,onClick:k=>{k.stopPropagation(),K(!0)},children:oe?r("sidecar.checking2","检查中…"):r("sidecar.checkUpdate","检查更新")}),I&&s.jsxs("button",{type:"button","data-id":"LocalTeamCard-update",className:"bcard__menu-item is-accent",onClick:()=>Ct("update",()=>window.cicy.sidecar.update(),r("sidecar.updated","已更新到最新")),children:[r("sidecar.updateTo","更新到")," v",st]}),c.base_url&&s.jsx("button",{type:"button","data-id":"LocalTeamCard-reload",className:"bcard__menu-item",onClick:k=>{var W,he,se;k.stopPropagation(),ae(!1),(se=(he=(W=window.cicy)==null?void 0:W.tabs)==null?void 0:he.reloadIfOpen)==null||se.call(he,c.base_url,c.name)},children:r("localTeams.reloadWindow","刷新窗口")}),le&&!we&&s.jsx("button",{type:"button","data-id":"LocalTeamCard-start",className:"bcard__menu-item is-accent",onClick:()=>Ct("start",()=>window.cicy.sidecar.start(),r("sidecar.started","已启动")),children:r("sidecar.start","启动")}),le&&we&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","data-id":"LocalTeamCard-restart",className:"bcard__menu-item",onClick:()=>Ct("restart",()=>window.cicy.sidecar.restart(),r("sidecar.restarted","已重启")),children:r("sidecar.restart","重启")}),s.jsx("button",{type:"button","data-id":"LocalTeamCard-stop",className:"bcard__menu-item is-danger",onClick:()=>Ct("stop",()=>window.cicy.sidecar.stop(),r("sidecar.stoppedDone","已停止")),children:r("sidecar.stop","停止")}),s.jsxs("button",{type:"button","data-id":"LocalTeamCard-lan",className:"bcard__menu-item",title:r("sidecar.lanHint","开启后同局域网设备可用本机 IP 访问(api_token 仍校验);切换会自动重启 cicy-code"),disabled:ce==="lan",onClick:async()=>{if(ce)return;const k=!X;ae(!1),te("lan"),je(k),_e.show({id:kt,message:k?r("sidecar.lanEnabling","开启局域网访问,重启中…"):r("sidecar.lanDisabling","关闭局域网访问,重启中…"),status:"running",progress:void 0});try{const W=await window.cicy.sidecar.setPublic(k);W!=null&&W.ok?_e.show({id:kt,message:k?r("sidecar.lanOn","已开启局域网访问"):r("sidecar.lanOff","已关闭局域网访问"),status:"done",ttl:3e3}):_e.show({id:kt,message:r("sidecar.lanFailed","设置失败")+(W!=null&&W.error?`: ${W.error}`:""),status:"error",ttl:7e3})}catch(W){_e.show({id:kt,message:r("sidecar.lanFailed","设置失败")+`: ${(W==null?void 0:W.message)||W}`,status:"error",ttl:7e3})}try{const W=await window.cicy.sidecar.getPublic();je(!!(W!=null&&W.public))}catch{}te(""),S==null||S()},children:[r("sidecar.lanAccess","局域网访问")," · ",X?r("common.on","开"):r("common.off","关")]})]}),ge&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","data-id":"LocalTeamCard-edit-url",className:"bcard__menu-item",onClick:k=>{k.stopPropagation(),ae(!1),ct(!0),ca(c.name||""),$t(c.base_url||""),jt("")},children:r("teamCard.editUrl","更改访问地址")}),s.jsx("button",{type:"button","data-id":"LocalTeamCard-remove",className:"bcard__menu-item is-danger",onClick:()=>{ae(!1),Me(!0)},children:r("localTeams.remove","删除")})]}),(Xe||c.version)&&s.jsxs("div",{"data-id":"LocalTeamCard-version",className:"bcard__menu-item",style:{cursor:"default",color:"#8b949e",fontSize:12},children:[r("localTeams.version","版本")," v",Xe||c.version]})]}),document.body)]})]}),s.jsxs("div",{className:"bcard__body",children:[s.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[s.jsx(Lr,{size:24,avatar:c==null?void 0:c.avatar,name:c==null?void 0:c.name,teamId:c==null?void 0:c.id,onChanged:S}),M?s.jsx("input",{"data-id":"LocalTeamCard-rename-input",autoFocus:!0,value:p,onChange:k=>N(k.target.value),onFocus:k=>k.target.select(),onBlur:F,onClick:k=>k.stopPropagation(),onKeyDown:k=>{k.nativeEvent.isComposing||k.keyCode===229||(k.key==="Enter"?F():k.key==="Escape"&&j(!1))},style:{flex:1,width:"100%",font:"inherit",fontWeight:600,padding:"2px 6px",border:"1px solid #3b82f6",borderRadius:6,background:"#0d1117",color:"#e6edf3",boxSizing:"border-box"}}):s.jsxs("h3",{className:"bcard__name",title:r("localTeams.renameHint","点名字或 ✎ 改名"),style:{display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,margin:0},onDoubleClick:U,children:[s.jsx("span",{"data-id":"LocalTeamCard-name-text",onClick:U,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"text"},children:R}),D==="saving"&&s.jsx("span",{"data-id":"LocalTeamCard-save-state",title:r("localTeams.saving","保存中…"),style:{flex:"none",display:"inline-flex"},children:s.jsx(Lt,{})}),D==="saved"&&s.jsx("span",{"data-id":"LocalTeamCard-save-state",title:r("localTeams.saved","已保存"),style:{flex:"none",color:"#3fb950",fontSize:13,lineHeight:1},children:"✓"}),!D&&s.jsx("button",{type:"button","data-id":"LocalTeamCard-rename-btn",title:r("localTeams.rename","重命名"),onClick:U,style:{flex:"none",cursor:"pointer",border:"none",background:"transparent",color:"#8b949e",fontSize:13,padding:0,lineHeight:1},children:"✎"})]})]}),s.jsx("div",{className:"bcard__meta",children:s.jsx("span",{className:"bcard__chip","data-id":"LocalTeamCard-kind",children:le?r("localTeams.kindLocal","本地"):r("localTeams.kindCustom","自定义")})})]}),s.jsxs("button",{type:"button",className:"bcard__cta","data-id":"LocalTeamCard-open",disabled:!!ce||!c.base_url,onClick:be,children:[ce&&ce!=="stop"?s.jsx(Lt,{}):s.jsx(lc,{}),s.jsx("span",{children:ce&&ht[ce]||re})]})]}),Gt&&sa.createPortal(s.jsx("div",{"data-id":"LocalTeamCard-url-modal",style:{position:"fixed",inset:0,zIndex:65,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:k=>{!vt&&k.target===k.currentTarget&&ct(!1)},children:s.jsxs("div",{onClick:k=>k.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[s.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:16},children:r("teamCard.editCustom","编辑自定义团队")}),s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("teams.customNameLabel","自定义标题")}),s.jsx("input",{"data-id":"LocalTeamCard-title-input",autoFocus:!0,className:"login-email-input",style:{width:"100%",marginBottom:14},value:Dt,placeholder:r("teams.customNamePlaceholder","我的团队"),spellCheck:!1,disabled:vt,onChange:k=>ca(k.target.value),onKeyDown:k=>{k.nativeEvent.isComposing||k.keyCode===229||(k.key==="Enter"?(k.preventDefault(),Ot()):k.key==="Escape"&&ct(!1))}}),s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("teams.customUrlLabel","地址 URL")}),s.jsx("textarea",{"data-id":"LocalTeamCard-url-input",rows:3,className:"login-email-input",style:{width:"100%",resize:"vertical",lineHeight:1.5,fontFamily:"var(--mono)"},value:bt,placeholder:"https://example.com:8008",spellCheck:!1,disabled:vt,onChange:k=>$t(k.target.value.replace(/[\r\n]+/g,"")),onKeyDown:k=>{k.nativeEvent.isComposing||k.keyCode===229||(k.key==="Enter"?(k.preventDefault(),Ot()):k.key==="Escape"&&ct(!1))}}),ra&&s.jsx("div",{className:"error",style:{marginTop:8,fontSize:12},children:ra}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn-ghost",disabled:vt,onClick:()=>ct(!1),children:r("common.cancel","取消")}),s.jsx("button",{type:"button",className:"btn-primary","data-id":"LocalTeamCard-url-save",disabled:vt,onClick:Ot,children:vt?r("common.saving","保存中…"):r("common.save","保存")})]})]})}),document.body),s.jsx(Sg,{open:Qe,title:r("localTeams.deleteTitle","删除团队"),message:r("localTeams.deleteMsg","确定删除「{{name}}」?此操作不可撤销。",{name:c.name}),confirmLabel:r("common.delete","删除"),danger:!0,onConfirm:ka,onCancel:()=>Me(!1)})]})}function Rr(c){var f;try{if(((f=window.cicy)==null?void 0:f.platform)==="win32")return!1;const h=new URL(c);return(h.hostname==="127.0.0.1"||h.hostname==="localhost"||h.hostname==="::1")&&(h.port==="8008"||h.port==="")}catch{return!1}}function Pm(c){var f;try{if(((f=window.cicy)==null?void 0:f.platform)!=="win32")return!1;const h=new URL(c);return(h.hostname==="127.0.0.1"||h.hostname==="localhost"||h.hostname==="::1")&&h.port==="8008"}catch{return!1}}function Ur(c,f){const h=String(c).split("."),d=String(f).split(".");for(let S=0;S<Math.max(h.length,d.length);S++){const w=(parseInt(h[S],10)||0)-(parseInt(d[S],10)||0);if(w)return w>0?1:-1}return 0}const eh={running:{tone:"ok",label:"running",cta:r("localStatus.open","打开")},stopped:{tone:"off",label:"stopped",cta:r("localStatus.notRunning","未运行")},auth_error:{tone:"warn",label:"auth error",cta:r("localStatus.tokenInvalid","Token 失效")},misconfigured:{tone:"err",label:"bad config",cta:r("localStatus.badUrl","URL 错误")},error:{tone:"err",label:"error",cta:r("localStatus.error","异常")}};function Sg({open:c,title:f,message:h,confirmLabel:d,danger:S,onConfirm:w,onCancel:b}){return c?sa.createPortal(s.jsx("div",{"data-id":"ConfirmModal",style:{position:"fixed",inset:0,zIndex:70,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:M=>{M.target===M.currentTarget&&(b==null||b())},children:s.jsxs("div",{onClick:M=>M.stopPropagation(),style:{width:360,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[s.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:6},children:f}),h&&s.jsx("div",{style:{fontSize:13,opacity:.7,marginBottom:16},children:h}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn-ghost",onClick:b,children:r("common.cancel","取消")}),s.jsx("button",{type:"button",className:"btn-primary","data-id":"ConfirmModal-ok",style:S?{background:"#dc2626",borderColor:"#dc2626"}:{},onClick:w,children:d||r("common.confirm","确认")})]})]})}),document.body):null}function th(){return s.jsxs("div",{className:"brand",children:[s.jsx("div",{className:"brand-mark",children:s.jsx(Tg,{})}),s.jsxs("div",{className:"brand-text",children:[s.jsx("div",{className:"brand-name",children:"CiCy Desktop"}),s.jsx("div",{className:"brand-sub",children:r("app.brandSub","团队 AI 协作工作台")})]})]})}function wg(){const[c,f]=g.useState(null),[h,d]=g.useState(!1),[S,w]=g.useState(!1),b=g.useRef(!1),M=N=>{var T,Z,D;w(N),(D=(Z=(T=window.cicy)==null?void 0:T.app)==null?void 0:Z.setAutoUpdate)==null||D.call(Z,N).catch(()=>{})};g.useEffect(()=>{var Z,D,J,R,U,F,Se,le,we;let N=!0;(J=(D=(Z=window.cicy)==null?void 0:Z.app)==null?void 0:D.updateState)==null||J.call(D).then(ce=>{N&&f(ce)}).catch(()=>{}),(F=(U=(R=window.cicy)==null?void 0:R.app)==null?void 0:U.getAutoUpdate)==null||F.call(U).then(ce=>{N&&w(ce===!0)}).catch(()=>{});const T=(we=(le=(Se=window.cicy)==null?void 0:Se.app)==null?void 0:le.onUpdateState)==null?void 0:we.call(le,ce=>{f(ce),typeof(ce==null?void 0:ce.autoUpdate)=="boolean"&&w(ce.autoUpdate),ce!=null&&ce.auto&&!b.current&&(ce.status==="downloading"||ce.status==="ready")&&(b.current=!0,d(!0),dt.open({kind:"app",title:r("updateBanner.drawerTitle","应用更新"),fromVer:ce.current,toVer:ce.version,onRetry:()=>{var te,V,ae;return(ae=(V=(te=window.cicy)==null?void 0:te.app)==null?void 0:V.downloadUpdate)==null?void 0:ae.call(V)}}),dt.push({phase:"download",status:"running",message:r("updateBanner.autoDl","已开启自动更新,正在下载安装包…")})),b.current&&(ce.status==="downloading"?dt.setProgress(ce.progress||{}):ce.status==="ready"?dt.ready({onInstall:()=>{var te,V,ae;return(ae=(V=(te=window.cicy)==null?void 0:te.app)==null?void 0:V.installUpdate)==null?void 0:ae.call(V)}}):ce.status==="error"&&(dt.finish({ok:!1,message:ce.error||r("updateBanner.error","更新失败")}),b.current=!1))});return()=>{N=!1;try{T&&T()}catch{}}},[]);const j=c==null?void 0:c.status;g.useEffect(()=>{d(!1)},[j]);const p=()=>{var N,T,Z;b.current=!0,d(!0),dt.open({kind:"app",title:r("updateBanner.drawerTitle","应用更新"),fromVer:c==null?void 0:c.current,toVer:c==null?void 0:c.version,onRetry:p}),dt.push({phase:"download",status:"running",message:r("updateBanner.startDl","开始下载安装包…")}),dt.setProgress({percent:0}),(Z=(T=(N=window.cicy)==null?void 0:N.app)==null?void 0:T.downloadUpdate)==null||Z.call(T)};return j!=="available"||h?null:sa.createPortal(s.jsx("div",{"data-id":"UpdateBanner",style:{position:"fixed",inset:0,zIndex:1e4,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(3px)",display:"flex",alignItems:"center",justifyContent:"center"},onMouseDown:N=>{N.target===N.currentTarget&&d(!0)},children:s.jsxs("div",{onClick:N=>N.stopPropagation(),style:{width:380,maxWidth:"90vw",background:"#161b22",border:"1px solid #30363d",borderRadius:14,padding:"24px 24px 20px",boxShadow:"0 20px 60px rgba(0,0,0,0.55)",textAlign:"center"},children:[s.jsx("div",{style:{fontSize:34,lineHeight:1,marginBottom:12},"aria-hidden":!0,children:"🚀"}),s.jsx("h3",{style:{margin:"0 0 8px",fontSize:17,color:"#e6edf3"},"data-id":"UpdateBanner-text",children:r("updateBanner.available","发现新版本 v{{v}}",{v:c.version})}),s.jsx("p",{style:{margin:"0 0 14px",fontSize:13,lineHeight:1.6,color:"#9aa4b2"},children:r("updateBanner.modalSub","建议尽快更新到最新版本")}),s.jsxs("label",{"data-id":"UpdateBanner-auto",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:7,margin:"0 0 18px",fontSize:12.5,color:"#c9d1d9",cursor:"pointer",userSelect:"none"},children:[s.jsx("input",{type:"checkbox",checked:S,onChange:N=>M(N.target.checked),style:{accentColor:"#238636",width:15,height:15,margin:0,cursor:"pointer"}}),r("updateBanner.autoNext","以后发现新版本自动更新,不再询问")]}),s.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"center"},children:[s.jsx("button",{type:"button","data-id":"UpdateBanner-later",onClick:()=>d(!0),style:{flex:1,padding:"9px 16px",borderRadius:9,border:"1px solid #30363d",background:"transparent",color:"#c9d1d9",cursor:"pointer",fontSize:14},children:r("updateBanner.later","稍后")}),s.jsx("button",{type:"button","data-id":"UpdateBanner-download",onClick:p,style:{flex:1,padding:"9px 16px",borderRadius:9,border:"none",background:"#238636",color:"white",cursor:"pointer",fontSize:14,fontWeight:600},children:r("updateBanner.updateNow","立即更新")})]})]})}),document.body)}function xg(){return s.jsxs("div",{className:"bcard bcard--skeleton","data-id":"SkeletonCard","aria-hidden":!0,children:[s.jsx("div",{className:"bcard__accent",style:{background:"rgba(255,255,255,.08)",opacity:1}}),s.jsxs("div",{className:"bcard__top",children:[s.jsx("div",{className:"skel",style:{width:84,height:26,borderRadius:999}}),s.jsx("div",{className:"skel",style:{width:22,height:22,borderRadius:6}})]}),s.jsxs("div",{style:{flex:1,minHeight:0,marginTop:14},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("div",{className:"skel",style:{width:24,height:24,borderRadius:6,flex:"0 0 auto"}}),s.jsx("div",{className:"skel skel--line",style:{width:"55%"}})]}),s.jsx("div",{className:"skel",style:{width:60,height:18,borderRadius:6,marginTop:12}})]}),s.jsx("div",{className:"skel skel--cta",style:{marginTop:0}})]})}const ah=["hsl(2 68% 48%)","hsl(26 72% 46%)","hsl(45 70% 42%)","hsl(96 55% 38%)","hsl(140 58% 40%)","hsl(168 62% 36%)","hsl(192 70% 42%)","hsl(210 72% 50%)","hsl(232 62% 56%)","hsl(266 55% 55%)","hsl(292 58% 50%)","hsl(324 66% 50%)"];function _g(c){c=String(c??"");let f=0;for(let h=0;h<c.length;h++)f=(f*31+c.charCodeAt(h))%100003;return f}function jg(c){return ah[_g(c)%ah.length]}function kg({open:c,onClose:f,toastId:h="dood-op"}){const[d,S]=g.useState(!1),[w,b]=g.useState(""),[M,j]=g.useState(!1),[p,N]=g.useState("");g.useEffect(()=>{var D,J;!c||!((J=(D=window.cicy)==null?void 0:D.sidecar)!=null&&J.getDood)||(b(""),N(""),window.cicy.sidecar.getDood().then(R=>j(!!(R!=null&&R.dood))).catch(()=>{}))},[c]),g.useEffect(()=>{var D,J;if(!(!c||!d||!((J=(D=window.cicy)==null?void 0:D.sidecar)!=null&&J.onOpProgress)))return window.cicy.sidecar.onOpProgress(R=>{R!=null&&R.message&&N(String(R.message))})},[c,d]);const T=async()=>{if(!d){S(!0),b(""),N(""),_e.show({id:h,message:M?r("dood.applying","开启容器 Docker 访问,重建容器中…"):r("dood.disabling","关闭中…"),status:"running",progress:void 0});try{const D=await window.cicy.sidecar.setDood(M);D!=null&&D.ok?(f&&f(),_e.show({id:h,message:M?r("dood.onDone","容器 Docker 访问已开启"):r("dood.offDone","容器 Docker 访问已关闭"),status:"done",ttl:4e3})):(b((D==null?void 0:D.error)||r("dood.failed","设置失败")),_e.show({id:h,message:r("dood.failed","设置失败")+(D!=null&&D.error?`: ${D.error}`:""),status:"error",ttl:6e3}))}catch(D){b((D==null?void 0:D.message)||String(D)),_e.show({id:h,message:r("dood.failed","设置失败")+`: ${(D==null?void 0:D.message)||D}`,status:"error",ttl:6e3})}finally{S(!1)}}},Z=D=>{f&&f()};return c?s.jsx(s.Fragment,{children:sa.createPortal(s.jsx("div",{"data-id":"dood-modal",style:{position:"fixed",inset:0,zIndex:66,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},onMouseDown:D=>{!d&&D.target===D.currentTarget&&Z()},children:s.jsxs("div",{onClick:D=>D.stopPropagation(),style:{width:440,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[s.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:r("dood.title","容器内使用 Docker")}),s.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:r("dood.subtitle","把宿主 Docker + docker 客户端挂进容器,容器内 agent 就能直接跑 docker(秒生效,无需下载)")}),s.jsxs("label",{"data-id":"dood-toggle-row",style:{display:"flex",alignItems:"center",gap:10,cursor:d?"default":"pointer",marginBottom:12},children:[s.jsx("input",{type:"checkbox","data-id":"dood-toggle",checked:M,disabled:d,onChange:D=>j(D.target.checked)}),s.jsx("span",{style:{fontSize:14,fontWeight:600},children:r("dood.enable","允许容器内使用 Docker")})]}),d&&p&&s.jsx("div",{"data-id":"dood-progress",style:{fontSize:11,opacity:.7,fontFamily:"var(--mono)",wordBreak:"break-all",margin:"0 0 8px",maxHeight:60,overflow:"hidden"},children:p}),w&&s.jsx("div",{className:"error",style:{marginTop:8,fontSize:12},children:w}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn-ghost",disabled:d,onClick:()=>Z(),children:r("common.cancel","取消")}),s.jsx("button",{type:"button",className:"btn-primary","data-id":"dood-save",disabled:d,onClick:T,children:d?r("common.saving","保存中…"):r("common.save","保存")})]})]})}),document.body)}):null}function Lr({avatar:c,name:f,teamId:h,onChanged:d,size:S=34}){const w=g.useRef(null),b=((f||"?").trim()[0]||"?").toUpperCase(),M=jg(h||f||""),j=p=>{const N=p.target.files&&p.target.files[0];if(p.target.value="",!N)return;const T=new FileReader;T.onload=async()=>{var Z,D,J;try{await((J=(D=(Z=window.cicy)==null?void 0:Z.localTeams)==null?void 0:D.setAvatar)==null?void 0:J.call(D,h,T.result)),d&&d()}catch{}},T.readAsDataURL(N)};return s.jsxs("div",{"data-id":"TeamAvatar",className:"team-avatar",title:h?r("teamCard.changeAvatar","点击更换头像"):"",onClick:h?p=>{p.stopPropagation(),w.current&&w.current.click()}:void 0,style:{width:S,height:S,borderRadius:9,flex:"none",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",cursor:h?"pointer":"default",background:c?"#0d1117":M,color:"#fff",fontWeight:700,fontSize:Math.round(S*.42),userSelect:"none"},children:[c?s.jsx("img",{src:c,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):b,h&&s.jsx("input",{ref:w,type:"file",accept:"image/*",style:{display:"none"},onChange:j})]})}function Tg(){return s.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 96 96",fill:"none",children:[s.jsx("path",{d:"M48 11L39.5 33.3L16 29.5L31 48L16 66.5L39.5 62.7L48 85L56.5 62.7L80 66.5L65 48L80 29.5L56.5 33.3Z",stroke:"white",strokeWidth:"10",strokeLinejoin:"round",strokeLinecap:"round"}),s.jsx("circle",{cx:"48",cy:"48",r:"6",fill:"white"})]})}function lc(){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),s.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function Lt(){return s.jsx("svg",{className:"spin",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.2-8.55"})})}function mh(){return s.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),s.jsx("line",{x1:"2",y1:"20",x2:"22",y2:"20"})]})}function qr(){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[s.jsx("circle",{cx:"12",cy:"5",r:"1.7"}),s.jsx("circle",{cx:"12",cy:"12",r:"1.7"}),s.jsx("circle",{cx:"12",cy:"19",r:"1.7"})]})}function Nl(c){try{return localStorage.getItem(c)||null}catch{return null}}function Ni(c){return c?/timeout/i.test(c)?"登录超时,请重新点击 Login。":/state/i.test(c)?"校验失败,请重新登录。":/no token/i.test(c)?"登录未完成,请重试。":/bridge missing/i.test(c)?"无法连接到登录服务(preload 未就绪)。":c:""}const Cg=3e4;function zl(c){const f=String(c||"");return{invalid_code:r("cicyHub.codeInvalid","验证码不对或已过期"),rate_limited:r("cicyHub.rateLimited","发送太频繁,稍后再试(每小时最多 5 次)"),mail_failed:r("cicyHub.mailFailed","邮件发送失败"),name_taken:r("cicyHub.nameTaken","名称冲突,换台机器再试"),expired:r("cicyHub.expired","登录已过期,重新发送"),invalid_email:r("auth.badEmail","请输入有效的邮箱地址")}[f]||f}function Eg(){var Y;const c=typeof window<"u"?(Y=window.cicy)==null?void 0:Y.hub:null,[f,h]=g.useState(null),[d,S]=g.useState(null),[w,b]=g.useState([]),[M,j]=g.useState(!1),[p,N]=g.useState(""),[T,Z]=g.useState(!1),[D,J]=g.useState(rh),[R,U]=g.useState(""),[F,Se]=g.useState("email"),[le,we]=g.useState(null);g.useEffect(()=>{let H=!0;return Di().then(ie=>H&&we(ie||"")),()=>{H=!1}},[]);const[ce,te]=g.useState(!1),[V,ae]=g.useState(""),X=g.useCallback(async()=>{if(!c)return null;try{const H=await c.status();return h(H||null),H}catch{return null}},[c]),je=g.useCallback(async()=>{if(c){j(!0);try{const H=await c.instances();if(H!=null&&H.ok){const ie=(H.instances||[]).filter(ee=>!/^desktop-/i.test(String(ee&&(ee.name||ee.slug)||"")));S(ie),b((H.instances||[]).map(ee=>String(ee&&(ee.name||ee.slug)||"").trim()).filter(Boolean)),N("")}else S([]),N((H==null?void 0:H.error)||""),((H==null?void 0:H.error)==="unauthorized"||(H==null?void 0:H.error)==="not_logged_in")&&X()}catch(H){N((H==null?void 0:H.message)||String(H))}finally{j(!1)}}},[c,X]);g.useEffect(()=>{var ee;if(!c){h({loggedIn:!1}),S([]);return}let H=!0;X().then(m=>{H&&(m!=null&&m.loggedIn)?je():H&&S([])});const ie=(ee=c.onComplete)==null?void 0:ee.call(c,m=>{m!=null&&m.ok?(Z(!1),te(!1),Se("email"),U(""),_e.show({id:"hub-login",message:r("auth.loginSuccess","登录成功"),status:"done",ttl:2500}),X().then(()=>je())):m!=null&&m.error&&m.error!=="cancelled"&&(te(!1),ae(zl(m.error)),Se("email"))});return()=>{H=!1;try{ie&&ie()}catch{}}},[c,je,X]),g.useEffect(()=>{if(!(f!=null&&f.loggedIn))return;const H=setInterval(je,Cg);return()=>clearInterval(H)},[f==null?void 0:f.loggedIn,je]);const qe=H=>{ae(""),Se("email"),U(""),H&&!D.trim()&&J(String(H)),Z(!0)},$e=()=>{if(F==="code")try{c==null||c.cancel()}catch{}Z(!1),te(!1)},st=async()=>{const H=D.trim();if(!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(H)){ae(r("auth.badEmail","请输入有效的邮箱地址"));return}const ie=String(le||"").trim();if(ie&&!oh.test(ie)){ae(r("cicyHub.teamBadFormat","team 名只能用字母、数字和 . _ -"));return}if(ie){const ee=Dl(ie).toLowerCase();if((w||[]).some(m=>{const x=String(m||"").trim().toLowerCase();return x.startsWith(Yn)&&x===ee})){ae(r("cicyHub.teamTaken","「"+ie+"」已经被另一台机器用了,换一个"));return}}if(te(!0),ae(""),ie)try{await Nr(ie)}catch{ae(r("cicyHub.teamSaveFailed","无法保存 team 名")),te(!1);return}try{window.__cicyFleetRelabel&&window.__cicyFleetRelabel()}catch{}try{const ee=await c.loginStart(H);if(!(ee!=null&&ee.ok)){ae(zl(ee==null?void 0:ee.error)||r("cicyHub.loginFailed","登录失败"));return}Se("code")}catch(ee){ae((ee==null?void 0:ee.message)||String(ee))}finally{te(!1)}},Xe=async()=>{const H=R.replace(/\D/g,"");if(H.length!==6){ae(r("cicyHub.codeInvalid","验证码不对或已过期"));return}te(!0),ae("");try{const ie=await c.loginCode(H);ie!=null&&ie.ok||(ae(zl(ie==null?void 0:ie.error)||r("cicyHub.loginFailed","登录失败")),te(!1))}catch(ie){ae((ie==null?void 0:ie.message)||String(ie)),te(!1)}},oe=async()=>{try{await(c==null?void 0:c.logout())}catch{}S([]),N(""),X()},C=async(H,ie,ee)=>{try{const m=await c.open(H.id,ee||H.name,0,ie||"/");m!=null&&m.ok||_e.show({id:"hub-open",message:zl(m==null?void 0:m.error)||r("cicyHub.loginFailed","打开失败"),status:"error",ttl:5e3})}catch(m){_e.show({id:"hub-open",message:(m==null?void 0:m.message)||String(m),status:"error",ttl:5e3})}};return{available:!!c,status:f,loggedIn:!!(f!=null&&f.loggedIn),owner:(f==null?void 0:f.owner)||"",instances:d,takenNames:w,loading:M,error:p,refresh:je,logout:oe,open:C,loginOpen:T,openLogin:qe,closeLogin:$e,email:D,setEmail:J,code:R,setCode:U,step:F,busy:ce,loginErr:V,sendCode:st,verify:Xe,team:le,setTeam:we}}function Ag({hub:c}){const f=c.step==="code";return sa.createPortal(s.jsx("div",{"data-id":"HubLoginModal",style:{position:"fixed",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,.5)"},children:s.jsxs("div",{onClick:h=>h.stopPropagation(),style:{width:400,maxWidth:"92vw",background:"var(--card, #1b1d22)",border:"1px solid var(--border, #2c2f36)",borderRadius:14,padding:22,boxShadow:"0 20px 60px rgba(0,0,0,.5)"},children:[s.jsx("div",{style:{fontSize:16,fontWeight:700,marginBottom:4},children:r("cicyHub.login","登录 CiCy Hub")}),s.jsx("div",{style:{fontSize:12,opacity:.6,marginBottom:16},children:f?r("cicyHub.codeSent","验证码已发到 {{email}},也可以直接点邮件里的链接",{email:c.email.trim()}):r("cicyHub.loginSub","填写本机 team 名 + 邮箱验证码登录。team 名是这台机器的身份,主机名不作数")}),f?s.jsxs(s.Fragment,{children:[s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("cicyHub.code","6 位验证码")}),s.jsx("input",{"data-id":"HubLoginModal-code",className:"login-email-input",style:{width:"100%",marginBottom:6,letterSpacing:6,fontSize:20,textAlign:"center"},inputMode:"numeric",autoFocus:!0,maxLength:6,value:c.code,onChange:h=>c.setCode(h.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"••••••",onKeyDown:h=>{h.key==="Enter"&&c.verify()}}),c.busy&&s.jsxs("div",{style:{fontSize:12,opacity:.6,display:"flex",alignItems:"center",gap:6},children:[s.jsx(Lt,{})," ",r("cicyHub.verifying","验证中…")]})]}):s.jsxs(s.Fragment,{children:[s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("cicyHub.team","本机 team 名(可选)")}),s.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12},children:[s.jsx("span",{style:{fontSize:13,opacity:.55,paddingRight:6,whiteSpace:"nowrap"},children:Yn}),s.jsx("input",{"data-id":"HubLoginModal-team",className:"login-email-input",style:{flex:1,marginBottom:0},type:"text",autoFocus:!0,spellCheck:!1,value:(c.team||"").replace(Yn,""),onChange:h=>c.setTeam(h.target.value),placeholder:r("cicyHub.teamPlaceholder","例如 xs-1001"),onKeyDown:h=>{h.key==="Enter"&&c.sendCode()}})]}),s.jsx("label",{style:{display:"block",fontSize:12,opacity:.75,marginBottom:6},children:r("cicyHub.email","邮箱")}),s.jsx("input",{"data-id":"HubLoginModal-email",className:"login-email-input",style:{width:"100%",marginBottom:6},type:"email",spellCheck:!1,value:c.email,onChange:h=>c.setEmail(h.target.value),placeholder:"you@example.com",onKeyDown:h=>{h.key==="Enter"&&c.sendCode()}})]}),c.loginErr&&s.jsx("div",{className:"error",style:{marginTop:10},children:c.loginErr}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn-ghost","data-id":"HubLoginModal-cancel",onClick:c.closeLogin,children:r("cicyHub.cancel","取消")}),f?s.jsx("button",{type:"button",className:"btn-primary","data-id":"HubLoginModal-verify",disabled:c.busy||c.code.length!==6,onClick:c.verify,children:c.busy?r("cicyHub.verifying","验证中…"):r("cicyHub.verify","登录")}):s.jsx("button",{type:"button",className:"btn-primary","data-id":"HubLoginModal-send",disabled:c.busy,onClick:c.sendCode,children:c.busy?r("cicyHub.sending","发送中…"):r("cicyHub.sendCode","发送验证码")})]})]})}),document.body)}function Cr(c){const f=Number(c);return Number.isFinite(f)?Math.round(f)+"%":"–"}function Fs(c){const f=Number(c);return Number.isFinite(f)&&f>0?(f/1073741824).toFixed(f>=100*1073741824?0:1)+"G":""}function Ng(c){const f=String(c.status||"").toLowerCase();return c.working||f==="working"||f==="busy"||f==="running"?"#3b82f6":f==="error"||f==="failed"?"#f87171":f==="active"||f==="idle"||f==="online"||c.online?"#4ade80":"#6b7280"}function zg({inst:c,onOpen:f}){const[h,d]=g.useState(null);if(g.useEffect(()=>{let w=!0;return(async()=>{var b,M,j;try{const p=await((j=(M=(b=window.cicy)==null?void 0:b.hub)==null?void 0:M.projects)==null?void 0:j.call(M,c.id));if(!w)return;d(p&&p.ok?{projects:p.projects||[]}:{error:p&&p.error||"failed"})}catch(p){w&&d({error:(p==null?void 0:p.message)||String(p)})}})(),()=>{w=!1}},[c.id]),!h)return s.jsxs("div",{"data-id":"HubInstanceTree",style:{padding:"6px 0",fontSize:12,opacity:.6,display:"flex",alignItems:"center",gap:6},children:[s.jsx(Lt,{})," ",r("cicyHub.loadingProjects","读取项目…")]});if(h.error)return s.jsx("div",{"data-id":"HubInstanceTree",className:"error",style:{fontSize:12},children:zl(h.error)});if(!h.projects.length)return s.jsx("div",{"data-id":"HubInstanceTree",style:{padding:"6px 0",fontSize:12,opacity:.6},children:r("cicyHub.noAgents","这台机器还没有 Agent")});const S={display:"flex",alignItems:"center",gap:6,padding:"4px 6px",borderRadius:6,cursor:"pointer",fontSize:12,minWidth:0};return s.jsx("div",{"data-id":"HubInstanceTree",style:{display:"flex",flexDirection:"column",gap:2,marginTop:6,maxHeight:260,overflowY:"auto"},children:h.projects.map(w=>s.jsxs("div",{"data-id":"HubProject",children:[s.jsxs("div",{className:"bcard__menu-item",style:{...S,fontWeight:600},title:r("cicyHub.openProject","打开项目"),onClick:b=>{b.stopPropagation(),f(w.slug?`/#/project/${encodeURIComponent(w.slug)}`:"/",w.name||c.name)},children:[s.jsx("span",{style:{opacity:.7},children:"📁"}),s.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.name||r("cicyHub.ungrouped","未分组")}),s.jsx("span",{style:{opacity:.5},children:r("cicyHub.agents","{{n}} 个 Agent",{n:w.agents.length})})]}),w.agents.map(b=>s.jsxs("div",{"data-id":"HubAgent",className:"bcard__menu-item",style:{...S,paddingLeft:22},title:`${b.wid}${b.workspace?" · "+b.workspace:""}`,onClick:M=>{M.stopPropagation(),f(`/#/agent/${encodeURIComponent(b.wid)}`,`${b.title||b.wid} · ${c.name}`)},children:[s.jsx("span",{style:{width:7,height:7,borderRadius:4,background:Ng(b),flex:"none"}}),s.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.title||b.wid}),b.role==="master"&&s.jsx("span",{className:"bcard__chip",style:{fontSize:10},children:"master"}),b.agentType&&s.jsx("span",{style:{opacity:.5,fontSize:10},children:b.agentType})]},b.wid))]},w.id))})}function Dg({inst:c,onOpen:f}){const h=c.online?"ok":"off",d=c.resources||null,[S,w]=g.useState(!1),[b,M]=g.useState(!1),j=async(D,J)=>{if(!S){w(!0);try{await f(D,J)}finally{w(!1)}}},p=c.reachable||c.online,N=D=>Number(D)>=90,T=d?[{k:"cpu",t:"CPU "+Cr(d.cpu_usage_pct),warn:N(d.cpu_usage_pct)},{k:"mem",t:"内存 "+Cr(d.mem_usage_pct),warn:N(d.mem_usage_pct)},{k:"disk",t:"磁盘 "+Cr(d.disk_usage_pct),warn:N(d.disk_usage_pct)}]:[],Z=d?`内存 ${Fs(d.mem_used_bytes)}/${Fs(d.mem_total_bytes)} · 磁盘 ${Fs(d.disk_used_bytes)}/${Fs(d.disk_total_bytes)}`:"";return s.jsxs("div",{"data-id":"HubInstanceCard",className:`bcard bcard--custom${c.online?" bcard--online":""}`,title:c.host,children:[s.jsx("div",{className:"bcard__accent"}),s.jsxs("div",{className:"bcard__top",children:[s.jsxs("div",{className:"bcard__pill",children:[s.jsx("span",{className:"bcard__dot","data-tone":h}),s.jsx(mh,{})]}),typeof c.agents=="number"&&c.agents>0&&s.jsxs("button",{type:"button","data-id":"HubInstanceCard-agents",className:"btn-ghost",disabled:!p,style:{fontSize:11,color:"#8b949e",padding:"2px 6px",border:"none",background:"transparent",cursor:"pointer"},title:r("cicyHub.toggleTree","展开 / 收起项目与 Agent"),onClick:D=>{D.stopPropagation(),M(J=>!J)},children:[r("cicyHub.agents","{{n}} 个 Agent",{n:c.agents})," ",b?"▾":"▸"]})]}),s.jsxs("div",{className:"bcard__body",children:[s.jsxs("div",{style:{height:28,display:"flex",alignItems:"center",gap:8},children:[s.jsx(Lr,{size:24,name:c.name,teamId:c.id}),s.jsx("h3",{className:"bcard__name",style:{flex:1,minWidth:0,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.name})]}),s.jsxs("div",{className:"bcard__meta",children:[s.jsx("span",{className:"bcard__chip","data-id":"HubInstanceCard-kind",children:r("cicyHub.kind","Hub")}),c.version&&s.jsxs("span",{className:"bcard__chip","data-id":"HubInstanceCard-version",children:["v",c.version]})]}),T.length>0&&s.jsx("div",{"data-id":"HubInstanceCard-usage",title:Z,style:{marginTop:6,fontSize:11,color:"#8b949e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:T.map((D,J)=>s.jsxs("span",{style:D.warn?{color:"#f87171"}:void 0,children:[J>0?" · ":"",D.t]},D.k))}),b&&p&&s.jsx(zg,{inst:c,onOpen:j})]}),s.jsxs("button",{type:"button",className:"bcard__cta","data-id":"HubInstanceCard-open",disabled:S||!p,onClick:()=>j("/",c.name),children:[S?s.jsx(Lt,{}):s.jsx(lc,{}),s.jsx("span",{children:p?r("cicyHub.open","打开"):r("cicyHub.unreachable","不可达")})]})]})}var nh;const Og=((nh=window.cicy)==null?void 0:nh.platform)||(()=>{const c=navigator.userAgent||"";return/Mac/i.test(c)?"darwin":/Windows/i.test(c)?"win32":"linux"})();document.documentElement.dataset.platform=Og;document.documentElement.dataset.fullscreen="0";var lh,ih;(ih=(lh=window.cicy)==null?void 0:lh.window)!=null&&ih.onFullscreen&&window.cicy.window.onFullscreen(c=>{document.documentElement.dataset.fullscreen=c?"1":"0"});Oy.createRoot(document.getElementById("root")).render(s.jsx(Xy,{}));
|