@i14ks/ccv 0.31.1 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/package.json +1 -1
- package/web/assets/{codemirror-Mu11LZof.js → codemirror-8sWY4R7N.js} +1 -1
- package/web/assets/{index-B-uZbpTM.js → index-0cT2tqQK.js} +1 -1
- package/web/assets/{index-BAlgeWgk.js → index-B0Em7t0A.js} +1 -1
- package/web/assets/index-BC0j8EcZ.js +143 -0
- package/web/assets/{index-nvCEaOt_.js → index-BFQtLIGp.js} +1 -1
- package/web/assets/{index-Fah17-KT.js → index-BHwKSla6.js} +1 -1
- package/web/assets/{index-gQynn_4Z.js → index-BIPKzKY2.js} +1 -1
- package/web/assets/{index-B-LIRCC5.js → index-BK02yRlK.js} +1 -1
- package/web/assets/{index--cQ8_aqK.js → index-Be-uaEj7.js} +1 -1
- package/web/assets/{index-BOG6YwGS.js → index-C7TDKl2E.js} +1 -1
- package/web/assets/{index-DdH3nyWH.js → index-CGFLZyFo.js} +1 -1
- package/web/assets/{index-BmU1au2p.js → index-CKBDPW6a.js} +1 -1
- package/web/assets/{index-LuDnKNtv.js → index-CaxQLwlz.js} +1 -1
- package/web/assets/{index-Cf0qn8gk.js → index-CoIc3yA2.js} +1 -1
- package/web/assets/{index-CmansqyT.js → index-ConRfKoY.js} +1 -1
- package/web/assets/{index-B2DXcZzx.js → index-DExNKFlx.js} +1 -1
- package/web/assets/{index-BuubCa9v.js → index-DWAenx-d.js} +1 -1
- package/web/assets/{index-DlxZi6BQ.js → index-DrgUSRh2.js} +1 -1
- package/web/assets/{index-Bz0WR3RW.js → index-O4C4WPxR.js} +1 -1
- package/web/assets/index-Vb27wc8u.css +1 -0
- package/web/assets/{index-CI8_AQA6.js → index-Zo5W0wV-.js} +1 -1
- package/web/assets/{index-CjvP4Ufw.js → index-u7ERMPB_.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-B-XLlkMy.css +0 -1
- package/web/assets/index-BRPWZVVZ.js +0 -143
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B2DXcZzx.js","./index-DlxZi6BQ.js","./index--cQ8_aqK.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-BOG6YwGS.js","./index-B-LIRCC5.js","./index-Fah17-KT.js","./index-CI8_AQA6.js","./index-Bz0WR3RW.js","./index-CmansqyT.js","./index-CjvP4Ufw.js","./index-LuDnKNtv.js","./index-Cf0qn8gk.js","./index-BAlgeWgk.js","./index-BuubCa9v.js","./index-gQynn_4Z.js","./index-BmU1au2p.js","./index-B-uZbpTM.js","./index-DdH3nyWH.js","./index-nvCEaOt_.js","./codemirror-Mu11LZof.js","./xterm-D6Mng-DB.js","./_commonjsHelpers-CqkleIqs.js","./addon-fit-CevVMrUA.js","./addon-web-links-CnB65OV_.js","./xterm-DYP7pi_n.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var F0=Object.defineProperty;var Kx=n=>{throw TypeError(n)};var P0=(n,s,i)=>s in n?F0(n,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[s]=i;var Jt=(n,s,i)=>P0(n,typeof s!="symbol"?s+"":s,i),Jh=(n,s,i)=>s.has(n)||Kx("Cannot "+i);var st=(n,s,i)=>(Jh(n,s,"read from private field"),i?i.call(n):s.get(n)),Nn=(n,s,i)=>s.has(n)?Kx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(n):s.set(n,i),Ht=(n,s,i,c)=>(Jh(n,s,"write to private field"),c?c.call(n,i):s.set(n,i),i),Yn=(n,s,i)=>(Jh(n,s,"access private method"),i);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function c(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();var Wh={exports:{}},iu={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Zx;function J0(){if(Zx)return iu;Zx=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function i(c,o,u){var h=null;if(u!==void 0&&(h=""+u),o.key!==void 0&&(h=""+o.key),"key"in o){u={};for(var g in o)g!=="key"&&(u[g]=o[g])}else u=o;return o=u.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:u}}return iu.Fragment=s,iu.jsx=i,iu.jsxs=i,iu}var Fx;function W0(){return Fx||(Fx=1,Wh.exports=J0()),Wh.exports}var a=W0(),ep={exports:{}},dt={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Px;function ev(){if(Px)return dt;Px=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),y=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function q(A,K,fe){this.props=A,this.context=K,this.refs=D,this.updater=fe||k}q.prototype.isReactComponent={},q.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},q.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function G(){}G.prototype=q.prototype;function V(A,K,fe){this.props=A,this.context=K,this.refs=D,this.updater=fe||k}var L=V.prototype=new G;L.constructor=V,C(L,q.prototype),L.isPureReactComponent=!0;var Y=Array.isArray;function E(){}var U={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function H(A,K,fe){var ke=fe.ref;return{$$typeof:n,type:A,key:K,ref:ke!==void 0?ke:null,props:fe}}function B(A,K){return H(A.type,K,A.props)}function N(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function X(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(fe){return K[fe]})}var le=/\/+/g;function de(A,K){return typeof A=="object"&&A!==null&&A.key!=null?X(""+A.key):K.toString(36)}function ye(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(E,E):(A.status="pending",A.then(function(K){A.status==="pending"&&(A.status="fulfilled",A.value=K)},function(K){A.status==="pending"&&(A.status="rejected",A.reason=K)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function I(A,K,fe,ke,Re){var Ue=typeof A;(Ue==="undefined"||Ue==="boolean")&&(A=null);var _e=!1;if(A===null)_e=!0;else switch(Ue){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(A.$$typeof){case n:case s:_e=!0;break;case _:return _e=A._init,I(_e(A._payload),K,fe,ke,Re)}}if(_e)return Re=Re(A),_e=ke===""?"."+de(A,0):ke,Y(Re)?(fe="",_e!=null&&(fe=_e.replace(le,"$&/")+"/"),I(Re,K,fe,"",function(Bt){return Bt})):Re!=null&&(N(Re)&&(Re=B(Re,fe+(Re.key==null||A&&A.key===Re.key?"":(""+Re.key).replace(le,"$&/")+"/")+_e)),K.push(Re)),1;_e=0;var Ze=ke===""?".":ke+":";if(Y(A))for(var rt=0;rt<A.length;rt++)ke=A[rt],Ue=Ze+de(ke,rt),_e+=I(ke,K,fe,Ue,Re);else if(rt=S(A),typeof rt=="function")for(A=rt.call(A),rt=0;!(ke=A.next()).done;)ke=ke.value,Ue=Ze+de(ke,rt++),_e+=I(ke,K,fe,Ue,Re);else if(Ue==="object"){if(typeof A.then=="function")return I(ye(A),K,fe,ke,Re);throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return _e}function R(A,K,fe){if(A==null)return A;var ke=[],Re=0;return I(A,ke,"","",function(Ue){return K.call(fe,Ue,Re++)}),ke}function P(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(fe){(A._status===0||A._status===-1)&&(A._status=1,A._result=fe)},function(fe){(A._status===0||A._status===-1)&&(A._status=2,A._result=fe)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var ae=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},Ne={map:R,forEach:function(A,K,fe){R(A,function(){K.apply(this,arguments)},fe)},count:function(A){var K=0;return R(A,function(){K++}),K},toArray:function(A){return R(A,function(K){return K})||[]},only:function(A){if(!N(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return dt.Activity=v,dt.Children=Ne,dt.Component=q,dt.Fragment=i,dt.Profiler=o,dt.PureComponent=V,dt.StrictMode=c,dt.Suspense=m,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,dt.__COMPILER_RUNTIME={__proto__:null,c:function(A){return U.H.useMemoCache(A)}},dt.cache=function(A){return function(){return A.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(A,K,fe){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var ke=C({},A.props),Re=A.key;if(K!=null)for(Ue in K.key!==void 0&&(Re=""+K.key),K)!Q.call(K,Ue)||Ue==="key"||Ue==="__self"||Ue==="__source"||Ue==="ref"&&K.ref===void 0||(ke[Ue]=K[Ue]);var Ue=arguments.length-2;if(Ue===1)ke.children=fe;else if(1<Ue){for(var _e=Array(Ue),Ze=0;Ze<Ue;Ze++)_e[Ze]=arguments[Ze+2];ke.children=_e}return H(A.type,Re,ke)},dt.createContext=function(A){return A={$$typeof:h,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:u,_context:A},A},dt.createElement=function(A,K,fe){var ke,Re={},Ue=null;if(K!=null)for(ke in K.key!==void 0&&(Ue=""+K.key),K)Q.call(K,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(Re[ke]=K[ke]);var _e=arguments.length-2;if(_e===1)Re.children=fe;else if(1<_e){for(var Ze=Array(_e),rt=0;rt<_e;rt++)Ze[rt]=arguments[rt+2];Re.children=Ze}if(A&&A.defaultProps)for(ke in _e=A.defaultProps,_e)Re[ke]===void 0&&(Re[ke]=_e[ke]);return H(A,Ue,Re)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(A){return{$$typeof:g,render:A}},dt.isValidElement=N,dt.lazy=function(A){return{$$typeof:_,_payload:{_status:-1,_result:A},_init:P}},dt.memo=function(A,K){return{$$typeof:x,type:A,compare:K===void 0?null:K}},dt.startTransition=function(A){var K=U.T,fe={};U.T=fe;try{var ke=A(),Re=U.S;Re!==null&&Re(fe,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(E,ae)}catch(Ue){ae(Ue)}finally{K!==null&&fe.types!==null&&(K.types=fe.types),U.T=K}},dt.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},dt.use=function(A){return U.H.use(A)},dt.useActionState=function(A,K,fe){return U.H.useActionState(A,K,fe)},dt.useCallback=function(A,K){return U.H.useCallback(A,K)},dt.useContext=function(A){return U.H.useContext(A)},dt.useDebugValue=function(){},dt.useDeferredValue=function(A,K){return U.H.useDeferredValue(A,K)},dt.useEffect=function(A,K){return U.H.useEffect(A,K)},dt.useEffectEvent=function(A){return U.H.useEffectEvent(A)},dt.useId=function(){return U.H.useId()},dt.useImperativeHandle=function(A,K,fe){return U.H.useImperativeHandle(A,K,fe)},dt.useInsertionEffect=function(A,K){return U.H.useInsertionEffect(A,K)},dt.useLayoutEffect=function(A,K){return U.H.useLayoutEffect(A,K)},dt.useMemo=function(A,K){return U.H.useMemo(A,K)},dt.useOptimistic=function(A,K){return U.H.useOptimistic(A,K)},dt.useReducer=function(A,K,fe){return U.H.useReducer(A,K,fe)},dt.useRef=function(A){return U.H.useRef(A)},dt.useState=function(A){return U.H.useState(A)},dt.useSyncExternalStore=function(A,K,fe){return U.H.useSyncExternalStore(A,K,fe)},dt.useTransition=function(){return U.H.useTransition()},dt.version="19.2.8",dt}var Jx;function qp(){return Jx||(Jx=1,ep.exports=ev()),ep.exports}var b=qp(),tp={exports:{}},ru={},np={exports:{}},sp={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Wx;function tv(){return Wx||(Wx=1,(function(n){function s(I,R){var P=I.length;I.push(R);e:for(;0<P;){var ae=P-1>>>1,Ne=I[ae];if(0<o(Ne,R))I[ae]=R,I[P]=Ne,P=ae;else break e}}function i(I){return I.length===0?null:I[0]}function c(I){if(I.length===0)return null;var R=I[0],P=I.pop();if(P!==R){I[0]=P;e:for(var ae=0,Ne=I.length,A=Ne>>>1;ae<A;){var K=2*(ae+1)-1,fe=I[K],ke=K+1,Re=I[ke];if(0>o(fe,P))ke<Ne&&0>o(Re,fe)?(I[ae]=Re,I[ke]=P,ae=ke):(I[ae]=fe,I[K]=P,ae=K);else if(ke<Ne&&0>o(Re,P))I[ae]=Re,I[ke]=P,ae=ke;else break e}}return R}function o(I,R){var P=I.sortIndex-R.sortIndex;return P!==0?P:I.id-R.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var h=Date,g=h.now();n.unstable_now=function(){return h.now()-g}}var m=[],x=[],_=1,v=null,y=3,S=!1,k=!1,C=!1,D=!1,q=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function L(I){for(var R=i(x);R!==null;){if(R.callback===null)c(x);else if(R.startTime<=I)c(x),R.sortIndex=R.expirationTime,s(m,R);else break;R=i(x)}}function Y(I){if(C=!1,L(I),!k)if(i(m)!==null)k=!0,E||(E=!0,X());else{var R=i(x);R!==null&&ye(Y,R.startTime-I)}}var E=!1,U=-1,Q=5,H=-1;function B(){return D?!0:!(n.unstable_now()-H<Q)}function N(){if(D=!1,E){var I=n.unstable_now();H=I;var R=!0;try{e:{k=!1,C&&(C=!1,G(U),U=-1),S=!0;var P=y;try{t:{for(L(I),v=i(m);v!==null&&!(v.expirationTime>I&&B());){var ae=v.callback;if(typeof ae=="function"){v.callback=null,y=v.priorityLevel;var Ne=ae(v.expirationTime<=I);if(I=n.unstable_now(),typeof Ne=="function"){v.callback=Ne,L(I),R=!0;break t}v===i(m)&&c(m),L(I)}else c(m);v=i(m)}if(v!==null)R=!0;else{var A=i(x);A!==null&&ye(Y,A.startTime-I),R=!1}}break e}finally{v=null,y=P,S=!1}R=void 0}}finally{R?X():E=!1}}}var X;if(typeof V=="function")X=function(){V(N)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,de=le.port2;le.port1.onmessage=N,X=function(){de.postMessage(null)}}else X=function(){q(N,0)};function ye(I,R){U=q(function(){I(n.unstable_now())},R)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(I){switch(y){case 1:case 2:case 3:var R=3;break;default:R=y}var P=y;y=R;try{return I()}finally{y=P}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var P=y;y=I;try{return R()}finally{y=P}},n.unstable_scheduleCallback=function(I,R,P){var ae=n.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?ae+P:ae):P=ae,I){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=P+Ne,I={id:_++,callback:R,priorityLevel:I,startTime:P,expirationTime:Ne,sortIndex:-1},P>ae?(I.sortIndex=P,s(x,I),i(m)===null&&I===i(x)&&(C?(G(U),U=-1):C=!0,ye(Y,P-ae))):(I.sortIndex=Ne,s(m,I),k||S||(k=!0,E||(E=!0,X()))),I},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(I){var R=y;return function(){var P=y;y=R;try{return I.apply(this,arguments)}finally{y=P}}}})(sp)),sp}var eb;function nv(){return eb||(eb=1,np.exports=tv()),np.exports}var lp={exports:{}},vs={};/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var tb;function sv(){if(tb)return vs;tb=1;var n=qp();function s(m){var x="https://react.dev/errors/"+m;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(s(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,x,_){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:x,implementation:_}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,x){if(m==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return vs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,vs.createPortal=function(m,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return u(m,x,null,_)},vs.flushSync=function(m){var x=h.T,_=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=_,c.d.f()}},vs.preconnect=function(m,x){typeof m=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(m,x))},vs.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},vs.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var _=x.as,v=g(_,x.crossOrigin),y=typeof x.integrity=="string"?x.integrity:void 0,S=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:S}):_==="script"&&c.d.X(m,{crossOrigin:v,integrity:y,fetchPriority:S,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},vs.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=g(x.as,x.crossOrigin);c.d.M(m,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(m)},vs.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,v=g(_,x.crossOrigin);c.d.L(m,_,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},vs.preloadModule=function(m,x){if(typeof m=="string")if(x){var _=g(x.as,x.crossOrigin);c.d.m(m,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(m)},vs.requestFormReset=function(m){c.d.r(m)},vs.unstable_batchedUpdates=function(m,x){return m(x)},vs.useFormState=function(m,x,_){return h.H.useFormState(m,x,_)},vs.useFormStatus=function(){return h.H.useHostTransitionStatus()},vs.version="19.2.8",vs}var nb;function T_(){if(nb)return lp.exports;nb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),lp.exports=sv(),lp.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var sb;function lv(){if(sb)return ru;sb=1;var n=nv(),s=qp(),i=T_();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(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 g(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 m(e){if(u(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(c(188));return t!==e?null:e}for(var l=e,r=t;;){var d=l.return;if(d===null)break;var f=d.alternate;if(f===null){if(r=d.return,r!==null){l=r;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===l)return m(d),e;if(f===r)return m(d),t;f=f.sibling}throw Error(c(188))}if(l.return!==r.return)l=d,r=f;else{for(var j=!1,w=d.child;w;){if(w===l){j=!0,l=d,r=f;break}if(w===r){j=!0,r=d,l=f;break}w=w.sibling}if(!j){for(w=f.child;w;){if(w===l){j=!0,l=f,r=d;break}if(w===r){j=!0,r=f,l=d;break}w=w.sibling}if(!j)throw Error(c(189))}}if(l.alternate!==r)throw Error(c(190))}if(l.tag!==3)throw Error(c(188));return l.stateNode.current===l?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),V=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function X(e){return e===null||typeof e!="object"?null:(e=N&&e[N]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function de(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case q:return"Profiler";case D:return"StrictMode";case Y:return"Suspense";case E:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case V:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var ye=Array.isArray,I=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ae=[],Ne=-1;function A(e){return{current:e}}function K(e){0>Ne||(e.current=ae[Ne],ae[Ne]=null,Ne--)}function fe(e,t){Ne++,ae[Ne]=e.current,e.current=t}var ke=A(null),Re=A(null),Ue=A(null),_e=A(null);function Ze(e,t){switch(fe(Ue,t),fe(Re,e),fe(ke,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xx(t),e=bx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(ke),fe(ke,e)}function rt(){K(ke),K(Re),K(Ue)}function Bt(e){e.memoizedState!==null&&fe(_e,e);var t=ke.current,l=bx(t,e.type);t!==l&&(fe(Re,e),fe(ke,l))}function he(e){Re.current===e&&(K(ke),K(Re)),_e.current===e&&(K(_e),nu._currentValue=P)}var at,oe;function Rt(e){if(at===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);at=t&&t[1]||"",oe=-1<l.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+at+e+oe}var He=!1;function qt(e,t){if(!e||He)return"";He=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ie){var se=ie}Reflect.construct(e,[],be)}else{try{be.call()}catch(ie){se=ie}e.call(be.prototype)}}else{try{throw Error()}catch(ie){se=ie}(be=e())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ie){if(ie&&se&&typeof ie.stack=="string")return[ie.stack,se.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),j=f[0],w=f[1];if(j&&w){var z=j.split(`
|
|
45
|
-
`),te=w.split(`
|
|
46
|
-
`);for(d=r=0;r<z.length&&!z[r].includes("DetermineComponentFrameRoot");)r++;for(;d<te.length&&!te[d].includes("DetermineComponentFrameRoot");)d++;if(r===z.length||d===te.length)for(r=z.length-1,d=te.length-1;1<=r&&0<=d&&z[r]!==te[d];)d--;for(;1<=r&&0<=d;r--,d--)if(z[r]!==te[d]){if(r!==1||d!==1)do if(r--,d--,0>d||z[r]!==te[d]){var ue=`
|
|
47
|
-
`+z[r].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=r&&0<=d);break}}}finally{He=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Rt(l):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return Rt(e.type);case 16:return Rt("Lazy");case 13:return e.child!==t&&t!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return qt(e.type,!1);case 11:return qt(e.type.render,!1);case 1:return qt(e.type,!0);case 31:return Rt("Activity");default:return""}}function bt(e){try{var t="",l=null;do t+=Un(e,l),l=e,e=e.return;while(e);return t}catch(r){return`
|
|
48
|
-
Error generating stack: `+r.message+`
|
|
49
|
-
`+r.stack}}var Kt=Object.prototype.hasOwnProperty,ln=n.unstable_scheduleCallback,Xn=n.unstable_cancelCallback,wt=n.unstable_shouldYield,Z=n.unstable_requestPaint,De=n.unstable_now,$e=n.unstable_getCurrentPriorityLevel,ht=n.unstable_ImmediatePriority,Ee=n.unstable_UserBlockingPriority,Te=n.unstable_NormalPriority,Oe=n.unstable_LowPriority,Ye=n.unstable_IdlePriority,Qe=n.log,Pe=n.unstable_setDisableYieldValue,pt=null,At=null;function Sn(e){if(typeof Qe=="function"&&Pe(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(pt,e)}catch{}}var Et=Math.clz32?Math.clz32:we,Lt=Math.log,re=Math.LN2;function we(e){return e>>>=0,e===0?32:31-(Lt(e)/re|0)|0}var Ve=256,et=262144,nt=4194304;function on(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 On(e,t,l){var r=e.pendingLanes;if(r===0)return 0;var d=0,f=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~f,r!==0?d=on(r):(j&=w,j!==0?d=on(j):l||(l=w&~e,l!==0&&(d=on(l))))):(w=r&~f,w!==0?d=on(w):j!==0?d=on(j):l||(l=r&~e,l!==0&&(d=on(l)))),d===0?0:t!==0&&t!==d&&(t&f)===0&&(f=d&-d,l=t&-t,f>=l||f===32&&(l&4194048)!==0)?t:d}function Wt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bn(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 Yt(){var e=nt;return nt<<=1,(nt&62914560)===0&&(nt=4194304),e}function zt(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function J(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pe(e,t,l,r,d,f){var j=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,te=e.hiddenUpdates;for(l=j&~l;0<l;){var ue=31-Et(l),be=1<<ue;w[ue]=0,z[ue]=-1;var se=te[ue];if(se!==null)for(te[ue]=null,ue=0;ue<se.length;ue++){var ie=se[ue];ie!==null&&(ie.lane&=-536870913)}l&=~be}r!==0&&Ae(e,r,0),f!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=f&~(j&~t))}function Ae(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|l&261930}function Ke(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var r=31-Et(l),d=1<<r;d&t|e[r]&t&&(e[r]|=t),l&=~d}}function It(e,t){var l=t&-t;return l=(l&42)!==0?1:an(l),(l&(e.suspendedLanes|t))!==0?0:l}function an(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 kt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gs(){var e=R.p;return e!==0?e:(e=window.event,e===void 0?32:qx(e.type))}function Qn(e,t){var l=R.p;try{return R.p=e,t()}finally{R.p=l}}var is=Math.random().toString(36).slice(2),rn="__reactFiber$"+is,it="__reactProps$"+is,un="__reactContainer$"+is,ks="__reactEvents$"+is,Ns="__reactListeners$"+is,Ss="__reactHandles$"+is,zs="__reactResources$"+is,rs="__reactMarker$"+is;function Es(e){delete e[rn],delete e[it],delete e[ks],delete e[Ns],delete e[Ss]}function Zt(e){var t=e[rn];if(t)return t;for(var l=e.parentNode;l;){if(t=l[un]||l[rn]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Nx(e);e!==null;){if(l=e[rn])return l;e=Nx(e)}return t}e=l,l=e.parentNode}return null}function Is(e){if(e=e[rn]||e[un]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _n(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function yn(e){var t=e[zs];return t||(t=e[zs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function lt(e){e[rs]=!0}var Jn=new Set,Kn={};function cs(e,t){dn(e,t),dn(e+"Capture",t)}function dn(e,t){for(Kn[e]=t,e=0;e<t.length;e++)Jn.add(t[e])}var rl=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]*$"),Ts={},os={};function Cs(e){return Kt.call(os,e)?!0:Kt.call(Ts,e)?!1:rl.test(e)?os[e]=!0:(Ts[e]=!0,!1)}function kn(e,t,l){if(Cs(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Ln(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Hn(e,t,l,r){if(r===null)e.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+r)}}function en(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function li(e,t,l){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var d=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){l=""+j,f.call(this,j)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kl(e){if(!e._valueTracker){var t=jl(e)?"checked":"value";e._valueTracker=li(e,t,""+e[t])}}function En(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),r="";return e&&(r=jl(e)?e.checked?"true":"false":e.value),e=r,e!==l?(t.setValue(e),!0):!1}function wl(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 kl=/[\n"\\]/g;function Wn(e){return e.replace(kl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Nl(e,t,l,r,d,f,j,w){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+en(t)):e.value!==""+en(t)&&(e.value=""+en(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?Us(e,j,en(t)):l!=null?Us(e,j,en(l)):r!=null&&e.removeAttribute("value"),d==null&&f!=null&&(e.defaultChecked=!!f),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+en(w):e.removeAttribute("name")}function Zl(e,t,l,r,d,f,j,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Kl(e);return}l=l!=null?""+en(l):"",t=t!=null?""+en(t):l,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??d,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),Kl(e)}function Us(e,t,l){t==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function vn(e,t,l,r){if(e=e.options,t){t={};for(var d=0;d<l.length;d++)t["$"+l[d]]=!0;for(l=0;l<e.length;l++)d=t.hasOwnProperty("$"+e[l].value),e[l].selected!==d&&(e[l].selected=d),d&&r&&(e[l].defaultSelected=!0)}else{for(l=""+en(l),t=null,d=0;d<e.length;d++){if(e[d].value===l){e[d].selected=!0,r&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Se(e,t,l){if(t!=null&&(t=""+en(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+en(l):""}function M(e,t,l,r){if(t==null){if(r!=null){if(l!=null)throw Error(c(92));if(ye(r)){if(1<r.length)throw Error(c(93));r=r[0]}l=r}l==null&&(l=""),t=l}l=en(t),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),Kl(e)}function W(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var ve=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 Ce(e,t,l){var r=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,l):typeof l!="number"||l===0||ve.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Xe(e,t,l){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var d in t)r=t[d],t.hasOwnProperty(d)&&l[d]!==r&&Ce(e,d,r)}else for(var f in t)t.hasOwnProperty(f)&&Ce(e,f,t[f])}function Je(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 Vt=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"]]),gt=/^[\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 cn(e){return gt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ct(){}var Mt=null;function fn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ps=null,Hs=null;function Pi(e){var t=Is(e);if(t&&(e=t.stateNode)){var l=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Nl(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Wn(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var r=l[t];if(r!==e&&r.form===e.form){var d=r[it]||null;if(!d)throw Error(c(90));Nl(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<l.length;t++)r=l[t],r.form===e.form&&En(r)}break e;case"textarea":Se(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&vn(e,!!l.multiple,t,!1)}}}var Sl=!1;function ai(e,t,l){if(Sl)return e(t,l);Sl=!0;try{var r=e(t);return r}finally{if(Sl=!1,(Ps!==null||Hs!==null)&&(fd(),Ps&&(t=Ps,e=Hs,Hs=Ps=null,Pi(t),e)))for(t=0;t<e.length;t++)Pi(e[t])}}function jn(e,t){var l=e.stateNode;if(l===null)return null;var r=l[it]||null;if(r===null)return null;l=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(c(231,t,typeof l));return l}var xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),es=!1;if(xs)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){es=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{es=!1}var T=null,ge=null,Ie=null;function _t(){if(Ie)return Ie;var e,t=ge,l=t.length,r,d="value"in T?T.value:T.textContent,f=d.length;for(e=0;e<l&&t[e]===d[e];e++);var j=l-e;for(r=1;r<=j&&t[l-r]===d[f-r];r++);return Ie=d.slice(e,1<r?1-r:void 0)}function bs(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 Hr(){return!0}function Ji(){return!1}function _s(e){function t(l,r,d,f,j){this._reactName=l,this._targetInst=d,this.type=r,this.nativeEvent=f,this.target=j,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(l=e[w],this[w]=l?l(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Hr:Ji,this.isPropagationStopped=Ji,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Hr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Hr)},persist:function(){},isPersistent:Hr}),t}var El={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Br=_s(El),Fl=v({},El,{view:0,detail:0}),Js=_s(Fl),ii,Tl,Cl,ka=v({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ri,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!==Cl&&(Cl&&e.type==="mousemove"?(ii=e.screenX-Cl.screenX,Tl=e.screenY-Cl.screenY):Tl=ii=0,Cl=e),ii)},movementY:function(e){return"movementY"in e?e.movementY:Tl}}),Wi=_s(ka),Na=v({},ka,{dataTransfer:0}),Ws=_s(Na),qr=v({},Fl,{relatedTarget:0}),Al=_s(qr),kf=v({},El,{animationName:0,elapsedTime:0,pseudoElement:0}),Pl=_s(kf),er=v({},El,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gr=_s(er),tr=v({},El,{data:0}),nr=_s(tr),Nf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ro={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"},$r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ou(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$r[e])?!!t[e]:!1}function ri(){return Ou}var Lu=v({},Fl,{key:function(e){if(e.key){var t=Nf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ro[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ri,charCode:function(e){return e.type==="keypress"?bs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sr=_s(Lu),Yr=v({},ka,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zu=_s(Yr),co=v({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ri}),Vr=_s(co),oo=v({},El,{propertyName:0,elapsedTime:0,pseudoElement:0}),Iu=_s(oo),Xr=v({},ka,{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}),Qr=_s(Xr),uo=v({},El,{newState:0,oldState:0}),Kr=_s(uo),lr=[9,13,27,32],fo=xs&&"CompositionEvent"in window,Jl=null;xs&&"documentMode"in document&&(Jl=document.documentMode);var Sf=xs&&"TextEvent"in window&&!Jl,ar=xs&&(!fo||Jl&&8<Jl&&11>=Jl),ir=" ",Zr=!1;function ci(e,t){switch(e){case"keyup":return lr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ml=!1;function ho(e,t){switch(e){case"compositionend":return Wl(t);case"keypress":return t.which!==32?null:(Zr=!0,ir);case"textInput":return e=t.data,e===ir&&Zr?null:e;default:return null}}function Ef(e,t){if(Ml)return e==="compositionend"||!fo&&ci(e,t)?(e=_t(),Ie=ge=T=null,Ml=!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 ar&&t.locale!=="ko"?null:t.data;default:return null}}var Sa={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 oi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sa[e.type]:t==="textarea"}function po(e,t,l,r){Ps?Hs?Hs.push(r):Hs=[r]:Ps=r,t=_d(t,"onChange"),0<t.length&&(l=new Br("onChange","change",null,l,r),e.push({event:l,listeners:t}))}var ea=null,ui=null;function Fr(e){dx(e,0)}function Bs(e){var t=_n(e);if(En(t))return e}function rr(e,t){if(e==="change")return t}var di=!1;if(xs){var Rl;if(xs){var Ea="oninput"in document;if(!Ea){var hn=document.createElement("div");hn.setAttribute("oninput","return;"),Ea=typeof hn.oninput=="function"}Rl=Ea}else Rl=!1;di=Rl&&(!document.documentMode||9<document.documentMode)}function Pr(){ea&&(ea.detachEvent("onpropertychange",Uu),ui=ea=null)}function Uu(e){if(e.propertyName==="value"&&Bs(ui)){var t=[];po(t,ui,e,fn(e)),ai(Fr,t)}}function Tf(e,t,l){e==="focusin"?(Pr(),ea=t,ui=l,ea.attachEvent("onpropertychange",Uu)):e==="focusout"&&Pr()}function Jr(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bs(ui)}function fi(e,t){if(e==="click")return Bs(t)}function Bn(e,t){if(e==="input"||e==="change")return Bs(t)}function Wr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ts=typeof Object.is=="function"?Object.is:Wr;function hi(e,t){if(ts(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),r=Object.keys(t);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var d=l[r];if(!Kt.call(t,d)||!ts(e[d],t[d]))return!1}return!0}function zn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mo(e,t){var l=zn(e);e=0;for(var r;l;){if(l.nodeType===3){if(r=e+l.textContent.length,e<=t&&r>=t)return{node:l,offset:t-e};e=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zn(l)}}function go(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?go(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ol(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wl(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=wl(e.document)}return t}function ec(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 tc=xs&&"documentMode"in document&&11>=document.documentMode,Dl=null,Ta=null,el=null,nc=!1;function pi(e,t,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;nc||Dl==null||Dl!==wl(r)||(r=Dl,"selectionStart"in r&&ec(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),el&&hi(el,r)||(el=r,r=_d(Ta,"onSelect"),0<r.length&&(t=new Br("onSelect","select",null,t,l),e.push({event:t,listeners:r}),t.target=Dl)))}function ul(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var dl={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionrun:ul("Transition","TransitionRun"),transitionstart:ul("Transition","TransitionStart"),transitioncancel:ul("Transition","TransitionCancel"),transitionend:ul("Transition","TransitionEnd")},Ca={},xo={};xs&&(xo=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function tl(e){if(Ca[e])return Ca[e];if(!dl[e])return e;var t=dl[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in xo)return Ca[e]=t[l];return e}var Hu=tl("animationend"),cr=tl("animationiteration"),bo=tl("animationstart"),ne=tl("transitionrun"),or=tl("transitionstart"),ur=tl("transitioncancel"),Cf=tl("transitionend"),sc=new Map,_o="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(" ");_o.push("scrollEnd");function nl(e,t){sc.set(e,t),cs(t,[e])}var lc=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)},qs=[],mi=0,Aa=0;function ac(){for(var e=mi,t=Aa=mi=0;t<e;){var l=qs[t];qs[t++]=null;var r=qs[t];qs[t++]=null;var d=qs[t];qs[t++]=null;var f=qs[t];if(qs[t++]=null,r!==null&&d!==null){var j=r.pending;j===null?d.next=d:(d.next=j.next,j.next=d),r.pending=d}f!==0&&Bu(l,d,f)}}function ic(e,t,l,r){qs[mi++]=e,qs[mi++]=t,qs[mi++]=l,qs[mi++]=r,Aa|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function yo(e,t,l,r){return ic(e,t,l,r),rc(e)}function Ma(e,t){return ic(e,null,null,t),rc(e)}function Bu(e,t,l){e.lanes|=l;var r=e.alternate;r!==null&&(r.lanes|=l);for(var d=!1,f=e.return;f!==null;)f.childLanes|=l,r=f.alternate,r!==null&&(r.childLanes|=l),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(d=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,d&&t!==null&&(d=31-Et(l),e=f.hiddenUpdates,r=e[d],r===null?e[d]=[t]:r.push(t),t.lane=l|536870912),f):null}function rc(e){if(50<Zo)throw Zo=0,jh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var gi={};function Af(e,t,l,r){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,l,r){return new Af(e,t,l,r)}function xi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fl(e,t){var l=e.alternate;return l===null?(l=qn(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function qu(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function dr(e,t,l,r,d,f){var j=0;if(r=e,typeof e=="function")xi(e)&&(j=1);else if(typeof e=="string")j=U0(e,l,ke.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=qn(31,l,t,d),e.elementType=H,e.lanes=f,e;case C:return ta(l.children,d,f,t);case D:j=8,d|=24;break;case q:return e=qn(12,l,t,d|2),e.elementType=q,e.lanes=f,e;case Y:return e=qn(13,l,t,d),e.elementType=Y,e.lanes=f,e;case E:return e=qn(19,l,t,d),e.elementType=E,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:j=10;break e;case G:j=9;break e;case L:j=11;break e;case U:j=14;break e;case Q:j=16,r=null;break e}j=29,l=Error(c(130,e===null?"null":typeof e,"")),r=null}return t=qn(j,l,t,d),t.elementType=e,t.type=r,t.lanes=f,t}function ta(e,t,l,r){return e=qn(7,e,r,t),e.lanes=l,e}function fr(e,t,l){return e=qn(6,e,null,t),e.lanes=l,e}function cc(e){var t=qn(18,null,null,0);return t.stateNode=e,t}function vo(e,t,l){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oc=new WeakMap;function Gs(e,t){if(typeof e=="object"&&e!==null){var l=oc.get(e);return l!==void 0?l:(t={value:e,source:t,stack:bt(t)},oc.set(e,t),t)}return{value:e,source:t,stack:bt(t)}}var bi=[],Ra=0,uc=null,Da=0,As=[],$s=0,Ol=null,hl=1,pl="";function Ll(e,t){bi[Ra++]=Da,bi[Ra++]=uc,uc=e,Da=t}function dc(e,t,l){As[$s++]=hl,As[$s++]=pl,As[$s++]=Ol,Ol=e;var r=hl;e=pl;var d=32-Et(r)-1;r&=~(1<<d),l+=1;var f=32-Et(t)+d;if(30<f){var j=d-d%5;f=(r&(1<<j)-1).toString(32),r>>=j,d-=j,hl=1<<32-Et(t)+d|l<<d|r,pl=f+e}else hl=1<<f|l<<d|r,pl=e}function jo(e){e.return!==null&&(Ll(e,1),dc(e,1,0))}function Oa(e){for(;e===uc;)uc=bi[--Ra],bi[Ra]=null,Da=bi[--Ra],bi[Ra]=null;for(;e===Ol;)Ol=As[--$s],As[$s]=null,pl=As[--$s],As[$s]=null,hl=As[--$s],As[$s]=null}function fc(e,t){As[$s++]=hl,As[$s++]=pl,As[$s++]=Ol,hl=t.id,pl=t.overflow,Ol=e}var Tn=null,tn=null,yt=!1,na=null,ns=!1,hc=Error(c(519));function sa(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hr(Gs(t,e)),hc}function wo(e){var t=e.stateNode,l=e.type,r=e.memoizedProps;switch(t[rn]=e,t[it]=r,l){case"dialog":jt("cancel",t),jt("close",t);break;case"iframe":case"object":case"embed":jt("load",t);break;case"video":case"audio":for(l=0;l<Po.length;l++)jt(Po[l],t);break;case"source":jt("error",t);break;case"img":case"image":case"link":jt("error",t),jt("load",t);break;case"details":jt("toggle",t);break;case"input":jt("invalid",t),Zl(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":jt("invalid",t);break;case"textarea":jt("invalid",t),M(t,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||r.suppressHydrationWarning===!0||mx(t.textContent,l)?(r.popover!=null&&(jt("beforetoggle",t),jt("toggle",t)),r.onScroll!=null&&jt("scroll",t),r.onScrollEnd!=null&&jt("scrollend",t),r.onClick!=null&&(t.onclick=ct),t=!0):t=!1,t||sa(e,!0)}function Gu(e){for(Tn=e.return;Tn;)switch(Tn.tag){case 5:case 31:case 13:ns=!1;return;case 27:case 3:ns=!0;return;default:Tn=Tn.return}}function _i(e){if(e!==Tn)return!1;if(!yt)return Gu(e),yt=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Ih(e.type,e.memoizedProps)),l=!l),l&&tn&&sa(e),Gu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));tn=kx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));tn=kx(e)}else t===27?(t=tn,Di(e.type)?(e=Gh,Gh=null,tn=e):tn=t):tn=Tn?xl(e.stateNode.nextSibling):null;return!0}function La(){tn=Tn=null,yt=!1}function ko(){var e=na;return e!==null&&(Ks===null?Ks=e:Ks.push.apply(Ks,e),na=null),e}function hr(e){na===null?na=[e]:na.push(e)}var No=A(null),za=null,zl=null;function la(e,t,l){fe(No,t._currentValue),t._currentValue=l}function Il(e){e._currentValue=No.current,K(No)}function So(e,t,l){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===l)break;e=e.return}}function Eo(e,t,l,r){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var f=d.dependencies;if(f!==null){var j=d.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=d;for(var z=0;z<t.length;z++)if(w.context===t[z]){f.lanes|=l,w=f.alternate,w!==null&&(w.lanes|=l),So(f.return,l,e),r||(j=null);break e}f=w.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(c(341));j.lanes|=l,f=j.alternate,f!==null&&(f.lanes|=l),So(j,l,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function yi(e,t,l,r){e=null;for(var d=t,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(c(387));if(j=j.memoizedProps,j!==null){var w=d.type;ts(d.pendingProps.value,j.value)||(e!==null?e.push(w):e=[w])}}else if(d===_e.current){if(j=d.alternate,j===null)throw Error(c(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(nu):e=[nu])}d=d.return}e!==null&&Eo(t,e,l,r),t.flags|=262144}function pc(e){for(e=e.firstContext;e!==null;){if(!ts(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ia(e){za=e,zl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zn(e){return mc(za,e)}function vi(e,t){return za===null&&Ia(e),mc(e,t)}function mc(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},zl===null){if(e===null)throw Error(c(308));zl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zl=zl.next=t;return l}var gc=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Mf=n.unstable_scheduleCallback,Rf=n.unstable_NormalPriority,Cn={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function To(){return{controller:new gc,data:new Map,refCount:0}}function pr(e){e.refCount--,e.refCount===0&&Mf(Rf,function(){e.controller.abort()})}var mr=null,Co=0,ji=0,wi=null;function Df(e,t){if(mr===null){var l=mr=[];Co=0,ji=Th(),wi={status:"pending",value:void 0,then:function(r){l.push(r)}}}return Co++,t.then($u,$u),t}function $u(){if(--Co===0&&mr!==null){wi!==null&&(wi.status="fulfilled");var e=mr;mr=null,ji=0,wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Of(e,t){var l=[],r={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var d=0;d<l.length;d++)(0,l[d])(t)},function(d){for(r.status="rejected",r.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),r}var Yu=I.S;I.S=function(e,t){Hg=De(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Df(e,t),Yu!==null&&Yu(e,t)};var Ua=A(null);function Ao(){var e=Ua.current;return e!==null?e:nn.pooledCache}function ml(e,t){t===null?fe(Ua,Ua.current):fe(Ua,t.pool)}function gl(){var e=Ao();return e===null?null:{parent:Cn._currentValue,pool:e}}var Ms=Error(c(460)),Mo=Error(c(474)),xc=Error(c(542)),Ro={then:function(){}};function Do(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gr(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(ct,ct),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oo(e),e;default:if(typeof t.status=="string")t.then(ct,ct);else{if(e=nn,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=r}},function(r){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oo(e),e}throw Ha=t,Ms}}function aa(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ha=l,Ms):l}}var Ha=null;function ki(){if(Ha===null)throw Error(c(459));var e=Ha;return Ha=null,e}function Oo(e){if(e===Ms||e===xc)throw Error(c(483))}var Ni=null,Ba=0;function bc(e){var t=Ba;return Ba+=1,Ni===null&&(Ni=[]),gr(Ni,e,t)}function ia(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ul(e,t){throw t.$$typeof===y?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Vu(e){function t(F,$){if(e){var ee=F.deletions;ee===null?(F.deletions=[$],F.flags|=16):ee.push($)}}function l(F,$){if(!e)return null;for(;$!==null;)t(F,$),$=$.sibling;return null}function r(F){for(var $=new Map;F!==null;)F.key!==null?$.set(F.key,F):$.set(F.index,F),F=F.sibling;return $}function d(F,$){return F=fl(F,$),F.index=0,F.sibling=null,F}function f(F,$,ee){return F.index=ee,e?(ee=F.alternate,ee!==null?(ee=ee.index,ee<$?(F.flags|=67108866,$):ee):(F.flags|=67108866,$)):(F.flags|=1048576,$)}function j(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function w(F,$,ee,me){return $===null||$.tag!==6?($=fr(ee,F.mode,me),$.return=F,$):($=d($,ee),$.return=F,$)}function z(F,$,ee,me){var Fe=ee.type;return Fe===C?ue(F,$,ee.props.children,me,ee.key):$!==null&&($.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Q&&aa(Fe)===$.type)?($=d($,ee.props),ia($,ee),$.return=F,$):($=dr(ee.type,ee.key,ee.props,null,F.mode,me),ia($,ee),$.return=F,$)}function te(F,$,ee,me){return $===null||$.tag!==4||$.stateNode.containerInfo!==ee.containerInfo||$.stateNode.implementation!==ee.implementation?($=vo(ee,F.mode,me),$.return=F,$):($=d($,ee.children||[]),$.return=F,$)}function ue(F,$,ee,me,Fe){return $===null||$.tag!==7?($=ta(ee,F.mode,me,Fe),$.return=F,$):($=d($,ee),$.return=F,$)}function be(F,$,ee){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=fr(""+$,F.mode,ee),$.return=F,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case S:return ee=dr($.type,$.key,$.props,null,F.mode,ee),ia(ee,$),ee.return=F,ee;case k:return $=vo($,F.mode,ee),$.return=F,$;case Q:return $=aa($),be(F,$,ee)}if(ye($)||X($))return $=ta($,F.mode,ee,null),$.return=F,$;if(typeof $.then=="function")return be(F,bc($),ee);if($.$$typeof===V)return be(F,vi(F,$),ee);Ul(F,$)}return null}function se(F,$,ee,me){var Fe=$!==null?$.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Fe!==null?null:w(F,$,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:return ee.key===Fe?z(F,$,ee,me):null;case k:return ee.key===Fe?te(F,$,ee,me):null;case Q:return ee=aa(ee),se(F,$,ee,me)}if(ye(ee)||X(ee))return Fe!==null?null:ue(F,$,ee,me,null);if(typeof ee.then=="function")return se(F,$,bc(ee),me);if(ee.$$typeof===V)return se(F,$,vi(F,ee),me);Ul(F,ee)}return null}function ie(F,$,ee,me,Fe){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return F=F.get(ee)||null,w($,F,""+me,Fe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return F=F.get(me.key===null?ee:me.key)||null,z($,F,me,Fe);case k:return F=F.get(me.key===null?ee:me.key)||null,te($,F,me,Fe);case Q:return me=aa(me),ie(F,$,ee,me,Fe)}if(ye(me)||X(me))return F=F.get(ee)||null,ue($,F,me,Fe,null);if(typeof me.then=="function")return ie(F,$,ee,bc(me),Fe);if(me.$$typeof===V)return ie(F,$,ee,vi($,me),Fe);Ul($,me)}return null}function Be(F,$,ee,me){for(var Fe=null,Dt=null,Ge=$,mt=$=0,St=null;Ge!==null&&mt<ee.length;mt++){Ge.index>mt?(St=Ge,Ge=null):St=Ge.sibling;var Ot=se(F,Ge,ee[mt],me);if(Ot===null){Ge===null&&(Ge=St);break}e&&Ge&&Ot.alternate===null&&t(F,Ge),$=f(Ot,$,mt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot,Ge=St}if(mt===ee.length)return l(F,Ge),yt&&Ll(F,mt),Fe;if(Ge===null){for(;mt<ee.length;mt++)Ge=be(F,ee[mt],me),Ge!==null&&($=f(Ge,$,mt),Dt===null?Fe=Ge:Dt.sibling=Ge,Dt=Ge);return yt&&Ll(F,mt),Fe}for(Ge=r(Ge);mt<ee.length;mt++)St=ie(Ge,F,mt,ee[mt],me),St!==null&&(e&&St.alternate!==null&&Ge.delete(St.key===null?mt:St.key),$=f(St,$,mt),Dt===null?Fe=St:Dt.sibling=St,Dt=St);return e&&Ge.forEach(function(Ui){return t(F,Ui)}),yt&&Ll(F,mt),Fe}function tt(F,$,ee,me){if(ee==null)throw Error(c(151));for(var Fe=null,Dt=null,Ge=$,mt=$=0,St=null,Ot=ee.next();Ge!==null&&!Ot.done;mt++,Ot=ee.next()){Ge.index>mt?(St=Ge,Ge=null):St=Ge.sibling;var Ui=se(F,Ge,Ot.value,me);if(Ui===null){Ge===null&&(Ge=St);break}e&&Ge&&Ui.alternate===null&&t(F,Ge),$=f(Ui,$,mt),Dt===null?Fe=Ui:Dt.sibling=Ui,Dt=Ui,Ge=St}if(Ot.done)return l(F,Ge),yt&&Ll(F,mt),Fe;if(Ge===null){for(;!Ot.done;mt++,Ot=ee.next())Ot=be(F,Ot.value,me),Ot!==null&&($=f(Ot,$,mt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot);return yt&&Ll(F,mt),Fe}for(Ge=r(Ge);!Ot.done;mt++,Ot=ee.next())Ot=ie(Ge,F,mt,Ot.value,me),Ot!==null&&(e&&Ot.alternate!==null&&Ge.delete(Ot.key===null?mt:Ot.key),$=f(Ot,$,mt),Dt===null?Fe=Ot:Dt.sibling=Ot,Dt=Ot);return e&&Ge.forEach(function(Z0){return t(F,Z0)}),yt&&Ll(F,mt),Fe}function Pt(F,$,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===C&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:e:{for(var Fe=ee.key;$!==null;){if($.key===Fe){if(Fe=ee.type,Fe===C){if($.tag===7){l(F,$.sibling),me=d($,ee.props.children),me.return=F,F=me;break e}}else if($.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Q&&aa(Fe)===$.type){l(F,$.sibling),me=d($,ee.props),ia(me,ee),me.return=F,F=me;break e}l(F,$);break}else t(F,$);$=$.sibling}ee.type===C?(me=ta(ee.props.children,F.mode,me,ee.key),me.return=F,F=me):(me=dr(ee.type,ee.key,ee.props,null,F.mode,me),ia(me,ee),me.return=F,F=me)}return j(F);case k:e:{for(Fe=ee.key;$!==null;){if($.key===Fe)if($.tag===4&&$.stateNode.containerInfo===ee.containerInfo&&$.stateNode.implementation===ee.implementation){l(F,$.sibling),me=d($,ee.children||[]),me.return=F,F=me;break e}else{l(F,$);break}else t(F,$);$=$.sibling}me=vo(ee,F.mode,me),me.return=F,F=me}return j(F);case Q:return ee=aa(ee),Pt(F,$,ee,me)}if(ye(ee))return Be(F,$,ee,me);if(X(ee)){if(Fe=X(ee),typeof Fe!="function")throw Error(c(150));return ee=Fe.call(ee),tt(F,$,ee,me)}if(typeof ee.then=="function")return Pt(F,$,bc(ee),me);if(ee.$$typeof===V)return Pt(F,$,vi(F,ee),me);Ul(F,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,$!==null&&$.tag===6?(l(F,$.sibling),me=d($,ee),me.return=F,F=me):(l(F,$),me=fr(ee,F.mode,me),me.return=F,F=me),j(F)):l(F,$)}return function(F,$,ee,me){try{Ba=0;var Fe=Pt(F,$,ee,me);return Ni=null,Fe}catch(Ge){if(Ge===Ms||Ge===xc)throw Ge;var Dt=qn(29,Ge,null,F.mode);return Dt.lanes=me,Dt.return=F,Dt}finally{}}}var ra=Vu(!0),Xu=Vu(!1),ca=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xr(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 oa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ua(e,t,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ut&2)!==0){var d=r.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),r.pending=t,t=rc(e),Bu(e,null,l),t}return ic(e,r,t,l),rc(e)}function Rs(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Ke(e,l)}}function Lo(e,t){var l=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var d=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?d=f=j:f=f.next=j,l=l.next}while(l!==null);f===null?d=f=t:f=f.next=t}else d=f=t;l={baseState:r.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:r.shared,callbacks:r.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var _c=!1;function p(){if(_c){var e=wi;if(e!==null)throw e}}function O(e,t,l,r){_c=!1;var d=e.updateQueue;ca=!1;var f=d.firstBaseUpdate,j=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var z=w,te=z.next;z.next=null,j===null?f=te:j.next=te,j=z;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,w=ue.lastBaseUpdate,w!==j&&(w===null?ue.firstBaseUpdate=te:w.next=te,ue.lastBaseUpdate=z))}if(f!==null){var be=d.baseState;j=0,ue=te=z=null,w=f;do{var se=w.lane&-536870913,ie=se!==w.lane;if(ie?(Nt&se)===se:(r&se)===se){se!==0&&se===ji&&(_c=!0),ue!==null&&(ue=ue.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var Be=e,tt=w;se=t;var Pt=l;switch(tt.tag){case 1:if(Be=tt.payload,typeof Be=="function"){be=Be.call(Pt,be,se);break e}be=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=tt.payload,se=typeof Be=="function"?Be.call(Pt,be,se):Be,se==null)break e;be=v({},be,se);break e;case 2:ca=!0}}se=w.callback,se!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=d.callbacks,ie===null?d.callbacks=[se]:ie.push(se))}else ie={lane:se,tag:w.tag,payload:w.payload,callback:w.callback,next:null},ue===null?(te=ue=ie,z=be):ue=ue.next=ie,j|=se;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;ie=w,w=ie.next,ie.next=null,d.lastBaseUpdate=ie,d.shared.pending=null}}while(!0);ue===null&&(z=be),d.baseState=z,d.firstBaseUpdate=te,d.lastBaseUpdate=ue,f===null&&(d.shared.lanes=0),Ti|=j,e.lanes=j,e.memoizedState=be}}function ce(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function qe(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)ce(l[e],t)}var ot=A(null),An=A(0);function Ys(e,t){e=Fa,fe(An,e),fe(ot,t),Fa=e|t.baseLanes}function Ga(){fe(An,Fa),fe(ot,ot.current)}function yc(){Fa=An.current,K(ot),K(An)}var ys=A(null),Ds=null;function Hl(e){var t=e.alternate;fe(je,je.current&1),fe(ys,e),Ds===null&&(t===null||ot.current!==null||t.memoizedState!==null)&&(Ds=e)}function vc(e){fe(je,je.current),fe(ys,e),Ds===null&&(Ds=e)}function zo(e){e.tag===22?(fe(je,je.current),fe(ys,e),Ds===null&&(Ds=e)):Bl()}function Bl(){fe(je,je.current),fe(ys,ys.current)}function xe(e){K(ys),Ds===e&&(Ds=null),K(je)}var je=A(0);function We(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Bh(l)||qh(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ut=0,Le=null,xt=null,Mn=null,Qu=!1,jc=!1,br=!1,Ku=0,Io=0,wc=null,Hy=0;function Rn(){throw Error(c(321))}function Lf(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!ts(e[l],t[l]))return!1;return!0}function zf(e,t,l,r,d,f){return ut=f,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Fm:Pf,br=!1,f=l(r,d),br=!1,jc&&(f=mm(t,l,r,d)),pm(e),f}function pm(e){I.H=Bo;var t=xt!==null&&xt.next!==null;if(ut=0,Mn=xt=Le=null,Qu=!1,Io=0,wc=null,t)throw Error(c(300));e===null||Gn||(e=e.dependencies,e!==null&&pc(e)&&(Gn=!0))}function mm(e,t,l,r){Le=e;var d=0;do{if(jc&&(wc=null),Io=0,jc=!1,25<=d)throw Error(c(301));if(d+=1,Mn=xt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}I.H=Pm,f=t(l,r)}while(jc);return f}function By(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?Uo(t):t,e=e.useState()[0],(xt!==null?xt.memoizedState:null)!==e&&(Le.flags|=1024),t}function If(){var e=Ku!==0;return Ku=0,e}function Uf(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Hf(e){if(Qu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qu=!1}ut=0,Mn=xt=Le=null,jc=!1,Io=Ku=0,wc=null}function Os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?Le.memoizedState=Mn=e:Mn=Mn.next=e,Mn}function In(){if(xt===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=xt.next;var t=Mn===null?Le.memoizedState:Mn.next;if(t!==null)Mn=t,xt=e;else{if(e===null)throw Le.alternate===null?Error(c(467)):Error(c(310));xt=e,e={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Mn===null?Le.memoizedState=Mn=e:Mn=Mn.next=e}return Mn}function Zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uo(e){var t=Io;return Io+=1,wc===null&&(wc=[]),e=gr(wc,e,t),t=Le,(Mn===null?t.memoizedState:Mn.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Fm:Pf),e}function Fu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Uo(e);if(e.$$typeof===V)return Zn(e)}throw Error(c(438,String(e)))}function Bf(e){var t=null,l=Le.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var r=Le.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Zu(),Le.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),r=0;r<e;r++)l[r]=B;return t.index++,l}function $a(e,t){return typeof t=="function"?t(e):t}function Pu(e){var t=In();return qf(t,xt,e)}function qf(e,t,l){var r=e.queue;if(r===null)throw Error(c(311));r.lastRenderedReducer=l;var d=e.baseQueue,f=r.pending;if(f!==null){if(d!==null){var j=d.next;d.next=f.next,f.next=j}t.baseQueue=d=f,r.pending=null}if(f=e.baseState,d===null)e.memoizedState=f;else{t=d.next;var w=j=null,z=null,te=t,ue=!1;do{var be=te.lane&-536870913;if(be!==te.lane?(Nt&be)===be:(ut&be)===be){var se=te.revertLane;if(se===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),be===ji&&(ue=!0);else if((ut&se)===se){te=te.next,se===ji&&(ue=!0);continue}else be={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},z===null?(w=z=be,j=f):z=z.next=be,Le.lanes|=se,Ti|=se;be=te.action,br&&l(f,be),f=te.hasEagerState?te.eagerState:l(f,be)}else se={lane:be,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},z===null?(w=z=se,j=f):z=z.next=se,Le.lanes|=be,Ti|=be;te=te.next}while(te!==null&&te!==t);if(z===null?j=f:z.next=w,!ts(f,e.memoizedState)&&(Gn=!0,ue&&(l=wi,l!==null)))throw l;e.memoizedState=f,e.baseState=j,e.baseQueue=z,r.lastRenderedState=f}return d===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Gf(e){var t=In(),l=t.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=e;var r=l.dispatch,d=l.pending,f=t.memoizedState;if(d!==null){l.pending=null;var j=d=d.next;do f=e(f,j.action),j=j.next;while(j!==d);ts(f,t.memoizedState)||(Gn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),l.lastRenderedState=f}return[f,r]}function gm(e,t,l){var r=Le,d=In(),f=yt;if(f){if(l===void 0)throw Error(c(407));l=l()}else l=t();var j=!ts((xt||d).memoizedState,l);if(j&&(d.memoizedState=l,Gn=!0),d=d.queue,Vf(_m.bind(null,r,d,e),[e]),d.getSnapshot!==t||j||Mn!==null&&Mn.memoizedState.tag&1){if(r.flags|=2048,kc(9,{destroy:void 0},bm.bind(null,r,d,l,t),null),nn===null)throw Error(c(349));f||(ut&127)!==0||xm(r,t,l)}return l}function xm(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Le.updateQueue,t===null?(t=Zu(),Le.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function bm(e,t,l,r){t.value=l,t.getSnapshot=r,ym(t)&&vm(e)}function _m(e,t,l){return l(function(){ym(t)&&vm(e)})}function ym(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!ts(e,l)}catch{return!0}}function vm(e){var t=Ma(e,2);t!==null&&Zs(t,e,2)}function $f(e){var t=Os();if(typeof e=="function"){var l=e;if(e=l(),br){Sn(!0);try{l()}finally{Sn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:e},t}function jm(e,t,l,r){return e.baseState=l,qf(e,xt,typeof r=="function"?r:$a)}function qy(e,t,l,r,d){if(ed(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){f.listeners.push(j)}};I.T!==null?l(!0):f.isTransition=!1,r(f),l=t.pending,l===null?(f.next=t.pending=f,wm(t,f)):(f.next=l.next,t.pending=l.next=f)}}function wm(e,t){var l=t.action,r=t.payload,d=e.state;if(t.isTransition){var f=I.T,j={};I.T=j;try{var w=l(d,r),z=I.S;z!==null&&z(j,w),km(e,t,w)}catch(te){Yf(e,t,te)}finally{f!==null&&j.types!==null&&(f.types=j.types),I.T=f}}else try{f=l(d,r),km(e,t,f)}catch(te){Yf(e,t,te)}}function km(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Nm(e,t,r)},function(r){return Yf(e,t,r)}):Nm(e,t,l)}function Nm(e,t,l){t.status="fulfilled",t.value=l,Sm(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,wm(e,l)))}function Yf(e,t,l){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=l,Sm(t),t=t.next;while(t!==r)}e.action=null}function Sm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Em(e,t){return t}function Tm(e,t){if(yt){var l=nn.formState;if(l!==null){e:{var r=Le;if(yt){if(tn){t:{for(var d=tn,f=ns;d.nodeType!==8;){if(!f){d=null;break t}if(d=xl(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){tn=xl(d.nextSibling),r=d.data==="F!";break e}}sa(r)}r=!1}r&&(t=l[0])}}return l=Os(),l.memoizedState=l.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Em,lastRenderedState:t},l.queue=r,l=Qm.bind(null,Le,r),r.dispatch=l,r=$f(!1),f=Ff.bind(null,Le,!1,r.queue),r=Os(),d={state:t,dispatch:null,action:e,pending:null},r.queue=d,l=qy.bind(null,Le,d,f,l),d.dispatch=l,r.memoizedState=e,[t,l,!1]}function Cm(e){var t=In();return Am(t,xt,e)}function Am(e,t,l){if(t=qf(e,t,Em)[0],e=Pu($a)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Uo(t)}catch(j){throw j===Ms?xc:j}else r=t;t=In();var d=t.queue,f=d.dispatch;return l!==t.memoizedState&&(Le.flags|=2048,kc(9,{destroy:void 0},Gy.bind(null,d,l),null)),[r,f,e]}function Gy(e,t){e.action=t}function Mm(e){var t=In(),l=xt;if(l!==null)return Am(t,l,e);In(),t=t.memoizedState,l=In();var r=l.queue.dispatch;return l.memoizedState=e,[t,r,!1]}function kc(e,t,l,r){return e={tag:e,create:l,deps:r,inst:t,next:null},t=Le.updateQueue,t===null&&(t=Zu(),Le.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(r=l.next,l.next=e,e.next=r,t.lastEffect=e),e}function Rm(){return In().memoizedState}function Ju(e,t,l,r){var d=Os();Le.flags|=e,d.memoizedState=kc(1|t,{destroy:void 0},l,r===void 0?null:r)}function Wu(e,t,l,r){var d=In();r=r===void 0?null:r;var f=d.memoizedState.inst;xt!==null&&r!==null&&Lf(r,xt.memoizedState.deps)?d.memoizedState=kc(t,f,l,r):(Le.flags|=e,d.memoizedState=kc(1|t,f,l,r))}function Dm(e,t){Ju(8390656,8,e,t)}function Vf(e,t){Wu(2048,8,e,t)}function $y(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=Zu(),Le.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Om(e){var t=In().memoizedState;return $y({ref:t,nextImpl:e}),function(){if((Ut&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Lm(e,t){return Wu(4,2,e,t)}function zm(e,t){return Wu(4,4,e,t)}function Im(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Um(e,t,l){l=l!=null?l.concat([e]):null,Wu(4,4,Im.bind(null,t,e),l)}function Xf(){}function Hm(e,t){var l=In();t=t===void 0?null:t;var r=l.memoizedState;return t!==null&&Lf(t,r[1])?r[0]:(l.memoizedState=[e,t],e)}function Bm(e,t){var l=In();t=t===void 0?null:t;var r=l.memoizedState;if(t!==null&&Lf(t,r[1]))return r[0];if(r=e(),br){Sn(!0);try{e()}finally{Sn(!1)}}return l.memoizedState=[r,t],r}function Qf(e,t,l){return l===void 0||(ut&1073741824)!==0&&(Nt&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=qg(),Le.lanes|=e,Ti|=e,l)}function qm(e,t,l,r){return ts(l,t)?l:ot.current!==null?(e=Qf(e,l,r),ts(e,t)||(Gn=!0),e):(ut&42)===0||(ut&1073741824)!==0&&(Nt&261930)===0?(Gn=!0,e.memoizedState=l):(e=qg(),Le.lanes|=e,Ti|=e,t)}function Gm(e,t,l,r,d){var f=R.p;R.p=f!==0&&8>f?f:8;var j=I.T,w={};I.T=w,Ff(e,!1,t,l);try{var z=d(),te=I.S;if(te!==null&&te(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ue=Of(z,r);Ho(e,t,ue,al(e))}else Ho(e,t,r,al(e))}catch(be){Ho(e,t,{then:function(){},status:"rejected",reason:be},al())}finally{R.p=f,j!==null&&w.types!==null&&(j.types=w.types),I.T=j}}function Yy(){}function Kf(e,t,l,r){if(e.tag!==5)throw Error(c(476));var d=$m(e).queue;Gm(e,d,t,P,l===null?Yy:function(){return Ym(e),l(r)})}function $m(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:P},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ym(e){var t=$m(e);t.next===null&&(t=e.alternate.memoizedState),Ho(e,t.next.queue,{},al())}function Zf(){return Zn(nu)}function Vm(){return In().memoizedState}function Xm(){return In().memoizedState}function Vy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=al();e=oa(l);var r=ua(t,e,l);r!==null&&(Zs(r,t,l),Rs(r,t,l)),t={cache:To()},e.payload=t;return}t=t.return}}function Xy(e,t,l){var r=al();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ed(e)?Km(t,l):(l=yo(e,t,l,r),l!==null&&(Zs(l,e,r),Zm(l,t,r)))}function Qm(e,t,l){var r=al();Ho(e,t,l,r)}function Ho(e,t,l,r){var d={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ed(e))Km(t,d);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var j=t.lastRenderedState,w=f(j,l);if(d.hasEagerState=!0,d.eagerState=w,ts(w,j))return ic(e,t,d,0),nn===null&&ac(),!1}catch{}finally{}if(l=yo(e,t,d,r),l!==null)return Zs(l,e,r),Zm(l,t,r),!0}return!1}function Ff(e,t,l,r){if(r={lane:2,revertLane:Th(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ed(e)){if(t)throw Error(c(479))}else t=yo(e,l,r,2),t!==null&&Zs(t,e,2)}function ed(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Km(e,t){jc=Qu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Zm(e,t,l){if((l&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,l|=r,t.lanes=l,Ke(e,l)}}var Bo={readContext:Zn,use:Fu,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};Bo.useEffectEvent=Rn;var Fm={readContext:Zn,use:Fu,useCallback:function(e,t){return Os().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:Dm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ju(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ju(4194308,4,e,t)},useInsertionEffect:function(e,t){Ju(4,2,e,t)},useMemo:function(e,t){var l=Os();t=t===void 0?null:t;var r=e();if(br){Sn(!0);try{e()}finally{Sn(!1)}}return l.memoizedState=[r,t],r},useReducer:function(e,t,l){var r=Os();if(l!==void 0){var d=l(t);if(br){Sn(!0);try{l(t)}finally{Sn(!1)}}}else d=t;return r.memoizedState=r.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},r.queue=e,e=e.dispatch=Xy.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Os();return e={current:e},t.memoizedState=e},useState:function(e){e=$f(e);var t=e.queue,l=Qm.bind(null,Le,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Xf,useDeferredValue:function(e,t){var l=Os();return Qf(l,e,t)},useTransition:function(){var e=$f(!1);return e=Gm.bind(null,Le,e.queue,!0,!1),Os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var r=Le,d=Os();if(yt){if(l===void 0)throw Error(c(407));l=l()}else{if(l=t(),nn===null)throw Error(c(349));(Nt&127)!==0||xm(r,t,l)}d.memoizedState=l;var f={value:l,getSnapshot:t};return d.queue=f,Dm(_m.bind(null,r,f,e),[e]),r.flags|=2048,kc(9,{destroy:void 0},bm.bind(null,r,f,l,t),null),l},useId:function(){var e=Os(),t=nn.identifierPrefix;if(yt){var l=pl,r=hl;l=(r&~(1<<32-Et(r)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ku++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Hy++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zf,useFormState:Tm,useActionState:Tm,useOptimistic:function(e){var t=Os();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Ff.bind(null,Le,!0,l),l.dispatch=t,[e,t]},useMemoCache:Bf,useCacheRefresh:function(){return Os().memoizedState=Vy.bind(null,Le)},useEffectEvent:function(e){var t=Os(),l={impl:e};return t.memoizedState=l,function(){if((Ut&2)!==0)throw Error(c(440));return l.impl.apply(void 0,arguments)}}},Pf={readContext:Zn,use:Fu,useCallback:Hm,useContext:Zn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Pu,useRef:Rm,useState:function(){return Pu($a)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=In();return qm(l,xt.memoizedState,e,t)},useTransition:function(){var e=Pu($a)[0],t=In().memoizedState;return[typeof e=="boolean"?e:Uo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var l=In();return jm(l,xt,e,t)},useMemoCache:Bf,useCacheRefresh:Xm};Pf.useEffectEvent=Om;var Pm={readContext:Zn,use:Fu,useCallback:Hm,useContext:Zn,useEffect:Vf,useImperativeHandle:Um,useInsertionEffect:Lm,useLayoutEffect:zm,useMemo:Bm,useReducer:Gf,useRef:Rm,useState:function(){return Gf($a)},useDebugValue:Xf,useDeferredValue:function(e,t){var l=In();return xt===null?Qf(l,e,t):qm(l,xt.memoizedState,e,t)},useTransition:function(){var e=Gf($a)[0],t=In().memoizedState;return[typeof e=="boolean"?e:Uo(e),t]},useSyncExternalStore:gm,useId:Vm,useHostTransitionStatus:Zf,useFormState:Mm,useActionState:Mm,useOptimistic:function(e,t){var l=In();return xt!==null?jm(l,xt,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:Xm};Pm.useEffectEvent=Om;function Jf(e,t,l,r){t=e.memoizedState,l=l(r,t),l=l==null?t:v({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Wf={enqueueSetState:function(e,t,l){e=e._reactInternals;var r=al(),d=oa(r);d.payload=t,l!=null&&(d.callback=l),t=ua(e,d,r),t!==null&&(Zs(t,e,r),Rs(t,e,r))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var r=al(),d=oa(r);d.tag=1,d.payload=t,l!=null&&(d.callback=l),t=ua(e,d,r),t!==null&&(Zs(t,e,r),Rs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=al(),r=oa(l);r.tag=2,t!=null&&(r.callback=t),t=ua(e,r,l),t!==null&&(Zs(t,e,l),Rs(t,e,l))}};function Jm(e,t,l,r,d,f,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,j):t.prototype&&t.prototype.isPureReactComponent?!hi(l,r)||!hi(d,f):!0}function Wm(e,t,l,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,r),t.state!==e&&Wf.enqueueReplaceState(t,t.state,null)}function _r(e,t){var l=t;if("ref"in t){l={};for(var r in t)r!=="ref"&&(l[r]=t[r])}if(e=e.defaultProps){l===t&&(l=v({},l));for(var d in e)l[d]===void 0&&(l[d]=e[d])}return l}function eg(e){lc(e)}function tg(e){console.error(e)}function ng(e){lc(e)}function td(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function sg(e,t,l){try{var r=e.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function eh(e,t,l){return l=oa(l),l.tag=3,l.payload={element:null},l.callback=function(){td(e,t)},l}function lg(e){return e=oa(e),e.tag=3,e}function ag(e,t,l,r){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var f=r.value;e.payload=function(){return d(f)},e.callback=function(){sg(t,l,r)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){sg(t,l,r),typeof d!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var w=r.stack;this.componentDidCatch(r.value,{componentStack:w!==null?w:""})})}function Qy(e,t,l,r,d){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=l.alternate,t!==null&&yi(t,l,d,!0),l=ys.current,l!==null){switch(l.tag){case 31:case 13:return Ds===null?hd():l.alternate===null&&Dn===0&&(Dn=3),l.flags&=-257,l.flags|=65536,l.lanes=d,r===Ro?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([r]):t.add(r),Nh(e,r,d)),!1;case 22:return l.flags|=65536,r===Ro?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([r]):l.add(r)),Nh(e,r,d)),!1}throw Error(c(435,l.tag))}return Nh(e,r,d),hd(),!1}if(yt)return t=ys.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,r!==hc&&(e=Error(c(422),{cause:r}),hr(Gs(e,l)))):(r!==hc&&(t=Error(c(423),{cause:r}),hr(Gs(t,l))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,r=Gs(r,l),d=eh(e.stateNode,r,d),Lo(e,d),Dn!==4&&(Dn=2)),!1;var f=Error(c(520),{cause:r});if(f=Gs(f,l),Ko===null?Ko=[f]:Ko.push(f),Dn!==4&&(Dn=2),t===null)return!0;r=Gs(r,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=d&-d,l.lanes|=e,e=eh(l.stateNode,r,e),Lo(l,e),!1;case 1:if(t=l.type,f=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ci===null||!Ci.has(f))))return l.flags|=65536,d&=-d,l.lanes|=d,d=lg(d),ag(d,e,l,r),Lo(l,d),!1}l=l.return}while(l!==null);return!1}var th=Error(c(461)),Gn=!1;function us(e,t,l,r){t.child=e===null?Xu(t,null,l,r):ra(t,e.child,l,r)}function ig(e,t,l,r,d){l=l.render;var f=t.ref;if("ref"in r){var j={};for(var w in r)w!=="ref"&&(j[w]=r[w])}else j=r;return Ia(t),r=zf(e,t,l,j,f,d),w=If(),e!==null&&!Gn?(Uf(e,t,d),Ya(e,t,d)):(yt&&w&&jo(t),t.flags|=1,us(e,t,r,d),t.child)}function rg(e,t,l,r,d){if(e===null){var f=l.type;return typeof f=="function"&&!xi(f)&&f.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=f,cg(e,t,f,r,d)):(e=dr(l.type,null,r,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!oh(e,d)){var j=f.memoizedProps;if(l=l.compare,l=l!==null?l:hi,l(j,r)&&e.ref===t.ref)return Ya(e,t,d)}return t.flags|=1,e=fl(f,r),e.ref=t.ref,e.return=t,t.child=e}function cg(e,t,l,r,d){if(e!==null){var f=e.memoizedProps;if(hi(f,r)&&e.ref===t.ref)if(Gn=!1,t.pendingProps=r=f,oh(e,d))(e.flags&131072)!==0&&(Gn=!0);else return t.lanes=e.lanes,Ya(e,t,d)}return nh(e,t,l,r,d)}function og(e,t,l,r){var d=r.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|l:l,e!==null){for(r=t.child=e.child,d=0;r!==null;)d=d|r.lanes|r.childLanes,r=r.sibling;r=d&~f}else r=0,t.child=null;return ug(e,t,f,l,r)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ml(t,f!==null?f.cachePool:null),f!==null?Ys(t,f):Ga(),zo(t);else return r=t.lanes=536870912,ug(e,t,f!==null?f.baseLanes|l:l,l,r)}else f!==null?(ml(t,f.cachePool),Ys(t,f),Bl(),t.memoizedState=null):(e!==null&&ml(t,null),Ga(),Bl());return us(e,t,d,l),t.child}function qo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ug(e,t,l,r,d){var f=Ao();return f=f===null?null:{parent:Cn._currentValue,pool:f},t.memoizedState={baseLanes:l,cachePool:f},e!==null&&ml(t,null),Ga(),zo(t),e!==null&&yi(e,t,r,!0),t.childLanes=d,null}function nd(e,t){return t=ld({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dg(e,t,l){return ra(t,e.child,null,l),e=nd(t,t.pendingProps),e.flags|=2,xe(t),t.memoizedState=null,e}function Ky(e,t,l){var r=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(yt){if(r.mode==="hidden")return e=nd(t,r),t.lanes=536870912,qo(null,e);if(vc(t),(e=tn)?(e=wx(e,ns),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ol!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},l=cc(e),l.return=t,t.child=l,Tn=t,tn=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return nd(t,r)}var f=e.memoizedState;if(f!==null){var j=f.dehydrated;if(vc(t),d)if(t.flags&256)t.flags&=-257,t=dg(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Gn||yi(e,t,l,!1),d=(l&e.childLanes)!==0,Gn||d){if(r=nn,r!==null&&(j=It(r,l),j!==0&&j!==f.retryLane))throw f.retryLane=j,Ma(e,j),Zs(r,e,j),th;hd(),t=dg(e,t,l)}else e=f.treeContext,tn=xl(j.nextSibling),Tn=t,yt=!0,na=null,ns=!1,e!==null&&fc(t,e),t=nd(t,r),t.flags|=4096;return t}return e=fl(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sd(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(c(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function nh(e,t,l,r,d){return Ia(t),l=zf(e,t,l,r,void 0,d),r=If(),e!==null&&!Gn?(Uf(e,t,d),Ya(e,t,d)):(yt&&r&&jo(t),t.flags|=1,us(e,t,l,d),t.child)}function fg(e,t,l,r,d,f){return Ia(t),t.updateQueue=null,l=mm(t,r,l,d),pm(e),r=If(),e!==null&&!Gn?(Uf(e,t,f),Ya(e,t,f)):(yt&&r&&jo(t),t.flags|=1,us(e,t,l,f),t.child)}function hg(e,t,l,r,d){if(Ia(t),t.stateNode===null){var f=gi,j=l.contextType;typeof j=="object"&&j!==null&&(f=Zn(j)),f=new l(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Wf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},qa(t),j=l.contextType,f.context=typeof j=="object"&&j!==null?Zn(j):gi,f.state=t.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(Jf(t,l,j,r),f.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(j=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),j!==f.state&&Wf.enqueueReplaceState(f,f.state,null),O(t,r,f,d),p(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,z=_r(l,w);f.props=z;var te=f.context,ue=l.contextType;j=gi,typeof ue=="object"&&ue!==null&&(j=Zn(ue));var be=l.getDerivedStateFromProps;ue=typeof be=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||te!==j)&&Wm(t,f,r,j),ca=!1;var se=t.memoizedState;f.state=se,O(t,r,f,d),p(),te=t.memoizedState,w||se!==te||ca?(typeof be=="function"&&(Jf(t,l,be,r),te=t.memoizedState),(z=ca||Jm(t,l,z,r,se,te,j))?(ue||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=te),f.props=r,f.state=te,f.context=j,r=z):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,xr(e,t),j=t.memoizedProps,ue=_r(l,j),f.props=ue,be=t.pendingProps,se=f.context,te=l.contextType,z=gi,typeof te=="object"&&te!==null&&(z=Zn(te)),w=l.getDerivedStateFromProps,(te=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(j!==be||se!==z)&&Wm(t,f,r,z),ca=!1,se=t.memoizedState,f.state=se,O(t,r,f,d),p();var ie=t.memoizedState;j!==be||se!==ie||ca||e!==null&&e.dependencies!==null&&pc(e.dependencies)?(typeof w=="function"&&(Jf(t,l,w,r),ie=t.memoizedState),(ue=ca||Jm(t,l,ue,r,se,ie,z)||e!==null&&e.dependencies!==null&&pc(e.dependencies))?(te||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,ie,z),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,ie,z)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ie),f.props=r,f.state=ie,f.context=z,r=ue):(typeof f.componentDidUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,sd(e,t),r=(t.flags&128)!==0,f||r?(f=t.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&r?(t.child=ra(t,e.child,null,d),t.child=ra(t,null,l,d)):us(e,t,l,d),t.memoizedState=f.state,e=t.child):e=Ya(e,t,d),e}function pg(e,t,l,r){return La(),t.flags|=256,us(e,t,l,r),t.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(e){return{baseLanes:e,cachePool:gl()}}function ah(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=ll),e}function mg(e,t,l){var r=t.pendingProps,d=!1,f=(t.flags&128)!==0,j;if((j=f)||(j=e!==null&&e.memoizedState===null?!1:(je.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(yt){if(d?Hl(t):Bl(),(e=tn)?(e=wx(e,ns),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ol!==null?{id:hl,overflow:pl}:null,retryLane:536870912,hydrationErrors:null},l=cc(e),l.return=t,t.child=l,Tn=t,tn=null)):e=null,e===null)throw sa(t);return qh(e)?t.lanes=32:t.lanes=536870912,null}var w=r.children;return r=r.fallback,d?(Bl(),d=t.mode,w=ld({mode:"hidden",children:w},d),r=ta(r,d,l,null),w.return=t,r.return=t,w.sibling=r,t.child=w,r=t.child,r.memoizedState=lh(l),r.childLanes=ah(e,j,l),t.memoizedState=sh,qo(null,r)):(Hl(t),ih(t,w))}var z=e.memoizedState;if(z!==null&&(w=z.dehydrated,w!==null)){if(f)t.flags&256?(Hl(t),t.flags&=-257,t=rh(e,t,l)):t.memoizedState!==null?(Bl(),t.child=e.child,t.flags|=128,t=null):(Bl(),w=r.fallback,d=t.mode,r=ld({mode:"visible",children:r.children},d),w=ta(w,d,l,null),w.flags|=2,r.return=t,w.return=t,r.sibling=w,t.child=r,ra(t,e.child,null,l),r=t.child,r.memoizedState=lh(l),r.childLanes=ah(e,j,l),t.memoizedState=sh,t=qo(null,r));else if(Hl(t),qh(w)){if(j=w.nextSibling&&w.nextSibling.dataset,j)var te=j.dgst;j=te,r=Error(c(419)),r.stack="",r.digest=j,hr({value:r,source:null,stack:null}),t=rh(e,t,l)}else if(Gn||yi(e,t,l,!1),j=(l&e.childLanes)!==0,Gn||j){if(j=nn,j!==null&&(r=It(j,l),r!==0&&r!==z.retryLane))throw z.retryLane=r,Ma(e,r),Zs(j,e,r),th;Bh(w)||hd(),t=rh(e,t,l)}else Bh(w)?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,tn=xl(w.nextSibling),Tn=t,yt=!0,na=null,ns=!1,e!==null&&fc(t,e),t=ih(t,r.children),t.flags|=4096);return t}return d?(Bl(),w=r.fallback,d=t.mode,z=e.child,te=z.sibling,r=fl(z,{mode:"hidden",children:r.children}),r.subtreeFlags=z.subtreeFlags&65011712,te!==null?w=fl(te,w):(w=ta(w,d,l,null),w.flags|=2),w.return=t,r.return=t,r.sibling=w,t.child=r,qo(null,r),r=t.child,w=e.child.memoizedState,w===null?w=lh(l):(d=w.cachePool,d!==null?(z=Cn._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=gl(),w={baseLanes:w.baseLanes|l,cachePool:d}),r.memoizedState=w,r.childLanes=ah(e,j,l),t.memoizedState=sh,qo(e.child,r)):(Hl(t),l=e.child,e=l.sibling,l=fl(l,{mode:"visible",children:r.children}),l.return=t,l.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=l,t.memoizedState=null,l)}function ih(e,t){return t=ld({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ld(e,t){return e=qn(22,e,null,t),e.lanes=0,e}function rh(e,t,l){return ra(t,e.child,null,l),e=ih(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gg(e,t,l){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),So(e.return,t,l)}function ch(e,t,l,r,d,f){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:d,treeForkCount:f}:(j.isBackwards=t,j.rendering=null,j.renderingStartTime=0,j.last=r,j.tail=l,j.tailMode=d,j.treeForkCount=f)}function xg(e,t,l){var r=t.pendingProps,d=r.revealOrder,f=r.tail;r=r.children;var j=je.current,w=(j&2)!==0;if(w?(j=j&1|2,t.flags|=128):j&=1,fe(je,j),us(e,t,r,l),r=yt?Da:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gg(e,l,t);else if(e.tag===19)gg(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(l=t.child,d=null;l!==null;)e=l.alternate,e!==null&&We(e)===null&&(d=l),l=l.sibling;l=d,l===null?(d=t.child,t.child=null):(d=l.sibling,l.sibling=null),ch(t,!1,d,l,f,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&We(e)===null){t.child=d;break}e=d.sibling,d.sibling=l,l=d,d=e}ch(t,!0,l,null,f,r);break;case"together":ch(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ya(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Ti|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(yi(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,l=fl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=fl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function oh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&pc(e)))}function Zy(e,t,l){switch(t.tag){case 3:Ze(t,t.stateNode.containerInfo),la(t,Cn,e.memoizedState.cache),La();break;case 27:case 5:Bt(t);break;case 4:Ze(t,t.stateNode.containerInfo);break;case 10:la(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,vc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Hl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?mg(e,t,l):(Hl(t),e=Ya(e,t,l),e!==null?e.sibling:null);Hl(t);break;case 19:var d=(e.flags&128)!==0;if(r=(l&t.childLanes)!==0,r||(yi(e,t,l,!1),r=(l&t.childLanes)!==0),d){if(r)return xg(e,t,l);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),fe(je,je.current),r)break;return null;case 22:return t.lanes=0,og(e,t,l,t.pendingProps);case 24:la(t,Cn,e.memoizedState.cache)}return Ya(e,t,l)}function bg(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Gn=!0;else{if(!oh(e,l)&&(t.flags&128)===0)return Gn=!1,Zy(e,t,l);Gn=(e.flags&131072)!==0}else Gn=!1,yt&&(t.flags&1048576)!==0&&dc(t,Da,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=aa(t.elementType),t.type=e,typeof e=="function")xi(e)?(r=_r(e,r),t.tag=1,t=hg(null,t,e,r,l)):(t.tag=0,t=nh(null,t,e,r,l));else{if(e!=null){var d=e.$$typeof;if(d===L){t.tag=11,t=ig(null,t,e,r,l);break e}else if(d===U){t.tag=14,t=rg(null,t,e,r,l);break e}}throw t=de(e)||e,Error(c(306,t,""))}}return t;case 0:return nh(e,t,t.type,t.pendingProps,l);case 1:return r=t.type,d=_r(r,t.pendingProps),hg(e,t,r,d,l);case 3:e:{if(Ze(t,t.stateNode.containerInfo),e===null)throw Error(c(387));r=t.pendingProps;var f=t.memoizedState;d=f.element,xr(e,t),O(t,r,null,l);var j=t.memoizedState;if(r=j.cache,la(t,Cn,r),r!==f.cache&&Eo(t,[Cn],l,!0),p(),r=j.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=pg(e,t,r,l);break e}else if(r!==d){d=Gs(Error(c(424)),t),hr(d),t=pg(e,t,r,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(tn=xl(e.firstChild),Tn=t,yt=!0,na=null,ns=!0,l=Xu(t,null,r,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(La(),r===d){t=Ya(e,t,l);break e}us(e,t,r,l)}t=t.child}return t;case 26:return sd(e,t),e===null?(l=Cx(t.type,null,t.pendingProps,null))?t.memoizedState=l:yt||(l=t.type,e=t.pendingProps,r=yd(Ue.current).createElement(l),r[rn]=t,r[it]=e,ds(r,l,e),lt(r),t.stateNode=r):t.memoizedState=Cx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bt(t),e===null&&yt&&(r=t.stateNode=Sx(t.type,t.pendingProps,Ue.current),Tn=t,ns=!0,d=tn,Di(t.type)?(Gh=d,tn=xl(r.firstChild)):tn=d),us(e,t,t.pendingProps.children,l),sd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&yt&&((d=r=tn)&&(r=N0(r,t.type,t.pendingProps,ns),r!==null?(t.stateNode=r,Tn=t,tn=xl(r.firstChild),ns=!1,d=!0):d=!1),d||sa(t)),Bt(t),d=t.type,f=t.pendingProps,j=e!==null?e.memoizedProps:null,r=f.children,Ih(d,f)?r=null:j!==null&&Ih(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=zf(e,t,By,null,null,l),nu._currentValue=d),sd(e,t),us(e,t,r,l),t.child;case 6:return e===null&&yt&&((e=l=tn)&&(l=S0(l,t.pendingProps,ns),l!==null?(t.stateNode=l,Tn=t,tn=null,e=!0):e=!1),e||sa(t)),null;case 13:return mg(e,t,l);case 4:return Ze(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ra(t,null,r,l):us(e,t,r,l),t.child;case 11:return ig(e,t,t.type,t.pendingProps,l);case 7:return us(e,t,t.pendingProps,l),t.child;case 8:return us(e,t,t.pendingProps.children,l),t.child;case 12:return us(e,t,t.pendingProps.children,l),t.child;case 10:return r=t.pendingProps,la(t,t.type,r.value),us(e,t,r.children,l),t.child;case 9:return d=t.type._context,r=t.pendingProps.children,Ia(t),d=Zn(d),r=r(d),t.flags|=1,us(e,t,r,l),t.child;case 14:return rg(e,t,t.type,t.pendingProps,l);case 15:return cg(e,t,t.type,t.pendingProps,l);case 19:return xg(e,t,l);case 31:return Ky(e,t,l);case 22:return og(e,t,l,t.pendingProps);case 24:return Ia(t),r=Zn(Cn),e===null?(d=Ao(),d===null&&(d=nn,f=To(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=l),d=f),t.memoizedState={parent:r,cache:d},qa(t),la(t,Cn,d)):((e.lanes&l)!==0&&(xr(e,t),O(t,null,null,l),p()),d=e.memoizedState,f=t.memoizedState,d.parent!==r?(d={parent:r,cache:r},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),la(t,Cn,r)):(r=f.cache,la(t,Cn,r),r!==d.cache&&Eo(t,[Cn],l,!0))),us(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Va(e){e.flags|=4}function uh(e,t,l,r,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw Ha=Ro,Mo}else e.flags&=-16777217}function _g(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ox(t))if(Vg())e.flags|=8192;else throw Ha=Ro,Mo}function ad(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yt():536870912,e.lanes|=t,Tc|=t)}function Go(e,t){if(!yt)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pn(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,r=0;if(t)for(var d=e.child;d!==null;)l|=d.lanes|d.childLanes,r|=d.subtreeFlags&65011712,r|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)l|=d.lanes|d.childLanes,r|=d.subtreeFlags,r|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=r,e.childLanes=l,t}function Fy(e,t,l){var r=t.pendingProps;switch(Oa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return pn(t),null;case 3:return l=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Il(Cn),rt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(_i(t)?Va(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ko())),pn(t),null;case 26:var d=t.type,f=t.memoizedState;return e===null?(Va(t),f!==null?(pn(t),_g(t,f)):(pn(t),uh(t,d,null,r,l))):f?f!==e.memoizedState?(Va(t),pn(t),_g(t,f)):(pn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Va(t),pn(t),uh(t,d,e,r,l)),null;case 27:if(he(t),l=Ue.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return pn(t),null}e=ke.current,_i(t)?wo(t):(e=Sx(d,r,l),t.stateNode=e,Va(t))}return pn(t),null;case 5:if(he(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(!r){if(t.stateNode===null)throw Error(c(166));return pn(t),null}if(f=ke.current,_i(t))wo(t);else{var j=yd(Ue.current);switch(f){case 1:f=j.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=j.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=j.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?j.createElement("select",{is:r.is}):j.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?j.createElement(d,{is:r.is}):j.createElement(d)}}f[rn]=t,f[it]=r;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)f.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=f;e:switch(ds(f,d,r),d){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Va(t)}}return pn(t),uh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ue.current,_i(t)){if(e=t.stateNode,l=t.memoizedProps,r=null,d=Tn,d!==null)switch(d.tag){case 27:case 5:r=d.memoizedProps}e[rn]=t,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||mx(e.nodeValue,l)),e||sa(t,!0)}else e=yd(e).createTextNode(r),e[rn]=t,t.stateNode=e}return pn(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(r=_i(t),l!==null){if(e===null){if(!r)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[rn]=t}else La(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pn(t),e=!1}else l=ko(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(xe(t),t):(xe(t),null);if((t.flags&128)!==0)throw Error(c(558))}return pn(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=_i(t),r!==null&&r.dehydrated!==null){if(e===null){if(!d)throw Error(c(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(c(317));d[rn]=t}else La(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pn(t),d=!1}else d=ko(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(xe(t),t):(xe(t),null)}return xe(t),(t.flags&128)!==0?(t.lanes=l,t):(l=r!==null,e=e!==null&&e.memoizedState!==null,l&&(r=t.child,d=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(d=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==d&&(r.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),ad(t,t.updateQueue),pn(t),null);case 4:return rt(),e===null&&Rh(t.stateNode.containerInfo),pn(t),null;case 10:return Il(t.type),pn(t),null;case 19:if(K(je),r=t.memoizedState,r===null)return pn(t),null;if(d=(t.flags&128)!==0,f=r.rendering,f===null)if(d)Go(r,!1);else{if(Dn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=We(e),f!==null){for(t.flags|=128,Go(r,!1),e=f.updateQueue,t.updateQueue=e,ad(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)qu(l,e),l=l.sibling;return fe(je,je.current&1|2),yt&&Ll(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>ud&&(t.flags|=128,d=!0,Go(r,!1),t.lanes=4194304)}else{if(!d)if(e=We(f),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ad(t,e),Go(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!yt)return pn(t),null}else 2*De()-r.renderingStartTime>ud&&l!==536870912&&(t.flags|=128,d=!0,Go(r,!1),t.lanes=4194304);r.isBackwards?(f.sibling=t.child,t.child=f):(e=r.last,e!==null?e.sibling=f:t.child=f,r.last=f)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,l=je.current,fe(je,d?l&1|2:l&1),yt&&Ll(t,r.treeForkCount),e):(pn(t),null);case 22:case 23:return xe(t),yc(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(l&536870912)!==0&&(t.flags&128)===0&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),l=t.updateQueue,l!==null&&ad(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==l&&(t.flags|=2048),e!==null&&K(Ua),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Il(Cn),pn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Py(e,t){switch(Oa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Il(Cn),rt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return he(t),null;case 31:if(t.memoizedState!==null){if(xe(t),t.alternate===null)throw Error(c(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xe(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(je),null;case 4:return rt(),null;case 10:return Il(t.type),null;case 22:case 23:return xe(t),yc(),e!==null&&K(Ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Il(Cn),null;case 25:return null;default:return null}}function yg(e,t){switch(Oa(t),t.tag){case 3:Il(Cn),rt();break;case 26:case 27:case 5:he(t);break;case 4:rt();break;case 31:t.memoizedState!==null&&xe(t);break;case 13:xe(t);break;case 19:K(je);break;case 10:Il(t.type);break;case 22:case 23:xe(t),yc(),e!==null&&K(Ua);break;case 24:Il(Cn)}}function $o(e,t){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var d=r.next;l=d;do{if((l.tag&e)===e){r=void 0;var f=l.create,j=l.inst;r=f(),j.destroy=r}l=l.next}while(l!==d)}}catch(w){Qt(t,t.return,w)}}function Si(e,t,l){try{var r=t.updateQueue,d=r!==null?r.lastEffect:null;if(d!==null){var f=d.next;r=f;do{if((r.tag&e)===e){var j=r.inst,w=j.destroy;if(w!==void 0){j.destroy=void 0,d=t;var z=l,te=w;try{te()}catch(ue){Qt(d,z,ue)}}}r=r.next}while(r!==f)}}catch(ue){Qt(t,t.return,ue)}}function vg(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{qe(t,l)}catch(r){Qt(e,e.return,r)}}}function jg(e,t,l){l.props=_r(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){Qt(e,t,r)}}function Yo(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(d){Qt(e,t,d)}}function da(e,t){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(d){Qt(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Qt(e,t,d)}else l.current=null}function wg(e){var t=e.type,l=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(d){Qt(e,e.return,d)}}function dh(e,t,l){try{var r=e.stateNode;_0(r,e.type,l,t),r[it]=t}catch(d){Qt(e,e.return,d)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Di(e.type)||e.tag===4}function fh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kg(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&&Di(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 hh(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=ct));else if(r!==4&&(r===27&&Di(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(hh(e,t,l),e=e.sibling;e!==null;)hh(e,t,l),e=e.sibling}function id(e,t,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(r!==4&&(r===27&&Di(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(id(e,t,l),e=e.sibling;e!==null;)id(e,t,l),e=e.sibling}function Ng(e){var t=e.stateNode,l=e.memoizedProps;try{for(var r=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);ds(t,r,l),t[rn]=e,t[it]=l}catch(f){Qt(e,e.return,f)}}var Xa=!1,$n=!1,ph=!1,Sg=typeof WeakSet=="function"?WeakSet:Set,ss=null;function Jy(e,t){if(e=e.containerInfo,Lh=Ed,e=ol(e),ec(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var d=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var j=0,w=-1,z=-1,te=0,ue=0,be=e,se=null;t:for(;;){for(var ie;be!==l||d!==0&&be.nodeType!==3||(w=j+d),be!==f||r!==0&&be.nodeType!==3||(z=j+r),be.nodeType===3&&(j+=be.nodeValue.length),(ie=be.firstChild)!==null;)se=be,be=ie;for(;;){if(be===e)break t;if(se===l&&++te===d&&(w=j),se===f&&++ue===r&&(z=j),(ie=be.nextSibling)!==null)break;be=se,se=be.parentNode}be=ie}l=w===-1||z===-1?null:{start:w,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(zh={focusedElem:e,selectionRange:l},Ed=!1,ss=t;ss!==null;)if(t=ss,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ss=e;else for(;ss!==null;){switch(t=ss,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)d=e[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,l=t,d=f.memoizedProps,f=f.memoizedState,r=l.stateNode;try{var Be=_r(l.type,d);e=r.getSnapshotBeforeUpdate(Be,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(tt){Qt(l,l.return,tt)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Hh(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hh(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ss=e;break}ss=t.return}}function Eg(e,t,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Ka(e,l),r&4&&$o(5,l);break;case 1:if(Ka(e,l),r&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(j){Qt(l,l.return,j)}else{var d=_r(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){Qt(l,l.return,j)}}r&64&&vg(l),r&512&&Yo(l,l.return);break;case 3:if(Ka(e,l),r&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{qe(e,t)}catch(j){Qt(l,l.return,j)}}break;case 27:t===null&&r&4&&Ng(l);case 26:case 5:Ka(e,l),t===null&&r&4&&wg(l),r&512&&Yo(l,l.return);break;case 12:Ka(e,l);break;case 31:Ka(e,l),r&4&&Ag(e,l);break;case 13:Ka(e,l),r&4&&Mg(e,l),r&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=r0.bind(null,l),E0(e,l))));break;case 22:if(r=l.memoizedState!==null||Xa,!r){t=t!==null&&t.memoizedState!==null||$n,d=Xa;var f=$n;Xa=r,($n=t)&&!f?Za(e,l,(l.subtreeFlags&8772)!==0):Ka(e,l),Xa=d,$n=f}break;case 30:break;default:Ka(e,l)}}function Tg(e){var t=e.alternate;t!==null&&(e.alternate=null,Tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Es(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 wn=null,Vs=!1;function Qa(e,t,l){for(l=l.child;l!==null;)Cg(e,t,l),l=l.sibling}function Cg(e,t,l){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(pt,l)}catch{}switch(l.tag){case 26:$n||da(l,t),Qa(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$n||da(l,t);var r=wn,d=Vs;Di(l.type)&&(wn=l.stateNode,Vs=!1),Qa(e,t,l),Wo(l.stateNode),wn=r,Vs=d;break;case 5:$n||da(l,t);case 6:if(r=wn,d=Vs,wn=null,Qa(e,t,l),wn=r,Vs=d,wn!==null)if(Vs)try{(wn.nodeType===9?wn.body:wn.nodeName==="HTML"?wn.ownerDocument.body:wn).removeChild(l.stateNode)}catch(f){Qt(l,t,f)}else try{wn.removeChild(l.stateNode)}catch(f){Qt(l,t,f)}break;case 18:wn!==null&&(Vs?(e=wn,vx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),zc(e)):vx(wn,l.stateNode));break;case 4:r=wn,d=Vs,wn=l.stateNode.containerInfo,Vs=!0,Qa(e,t,l),wn=r,Vs=d;break;case 0:case 11:case 14:case 15:Si(2,l,t),$n||Si(4,l,t),Qa(e,t,l);break;case 1:$n||(da(l,t),r=l.stateNode,typeof r.componentWillUnmount=="function"&&jg(l,t,r)),Qa(e,t,l);break;case 21:Qa(e,t,l);break;case 22:$n=(r=$n)||l.memoizedState!==null,Qa(e,t,l),$n=r;break;default:Qa(e,t,l)}}function Ag(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zc(e)}catch(l){Qt(t,t.return,l)}}}function Mg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zc(e)}catch(l){Qt(t,t.return,l)}}function Wy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sg),t;default:throw Error(c(435,e.tag))}}function rd(e,t){var l=Wy(e);t.forEach(function(r){if(!l.has(r)){l.add(r);var d=c0.bind(null,e,r);r.then(d,d)}})}function Xs(e,t){var l=t.deletions;if(l!==null)for(var r=0;r<l.length;r++){var d=l[r],f=e,j=t,w=j;e:for(;w!==null;){switch(w.tag){case 27:if(Di(w.type)){wn=w.stateNode,Vs=!1;break e}break;case 5:wn=w.stateNode,Vs=!1;break e;case 3:case 4:wn=w.stateNode.containerInfo,Vs=!0;break e}w=w.return}if(wn===null)throw Error(c(160));Cg(f,j,d),wn=null,Vs=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rg(t,e),t=t.sibling}var ql=null;function Rg(e,t){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xs(t,e),Qs(e),r&4&&(Si(3,e,e.return),$o(3,e),Si(5,e,e.return));break;case 1:Xs(t,e),Qs(e),r&512&&($n||l===null||da(l,l.return)),r&64&&Xa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var d=ql;if(Xs(t,e),Qs(e),r&512&&($n||l===null||da(l,l.return)),r&4){var f=l!==null?l.memoizedState:null;if(r=e.memoizedState,l===null)if(r===null)if(e.stateNode===null){e:{r=e.type,l=e.memoizedProps,d=d.ownerDocument||d;t:switch(r){case"title":f=d.getElementsByTagName("title")[0],(!f||f[rs]||f[rn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(r),d.head.insertBefore(f,d.querySelector("head > title"))),ds(f,r,l),f[rn]=e,lt(f),r=f;break e;case"link":var j=Rx("link","href",d).get(r+(l.href||""));if(j){for(var w=0;w<j.length;w++)if(f=j[w],f.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&f.getAttribute("rel")===(l.rel==null?null:l.rel)&&f.getAttribute("title")===(l.title==null?null:l.title)&&f.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(w,1);break t}}f=d.createElement(r),ds(f,r,l),d.head.appendChild(f);break;case"meta":if(j=Rx("meta","content",d).get(r+(l.content||""))){for(w=0;w<j.length;w++)if(f=j[w],f.getAttribute("content")===(l.content==null?null:""+l.content)&&f.getAttribute("name")===(l.name==null?null:l.name)&&f.getAttribute("property")===(l.property==null?null:l.property)&&f.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&f.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(w,1);break t}}f=d.createElement(r),ds(f,r,l),d.head.appendChild(f);break;default:throw Error(c(468,r))}f[rn]=e,lt(f),r=f}e.stateNode=r}else Dx(d,e.type,e.stateNode);else e.stateNode=Mx(d,r,e.memoizedProps);else f!==r?(f===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):f.count--,r===null?Dx(d,e.type,e.stateNode):Mx(d,r,e.memoizedProps)):r===null&&e.stateNode!==null&&dh(e,e.memoizedProps,l.memoizedProps)}break;case 27:Xs(t,e),Qs(e),r&512&&($n||l===null||da(l,l.return)),l!==null&&r&4&&dh(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Xs(t,e),Qs(e),r&512&&($n||l===null||da(l,l.return)),e.flags&32){d=e.stateNode;try{W(d,"")}catch(Be){Qt(e,e.return,Be)}}r&4&&e.stateNode!=null&&(d=e.memoizedProps,dh(e,d,l!==null?l.memoizedProps:d)),r&1024&&(ph=!0);break;case 6:if(Xs(t,e),Qs(e),r&4){if(e.stateNode===null)throw Error(c(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(Be){Qt(e,e.return,Be)}}break;case 3:if(wd=null,d=ql,ql=vd(t.containerInfo),Xs(t,e),ql=d,Qs(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{zc(t.containerInfo)}catch(Be){Qt(e,e.return,Be)}ph&&(ph=!1,Dg(e));break;case 4:r=ql,ql=vd(e.stateNode.containerInfo),Xs(t,e),Qs(e),ql=r;break;case 12:Xs(t,e),Qs(e);break;case 31:Xs(t,e),Qs(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 13:Xs(t,e),Qs(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(od=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 22:d=e.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,te=Xa,ue=$n;if(Xa=te||d,$n=ue||z,Xs(t,e),$n=ue,Xa=te,Qs(e),r&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(l===null||z||Xa||$n||yr(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){z=l=t;try{if(f=z.stateNode,d)j=f.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{w=z.stateNode;var be=z.memoizedProps.style,se=be!=null&&be.hasOwnProperty("display")?be.display:null;w.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Be){Qt(z,z.return,Be)}}}else if(t.tag===6){if(l===null){z=t;try{z.stateNode.nodeValue=d?"":z.memoizedProps}catch(Be){Qt(z,z.return,Be)}}}else if(t.tag===18){if(l===null){z=t;try{var ie=z.stateNode;d?jx(ie,!0):jx(z.stateNode,!1)}catch(Be){Qt(z,z.return,Be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,rd(e,l))));break;case 19:Xs(t,e),Qs(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,rd(e,r)));break;case 30:break;case 21:break;default:Xs(t,e),Qs(e)}}function Qs(e){var t=e.flags;if(t&2){try{for(var l,r=e.return;r!==null;){if(kg(r)){l=r;break}r=r.return}if(l==null)throw Error(c(160));switch(l.tag){case 27:var d=l.stateNode,f=fh(e);id(e,f,d);break;case 5:var j=l.stateNode;l.flags&32&&(W(j,""),l.flags&=-33);var w=fh(e);id(e,w,j);break;case 3:case 4:var z=l.stateNode.containerInfo,te=fh(e);hh(e,te,z);break;default:throw Error(c(161))}}catch(ue){Qt(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eg(e,t.alternate,t),t=t.sibling}function yr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Si(4,t,t.return),yr(t);break;case 1:da(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&jg(t,t.return,l),yr(t);break;case 27:Wo(t.stateNode);case 26:case 5:da(t,t.return),yr(t);break;case 22:t.memoizedState===null&&yr(t);break;case 30:yr(t);break;default:yr(t)}e=e.sibling}}function Za(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,d=e,f=t,j=f.flags;switch(f.tag){case 0:case 11:case 15:Za(d,f,l),$o(4,f);break;case 1:if(Za(d,f,l),r=f,d=r.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(te){Qt(r,r.return,te)}if(r=f,d=r.updateQueue,d!==null){var w=r.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)ce(z[d],w)}catch(te){Qt(r,r.return,te)}}l&&j&64&&vg(f),Yo(f,f.return);break;case 27:Ng(f);case 26:case 5:Za(d,f,l),l&&r===null&&j&4&&wg(f),Yo(f,f.return);break;case 12:Za(d,f,l);break;case 31:Za(d,f,l),l&&j&4&&Ag(d,f);break;case 13:Za(d,f,l),l&&j&4&&Mg(d,f);break;case 22:f.memoizedState===null&&Za(d,f,l),Yo(f,f.return);break;case 30:break;default:Za(d,f,l)}t=t.sibling}}function mh(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&pr(l))}function gh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pr(e))}function Gl(e,t,l,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Og(e,t,l,r),t=t.sibling}function Og(e,t,l,r){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Gl(e,t,l,r),d&2048&&$o(9,t);break;case 1:Gl(e,t,l,r);break;case 3:Gl(e,t,l,r),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pr(e)));break;case 12:if(d&2048){Gl(e,t,l,r),e=t.stateNode;try{var f=t.memoizedProps,j=f.id,w=f.onPostCommit;typeof w=="function"&&w(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Qt(t,t.return,z)}}else Gl(e,t,l,r);break;case 31:Gl(e,t,l,r);break;case 13:Gl(e,t,l,r);break;case 23:break;case 22:f=t.stateNode,j=t.alternate,t.memoizedState!==null?f._visibility&2?Gl(e,t,l,r):Vo(e,t):f._visibility&2?Gl(e,t,l,r):(f._visibility|=2,Nc(e,t,l,r,(t.subtreeFlags&10256)!==0||!1)),d&2048&&mh(j,t);break;case 24:Gl(e,t,l,r),d&2048&&gh(t.alternate,t);break;default:Gl(e,t,l,r)}}function Nc(e,t,l,r,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,j=t,w=l,z=r,te=j.flags;switch(j.tag){case 0:case 11:case 15:Nc(f,j,w,z,d),$o(8,j);break;case 23:break;case 22:var ue=j.stateNode;j.memoizedState!==null?ue._visibility&2?Nc(f,j,w,z,d):Vo(f,j):(ue._visibility|=2,Nc(f,j,w,z,d)),d&&te&2048&&mh(j.alternate,j);break;case 24:Nc(f,j,w,z,d),d&&te&2048&&gh(j.alternate,j);break;default:Nc(f,j,w,z,d)}t=t.sibling}}function Vo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,r=t,d=r.flags;switch(r.tag){case 22:Vo(l,r),d&2048&&mh(r.alternate,r);break;case 24:Vo(l,r),d&2048&&gh(r.alternate,r);break;default:Vo(l,r)}t=t.sibling}}var Xo=8192;function Sc(e,t,l){if(e.subtreeFlags&Xo)for(e=e.child;e!==null;)Lg(e,t,l),e=e.sibling}function Lg(e,t,l){switch(e.tag){case 26:Sc(e,t,l),e.flags&Xo&&e.memoizedState!==null&&H0(l,ql,e.memoizedState,e.memoizedProps);break;case 5:Sc(e,t,l);break;case 3:case 4:var r=ql;ql=vd(e.stateNode.containerInfo),Sc(e,t,l),ql=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Xo,Xo=16777216,Sc(e,t,l),Xo=r):Sc(e,t,l));break;default:Sc(e,t,l)}}function zg(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 Qo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];ss=r,Ug(r,e)}zg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ig(e),e=e.sibling}function Ig(e){switch(e.tag){case 0:case 11:case 15:Qo(e),e.flags&2048&&Si(9,e,e.return);break;case 3:Qo(e);break;case 12:Qo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,cd(e)):Qo(e);break;default:Qo(e)}}function cd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var r=t[l];ss=r,Ug(r,e)}zg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Si(8,t,t.return),cd(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,cd(t));break;default:cd(t)}e=e.sibling}}function Ug(e,t){for(;ss!==null;){var l=ss;switch(l.tag){case 0:case 11:case 15:Si(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:pr(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,ss=r;else e:for(l=e;ss!==null;){r=ss;var d=r.sibling,f=r.return;if(Tg(r),r===l){ss=null;break e}if(d!==null){d.return=f,ss=d;break e}ss=f}}}var e0={getCacheForType:function(e){var t=Zn(Cn),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Zn(Cn).controller.signal}},t0=typeof WeakMap=="function"?WeakMap:Map,Ut=0,nn=null,vt=null,Nt=0,Xt=0,sl=null,Ei=!1,Ec=!1,xh=!1,Fa=0,Dn=0,Ti=0,vr=0,bh=0,ll=0,Tc=0,Ko=null,Ks=null,_h=!1,od=0,Hg=0,ud=1/0,dd=null,Ci=null,Fn=0,Ai=null,Cc=null,Pa=0,yh=0,vh=null,Bg=null,Zo=0,jh=null;function al(){return(Ut&2)!==0&&Nt!==0?Nt&-Nt:I.T!==null?Th():gs()}function qg(){if(ll===0)if((Nt&536870912)===0||yt){var e=et;et<<=1,(et&3932160)===0&&(et=262144),ll=e}else ll=536870912;return e=ys.current,e!==null&&(e.flags|=32),ll}function Zs(e,t,l){(e===nn&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)&&(Ac(e,0),Mi(e,Nt,ll,!1)),J(e,l),((Ut&2)===0||e!==nn)&&(e===nn&&((Ut&2)===0&&(vr|=l),Dn===4&&Mi(e,Nt,ll,!1)),fa(e))}function Gg(e,t,l){if((Ut&6)!==0)throw Error(c(327));var r=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Wt(e,t),d=r?l0(e,t):kh(e,t,!0),f=r;do{if(d===0){Ec&&!r&&Mi(e,t,0,!1);break}else{if(l=e.current.alternate,f&&!n0(l)){d=kh(e,t,!1),f=!1;continue}if(d===2){if(f=t,e.errorRecoveryDisabledLanes&f)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var w=e;d=Ko;var z=w.current.memoizedState.isDehydrated;if(z&&(Ac(w,j).flags|=256),j=kh(w,j,!1),j!==2){if(xh&&!z){w.errorRecoveryDisabledLanes|=f,vr|=f,d=4;break e}f=Ks,Ks=d,f!==null&&(Ks===null?Ks=f:Ks.push.apply(Ks,f))}d=j}if(f=!1,d!==2)continue}}if(d===1){Ac(e,0),Mi(e,t,0,!0);break}e:{switch(r=e,f=d,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Mi(r,t,ll,!Ei);break e;case 2:Ks=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(d=od+300-De(),10<d)){if(Mi(r,t,ll,!Ei),On(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=_x($g.bind(null,r,l,Ks,dd,_h,t,ll,vr,Tc,Ei,f,"Throttled",-0,0),d);break e}$g(r,l,Ks,dd,_h,t,ll,vr,Tc,Ei,f,null,-0,0)}}break}while(!0);fa(e)}function $g(e,t,l,r,d,f,j,w,z,te,ue,be,se,ie){if(e.timeoutHandle=-1,be=t.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ct},Lg(t,f,be);var Be=(f&62914560)===f?od-De():(f&4194048)===f?Hg-De():0;if(Be=B0(be,Be),Be!==null){Pa=f,e.cancelPendingCommit=Be(Pg.bind(null,e,t,f,l,r,d,j,w,z,ue,be,null,se,ie)),Mi(e,f,j,!te);return}}Pg(e,t,f,l,r,d,j,w,z)}function n0(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var d=l[r],f=d.getSnapshot;d=d.value;try{if(!ts(f(),d))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mi(e,t,l,r){t&=~bh,t&=~vr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var d=t;0<d;){var f=31-Et(d),j=1<<f;r[f]=-1,d&=~j}l!==0&&Ae(e,l,t)}function fd(){return(Ut&6)===0?(Fo(0),!1):!0}function wh(){if(vt!==null){if(Xt===0)var e=vt.return;else e=vt,zl=za=null,Hf(e),Ni=null,Ba=0,e=vt;for(;e!==null;)yg(e.alternate,e),e=e.return;vt=null}}function Ac(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,j0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Pa=0,wh(),nn=e,vt=l=fl(e.current,null),Nt=t,Xt=0,sl=null,Ei=!1,Ec=Wt(e,t),xh=!1,Tc=ll=bh=vr=Ti=Dn=0,Ks=Ko=null,_h=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var d=31-Et(r),f=1<<d;t|=e[d],r&=~f}return Fa=t,ac(),l}function Yg(e,t){Le=null,I.H=Bo,t===Ms||t===xc?(t=ki(),Xt=3):t===Mo?(t=ki(),Xt=4):Xt=t===th?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sl=t,vt===null&&(Dn=1,td(e,Gs(t,e.current)))}function Vg(){var e=ys.current;return e===null?!0:(Nt&4194048)===Nt?Ds===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?e===Ds:!1}function Xg(){var e=I.H;return I.H=Bo,e===null?Bo:e}function Qg(){var e=I.A;return I.A=e0,e}function hd(){Dn=4,Ei||(Nt&4194048)!==Nt&&ys.current!==null||(Ec=!0),(Ti&134217727)===0&&(vr&134217727)===0||nn===null||Mi(nn,Nt,ll,!1)}function kh(e,t,l){var r=Ut;Ut|=2;var d=Xg(),f=Qg();(nn!==e||Nt!==t)&&(dd=null,Ac(e,t)),t=!1;var j=Dn;e:do try{if(Xt!==0&&vt!==null){var w=vt,z=sl;switch(Xt){case 8:wh(),j=6;break e;case 3:case 2:case 9:case 6:ys.current===null&&(t=!0);var te=Xt;if(Xt=0,sl=null,Mc(e,w,z,te),l&&Ec){j=0;break e}break;default:te=Xt,Xt=0,sl=null,Mc(e,w,z,te)}}s0(),j=Dn;break}catch(ue){Yg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,zl=za=null,Ut=r,I.H=d,I.A=f,vt===null&&(nn=null,Nt=0,ac()),j}function s0(){for(;vt!==null;)Kg(vt)}function l0(e,t){var l=Ut;Ut|=2;var r=Xg(),d=Qg();nn!==e||Nt!==t?(dd=null,ud=De()+500,Ac(e,t)):Ec=Wt(e,t);e:do try{if(Xt!==0&&vt!==null){t=vt;var f=sl;t:switch(Xt){case 1:Xt=0,sl=null,Mc(e,t,f,1);break;case 2:case 9:if(Do(f)){Xt=0,sl=null,Zg(t);break}t=function(){Xt!==2&&Xt!==9||nn!==e||(Xt=7),fa(e)},f.then(t,t);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:Do(f)?(Xt=0,sl=null,Zg(t)):(Xt=0,sl=null,Mc(e,t,f,7));break;case 5:var j=null;switch(vt.tag){case 26:j=vt.memoizedState;case 5:case 27:var w=vt;if(j?Ox(j):w.stateNode.complete){Xt=0,sl=null;var z=w.sibling;if(z!==null)vt=z;else{var te=w.return;te!==null?(vt=te,pd(te)):vt=null}break t}}Xt=0,sl=null,Mc(e,t,f,5);break;case 6:Xt=0,sl=null,Mc(e,t,f,6);break;case 8:wh(),Dn=6;break e;default:throw Error(c(462))}}a0();break}catch(ue){Yg(e,ue)}while(!0);return zl=za=null,I.H=r,I.A=d,Ut=l,vt!==null?0:(nn=null,Nt=0,ac(),Dn)}function a0(){for(;vt!==null&&!wt();)Kg(vt)}function Kg(e){var t=bg(e.alternate,e,Fa);e.memoizedProps=e.pendingProps,t===null?pd(e):vt=t}function Zg(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=fg(l,t,t.pendingProps,t.type,void 0,Nt);break;case 11:t=fg(l,t,t.pendingProps,t.type.render,t.ref,Nt);break;case 5:Hf(t);default:yg(l,t),t=vt=qu(t,Fa),t=bg(l,t,Fa)}e.memoizedProps=e.pendingProps,t===null?pd(e):vt=t}function Mc(e,t,l,r){zl=za=null,Hf(t),Ni=null,Ba=0;var d=t.return;try{if(Qy(e,d,t,l,Nt)){Dn=1,td(e,Gs(l,e.current)),vt=null;return}}catch(f){if(d!==null)throw vt=d,f;Dn=1,td(e,Gs(l,e.current)),vt=null;return}t.flags&32768?(yt||r===1?e=!0:Ec||(Nt&536870912)!==0?e=!1:(Ei=e=!0,(r===2||r===9||r===3||r===6)&&(r=ys.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fg(t,e)):pd(t)}function pd(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Ei);return}e=t.return;var l=Fy(t.alternate,t,Fa);if(l!==null){vt=l;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Dn===0&&(Dn=5)}function Fg(e,t){do{var l=Py(e.alternate,e);if(l!==null){l.flags&=32767,vt=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){vt=e;return}vt=e=l}while(e!==null);Dn=6,vt=null}function Pg(e,t,l,r,d,f,j,w,z){e.cancelPendingCommit=null;do md();while(Fn!==0);if((Ut&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Aa,pe(e,l,f,j,w,z),e===nn&&(vt=nn=null,Nt=0),Cc=t,Ai=e,Pa=l,yh=f,vh=d,Bg=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,o0(Te,function(){return nx(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=I.T,I.T=null,d=R.p,R.p=2,j=Ut,Ut|=4;try{Jy(e,t,l)}finally{Ut=j,R.p=d,I.T=r}}Fn=1,Jg(),Wg(),ex()}}function Jg(){if(Fn===1){Fn=0;var e=Ai,t=Cc,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=I.T,I.T=null;var r=R.p;R.p=2;var d=Ut;Ut|=4;try{Rg(t,e);var f=zh,j=ol(e.containerInfo),w=f.focusedElem,z=f.selectionRange;if(j!==w&&w&&w.ownerDocument&&go(w.ownerDocument.documentElement,w)){if(z!==null&&ec(w)){var te=z.start,ue=z.end;if(ue===void 0&&(ue=te),"selectionStart"in w)w.selectionStart=te,w.selectionEnd=Math.min(ue,w.value.length);else{var be=w.ownerDocument||document,se=be&&be.defaultView||window;if(se.getSelection){var ie=se.getSelection(),Be=w.textContent.length,tt=Math.min(z.start,Be),Pt=z.end===void 0?tt:Math.min(z.end,Be);!ie.extend&&tt>Pt&&(j=Pt,Pt=tt,tt=j);var F=mo(w,tt),$=mo(w,Pt);if(F&&$&&(ie.rangeCount!==1||ie.anchorNode!==F.node||ie.anchorOffset!==F.offset||ie.focusNode!==$.node||ie.focusOffset!==$.offset)){var ee=be.createRange();ee.setStart(F.node,F.offset),ie.removeAllRanges(),tt>Pt?(ie.addRange(ee),ie.extend($.node,$.offset)):(ee.setEnd($.node,$.offset),ie.addRange(ee))}}}}for(be=[],ie=w;ie=ie.parentNode;)ie.nodeType===1&&be.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<be.length;w++){var me=be[w];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Ed=!!Lh,zh=Lh=null}finally{Ut=d,R.p=r,I.T=l}}e.current=t,Fn=2}}function Wg(){if(Fn===2){Fn=0;var e=Ai,t=Cc,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=I.T,I.T=null;var r=R.p;R.p=2;var d=Ut;Ut|=4;try{Eg(e,t.alternate,t)}finally{Ut=d,R.p=r,I.T=l}}Fn=3}}function ex(){if(Fn===4||Fn===3){Fn=0,Z();var e=Ai,t=Cc,l=Pa,r=Bg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fn=5:(Fn=0,Cc=Ai=null,tx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ci=null),kt(l),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(pt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=I.T,d=R.p,R.p=2,I.T=null;try{for(var f=e.onRecoverableError,j=0;j<r.length;j++){var w=r[j];f(w.value,{componentStack:w.stack})}}finally{I.T=t,R.p=d}}(Pa&3)!==0&&md(),fa(e),d=e.pendingLanes,(l&261930)!==0&&(d&42)!==0?e===jh?Zo++:(Zo=0,jh=e):Zo=0,Fo(0)}}function tx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,pr(t)))}function md(){return Jg(),Wg(),ex(),nx()}function nx(){if(Fn!==5)return!1;var e=Ai,t=yh;yh=0;var l=kt(Pa),r=I.T,d=R.p;try{R.p=32>l?32:l,I.T=null,l=vh,vh=null;var f=Ai,j=Pa;if(Fn=0,Cc=Ai=null,Pa=0,(Ut&6)!==0)throw Error(c(331));var w=Ut;if(Ut|=4,Ig(f.current),Og(f,f.current,j,l),Ut=w,Fo(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(pt,f)}catch{}return!0}finally{R.p=d,I.T=r,tx(e,t)}}function sx(e,t,l){t=Gs(l,t),t=eh(e.stateNode,t,2),e=ua(e,t,2),e!==null&&(J(e,2),fa(e))}function Qt(e,t,l){if(e.tag===3)sx(e,e,l);else for(;t!==null;){if(t.tag===3){sx(t,e,l);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ci===null||!Ci.has(r))){e=Gs(l,e),l=lg(2),r=ua(t,l,2),r!==null&&(ag(l,r,t,e),J(r,2),fa(r));break}}t=t.return}}function Nh(e,t,l){var r=e.pingCache;if(r===null){r=e.pingCache=new t0;var d=new Set;r.set(t,d)}else d=r.get(t),d===void 0&&(d=new Set,r.set(t,d));d.has(l)||(xh=!0,d.add(l),e=i0.bind(null,e,t,l),t.then(e,e))}function i0(e,t,l){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,nn===e&&(Nt&l)===l&&(Dn===4||Dn===3&&(Nt&62914560)===Nt&&300>De()-od?(Ut&2)===0&&Ac(e,0):bh|=l,Tc===Nt&&(Tc=0)),fa(e)}function lx(e,t){t===0&&(t=Yt()),e=Ma(e,t),e!==null&&(J(e,t),fa(e))}function r0(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),lx(e,l)}function c0(e,t){var l=0;switch(e.tag){case 31:case 13:var r=e.stateNode,d=e.memoizedState;d!==null&&(l=d.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(c(314))}r!==null&&r.delete(t),lx(e,l)}function o0(e,t){return ln(e,t)}var gd=null,Rc=null,Sh=!1,xd=!1,Eh=!1,Ri=0;function fa(e){e!==Rc&&e.next===null&&(Rc===null?gd=Rc=e:Rc=Rc.next=e),xd=!0,Sh||(Sh=!0,d0())}function Fo(e,t){if(!Eh&&xd){Eh=!0;do for(var l=!1,r=gd;r!==null;){if(e!==0){var d=r.pendingLanes;if(d===0)var f=0;else{var j=r.suspendedLanes,w=r.pingedLanes;f=(1<<31-Et(42|e)+1)-1,f&=d&~(j&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,cx(r,f))}else f=Nt,f=On(r,r===nn?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Wt(r,f)||(l=!0,cx(r,f));r=r.next}while(l);Eh=!1}}function u0(){ax()}function ax(){xd=Sh=!1;var e=0;Ri!==0&&v0()&&(e=Ri);for(var t=De(),l=null,r=gd;r!==null;){var d=r.next,f=ix(r,t);f===0?(r.next=null,l===null?gd=d:l.next=d,d===null&&(Rc=l)):(l=r,(e!==0||(f&3)!==0)&&(xd=!0)),r=d}Fn!==0&&Fn!==5||Fo(e),Ri!==0&&(Ri=0)}function ix(e,t){for(var l=e.suspendedLanes,r=e.pingedLanes,d=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var j=31-Et(f),w=1<<j,z=d[j];z===-1?((w&l)===0||(w&r)!==0)&&(d[j]=bn(w,t)):z<=t&&(e.expiredLanes|=w),f&=~w}if(t=nn,l=Nt,l=On(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===t&&(Xt===2||Xt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Xn(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Wt(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(r!==null&&Xn(r),kt(l)){case 2:case 8:l=Ee;break;case 32:l=Te;break;case 268435456:l=Ye;break;default:l=Te}return r=rx.bind(null,e),l=ln(l,r),e.callbackPriority=t,e.callbackNode=l,t}return r!==null&&r!==null&&Xn(r),e.callbackPriority=2,e.callbackNode=null,2}function rx(e,t){if(Fn!==0&&Fn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(md()&&e.callbackNode!==l)return null;var r=Nt;return r=On(e,e===nn?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gg(e,r,t),ix(e,De()),e.callbackNode!=null&&e.callbackNode===l?rx.bind(null,e):null)}function cx(e,t){if(md())return null;Gg(e,t,!0)}function d0(){w0(function(){(Ut&6)!==0?ln(ht,u0):ax()})}function Th(){if(Ri===0){var e=ji;e===0&&(e=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),Ri=e}return Ri}function ox(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cn(""+e)}function ux(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function f0(e,t,l,r,d){if(t==="submit"&&l&&l.stateNode===d){var f=ox((d[it]||null).action),j=r.submitter;j&&(t=(t=j[it]||null)?ox(t.formAction):j.getAttribute("formAction"),t!==null&&(f=t,j=null));var w=new Br("action","action",null,r,d);e.push({event:w,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ri!==0){var z=j?ux(d,j):new FormData(d);Kf(l,{pending:!0,data:z,method:d.method,action:f},null,z)}}else typeof f=="function"&&(w.preventDefault(),z=j?ux(d,j):new FormData(d),Kf(l,{pending:!0,data:z,method:d.method,action:f},f,z))},currentTarget:d}]})}}for(var Ch=0;Ch<_o.length;Ch++){var Ah=_o[Ch],h0=Ah.toLowerCase(),p0=Ah[0].toUpperCase()+Ah.slice(1);nl(h0,"on"+p0)}nl(Hu,"onAnimationEnd"),nl(cr,"onAnimationIteration"),nl(bo,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(ne,"onTransitionRun"),nl(or,"onTransitionStart"),nl(ur,"onTransitionCancel"),nl(Cf,"onTransitionEnd"),dn("onMouseEnter",["mouseout","mouseover"]),dn("onMouseLeave",["mouseout","mouseover"]),dn("onPointerEnter",["pointerout","pointerover"]),dn("onPointerLeave",["pointerout","pointerover"]),cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="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(" "),m0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Po));function dx(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var r=e[l],d=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var j=r.length-1;0<=j;j--){var w=r[j],z=w.instance,te=w.currentTarget;if(w=w.listener,z!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=te;try{f(d)}catch(ue){lc(ue)}d.currentTarget=null,f=z}else for(j=0;j<r.length;j++){if(w=r[j],z=w.instance,te=w.currentTarget,w=w.listener,z!==f&&d.isPropagationStopped())break e;f=w,d.currentTarget=te;try{f(d)}catch(ue){lc(ue)}d.currentTarget=null,f=z}}}}function jt(e,t){var l=t[ks];l===void 0&&(l=t[ks]=new Set);var r=e+"__bubble";l.has(r)||(fx(t,e,2,!1),l.add(r))}function Mh(e,t,l){var r=0;t&&(r|=4),fx(l,e,r,t)}var bd="_reactListening"+Math.random().toString(36).slice(2);function Rh(e){if(!e[bd]){e[bd]=!0,Jn.forEach(function(l){l!=="selectionchange"&&(m0.has(l)||Mh(l,!1,e),Mh(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,Mh("selectionchange",!1,t))}}function fx(e,t,l,r){switch(qx(t)){case 2:var d=$0;break;case 8:d=Y0;break;default:d=Qh}l=d.bind(null,t,l,e),d=void 0,!es||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),r?d!==void 0?e.addEventListener(t,l,{capture:!0,passive:d}):e.addEventListener(t,l,!0):d!==void 0?e.addEventListener(t,l,{passive:d}):e.addEventListener(t,l,!1)}function Dh(e,t,l,r,d){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var j=r.tag;if(j===3||j===4){var w=r.stateNode.containerInfo;if(w===d)break;if(j===4)for(j=r.return;j!==null;){var z=j.tag;if((z===3||z===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;w!==null;){if(j=Zt(w),j===null)return;if(z=j.tag,z===5||z===6||z===26||z===27){r=f=j;continue e}w=w.parentNode}}r=r.return}ai(function(){var te=f,ue=fn(l),be=[];e:{var se=sc.get(e);if(se!==void 0){var ie=Br,Be=e;switch(e){case"keypress":if(bs(l)===0)break e;case"keydown":case"keyup":ie=sr;break;case"focusin":Be="focus",ie=Al;break;case"focusout":Be="blur",ie=Al;break;case"beforeblur":case"afterblur":ie=Al;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Wi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Ws;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Vr;break;case Hu:case cr:case bo:ie=Pl;break;case Cf:ie=Iu;break;case"scroll":case"scrollend":ie=Js;break;case"wheel":ie=Qr;break;case"copy":case"cut":case"paste":ie=Gr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=zu;break;case"toggle":case"beforetoggle":ie=Kr}var tt=(t&4)!==0,Pt=!tt&&(e==="scroll"||e==="scrollend"),F=tt?se!==null?se+"Capture":null:se;tt=[];for(var $=te,ee;$!==null;){var me=$;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||F===null||(me=jn($,F),me!=null&&tt.push(Jo($,me,ee))),Pt)break;$=$.return}0<tt.length&&(se=new ie(se,Be,null,l,ue),be.push({event:se,listeners:tt}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",se&&l!==Mt&&(Be=l.relatedTarget||l.fromElement)&&(Zt(Be)||Be[un]))break e;if((ie||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,ie?(Be=l.relatedTarget||l.toElement,ie=te,Be=Be?Zt(Be):null,Be!==null&&(Pt=u(Be),tt=Be.tag,Be!==Pt||tt!==5&&tt!==27&&tt!==6)&&(Be=null)):(ie=null,Be=te),ie!==Be)){if(tt=Wi,me="onMouseLeave",F="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(tt=zu,me="onPointerLeave",F="onPointerEnter",$="pointer"),Pt=ie==null?se:_n(ie),ee=Be==null?se:_n(Be),se=new tt(me,$+"leave",ie,l,ue),se.target=Pt,se.relatedTarget=ee,me=null,Zt(ue)===te&&(tt=new tt(F,$+"enter",Be,l,ue),tt.target=ee,tt.relatedTarget=Pt,me=tt),Pt=me,ie&&Be)t:{for(tt=g0,F=ie,$=Be,ee=0,me=F;me;me=tt(me))ee++;me=0;for(var Fe=$;Fe;Fe=tt(Fe))me++;for(;0<ee-me;)F=tt(F),ee--;for(;0<me-ee;)$=tt($),me--;for(;ee--;){if(F===$||$!==null&&F===$.alternate){tt=F;break t}F=tt(F),$=tt($)}tt=null}else tt=null;ie!==null&&hx(be,se,ie,tt,!1),Be!==null&&Pt!==null&&hx(be,Pt,Be,tt,!0)}}e:{if(se=te?_n(te):window,ie=se.nodeName&&se.nodeName.toLowerCase(),ie==="select"||ie==="input"&&se.type==="file")var Dt=rr;else if(oi(se))if(di)Dt=Bn;else{Dt=Jr;var Ge=Tf}else ie=se.nodeName,!ie||ie.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?te&&Je(te.elementType)&&(Dt=rr):Dt=fi;if(Dt&&(Dt=Dt(e,te))){po(be,Dt,l,ue);break e}Ge&&Ge(e,se,te),e==="focusout"&&te&&se.type==="number"&&te.memoizedProps.value!=null&&Us(se,"number",se.value)}switch(Ge=te?_n(te):window,e){case"focusin":(oi(Ge)||Ge.contentEditable==="true")&&(Dl=Ge,Ta=te,el=null);break;case"focusout":el=Ta=Dl=null;break;case"mousedown":nc=!0;break;case"contextmenu":case"mouseup":case"dragend":nc=!1,pi(be,l,ue);break;case"selectionchange":if(tc)break;case"keydown":case"keyup":pi(be,l,ue)}var mt;if(fo)e:{switch(e){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Ml?ci(e,l)&&(St="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(St="onCompositionStart");St&&(ar&&l.locale!=="ko"&&(Ml||St!=="onCompositionStart"?St==="onCompositionEnd"&&Ml&&(mt=_t()):(T=ue,ge="value"in T?T.value:T.textContent,Ml=!0)),Ge=_d(te,St),0<Ge.length&&(St=new nr(St,e,null,l,ue),be.push({event:St,listeners:Ge}),mt?St.data=mt:(mt=Wl(l),mt!==null&&(St.data=mt)))),(mt=Sf?ho(e,l):Ef(e,l))&&(St=_d(te,"onBeforeInput"),0<St.length&&(Ge=new nr("onBeforeInput","beforeinput",null,l,ue),be.push({event:Ge,listeners:St}),Ge.data=mt)),f0(be,e,te,l,ue)}dx(be,t)})}function Jo(e,t,l){return{instance:e,listener:t,currentTarget:l}}function _d(e,t){for(var l=t+"Capture",r=[];e!==null;){var d=e,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=jn(e,l),d!=null&&r.unshift(Jo(e,d,f)),d=jn(e,t),d!=null&&r.push(Jo(e,d,f))),e.tag===3)return r;e=e.return}return[]}function g0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hx(e,t,l,r,d){for(var f=t._reactName,j=[];l!==null&&l!==r;){var w=l,z=w.alternate,te=w.stateNode;if(w=w.tag,z!==null&&z===r)break;w!==5&&w!==26&&w!==27||te===null||(z=te,d?(te=jn(l,f),te!=null&&j.unshift(Jo(l,te,z))):d||(te=jn(l,f),te!=null&&j.push(Jo(l,te,z)))),l=l.return}j.length!==0&&e.push({event:t,listeners:j})}var x0=/\r\n?/g,b0=/\u0000|\uFFFD/g;function px(e){return(typeof e=="string"?e:""+e).replace(x0,`
|
|
50
|
-
`).replace(b0,"")}function mx(e,t){return t=px(t),px(e)===t}function Ft(e,t,l,r,d,f){switch(l){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||W(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&W(e,""+r);break;case"className":Ln(e,"class",r);break;case"tabIndex":Ln(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ln(e,l,r);break;case"style":Xe(e,r,f);break;case"data":if(t!=="object"){Ln(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=cn(""+r),e.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(l==="formAction"?(t!=="input"&&Ft(e,t,"name",d.name,d,null),Ft(e,t,"formEncType",d.formEncType,d,null),Ft(e,t,"formMethod",d.formMethod,d,null),Ft(e,t,"formTarget",d.formTarget,d,null)):(Ft(e,t,"encType",d.encType,d,null),Ft(e,t,"method",d.method,d,null),Ft(e,t,"target",d.target,d,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=cn(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=ct);break;case"onScroll":r!=null&&jt("scroll",e);break;case"onScrollEnd":r!=null&&jt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(l=r.__html,l!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=l}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}l=cn(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""+r):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":r===!0?e.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,r):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(l,r):e.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(l):e.setAttribute(l,r);break;case"popover":jt("beforetoggle",e),jt("toggle",e),kn(e,"popover",r);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":kn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Vt.get(l)||l,kn(e,l,r))}}function Oh(e,t,l,r,d,f){switch(l){case"style":Xe(e,r,f);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(c(61));if(l=r.__html,l!=null){if(d.children!=null)throw Error(c(60));e.innerHTML=l}}break;case"children":typeof r=="string"?W(e,r):(typeof r=="number"||typeof r=="bigint")&&W(e,""+r);break;case"onScroll":r!=null&&jt("scroll",e);break;case"onScrollEnd":r!=null&&jt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ct);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),t=l.slice(2,d?l.length-7:void 0),f=e[it]||null,f=f!=null?f[l]:null,typeof f=="function"&&e.removeEventListener(t,f,d),typeof r=="function")){typeof f!="function"&&f!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,r,d);break e}l in e?e[l]=r:r===!0?e.setAttribute(l,""):kn(e,l,r)}}}function ds(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",e),jt("load",e);var r=!1,d=!1,f;for(f in l)if(l.hasOwnProperty(f)){var j=l[f];if(j!=null)switch(f){case"src":r=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ft(e,t,f,j,l,null)}}d&&Ft(e,t,"srcSet",l.srcSet,l,null),r&&Ft(e,t,"src",l.src,l,null);return;case"input":jt("invalid",e);var w=f=j=d=null,z=null,te=null;for(r in l)if(l.hasOwnProperty(r)){var ue=l[r];if(ue!=null)switch(r){case"name":d=ue;break;case"type":j=ue;break;case"checked":z=ue;break;case"defaultChecked":te=ue;break;case"value":f=ue;break;case"defaultValue":w=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(c(137,t));break;default:Ft(e,t,r,ue,l,null)}}Zl(e,f,w,z,te,j,d,!1);return;case"select":jt("invalid",e),r=j=f=null;for(d in l)if(l.hasOwnProperty(d)&&(w=l[d],w!=null))switch(d){case"value":f=w;break;case"defaultValue":j=w;break;case"multiple":r=w;default:Ft(e,t,d,w,l,null)}t=f,l=j,e.multiple=!!r,t!=null?vn(e,!!r,t,!1):l!=null&&vn(e,!!r,l,!0);return;case"textarea":jt("invalid",e),f=d=r=null;for(j in l)if(l.hasOwnProperty(j)&&(w=l[j],w!=null))switch(j){case"value":r=w;break;case"defaultValue":d=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(91));break;default:Ft(e,t,j,w,l,null)}M(e,r,d,f);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(r=l[z],r!=null))switch(z){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ft(e,t,z,r,l,null)}return;case"dialog":jt("beforetoggle",e),jt("toggle",e),jt("cancel",e),jt("close",e);break;case"iframe":case"object":jt("load",e);break;case"video":case"audio":for(r=0;r<Po.length;r++)jt(Po[r],e);break;case"image":jt("error",e),jt("load",e);break;case"details":jt("toggle",e);break;case"embed":case"source":case"link":jt("error",e),jt("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(te in l)if(l.hasOwnProperty(te)&&(r=l[te],r!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ft(e,t,te,r,l,null)}return;default:if(Je(t)){for(ue in l)l.hasOwnProperty(ue)&&(r=l[ue],r!==void 0&&Oh(e,t,ue,r,l,void 0));return}}for(w in l)l.hasOwnProperty(w)&&(r=l[w],r!=null&&Ft(e,t,w,r,l,null))}function _0(e,t,l,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,j=null,w=null,z=null,te=null,ue=null;for(ie in l){var be=l[ie];if(l.hasOwnProperty(ie)&&be!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":z=be;default:r.hasOwnProperty(ie)||Ft(e,t,ie,null,r,be)}}for(var se in r){var ie=r[se];if(be=l[se],r.hasOwnProperty(se)&&(ie!=null||be!=null))switch(se){case"type":f=ie;break;case"name":d=ie;break;case"checked":te=ie;break;case"defaultChecked":ue=ie;break;case"value":j=ie;break;case"defaultValue":w=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:ie!==be&&Ft(e,t,se,ie,r,be)}}Nl(e,j,w,z,te,ue,f,d);return;case"select":ie=j=w=se=null;for(f in l)if(z=l[f],l.hasOwnProperty(f)&&z!=null)switch(f){case"value":break;case"multiple":ie=z;default:r.hasOwnProperty(f)||Ft(e,t,f,null,r,z)}for(d in r)if(f=r[d],z=l[d],r.hasOwnProperty(d)&&(f!=null||z!=null))switch(d){case"value":se=f;break;case"defaultValue":w=f;break;case"multiple":j=f;default:f!==z&&Ft(e,t,d,f,r,z)}t=w,l=j,r=ie,se!=null?vn(e,!!l,se,!1):!!r!=!!l&&(t!=null?vn(e,!!l,t,!0):vn(e,!!l,l?[]:"",!1));return;case"textarea":ie=se=null;for(w in l)if(d=l[w],l.hasOwnProperty(w)&&d!=null&&!r.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ft(e,t,w,null,r,d)}for(j in r)if(d=r[j],f=l[j],r.hasOwnProperty(j)&&(d!=null||f!=null))switch(j){case"value":se=d;break;case"defaultValue":ie=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(c(91));break;default:d!==f&&Ft(e,t,j,d,r,f)}Se(e,se,ie);return;case"option":for(var Be in l)if(se=l[Be],l.hasOwnProperty(Be)&&se!=null&&!r.hasOwnProperty(Be))switch(Be){case"selected":e.selected=!1;break;default:Ft(e,t,Be,null,r,se)}for(z in r)if(se=r[z],ie=l[z],r.hasOwnProperty(z)&&se!==ie&&(se!=null||ie!=null))switch(z){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Ft(e,t,z,se,r,ie)}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 tt in l)se=l[tt],l.hasOwnProperty(tt)&&se!=null&&!r.hasOwnProperty(tt)&&Ft(e,t,tt,null,r,se);for(te in r)if(se=r[te],ie=l[te],r.hasOwnProperty(te)&&se!==ie&&(se!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Ft(e,t,te,se,r,ie)}return;default:if(Je(t)){for(var Pt in l)se=l[Pt],l.hasOwnProperty(Pt)&&se!==void 0&&!r.hasOwnProperty(Pt)&&Oh(e,t,Pt,void 0,r,se);for(ue in r)se=r[ue],ie=l[ue],!r.hasOwnProperty(ue)||se===ie||se===void 0&&ie===void 0||Oh(e,t,ue,se,r,ie);return}}for(var F in l)se=l[F],l.hasOwnProperty(F)&&se!=null&&!r.hasOwnProperty(F)&&Ft(e,t,F,null,r,se);for(be in r)se=r[be],ie=l[be],!r.hasOwnProperty(be)||se===ie||se==null&&ie==null||Ft(e,t,be,se,r,ie)}function gx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var d=l[r],f=d.transferSize,j=d.initiatorType,w=d.duration;if(f&&w&&gx(j)){for(j=0,w=d.responseEnd,r+=1;r<l.length;r++){var z=l[r],te=z.startTime;if(te>w)break;var ue=z.transferSize,be=z.initiatorType;ue&&gx(be)&&(z=z.responseEnd,j+=ue*(z<w?1:(w-te)/(z-te)))}if(--r,t+=8*(f+j)/(d.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 Lh=null,zh=null;function yd(e){return e.nodeType===9?e:e.ownerDocument}function xx(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 bx(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 Ih(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 Uh=null;function v0(){var e=window.event;return e&&e.type==="popstate"?e===Uh?!1:(Uh=e,!0):(Uh=null,!1)}var _x=typeof setTimeout=="function"?setTimeout:void 0,j0=typeof clearTimeout=="function"?clearTimeout:void 0,yx=typeof Promise=="function"?Promise:void 0,w0=typeof queueMicrotask=="function"?queueMicrotask:typeof yx<"u"?function(e){return yx.resolve(null).then(e).catch(k0)}:_x;function k0(e){setTimeout(function(){throw e})}function Di(e){return e==="head"}function vx(e,t){var l=t,r=0;do{var d=l.nextSibling;if(e.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(r===0){e.removeChild(d),zc(t);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")Wo(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wo(l);for(var f=l.firstChild;f;){var j=f.nextSibling,w=f.nodeName;f[rs]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||l.removeChild(f),f=j}}else l==="body"&&Wo(e.ownerDocument.body);l=d}while(l);zc(t)}function jx(e,t){var l=e;e=0;do{var r=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=r}while(l)}function Hh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Hh(l),Es(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function N0(e,t,l,r){for(;e.nodeType===1;){var d=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[rs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=xl(e.nextSibling),e===null)break}return null}function S0(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=xl(e.nextSibling),e===null))return null;return e}function wx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=xl(e.nextSibling),e===null))return null;return e}function Bh(e){return e.data==="$?"||e.data==="$~"}function qh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function E0(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var r=function(){t(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function xl(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 Gh=null;function kx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return xl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Nx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Sx(e,t,l){switch(t=yd(l),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Wo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Es(e)}var bl=new Map,Ex=new Set;function vd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ja=R.d;R.d={f:T0,r:C0,D:A0,C:M0,L:R0,m:D0,X:L0,S:O0,M:z0};function T0(){var e=Ja.f(),t=fd();return e||t}function C0(e){var t=Is(e);t!==null&&t.tag===5&&t.type==="form"?Ym(t):Ja.r(e)}var Dc=typeof document>"u"?null:document;function Tx(e,t,l){var r=Dc;if(r&&typeof t=="string"&&t){var d=Wn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),Ex.has(d)||(Ex.add(d),e={rel:e,crossOrigin:l,href:t},r.querySelector(d)===null&&(t=r.createElement("link"),ds(t,"link",e),lt(t),r.head.appendChild(t)))}}function A0(e){Ja.D(e),Tx("dns-prefetch",e,null)}function M0(e,t){Ja.C(e,t),Tx("preconnect",e,t)}function R0(e,t,l){Ja.L(e,t,l);var r=Dc;if(r&&e&&t){var d='link[rel="preload"][as="'+Wn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Wn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Wn(l.imageSizes)+'"]')):d+='[href="'+Wn(e)+'"]';var f=d;switch(t){case"style":f=Oc(e);break;case"script":f=Lc(e)}bl.has(f)||(e=v({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),bl.set(f,e),r.querySelector(d)!==null||t==="style"&&r.querySelector(eu(f))||t==="script"&&r.querySelector(tu(f))||(t=r.createElement("link"),ds(t,"link",e),lt(t),r.head.appendChild(t)))}}function D0(e,t){Ja.m(e,t);var l=Dc;if(l&&e){var r=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Wn(r)+'"][href="'+Wn(e)+'"]',f=d;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Lc(e)}if(!bl.has(f)&&(e=v({rel:"modulepreload",href:e},t),bl.set(f,e),l.querySelector(d)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(tu(f)))return}r=l.createElement("link"),ds(r,"link",e),lt(r),l.head.appendChild(r)}}}function O0(e,t,l){Ja.S(e,t,l);var r=Dc;if(r&&e){var d=yn(r).hoistableStyles,f=Oc(e);t=t||"default";var j=d.get(f);if(!j){var w={loading:0,preload:null};if(j=r.querySelector(eu(f)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},l),(l=bl.get(f))&&$h(e,l);var z=j=r.createElement("link");lt(z),ds(z,"link",e),z._p=new Promise(function(te,ue){z.onload=te,z.onerror=ue}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,jd(j,t,r)}j={type:"stylesheet",instance:j,count:1,state:w},d.set(f,j)}}}function L0(e,t){Ja.X(e,t);var l=Dc;if(l&&e){var r=yn(l).hoistableScripts,d=Lc(e),f=r.get(d);f||(f=l.querySelector(tu(d)),f||(e=v({src:e,async:!0},t),(t=bl.get(d))&&Yh(e,t),f=l.createElement("script"),lt(f),ds(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(d,f))}}function z0(e,t){Ja.M(e,t);var l=Dc;if(l&&e){var r=yn(l).hoistableScripts,d=Lc(e),f=r.get(d);f||(f=l.querySelector(tu(d)),f||(e=v({src:e,async:!0,type:"module"},t),(t=bl.get(d))&&Yh(e,t),f=l.createElement("script"),lt(f),ds(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(d,f))}}function Cx(e,t,l,r){var d=(d=Ue.current)?vd(d):null;if(!d)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Oc(l.href),l=yn(d).hoistableStyles,r=l.get(t),r||(r={type:"style",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Oc(l.href);var f=yn(d).hoistableStyles,j=f.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,j),(f=d.querySelector(eu(e)))&&!f._p&&(j.instance=f,j.state.loading=5),bl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},bl.set(e,l),f||I0(d,e,l,j.state))),t&&r===null)throw Error(c(528,""));return j}if(t&&r!==null)throw Error(c(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Lc(l),l=yn(d).hoistableScripts,r=l.get(t),r||(r={type:"script",instance:null,count:0,state:null},l.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Oc(e){return'href="'+Wn(e)+'"'}function eu(e){return'link[rel="stylesheet"]['+e+"]"}function Ax(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function I0(e,t,l,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),ds(t,"link",l),lt(t),e.head.appendChild(t))}function Lc(e){return'[src="'+Wn(e)+'"]'}function tu(e){return"script[async]"+e}function Mx(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Wn(l.href)+'"]');if(r)return t.instance=r,lt(r),r;var d=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),lt(r),ds(r,"style",d),jd(r,l.precedence,e),t.instance=r;case"stylesheet":d=Oc(l.href);var f=e.querySelector(eu(d));if(f)return t.state.loading|=4,t.instance=f,lt(f),f;r=Ax(l),(d=bl.get(d))&&$h(r,d),f=(e.ownerDocument||e).createElement("link"),lt(f);var j=f;return j._p=new Promise(function(w,z){j.onload=w,j.onerror=z}),ds(f,"link",r),t.state.loading|=4,jd(f,l.precedence,e),t.instance=f;case"script":return f=Lc(l.src),(d=e.querySelector(tu(f)))?(t.instance=d,lt(d),d):(r=l,(d=bl.get(f))&&(r=v({},l),Yh(r,d)),e=e.ownerDocument||e,d=e.createElement("script"),lt(d),ds(d,"link",r),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,jd(r,l.precedence,e));return t.instance}function jd(e,t,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=r.length?r[r.length-1]:null,f=d,j=0;j<r.length;j++){var w=r[j];if(w.dataset.precedence===t)f=w;else if(f!==d)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wd=null;function Rx(e,t,l){if(wd===null){var r=new Map,d=wd=new Map;d.set(l,r)}else d=wd,r=d.get(l),r||(r=new Map,d.set(l,r));if(r.has(e))return r;for(r.set(e,null),l=l.getElementsByTagName(e),d=0;d<l.length;d++){var f=l[d];if(!(f[rs]||f[rn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var j=f.getAttribute(t)||"";j=e+j;var w=r.get(j);w?w.push(f):r.set(j,[f])}}return r}function Dx(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function U0(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ox(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function H0(e,t,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=Oc(r.href),f=t.querySelector(eu(d));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=kd.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=f,lt(f);return}f=t.ownerDocument||t,r=Ax(r),(d=bl.get(d))&&$h(r,d),f=f.createElement("link"),lt(f);var j=f;j._p=new Promise(function(w,z){j.onload=w,j.onerror=z}),ds(f,"link",r),l.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=kd.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Vh=0;function B0(e,t){return e.stylesheets&&e.count===0&&Sd(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&Sd(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Vh===0&&(Vh=62500*y0());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Sd(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Vh?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(d)}}:null}function kd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nd=null;function Sd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nd=new Map,t.forEach(q0,e),Nd=null,kd.call(e))}function q0(e,t){if(!(t.state.loading&4)){var l=Nd.get(e);if(l)var r=l.get(null);else{l=new Map,Nd.set(e,l);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var j=d[f];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),r=j)}r&&l.set(null,r)}d=t.instance,j=d.getAttribute("data-precedence"),f=l.get(j)||r,f===r&&l.set(null,d),l.set(j,d),this.count++,r=kd.bind(this),d.addEventListener("load",r),d.addEventListener("error",r),f?f.parentNode.insertBefore(d,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var nu={$$typeof:V,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function G0(e,t,l,r,d,f,j,w,z){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=zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zt(0),this.hiddenUpdates=zt(null),this.identifierPrefix=r,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Lx(e,t,l,r,d,f,j,w,z,te,ue,be){return e=new G0(e,t,l,j,z,te,ue,be,w),t=1,f===!0&&(t|=24),f=qn(3,null,null,t),e.current=f,f.stateNode=e,t=To(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:l,cache:t},qa(f),e}function zx(e){return e?(e=gi,e):gi}function Ix(e,t,l,r,d,f){d=zx(d),r.context===null?r.context=d:r.pendingContext=d,r=oa(t),r.payload={element:l},f=f===void 0?null:f,f!==null&&(r.callback=f),l=ua(e,r,t),l!==null&&(Zs(l,e,t),Rs(l,e,t))}function Ux(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Xh(e,t){Ux(e,t),(e=e.alternate)&&Ux(e,t)}function Hx(e){if(e.tag===13||e.tag===31){var t=Ma(e,67108864);t!==null&&Zs(t,e,67108864),Xh(e,67108864)}}function Bx(e){if(e.tag===13||e.tag===31){var t=al();t=an(t);var l=Ma(e,t);l!==null&&Zs(l,e,t),Xh(e,t)}}var Ed=!0;function $0(e,t,l,r){var d=I.T;I.T=null;var f=R.p;try{R.p=2,Qh(e,t,l,r)}finally{R.p=f,I.T=d}}function Y0(e,t,l,r){var d=I.T;I.T=null;var f=R.p;try{R.p=8,Qh(e,t,l,r)}finally{R.p=f,I.T=d}}function Qh(e,t,l,r){if(Ed){var d=Kh(r);if(d===null)Dh(e,t,r,Td,l),Gx(e,r);else if(X0(d,e,t,l,r))r.stopPropagation();else if(Gx(e,r),t&4&&-1<V0.indexOf(e)){for(;d!==null;){var f=Is(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var j=on(f.pendingLanes);if(j!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;j;){var z=1<<31-Et(j);w.entanglements[1]|=z,j&=~z}fa(f),(Ut&6)===0&&(ud=De()+500,Fo(0))}}break;case 31:case 13:w=Ma(f,2),w!==null&&Zs(w,f,2),fd(),Xh(f,2)}if(f=Kh(r),f===null&&Dh(e,t,r,Td,l),f===d)break;d=f}d!==null&&r.stopPropagation()}else Dh(e,t,r,null,l)}}function Kh(e){return e=fn(e),Zh(e)}var Td=null;function Zh(e){if(Td=null,e=Zt(e),e!==null){var t=u(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(t),e!==null)return e;e=null}else if(l===31){if(e=g(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Td=e,null}function qx(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($e()){case ht:return 2;case Ee:return 8;case Te:case Oe:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Fh=!1,Oi=null,Li=null,zi=null,su=new Map,lu=new Map,Ii=[],V0="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 Gx(e,t){switch(e){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Li=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":su.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lu.delete(t.pointerId)}}function au(e,t,l,r,d,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:l,eventSystemFlags:r,nativeEvent:f,targetContainers:[d]},t!==null&&(t=Is(t),t!==null&&Hx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function X0(e,t,l,r,d){switch(t){case"focusin":return Oi=au(Oi,e,t,l,r,d),!0;case"dragenter":return Li=au(Li,e,t,l,r,d),!0;case"mouseover":return zi=au(zi,e,t,l,r,d),!0;case"pointerover":var f=d.pointerId;return su.set(f,au(su.get(f)||null,e,t,l,r,d)),!0;case"gotpointercapture":return f=d.pointerId,lu.set(f,au(lu.get(f)||null,e,t,l,r,d)),!0}return!1}function $x(e){var t=Zt(e.target);if(t!==null){var l=u(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,Qn(e.priority,function(){Bx(l)});return}}else if(t===31){if(t=g(l),t!==null){e.blockedOn=t,Qn(e.priority,function(){Bx(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Kh(e.nativeEvent);if(l===null){l=e.nativeEvent;var r=new l.constructor(l.type,l);Mt=r,l.target.dispatchEvent(r),Mt=null}else return t=Is(l),t!==null&&Hx(t),e.blockedOn=l,!1;t.shift()}return!0}function Yx(e,t,l){Cd(e)&&l.delete(t)}function Q0(){Fh=!1,Oi!==null&&Cd(Oi)&&(Oi=null),Li!==null&&Cd(Li)&&(Li=null),zi!==null&&Cd(zi)&&(zi=null),su.forEach(Yx),lu.forEach(Yx)}function Ad(e,t){e.blockedOn===t&&(e.blockedOn=null,Fh||(Fh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Q0)))}var Md=null;function Vx(e){Md!==e&&(Md=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Md===e&&(Md=null);for(var t=0;t<e.length;t+=3){var l=e[t],r=e[t+1],d=e[t+2];if(typeof r!="function"){if(Zh(r||l)===null)continue;break}var f=Is(l);f!==null&&(e.splice(t,3),t-=3,Kf(f,{pending:!0,data:d,method:l.method,action:r},r,d))}}))}function zc(e){function t(z){return Ad(z,e)}Oi!==null&&Ad(Oi,e),Li!==null&&Ad(Li,e),zi!==null&&Ad(zi,e),su.forEach(t),lu.forEach(t);for(var l=0;l<Ii.length;l++){var r=Ii[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ii.length&&(l=Ii[0],l.blockedOn===null);)$x(l),l.blockedOn===null&&Ii.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var d=l[r],f=l[r+1],j=d[it]||null;if(typeof f=="function")j||Vx(l);else if(j){var w=null;if(f&&f.hasAttribute("formAction")){if(d=f,j=f[it]||null)w=j.formAction;else if(Zh(d)!==null)continue}else w=j.action;typeof w=="function"?l[r+1]=w:(l.splice(r,3),r-=3),Vx(l)}}}function Xx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(j){return d=j})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Ph(e){this._internalRoot=e}Rd.prototype.render=Ph.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var l=t.current,r=al();Ix(l,r,e,t,null,null)},Rd.prototype.unmount=Ph.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ix(e.current,2,null,e,null,null),fd(),t[un]=null}};function Rd(e){this._internalRoot=e}Rd.prototype.unstable_scheduleHydration=function(e){if(e){var t=gs();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ii.length&&t!==0&&t<Ii[l].priority;l++);Ii.splice(l,0,e),l===0&&$x(e)}};var Qx=s.version;if(Qx!=="19.2.8")throw Error(c(527,Qx,"19.2.8"));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var K0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dd.isDisabled&&Dd.supportsFiber)try{pt=Dd.inject(K0),At=Dd}catch{}}return ru.createRoot=function(e,t){if(!o(e))throw Error(c(299));var l=!1,r="",d=eg,f=tg,j=ng;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError)),t=Lx(e,1,!1,null,null,l,r,null,d,f,j,Xx),e[un]=t.current,Rh(e),new Ph(t)},ru.hydrateRoot=function(e,t,l){if(!o(e))throw Error(c(299));var r=!1,d="",f=eg,j=tg,w=ng,z=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(f=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),t=Lx(e,1,!0,t,l??null,r,d,z,f,j,w,Xx),t.context=zx(null),l=t.current,r=al(),r=an(r),d=oa(r),d.callback=null,ua(l,d,r),l=r,t.current.lanes=l,J(t,l),fa(t),e[un]=t.current,Rh(e),new Rd(t)},ru.version="19.2.8",ru}var lb;function av(){if(lb)return tp.exports;lb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),tp.exports=lv(),tp.exports}var iv=av();const C_=1;function rv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${A_(n)}`}function cv(n){const s=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),i=`${s.replace(/^-+|-+$/g,"")||"project"}-${A_(n)}`,c=rv(n);return[s,i].filter(o=>o!==c)}function A_(n){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return ov(s?n.toLowerCase():n)}function ov(n){let s=3735928559,i=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);s=Math.imul(s^o,2654435761),i=Math.imul(i^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&i)+(s>>>0)).toString(36)}var ni,Zc,Fc,Pc,Jc,Ru,Wc,_f,M_;class uv{constructor(s){Nn(this,_f);Nn(this,ni,null);Nn(this,Zc,new Set);Nn(this,Fc,500);Nn(this,Pc,null);Nn(this,Jc,!1);Nn(this,Ru,null);Nn(this,Wc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Ht(this,Wc,s)}connect(){if(st(this,Jc))return;const s=new WebSocket(this.url);Ht(this,ni,s),s.addEventListener("open",()=>{var i,c;Ht(this,Fc,500),this.send({type:"hello",protocol:C_,clientName:"ccv-web"}),(i=st(this,Ru))==null||i.call(this),(c=st(this,Wc))==null||c.call(this)}),s.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of st(this,Zc))o(c)}),s.addEventListener("close",()=>{var i;Ht(this,ni,null),(i=st(this,Wc))==null||i.call(this),Yn(this,_f,M_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Ht(this,Ru,s)}on(s){return st(this,Zc).add(s),()=>st(this,Zc).delete(s)}send(s){var i;((i=st(this,ni))==null?void 0:i.readyState)===WebSocket.OPEN&&st(this,ni).send(JSON.stringify(s))}get connected(){var s;return((s=st(this,ni))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Ht(this,Jc,!0),(s=st(this,ni))==null||s.close()}}ni=new WeakMap,Zc=new WeakMap,Fc=new WeakMap,Pc=new WeakMap,Jc=new WeakMap,Ru=new WeakMap,Wc=new WeakMap,_f=new WeakSet,M_=function(){if(st(this,Jc)||st(this,Pc)!==null)return;const s=st(this,Fc);Ht(this,Fc,Math.min(s*2,1e4)),Ht(this,Pc,window.setTimeout(()=>{Ht(this,Pc,null),this.connect()},s))};const dv=1,R_="ccv:relay",tf="ccv:relay.host";function fv(){try{const n=localStorage.getItem(R_);if(!n)return null;const s=JSON.parse(n);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function D_(){localStorage.removeItem(R_)}var ya,eo,va,to,no,Qi,Er,Tr,Ki,Cr,so,Ar,Mr,gn,qi,kp,O_,Nr,Np;class hv{constructor(s){Nn(this,gn);Nn(this,ya,null);Nn(this,eo,new Set);Nn(this,va,null);Nn(this,to,null);Nn(this,no,500);Nn(this,Qi,null);Nn(this,Er,!1);Nn(this,Tr,!1);Nn(this,Ki,!1);Nn(this,Cr,null);Nn(this,so,"Подключаемся…");Nn(this,Ar,0);Nn(this,Mr,[]);this.session=s}get connected(){return st(this,Tr)&&st(this,Ki)}get statusText(){return st(this,so)}get hostId(){return st(this,Cr)}on(s){return st(this,eo).add(s),()=>st(this,eo).delete(s)}onReconnect(s){Ht(this,to,s)}onStatus(s){Ht(this,va,s)}connect(){st(this,Er)||Yn(this,gn,kp).call(this)}send(s){if(!st(this,Tr)){st(this,Mr).length<64&&st(this,Mr).push(s);return}Yn(this,gn,Nr).call(this,{t:"client.frame",body:s})}close(){var s;Ht(this,Er,!0),st(this,Qi)!==null&&window.clearTimeout(st(this,Qi)),(s=st(this,ya))==null||s.close()}}ya=new WeakMap,eo=new WeakMap,va=new WeakMap,to=new WeakMap,no=new WeakMap,Qi=new WeakMap,Er=new WeakMap,Tr=new WeakMap,Ki=new WeakMap,Cr=new WeakMap,so=new WeakMap,Ar=new WeakMap,Mr=new WeakMap,gn=new WeakSet,qi=function(s){var i;st(this,so)!==s&&(Ht(this,so,s),(i=st(this,va))==null||i.call(this))},kp=async function(){if(st(this,ya))return;if(!st(this,Cr))try{Ht(this,Cr,await pv(this.session.token))}catch(c){Yn(this,gn,qi).call(this,c instanceof Error?c.message:String(c)),Yn(this,gn,Np).call(this);return}const s=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${s}://${location.host}/relay/client`);Ht(this,ya,i),i.addEventListener("open",()=>{Yn(this,gn,Nr).call(this,{t:"client.hello",protocol:dv,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Yn(this,gn,O_).call(this,o)}),i.addEventListener("close",()=>{var c;Ht(this,ya,null),Ht(this,Tr,!1),Ht(this,Ki,!1),Yn(this,gn,qi).call(this,"Нет связи с сервером"),(c=st(this,va))==null||c.call(this),Yn(this,gn,Np).call(this)}),i.addEventListener("error",()=>i.close())},O_=function(s){var i,c,o,u,h,g,m;switch(s.t){case"client.ok":Ht(this,no,500),Yn(this,gn,Nr).call(this,{t:"client.attach",hostId:st(this,Cr)??"",...st(this,Ar)>0?{sinceRseq:st(this,Ar)}:{}});return;case"client.attached":Ht(this,Tr,!0),Ht(this,Ki,s.online),Ht(this,Ar,s.rseq),Yn(this,gn,qi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),Yn(this,gn,Nr).call(this,{t:"client.frame",body:{type:"hello",protocol:C_,clientName:"ccv-web-relay"}});const x=st(this,Mr);Ht(this,Mr,[]);for(const _ of x)Yn(this,gn,Nr).call(this,{t:"client.frame",body:_});(i=st(this,to))==null||i.call(this),(c=st(this,va))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Ht(this,Ar,s.rseq);const _=s.body;for(const v of st(this,eo))v(_);return}case"host.online":Ht(this,Ki,!0),Yn(this,gn,qi).call(this,"Хост на связи"),(o=st(this,to))==null||o.call(this),(u=st(this,va))==null||u.call(this);return;case"host.offline":Ht(this,Ki,!1),Yn(this,gn,qi).call(this,"Компьютер не на связи"),(h=st(this,va))==null||h.call(this);return;case"ping":Yn(this,gn,Nr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){D_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(tf),Yn(this,gn,qi).call(this,"Этот компьютер отвязан от аккаунта"),Ht(this,Er,!0),(g=st(this,ya))==null||g.close();return}s.code!=="offline"&&Yn(this,gn,qi).call(this,s.message),(m=st(this,va))==null||m.call(this);return}},Nr=function(s){var i;((i=st(this,ya))==null?void 0:i.readyState)===WebSocket.OPEN&&st(this,ya).send(JSON.stringify(s))},Np=function(){if(st(this,Er)||st(this,Qi)!==null)return;const s=st(this,no);Ht(this,no,Math.min(s*2,1e4)),Ht(this,Qi,window.setTimeout(()=>{Ht(this,Qi,null),Yn(this,gn,kp).call(this)},s))};async function pv(n){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(tf,s),s;const i=localStorage.getItem(tf);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw D_(),location.href="/login",new Error("нужен вход");const u=(await c.json()).hosts??[];if(u.length===1&&u[0])return localStorage.setItem(tf,u[0].id),u[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function nf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const mv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function gv(){if(nf()==="local")return new uv(mv);const n=fv();return n?new hv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const L_="ccv:drafts",xv=40,bv=2e4,_v=500;let bu=null,_u=null;function Gp(){if(bu)return bu;const n=new Map;try{const s=localStorage.getItem(L_);if(s){const i=JSON.parse(s);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return bu=n,window.addEventListener("pagehide",I_),n}function yu(n){return Gp().get(n)??""}function af(n,s){const i=Gp(),c=s.slice(0,bv),o=i.has(n);if(o&&i.delete(n),c!=="")i.set(n,c);else if(!o)return;for(;i.size>xv;){const u=i.keys().next();if(u.done)break;i.delete(u.value)}jv(),vv()}function z_(){const n=new Set;for(const s of Gp().keys())n.add(s.startsWith("side:")?s.slice(5):s);return[...n].sort()}const Sp=new Set;let ab="";function yv(n){return Sp.add(n),()=>Sp.delete(n)}function vv(){const n=z_(),s=n.join(`
|
|
51
|
-
`);if(s!==ab){ab=s;for(const i of Sp)i(n)}}function jv(){_u===null&&(_u=window.setTimeout(I_,_v))}function I_(){if(_u!==null&&window.clearTimeout(_u),_u=null,!!bu)try{localStorage.setItem(L_,JSON.stringify(Object.fromEntries(bu)))}catch{}}const fs={items:[],pending:[],lastSeq:0,contextTokens:null},Zi={entries:[],total:0,loading:!1};function $p(n){var s;return((s=n.entries[0])==null?void 0:s.seq)??1}function U_(n){return n.total>0&&$p(n)>1}function H_(n,s){const i=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...s.entries.filter(o=>!i.has(o.seq))].sort((o,u)=>o.seq-u.seq),total:s.total,loading:!1}}function Yp(n){return vu(fs,n).items.map(s=>({...s,id:`h:${s.id}`}))}function vu(n,s){let i=n;for(const c of s)c.seq<=i.lastSeq||(i={...wv(i,c.event,c.seq),lastSeq:c.seq});return i}function wv(n,s,i){var o,u;const c=n.items;switch(s.kind){case"user.message":return ha(n,{id:`u${i}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(m=>m.id===s.blockId);if(h===-1)return ha(n,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const g=c[h];return Ic(n,h,{...g,text:g.text+s.text})}case"assistant.text":{const h=c.findIndex(m=>m.id===s.blockId),g={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?ha(n,g):Ic(n,h,g)}case"thinking.delta":{const h=c.findIndex(m=>m.id===s.blockId);if(h===-1)return ha(n,{id:s.blockId,kind:"thinking",text:s.text});const g=c[h];return Ic(n,h,{...g,text:g.text+s.text})}case"assistant.thinking":{const h=c.findIndex(m=>m.id===s.blockId),g={id:s.blockId,kind:"thinking",text:s.text};return h===-1?ha(n,g):Ic(n,h,g)}case"tool.use":return ha(n,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(m=>m.kind==="tool"&&m.toolUseId===s.toolUseId);if(h===-1)return n;const g=c[h];return Ic(n,h,{...g,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(m=>m.requestId===s.requestId),g=n.pending.filter(m=>m.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const m=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(m!==-1){const x=c[m];return Ic({...n,pending:g},m,{...x,answers:s.answers})}}return s.decision==="allow"?{...n,pending:g}:ha({...n,pending:g},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=n.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),g=s.contextTokens??n.contextTokens;return ha({...n,items:h,contextTokens:g},{id:`r${i}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((u=s.usage)==null?void 0:u.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?n:ha(n,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ha(n,{id:`e${i}`,kind:"notice",tone:"error",text:s.message});case"state":return n;case"rewound":return n;default:return n}}function B_(n,s){let i=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(i===s)return n.slice(0,c);i++}return n}function q_(n,s,i){const c=s-i;if(c<=0)return[];let o=0;for(let u=0;u<n.length;u++)if(n[u].kind==="user"){if(o===c)return n.slice(0,u);o++}return n}function ha(n,s){return{...n,items:[...n.items,s]}}function Ic(n,s,i){const c=n.items.slice();return c[s]=i,{...n,items:c}}const Ep="ccv:theme",ap=["system","light","dark"];function kv(){const[n,s]=b.useState(Nv);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{var g;const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light",(g=document.querySelector('meta[name="theme-color"]'))==null||g.setAttribute("content",h?"#101115":"#f3f4f0")};return u(),o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[n]);const i=b.useCallback(o=>{try{localStorage.setItem(Ep,o)}catch{}s(o)},[]),c=b.useCallback(()=>{s(o=>{const u=ap[(ap.indexOf(o)+1)%ap.length];try{localStorage.setItem(Ep,u)}catch{}return u})},[]);return[n,i,c]}function Nv(){try{const n=localStorage.getItem(Ep);if(n==="gpt")return"dark";if(n==="light"||n==="dark"||n==="system")return n}catch{}return"dark"}const Vp=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],G_=[{value:"default",hint:"чтение свободно, изменения и выход из песочницы — с разрешения"},{value:"acceptEdits",hint:"работа внутри проекта, выход за границы — с разрешения"},{value:"plan",hint:"песочница только для чтения; изменения требуют разрешения"},{value:"bypassPermissions",hint:"полный доступ без подтверждений"}],$_=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Rr={sidebar:{side:"left",min:200,max:520,width:276,label:"сессий"},files:{side:"left",min:180,max:560,width:260,label:"файлов"},search:{side:"left",min:220,max:640,width:320,label:"поиска"},git:{side:"left",min:220,max:640,width:320,label:"истории"},ask:{side:"right",min:260,max:720,width:380,label:"вопроса"},comparison:{side:"right",min:320,max:1200,width:460,label:"второго разговора"}},ib=320,Y_="ccv:panes";function Sv(n){return`--${n}-w`}function V_(n,s){const i=Rr[n];return Math.round(Math.min(i.max,Math.max(i.min,s)))}function Ev(){const n={};for(const s of Object.keys(Rr))n[s]=Rr[s].width;try{const s=localStorage.getItem(Y_);if(s){const i=JSON.parse(s);for(const c of Object.keys(Rr)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=V_(c,o))}}}catch{}return n}function Tv(){const[n,s]=b.useState(Ev),i=b.useCallback(h=>{try{localStorage.setItem(Y_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,g)=>{s(m=>{const x=V_(h,g);if(m[h]===x)return m;const _={...m,[h]:x};return i(_),_})},[i]),o=b.useCallback(h=>{s(g=>{const m={...g,[h]:Rr[h].width};return i(m),m})},[i]),u={};for(const h of Object.keys(Rr))u[Sv(h)]=`${n[h]}px`;return{widths:n,style:u,setWidth:c,reset:o}}const ip=260,X_=120,Cv=200,rb="ccv:terminal-h";function cb(n,s){return Math.round(Math.min(s,Math.max(X_,n)))}function Av(){const[n,s]=b.useState(()=>{try{const u=localStorage.getItem(rb);if(u){const h=Number(u);if(Number.isFinite(h))return cb(h,1/0)}}catch{}return ip}),i=b.useCallback(u=>{try{localStorage.setItem(rb,String(u))}catch{}},[]),c=b.useCallback((u,h)=>{const g=cb(u,h);s(m=>m===g?m:(i(g),g))},[i]),o=b.useCallback(()=>{s(ip),i(ip)},[i]);return{height:n,setHeight:c,reset:o}}function yf(n){const[s,i]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return b.useEffect(()=>{const c=window.matchMedia(n),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),s}const Mv=500,Rv=6;function Dv({onLongPress:n,onClick:s,disabled:i=!1,thresholdMs:c=Mv,moveCancelPx:o=Rv}){const u=b.useRef(null),[h,g]=b.useState(!1),m=b.useCallback(()=>{u.current&&window.clearTimeout(u.current.timer),u.current=null,g(!1)},[]),x=b.useCallback(C=>{if(i||C.button!==0)return;const D={timer:0,x:C.clientX,y:C.clientY,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,g(!1),n()},c),u.current=D,g(!0)},[i,c,n]),_=b.useCallback(C=>{const D=u.current;!D||D.fired||Math.hypot(C.clientX-D.x,C.clientY-D.y)>o&&m()},[o,m]),v=b.useCallback(()=>{u.current&&!u.current.fired?m():g(!1)},[m]),y=b.useCallback(C=>{var D;if((D=u.current)!=null&&D.fired){u.current=null,C.preventDefault();return}if(!i){if(C.shiftKey){n();return}s()}},[i,s,n]),S=b.useCallback(C=>{C.preventDefault()},[]),k=b.useCallback(C=>{i||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n())},[i,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:_,onPointerUp:v,onPointerCancel:v,onPointerLeave:v,onClick:y,onContextMenu:S,onKeyDown:k}}}const Ov={height:0,offsetTop:0,offsetLeft:0};function ob(){if(typeof window>"u")return Ov;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Lv(n){const[s,i]=b.useState(ob);return b.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const u=ob();i(h=>h.height===u.height&&h.offsetTop===u.offsetTop&&h.offsetLeft===u.offsetLeft?h:u)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[n]),s}function Xp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zr=Xp();function Q_(n){zr=n}var Sr={exec:()=>null};function Uc(n){let s=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=s[c];return o||(o=n(c),s[c]=o),o}}function Ct(n,s=""){let i=typeof n=="string"?n:n.source,c={replace:(o,u)=>{let h=typeof u=="string"?u:u.source;return h=h.replace(js.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,s)};return c}var zv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),js={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Uc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Uc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Uc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Uc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Uc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Uc(n=>new RegExp(`^ {0,${n}}>`))},Iv=/^(?:[ \t]*(?:\n|$))+/,Uv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Du=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,K_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Z_=Ct(K_).replace(/bull/g,Qp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),qv=Ct(K_).replace(/bull/g,Qp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Gv=/^[^\n]+/,Zp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$v=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yv=Ct(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Qp).getRegex(),vf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vv=Ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Fp).replace("tag",vf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),F_=n=>Ct(Kp).replace("hr",Du).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex(),Xv=F_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Qv=F_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Kv=Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qv).getRegex(),Pp={blockquote:Kv,code:Uv,def:$v,fences:Hv,heading:Bv,hr:Du,html:Vv,lheading:Z_,list:Yv,newline:Iv,paragraph:Xv,table:Sr,text:Gv},ub=Ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Du).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex(),Zv={...Pp,lheading:qv,table:ub,paragraph:Ct(Kp).replace("hr",Du).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ub).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",vf).getRegex()},Fv={...Pp,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Kp).replace("hr",Du).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",Z_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,P_=/^( {2,}|\\)\n(?!\s*$)/,Wv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ao=/[\p{P}\p{S}]/u,jf=/[\s\p{P}\p{S}]/u,Jp=/[^\s\p{P}\p{S}]/u,ej=Ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jf).getRegex(),J_=/(?!~)[\p{P}\p{S}]/u,tj=/(?!~)[\s\p{P}\p{S}]/u,nj=/(?:[^\s\p{P}\p{S}]|~)/u,sj=Ct(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",zv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),W_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lj=Ct(W_,"u").replace(/punct/g,ao).getRegex(),aj=Ct(W_,"u").replace(/punct/g,J_).getRegex(),ey="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ij=Ct(ey,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,ao).getRegex(),rj=Ct(ey,"gu").replace(/notPunctSpace/g,nj).replace(/punctSpace/g,tj).replace(/punct/g,J_).getRegex(),cj=Ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,ao).getRegex(),oj=Ct(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ao).getRegex(),uj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",dj=Ct(uj,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,jf).replace(/punct/g,ao).getRegex(),fj=Ct(/\\(punct)/,"gu").replace(/punct/g,ao).getRegex(),hj=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pj=Ct(Fp).replace("(?:-->|$)","-->").getRegex(),mj=Ct("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gj=Ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",rf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ty=Ct(/^!?\[(label)\]\[(ref)\]/).replace("label",rf).replace("ref",Zp).getRegex(),ny=Ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zp).getRegex(),xj=Ct("reflink|nolink(?!\\()","g").replace("reflink",ty).replace("nolink",ny).getRegex(),db=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wp={_backpedal:Sr,anyPunctuation:fj,autolink:hj,blockSkip:sj,br:P_,code:Jv,del:Sr,delLDelim:Sr,delRDelim:Sr,emStrongLDelim:lj,emStrongRDelimAst:ij,emStrongRDelimUnd:cj,escape:Pv,link:gj,nolink:ny,punctuation:ej,reflink:ty,reflinkSearch:xj,tag:mj,text:Wv,url:Sr},bj={...Wp,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",rf).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rf).getRegex()},Tp={...Wp,emStrongRDelimAst:rj,emStrongLDelim:aj,delLDelim:oj,delRDelim:dj,url:Ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",db).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",db).getRegex()},_j={...Tp,br:Ct(P_).replace("{2,}","*").getRegex(),text:Ct(Tp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Od={normal:Pp,gfm:Zv,pedantic:Fv},cu={normal:Wp,gfm:Tp,breaks:_j,pedantic:bj},yj={"&":"&","<":"<",">":">",'"':""","'":"'"},fb=n=>yj[n];function xa(n,s){if(s){if(js.escapeTest.test(n))return n.replace(js.escapeReplace,fb)}else if(js.escapeTestNoEncode.test(n))return n.replace(js.escapeReplaceNoEncode,fb);return n}function hb(n){try{n=encodeURI(n).replace(js.percentDecode,"%")}catch{return null}return n}function pb(n,s){var u;let i=n.replace(js.findPipe,(h,g,m)=>{let x=!1,_=g;for(;--_>=0&&m[_]==="\\";)x=!x;return x?"|":" |"}),c=i.split(js.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((u=c.at(-1))!=null&&u.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(js.slashPipe,"|");return c}function Hi(n,s,i){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===s;)o++;return n.slice(0,c-o)}function mb(n){let s=n.split(`
|
|
53
|
-
`),i=s.length-1;for(;i>=0&&js.blankLine.test(s[i]);)i--;return s.length-i<=2?n:s.slice(0,i+1).join(`
|
|
54
|
-
`)}function vj(n,s){if(n.indexOf(s[1])===-1)return-1;let i=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===s[0])i++;else if(n[c]===s[1]&&(i--,i<0))return c;return i>0?-2:-1}function jj(n,s=0){let i=s,c="";for(let o of n)if(o===" "){let u=4-i%4;c+=" ".repeat(u),i+=u}else c+=o,i++;return c}function gb(n,s,i,c,o){let u=s.href,h=s.title||null,g=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let m={type:n[0].charAt(0)==="!"?"image":"link",raw:i,href:u,title:h,text:g,tokens:c.inlineTokens(g)};return c.state.inLink=!1,m}function wj(n,s,i){let c=n.match(i.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
|
|
55
|
-
`).map(u=>{let h=u.match(i.other.beginningSpace);if(h===null)return u;let[g]=h;return g.length>=o.length?u.slice(o.length):u}).join(`
|
|
56
|
-
`)}var cf=class{constructor(n){Jt(this,"options");Jt(this,"rules");Jt(this,"lexer");this.options=n||zr}space(n){let s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){let s=this.rules.block.code.exec(n);if(s){let i=this.options.pedantic?s[0]:mb(s[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(n){let s=this.rules.block.fences.exec(n);if(s){let i=s[0],c=wj(i,s[3]||"",this.rules);return{type:"code",raw:i,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(n){let s=this.rules.block.heading.exec(n);if(s){let i=s[2].trim();if(this.rules.other.endingHash.test(i)){let c=Hi(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:Hi(s[0],`
|
|
57
|
-
`),depth:s[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(n){let s=this.rules.block.hr.exec(n);if(s)return{type:"hr",raw:Hi(s[0],`
|
|
58
|
-
`)}}blockquote(n){let s=this.rules.block.blockquote.exec(n);if(s){let i=Hi(s[0],`
|
|
59
|
-
`).split(`
|
|
60
|
-
`),c="",o="",u=[];for(;i.length>0;){let h=!1,g=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))g.push(i[m]),h=!0;else if(!h)g.push(i[m]);else break;i=i.slice(m);let x=g.join(`
|
|
61
|
-
`),_=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${x}`:x,o=o?`${o}
|
|
64
|
-
${_}`:_;let v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,u,!0),this.lexer.state.top=v,i.length===0)break;let y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let S=y,k=S.raw+`
|
|
65
|
-
`+i.join(`
|
|
66
|
-
`),C=this.blockquote(k);u[u.length-1]=C,c=c.substring(0,c.length-S.raw.length)+C.raw,o=o.substring(0,o.length-S.text.length)+C.text;break}else if((y==null?void 0:y.type)==="list"){let S=y,k=S.raw+`
|
|
67
|
-
`+i.join(`
|
|
68
|
-
`),C=this.list(k);u[u.length-1]=C,c=c.substring(0,c.length-y.raw.length)+C.raw,o=o.substring(0,o.length-S.raw.length)+C.raw,i=k.substring(u.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:u,text:o}}}list(n){let s=this.rules.block.list.exec(n);if(s){let i=s[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let u=this.rules.other.listItemRegex(i),h=!1;for(;n;){let m=!1,x="",_="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;x=s[0],n=n.substring(x.length);let v=jj(s[2].split(`
|
|
70
|
-
`,1)[0],s[1].length),y=n.split(`
|
|
71
|
-
`,1)[0],S=!v.trim(),k=0;if(this.options.pedantic?(k=2,_=v.trimStart()):S?k=s[1].length+1:(k=v.search(this.rules.other.nonSpaceChar),k=k>4?1:k,_=v.slice(k),k+=s[1].length),S&&this.rules.other.blankLine.test(y)&&(x+=y+`
|
|
72
|
-
`,n=n.substring(y.length+1),m=!0),!m){let C=this.rules.other.nextBulletRegex(k),D=this.rules.other.hrRegex(k),q=this.rules.other.fencesBeginRegex(k),G=this.rules.other.headingBeginRegex(k),V=this.rules.other.htmlBeginRegex(k),L=this.rules.other.blockquoteBeginRegex(k);for(;n;){let Y=n.split(`
|
|
73
|
-
`,1)[0],E;if(y=Y,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),E=y):E=y.replace(this.rules.other.tabCharGlobal," "),q.test(y)||G.test(y)||V.test(y)||L.test(y)||C.test(y)||D.test(y))break;if(E.search(this.rules.other.nonSpaceChar)>=k||!y.trim())_+=`
|
|
74
|
-
`+E.slice(k);else{if(S||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||q.test(v)||G.test(v)||D.test(v))break;_+=`
|
|
75
|
-
`+y}S=!y.trim(),x+=Y+`
|
|
76
|
-
`,n=n.substring(Y.length+1),v=E.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=x}let g=o.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let m of o.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let x=m.tokens[0];if(m.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(m.raw);if(_){let v={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};m.checked=v.checked,o.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=v.raw+m.tokens[0].raw,m.tokens[0].text=v.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(v)):m.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):m.tokens.unshift(v)}}else m.task&&(m.task=!1);if(!o.loose){let _=m.tokens.filter(y=>y.type==="space"),v=_.length>0&&_.some(y=>this.rules.other.anyLine.test(y.raw));o.loose=v}}if(o.loose)for(let m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(n){let s=this.rules.block.html.exec(n);if(s){let i=mb(s[0]);return{type:"html",block:!0,raw:i,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:i}}}def(n){let s=this.rules.block.def.exec(n);if(s){let i=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:i,raw:Hi(s[0],`
|
|
77
|
-
`),href:c,title:o}}}table(n){var h;let s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let i=pb(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],u={type:"table",raw:Hi(s[0],`
|
|
79
|
-
`),header:[],align:[],rows:[]};if(i.length===c.length){for(let g of c)this.rules.other.tableAlignRight.test(g)?u.align.push("right"):this.rules.other.tableAlignCenter.test(g)?u.align.push("center"):this.rules.other.tableAlignLeft.test(g)?u.align.push("left"):u.align.push(null);for(let g=0;g<i.length;g++)u.header.push({text:i[g],tokens:this.lexer.inline(i[g]),header:!0,align:u.align[g]});for(let g of o)u.rows.push(pb(g,u.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[x]})));return u}}lheading(n){let s=this.rules.block.lheading.exec(n);if(s){let i=s[1].trim();return{type:"heading",raw:Hi(s[0],`
|
|
80
|
-
`),depth:s[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(n){let s=this.rules.block.paragraph.exec(n);if(s){let i=s[1].charAt(s[1].length-1)===`
|
|
81
|
-
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:i,tokens:this.lexer.inline(i)}}}text(n){let s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){let s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){let s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){let s=this.rules.inline.link.exec(n);if(s){let i=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let u=Hi(i.slice(0,-1),"\\");if((i.length-u.length)%2===0)return}else{let u=vj(s[2],"()");if(u===-2)return;if(u>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let u=this.rules.other.pedanticHrefTitle.exec(c);u&&(c=u[1],o=u[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?c=c.slice(1):c=c.slice(1,-1)),gb(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let i;if((i=this.rules.inline.reflink.exec(n))||(i=this.rules.inline.nolink.exec(n))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let u=i[0].charAt(0);return{type:"text",raw:u,text:u}}return gb(i,o,i[0],this.lexer,this.rules)}}emStrong(n,s,i=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,u,h,g=o,m=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*n.length+o);(c=x.exec(s))!==null;){if(u=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!u)continue;if(h=[...u].length,c[3]||c[4]){g+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){m+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g+m);let _=[...c[0]][0].length,v=n.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let S=v.slice(1,-1);return{type:"em",raw:v,text:S,tokens:this.lexer.inlineTokens(S)}}let y=v.slice(2,-2);return{type:"strong",raw:v,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let s=this.rules.inline.code.exec(n);if(s){let i=s[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:s[0],text:i}}}br(n){let s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n,s,i=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,u,h,g=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,s=s.slice(-1*n.length+o);(c=m.exec(s))!==null;){if(u=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!u||(h=[...u].length,h!==o))continue;if(c[3]||c[4]){g+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g);let x=[...c[0]][0].length,_=n.slice(0,o+c.index+x+h),v=_.slice(o,-o);return{type:"del",raw:_,text:v,tokens:this.lexer.inlineTokens(v)}}}}autolink(n){let s=this.rules.inline.autolink.exec(n);if(s){let i,c;return s[2]==="@"?(i=s[1],c="mailto:"+i):(i=s[1],c=i),{type:"link",raw:s[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(n){var i;let s;if(s=this.rules.inline.url.exec(n)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let u;do u=s[0],s[0]=((i=this.rules.inline._backpedal.exec(s[0]))==null?void 0:i[0])??"";while(u!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let s=this.rules.inline.text.exec(n);if(s){let i=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:i}}}},Yl=class Cp{constructor(s){Jt(this,"tokens");Jt(this,"options");Jt(this,"state");Jt(this,"inlineQueue");Jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||zr,this.options.tokenizer=this.options.tokenizer||new cf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:js,block:Od.normal,inline:cu.normal};this.options.pedantic?(i.block=Od.pedantic,i.inline=cu.pedantic):this.options.gfm&&(i.block=Od.gfm,this.options.breaks?i.inline=cu.breaks:i.inline=cu.gfm),this.tokenizer.rules=i}static get rules(){return{block:Od,inline:cu}}static lex(s,i){return new Cp(i).lex(s)}static lexInline(s,i){return new Cp(i).inlineTokens(s)}lex(s){s=s.replace(js.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(s,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,i=[],c=!1){var u,h,g;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(js.tabCharGlobal," ").replace(js.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}let m;if((h=(u=this.options.extensions)==null?void 0:u.block)!=null&&h.some(_=>(m=_.call({lexer:this},s,i))?(s=s.substring(m.raw.length),i.push(m),!0):!1))continue;if(m=this.tokenizer.space(s)){s=s.substring(m.raw.length);let _=i.at(-1);m.raw.length===1&&_!==void 0?_.raw+=`
|
|
83
|
-
`:i.push(m);continue}if(m=this.tokenizer.code(s)){s=s.substring(m.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+m.raw,_.text+=`
|
|
86
|
-
`+m.text,this.inlineQueue.at(-1).src=_.text):i.push(m);continue}if(m=this.tokenizer.fences(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.heading(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.hr(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.blockquote(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.list(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.html(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.def(s)){s=s.substring(m.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+m.raw,_.text+=`
|
|
89
|
-
`+m.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},i.push(m));continue}if(m=this.tokenizer.table(s)){s=s.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.lheading(s)){s=s.substring(m.raw.length),i.push(m);continue}let x=s;if((g=this.options.extensions)!=null&&g.startBlock){let _=1/0,v=s.slice(1),y;this.options.extensions.startBlock.forEach(S=>{y=S.call({lexer:this},v),typeof y=="number"&&y>=0&&(_=Math.min(_,y))}),_<1/0&&_>=0&&(x=s.substring(0,_+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let _=i.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
90
|
-
`)?"":`
|
|
91
|
-
`)+m.raw,_.text+=`
|
|
92
|
-
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(m),c=x.length!==s.length,s=s.substring(m.raw.length);continue}if(m=this.tokenizer.text(s)){s=s.substring(m.raw.length);let _=i.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+m.raw,_.text+=`
|
|
95
|
-
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(m);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,i}inline(s,i=[]){return this.inlineQueue.push({src:s,tokens:i}),i}inlineTokens(s,i=[]){var g,m,x,_,v;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let y=Object.keys(this.tokens.links);y.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>y.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(y,S,k)=>{let C=k?k.length:0;return y.slice(0,C)+"["+"a".repeat(y.length-C-2)+"]"}),c=((m=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:m.call({lexer:this},c))??c;let o=!1,u="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(u=""),o=!1;let y;if((_=(x=this.options.extensions)==null?void 0:x.inline)!=null&&_.some(k=>(y=k.call({lexer:this},s,i))?(s=s.substring(y.raw.length),i.push(y),!0):!1))continue;if(y=this.tokenizer.escape(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.tag(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.link(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(y.raw.length);let k=i.at(-1);y.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=y.raw,k.text+=y.text):i.push(y);continue}if(y=this.tokenizer.emStrong(s,c,u)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.codespan(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.br(s)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.del(s,c,u)){s=s.substring(y.raw.length),i.push(y);continue}if(y=this.tokenizer.autolink(s)){s=s.substring(y.raw.length),i.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(s))){s=s.substring(y.raw.length),i.push(y);continue}let S=s;if((v=this.options.extensions)!=null&&v.startInline){let k=1/0,C=s.slice(1),D;this.options.extensions.startInline.forEach(q=>{D=q.call({lexer:this},C),typeof D=="number"&&D>=0&&(k=Math.min(k,D))}),k<1/0&&k>=0&&(S=s.substring(0,k+1))}if(y=this.tokenizer.inlineText(S)){s=s.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(u=y.raw.slice(-1)),o=!0;let k=i.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=y.raw,k.text+=y.text):i.push(y);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return i}infiniteLoopError(s){let i="Infinite loop on byte: "+s;if(this.options.silent)console.error(i);else throw new Error(i)}},of=class{constructor(n){Jt(this,"options");Jt(this,"parser");this.options=n||zr}space(n){return""}code({text:n,lang:s,escaped:i}){var u;let c=(u=(s||"").match(js.notSpaceStart))==null?void 0:u[0],o=n.replace(js.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+xa(c)+'">'+(i?o:xa(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(i?o:xa(o,!0))+`</code></pre>
|
|
98
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
99
|
-
${this.parser.parse(n)}</blockquote>
|
|
100
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
|
|
101
|
-
`}hr(n){return`<hr>
|
|
102
|
-
`}list(n){let s=n.ordered,i=n.start,c="";for(let h=0;h<n.items.length;h++){let g=n.items[h];c+=this.listitem(g)}let o=s?"ol":"ul",u=s&&i!==1?' start="'+i+'"':"";return"<"+o+u+`>
|
|
103
|
-
`+c+"</"+o+`>
|
|
104
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
105
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
106
|
-
`}table(n){let s="",i="";for(let o=0;o<n.header.length;o++)i+=this.tablecell(n.header[o]);s+=this.tablerow({text:i});let c="";for(let o=0;o<n.rows.length;o++){let u=n.rows[o];i="";for(let h=0;h<u.length;h++)i+=this.tablecell(u[h]);c+=this.tablerow({text:i})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+s+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:n}){return`<tr>
|
|
111
|
-
${n}</tr>
|
|
112
|
-
`}tablecell(n){let s=this.parser.parseInline(n.tokens),i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+s+`</${i}>
|
|
113
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${xa(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:i}){let c=this.parser.parseInline(i),o=hb(n);if(o===null)return c;n=o;let u='<a href="'+n+'"';return s&&(u+=' title="'+xa(s)+'"'),u+=">"+c+"</a>",u}image({href:n,title:s,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=hb(n);if(o===null)return xa(i);n=o;let u=`<img src="${n}" alt="${xa(i)}"`;return s&&(u+=` title="${xa(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:xa(n.text)}},em=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Vl=class Ap{constructor(s){Jt(this,"options");Jt(this,"renderer");Jt(this,"textRenderer");this.options=s||zr,this.options.renderer=this.options.renderer||new of,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new em}static parse(s,i){return new Ap(i).parse(s)}static parseInline(s,i){return new Ap(i).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let i="";for(let u=0;u<s.length;u++){let h=s[u];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let m=h,x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.type)){i+=x||"";continue}}let g=h;switch(g.type){case"space":{i+=this.renderer.space(g);break}case"hr":{i+=this.renderer.hr(g);break}case"heading":{i+=this.renderer.heading(g);break}case"code":{i+=this.renderer.code(g);break}case"table":{i+=this.renderer.table(g);break}case"blockquote":{i+=this.renderer.blockquote(g);break}case"list":{i+=this.renderer.list(g);break}case"checkbox":{i+=this.renderer.checkbox(g);break}case"html":{i+=this.renderer.html(g);break}case"def":{i+=this.renderer.def(g);break}case"paragraph":{i+=this.renderer.paragraph(g);break}case"text":{i+=this.renderer.text(g);break}default:{let m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}parseInline(s,i=this.renderer){var o,u;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let g=s[h];if((u=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&u[g.type]){let x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){c+=x||"";continue}}let m=g;switch(m.type){case"escape":{c+=i.text(m);break}case"html":{c+=i.html(m);break}case"link":{c+=i.link(m);break}case"image":{c+=i.image(m);break}case"checkbox":{c+=i.checkbox(m);break}case"strong":{c+=i.strong(m);break}case"em":{c+=i.em(m);break}case"codespan":{c+=i.codespan(m);break}case"br":{c+=i.br(m);break}case"del":{c+=i.del(m);break}case"text":{c+=i.text(m);break}default:{let x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},ef,gu=(ef=class{constructor(n){Jt(this,"options");Jt(this,"block");this.options=n||zr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?Yl.lex:Yl.lexInline}provideParser(n=this.block){return n?Vl.parse:Vl.parseInline}},Jt(ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Jt(ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ef),kj=class{constructor(...n){Jt(this,"defaults",Xp());Jt(this,"options",this.setOptions);Jt(this,"parse",this.parseMarkdown(!0));Jt(this,"parseInline",this.parseMarkdown(!1));Jt(this,"Parser",Vl);Jt(this,"Renderer",of);Jt(this,"TextRenderer",em);Jt(this,"Lexer",Yl);Jt(this,"Tokenizer",cf);Jt(this,"Hooks",gu);this.use(...n)}walkTokens(n,s){var c,o;let i=[];for(let u of n)switch(i=i.concat(s.call(this,u)),u.type){case"table":{let h=u;for(let g of h.header)i=i.concat(this.walkTokens(g.tokens,s));for(let g of h.rows)for(let m of g)i=i.concat(this.walkTokens(m.tokens,s));break}case"list":{let h=u;i=i.concat(this.walkTokens(h.items,s));break}default:{let h=u;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(g=>{let m=h[g].flat(1/0);i=i.concat(this.walkTokens(m,s))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,s)))}}return i}use(...n){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=s.renderers[o.name];u?s.renderers[o.name]=function(...h){let g=o.renderer.apply(this,h);return g===!1&&(g=u.apply(this,h)),g}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=s[o.level];u?u.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),i.renderer){let o=this.defaults.renderer||new of(this.defaults);for(let u in i.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,g=i.renderer[h],m=o[h];o[h]=(...x)=>{let _=g.apply(o,x);return _===!1&&(_=m.apply(o,x)),_||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new cf(this.defaults);for(let u in i.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,g=i.tokenizer[h],m=o[h];o[h]=(...x)=>{let _=g.apply(o,x);return _===!1&&(_=m.apply(o,x)),_}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new gu;for(let u in i.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,g=i.hooks[h],m=o[h];gu.passThroughHooks.has(u)?o[h]=x=>{if(this.defaults.async&&gu.passThroughHooksRespectAsync.has(u))return(async()=>{let v=await g.call(o,x);return m.call(o,v)})();let _=g.call(o,x);return m.call(o,_)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let v=await g.apply(o,x);return v===!1&&(v=await m.apply(o,x)),v})();let _=g.apply(o,x);return _===!1&&(_=m.apply(o,x)),_}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,u=i.walkTokens;c.walkTokens=function(h){let g=[];return g.push(u.call(this,h)),o&&(g=g.concat(o.call(this,h))),g}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return Yl.lex(n,s??this.defaults)}parser(n,s){return Vl.parse(n,s??this.defaults)}parseMarkdown(n){return(s,i)=>{let c={...i},o={...this.defaults,...c},u=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,g=await(o.hooks?await o.hooks.provideLexer(n):n?Yl.lex:Yl.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(g):g;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(n):n?Vl.parse:Vl.parseInline)(m,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(u);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(n):n?Yl.lex:Yl.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let g=(o.hooks?o.hooks.provideParser(n):n?Vl.parse:Vl.parseInline)(h,o);return o.hooks&&(g=o.hooks.postprocess(g)),g}catch(h){return u(h)}}}onError(n,s){return i=>{if(i.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+xa(i.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(i);throw i}}},Lr=new kj;function $t(n,s){return Lr.parse(n,s)}$t.options=$t.setOptions=function(n){return Lr.setOptions(n),$t.defaults=Lr.defaults,Q_($t.defaults),$t};$t.getDefaults=Xp;$t.defaults=zr;$t.use=function(...n){return Lr.use(...n),$t.defaults=Lr.defaults,Q_($t.defaults),$t};$t.walkTokens=function(n,s){return Lr.walkTokens(n,s)};$t.parseInline=Lr.parseInline;$t.Parser=Vl;$t.parser=Vl.parse;$t.Renderer=of;$t.TextRenderer=em;$t.Lexer=Yl;$t.lexer=Yl.lex;$t.Tokenizer=cf;$t.Hooks=gu;$t.parse=$t;$t.options;$t.setOptions;$t.use;$t.walkTokens;$t.parseInline;Vl.parse;Yl.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function xb(n,s){(s==null||s>n.length)&&(s=n.length);for(var i=0,c=Array(s);i<s;i++)c[i]=n[i];return c}function Nj(n){if(Array.isArray(n))return n}function Sj(n,s){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var c,o,u,h,g=[],m=!0,x=!1;try{if(u=(i=i.call(n)).next,s!==0)for(;!(m=(c=u.call(i)).done)&&(g.push(c.value),g.length!==s);m=!0);}catch(_){x=!0,o=_}finally{try{if(!m&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return g}}function Ej(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
115
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tj(n,s){return Nj(n)||Sj(n,s)||Cj(n,s)||Ej()}function Cj(n,s){if(n){if(typeof n=="string")return xb(n,s);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?xb(n,s):void 0}}const sy=Object.entries,bb=Object.setPrototypeOf,Aj=Object.isFrozen,Mj=Object.getPrototypeOf,Rj=Object.getOwnPropertyDescriptor;let ps=Object.freeze,ms=Object.seal,$c=Object.create,ly=typeof Reflect<"u"&&Reflect,Mp=ly.apply,Rp=ly.construct;ps||(ps=function(s){return s});ms||(ms=function(s){return s});Mp||(Mp=function(s,i){for(var c=arguments.length,o=new Array(c>2?c-2:0),u=2;u<c;u++)o[u-2]=arguments[u];return s.apply(i,o)});Rp||(Rp=function(s){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new s(...c)});const Hc=Vn(Array.prototype.forEach),Dj=Vn(Array.prototype.lastIndexOf),_b=Vn(Array.prototype.pop),Bc=Vn(Array.prototype.push),Oj=Vn(Array.prototype.splice),Vi=Array.isArray,xu=Vn(String.prototype.toLowerCase),rp=Vn(String.prototype.toString),yb=Vn(String.prototype.match),ou=Vn(String.prototype.replace),vb=Vn(String.prototype.indexOf),Lj=Vn(String.prototype.trim),zj=Vn(Number.prototype.toString),Ij=Vn(Boolean.prototype.toString),jb=typeof BigInt>"u"?null:Vn(BigInt.prototype.toString),wb=typeof Symbol>"u"?null:Vn(Symbol.prototype.toString),as=Vn(Object.prototype.hasOwnProperty),uu=Vn(Object.prototype.toString),ls=Vn(RegExp.prototype.test),jr=Uj(TypeError);function Vn(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return Mp(n,s,c)}}function Uj(n){return function(){for(var s=arguments.length,i=new Array(s),c=0;c<s;c++)i[c]=arguments[c];return Rp(n,i)}}function Tt(n,s){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xu;if(bb&&bb(n,null),!Vi(s))return n;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const u=i(o);u!==o&&(Aj(s)||(s[c]=u),o=u)}n[o]=!0}return n}function Hj(n){for(let s=0;s<n.length;s++)as(n,s)||(n[s]=null);return n}function Ls(n){const s=$c(null);for(const c of sy(n)){var i=Tj(c,2);const o=i[0],u=i[1];as(n,o)&&(Vi(u)?s[o]=Hj(u):u&&typeof u=="object"&&u.constructor===Object?s[o]=Ls(u):s[o]=u)}return s}function Bj(n){switch(typeof n){case"string":return n;case"number":return zj(n);case"boolean":return Ij(n);case"bigint":return jb?jb(n):"0";case"symbol":return wb?wb(n):"Symbol()";case"undefined":return uu(n);case"function":case"object":{if(n===null)return uu(n);const s=n,i=ba(s,"toString");if(typeof i=="function"){const c=i(s);return typeof c=="string"?c:uu(c)}return uu(n)}default:return uu(n)}}function ba(n,s){for(;n!==null;){const c=Rj(n,s);if(c){if(c.get)return Vn(c.get);if(typeof c.value=="function")return Vn(c.value)}n=Mj(n)}function i(){return null}return i}function qj(n){try{return ls(n,""),!0}catch{return!1}}const kb=ps(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cp=ps(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),op=ps(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gj=ps(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),up=ps(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$j=ps(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nb=ps(["#text"]),Sb=ps(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),dp=ps(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Eb=ps(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ld=ps(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yj=ms(/{{[\w\W]*|^[\w\W]*}}/g),Vj=ms(/<%[\w\W]*|^[\w\W]*%>/g),Xj=ms(/\${[\w\W]*/g),Qj=ms(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kj=ms(/^aria-[\-\w]+$/),Tb=ms(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zj=ms(/^(?:\w+script|data):/i),Fj=ms(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pj=ms(/^html$/i),Jj=ms(/^[a-z][.\w]*(-[.\w]+)+$/i),Cb=ms(/<[/\w!]/g),Ab=ms(/<[/\w]/g),Wj=ms(/<\/no(script|embed|frames)/i),ew=ms(/\/>/i),il={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},tw=function(){return typeof window>"u"?null:window},nw=function(s,i){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.getAttribute(o));const u="dompurify"+(c?"#"+c:"");try{return s.createPolicy(u,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Mb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Bi=function(s,i,c,o){return as(s,i)&&Vi(s[i])?Tt(o.base?Ls(o.base):{},s[i],o.transform):c};function ay(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tw();const s=Se=>ay(Se);if(s.version="3.4.12",s.removed=[],!n||!n.document||n.document.nodeType!==il.document||!n.Element)return s.isSupported=!1,s;let i=n.document;const c=i,o=c.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,h=n.Node,g=n.Element,m=n.NodeFilter,x=n.NamedNodeMap;x===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const _=n.DOMParser,v=n.trustedTypes,y=g.prototype,S=ba(y,"cloneNode"),k=ba(y,"remove"),C=ba(y,"nextSibling"),D=ba(y,"childNodes"),q=ba(y,"parentNode"),G=ba(y,"shadowRoot"),V=ba(y,"attributes"),L=h&&h.prototype?ba(h.prototype,"nodeType"):null,Y=h&&h.prototype?ba(h.prototype,"nodeName"):null;if(typeof u=="function"){const Se=i.createElement("template");Se.content&&Se.content.ownerDocument&&(i=Se.content.ownerDocument)}let E,U="",Q,H=!1,B=0;const N=function(){if(B>0)throw jr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},X=function(M){N(),B++;try{return E.createHTML(M)}finally{B--}},le=function(M){N(),B++;try{return E.createScriptURL(M)}finally{B--}},de=function(){return H||(Q=nw(v,o),H=!0),Q},ye=i,I=ye.implementation,R=ye.createNodeIterator,P=ye.createDocumentFragment,ae=ye.getElementsByTagName,Ne=c.importNode;let A=Mb();s.isSupported=typeof sy=="function"&&typeof q=="function"&&I&&I.createHTMLDocument!==void 0;const K=Yj,fe=Vj,ke=Xj,Re=Qj,Ue=Kj,_e=Zj,Ze=Fj,rt=Jj;let Bt=Tb,he=null;const at=Tt({},[...kb,...cp,...op,...up,...Nb]);let oe=null;const Rt=Tt({},[...Sb,...dp,...Eb,...Ld]);let He=Object.seal($c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qt=null,Un=null;const bt=Object.seal($c(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Kt=!0,ln=!0,Xn=!1,wt=!0,Z=!1,De=!0,$e=!1,ht=!1,Ee=null,Te=null,Oe=!1,Ye=!1,Qe=!1,Pe=!1,pt=!0,At=!1;const Sn="user-content-";let Et=!0,Lt=!1,re={},we=null;const Ve=Tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let et=null;const nt=Tt({},["audio","video","img","source","image","track"]);let on=null;const On=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wt="http://www.w3.org/1998/Math/MathML",bn="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let zt=Yt,J=!1,pe=null;const Ae=Tt({},[Wt,bn,Yt],rp),Ke=ps(["mi","mo","mn","ms","mtext"]);let It=Tt({},Ke);const an=ps(["annotation-xml"]);let kt=Tt({},an);const gs=Tt({},["title","style","font","a","script"]);let Qn=null;const is=["application/xhtml+xml","text/html"],rn="text/html";let it=null,un=null;const ks=i.createElement("form"),Ns=function(M){return M instanceof RegExp||M instanceof Function},Ss=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(un&&un===M)return;(!M||typeof M!="object")&&(M={}),M=Ls(M),Qn=is.indexOf(M.PARSER_MEDIA_TYPE)===-1?rn:M.PARSER_MEDIA_TYPE,it=Qn==="application/xhtml+xml"?rp:xu,he=Bi(M,"ALLOWED_TAGS",at,{transform:it}),oe=Bi(M,"ALLOWED_ATTR",Rt,{transform:it}),pe=Bi(M,"ALLOWED_NAMESPACES",Ae,{transform:rp}),on=Bi(M,"ADD_URI_SAFE_ATTR",On,{transform:it,base:On}),et=Bi(M,"ADD_DATA_URI_TAGS",nt,{transform:it,base:nt}),we=Bi(M,"FORBID_CONTENTS",Ve,{transform:it}),qt=Bi(M,"FORBID_TAGS",Ls({}),{transform:it}),Un=Bi(M,"FORBID_ATTR",Ls({}),{transform:it}),re=as(M,"USE_PROFILES")?M.USE_PROFILES&&typeof M.USE_PROFILES=="object"?Ls(M.USE_PROFILES):M.USE_PROFILES:!1,Kt=M.ALLOW_ARIA_ATTR!==!1,ln=M.ALLOW_DATA_ATTR!==!1,Xn=M.ALLOW_UNKNOWN_PROTOCOLS||!1,wt=M.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=M.SAFE_FOR_TEMPLATES||!1,De=M.SAFE_FOR_XML!==!1,$e=M.WHOLE_DOCUMENT||!1,Ye=M.RETURN_DOM||!1,Qe=M.RETURN_DOM_FRAGMENT||!1,Pe=M.RETURN_TRUSTED_TYPE||!1,Oe=M.FORCE_BODY||!1,pt=M.SANITIZE_DOM!==!1,At=M.SANITIZE_NAMED_PROPS||!1,Et=M.KEEP_CONTENT!==!1,Lt=M.IN_PLACE||!1,Bt=qj(M.ALLOWED_URI_REGEXP)?M.ALLOWED_URI_REGEXP:Tb,zt=typeof M.NAMESPACE=="string"?M.NAMESPACE:Yt,It=as(M,"MATHML_TEXT_INTEGRATION_POINTS")&&M.MATHML_TEXT_INTEGRATION_POINTS&&typeof M.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ls(M.MATHML_TEXT_INTEGRATION_POINTS):Tt({},Ke),kt=as(M,"HTML_INTEGRATION_POINTS")&&M.HTML_INTEGRATION_POINTS&&typeof M.HTML_INTEGRATION_POINTS=="object"?Ls(M.HTML_INTEGRATION_POINTS):Tt({},an);const W=as(M,"CUSTOM_ELEMENT_HANDLING")&&M.CUSTOM_ELEMENT_HANDLING&&typeof M.CUSTOM_ELEMENT_HANDLING=="object"?Ls(M.CUSTOM_ELEMENT_HANDLING):$c(null);if(He=$c(null),as(W,"tagNameCheck")&&Ns(W.tagNameCheck)&&(He.tagNameCheck=W.tagNameCheck),as(W,"attributeNameCheck")&&Ns(W.attributeNameCheck)&&(He.attributeNameCheck=W.attributeNameCheck),as(W,"allowCustomizedBuiltInElements")&&typeof W.allowCustomizedBuiltInElements=="boolean"&&(He.allowCustomizedBuiltInElements=W.allowCustomizedBuiltInElements),ms(He),Z&&(ln=!1),Qe&&(Ye=!0),re&&(he=Tt({},Nb),oe=$c(null),re.html===!0&&(Tt(he,kb),Tt(oe,Sb)),re.svg===!0&&(Tt(he,cp),Tt(oe,dp),Tt(oe,Ld)),re.svgFilters===!0&&(Tt(he,op),Tt(oe,dp),Tt(oe,Ld)),re.mathMl===!0&&(Tt(he,up),Tt(oe,Eb),Tt(oe,Ld))),bt.tagCheck=null,bt.attributeCheck=null,as(M,"ADD_TAGS")&&(typeof M.ADD_TAGS=="function"?bt.tagCheck=M.ADD_TAGS:Vi(M.ADD_TAGS)&&(he===at&&(he=Ls(he)),Tt(he,M.ADD_TAGS,it))),as(M,"ADD_ATTR")&&(typeof M.ADD_ATTR=="function"?bt.attributeCheck=M.ADD_ATTR:Vi(M.ADD_ATTR)&&(oe===Rt&&(oe=Ls(oe)),Tt(oe,M.ADD_ATTR,it))),as(M,"ADD_URI_SAFE_ATTR")&&Vi(M.ADD_URI_SAFE_ATTR)&&Tt(on,M.ADD_URI_SAFE_ATTR,it),as(M,"FORBID_CONTENTS")&&Vi(M.FORBID_CONTENTS)&&(we===Ve&&(we=Ls(we)),Tt(we,M.FORBID_CONTENTS,it)),as(M,"ADD_FORBID_CONTENTS")&&Vi(M.ADD_FORBID_CONTENTS)&&(we===Ve&&(we=Ls(we)),Tt(we,M.ADD_FORBID_CONTENTS,it)),Et&&(he["#text"]=!0),$e&&Tt(he,["html","head","body"]),he.table&&(Tt(he,["tbody"]),delete qt.tbody),M.TRUSTED_TYPES_POLICY){if(typeof M.TRUSTED_TYPES_POLICY.createHTML!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof M.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ve=E;E=M.TRUSTED_TYPES_POLICY;try{U=X("")}catch(Ce){throw E=ve,Ce}}else M.TRUSTED_TYPES_POLICY===null?(E=void 0,U=""):(E===void 0&&(E=de()),E&&typeof U=="string"&&(U=X("")));ps&&ps(M),un=M},zs=Tt({},[...cp,...op,...Gj]),rs=Tt({},[...up,...$j]),Es=function(M,W,ve){return W.namespaceURI===Yt?M==="svg":W.namespaceURI===Wt?M==="svg"&&(ve==="annotation-xml"||It[ve]):!!zs[M]},Zt=function(M,W,ve){return W.namespaceURI===Yt?M==="math":W.namespaceURI===bn?M==="math"&&kt[ve]:!!rs[M]},Is=function(M,W,ve){return W.namespaceURI===bn&&!kt[ve]||W.namespaceURI===Wt&&!It[ve]?!1:!rs[M]&&(gs[M]||!zs[M])},_n=function(M){let W=q(M);(!W||!W.tagName)&&(W={namespaceURI:zt,tagName:"template"});const ve=xu(M.tagName),Ce=xu(W.tagName);return pe[M.namespaceURI]?M.namespaceURI===bn?Es(ve,W,Ce):M.namespaceURI===Wt?Zt(ve,W,Ce):M.namespaceURI===Yt?Is(ve,W,Ce):!!(Qn==="application/xhtml+xml"&&pe[M.namespaceURI]):!1},yn=function(M){Bc(s.removed,{element:M});try{q(M).removeChild(M)}catch{if(k(M),!q(M))throw jr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},lt=function(M){cs(M);const W=D(M);if(W){const Ce=[];Hc(W,Xe=>{Bc(Ce,Xe)}),Hc(Ce,Xe=>{try{k(Xe)}catch{}})}const ve=V(M);if(ve)for(let Ce=ve.length-1;Ce>=0;--Ce){const Xe=ve[Ce],Je=Xe&&Xe.name;if(typeof Je=="string")try{M.removeAttribute(Je)}catch{}}},Jn=function(M,W){try{Bc(s.removed,{attribute:W.getAttributeNode(M),from:W})}catch{Bc(s.removed,{attribute:null,from:W})}if(W.removeAttribute(M),M==="is")if(Ye||Qe)try{yn(W)}catch{}else try{W.setAttribute(M,"")}catch{}},Kn=function(M){const W=V(M);if(W)for(let ve=W.length-1;ve>=0;--ve){const Ce=W[ve],Xe=Ce&&Ce.name;if(!(typeof Xe!="string"||oe[it(Xe)]))try{M.removeAttribute(Xe)}catch{}}},cs=function(M){const W=[M];for(;W.length>0;){const ve=W.pop();(L?L(ve):ve.nodeType)===il.element&&Kn(ve);const Xe=D(ve);if(Xe)for(let Je=Xe.length-1;Je>=0;--Je)W.push(Xe[Je])}},dn=function(M){if(!De)return;const W=[M];for(;W.length>0;){const ve=W.pop(),Ce=L?L(ve):ve.nodeType;if(Ce===il.processingInstruction||Ce===il.comment&&ls(Ab,ve.data)){try{k(ve)}catch{}continue}if(Ce===il.element){const Je=ve,Vt=it(Y?Y(ve):ve.nodeName);try{Je.hasAttribute&&Je.hasAttribute("patchsrc")&&Je.removeAttribute("patchsrc"),Je.hasAttribute&&Je.hasAttribute("for")&&Vt!=="label"&&Vt!=="output"&&Je.removeAttribute("for")}catch{}}const Xe=D(ve);if(Xe)for(let Je=Xe.length-1;Je>=0;--Je)W.push(Xe[Je])}},rl=function(M){let W=null,ve=null;if(Oe)M="<remove></remove>"+M;else{const Je=yb(M,/^[\r\n\t ]+/);ve=Je&&Je[0]}Qn==="application/xhtml+xml"&&zt===Yt&&(M='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+M+"</body></html>");const Ce=E?X(M):M;if(zt===Yt)try{W=new _().parseFromString(Ce,Qn)}catch{}if(!W||!W.documentElement){W=I.createDocument(zt,"template",null);try{W.documentElement.innerHTML=J?U:Ce}catch{}}const Xe=W.body||W.documentElement;return M&&ve&&Xe.insertBefore(i.createTextNode(ve),Xe.childNodes[0]||null),zt===Yt?ae.call(W,$e?"html":"body")[0]:$e?W.documentElement:Xe},Ts=function(M){return R.call(M.ownerDocument||M,M,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},os=function(M){return M=ou(M,K," "),M=ou(M,fe," "),M=ou(M,ke," "),M},Cs=function(M){var W;M.normalize();const ve=R.call(M.ownerDocument||M,M,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ve.nextNode();for(;Ce;)Ce.data=os(Ce.data),Ce=ve.nextNode();const Xe=(W=M.querySelectorAll)===null||W===void 0?void 0:W.call(M,"template");Xe&&Hc(Xe,Je=>{Ln(Je.content)&&Cs(Je.content)})},kn=function(M){const W=Y?Y(M):null;return typeof W!="string"||it(W)!=="form"?!1:typeof M.nodeName!="string"||typeof M.textContent!="string"||typeof M.removeChild!="function"||M.attributes!==V(M)||typeof M.removeAttribute!="function"||typeof M.setAttribute!="function"||typeof M.namespaceURI!="string"||typeof M.insertBefore!="function"||typeof M.hasChildNodes!="function"||M.nodeType!==L(M)||M.childNodes!==D(M)},Ln=function(M){if(!L||typeof M!="object"||M===null)return!1;try{return L(M)===il.documentFragment}catch{return!1}},Hn=function(M){if(!L||typeof M!="object"||M===null)return!1;try{return typeof L(M)=="number"}catch{return!1}};function en(Se,M,W){Se.length!==0&&Hc(Se,ve=>{ve.call(s,M,W,un)})}const jl=function(M,W){return!!(De&&M.hasChildNodes()&&!Hn(M.firstElementChild)&&ls(Cb,M.textContent)&&ls(Cb,M.innerHTML)||De&&M.namespaceURI===Yt&&W==="style"&&Hn(M.firstElementChild)||M.nodeType===il.processingInstruction||De&&M.nodeType===il.comment&&ls(Ab,M.data))},li=function(M,W){if(!qt[W]&&kl(W)&&(He.tagNameCheck instanceof RegExp&&ls(He.tagNameCheck,W)||He.tagNameCheck instanceof Function&&He.tagNameCheck(W)))return!1;if(Et&&!we[W]){const ve=q(M),Ce=D(M);if(Ce&&ve){const Xe=Ce.length;for(let Je=Xe-1;Je>=0;--Je){const Vt=Lt?Ce[Je]:S(Ce[Je],!0);ve.insertBefore(Vt,C(M))}}}return yn(M),!0},Kl=function(M,W){if(en(A.beforeSanitizeElements,M,null),M!==W&&q(M)===null)return!0;if(kn(M))return yn(M),!0;const ve=it(Y?Y(M):M.nodeName);if(en(A.uponSanitizeElement,M,{tagName:ve,allowedTags:he}),M!==W&&q(M)===null)return!0;if(jl(M,ve))return yn(M),!0;if(qt[ve]||!(bt.tagCheck instanceof Function&&bt.tagCheck(ve))&&!he[ve]){const Xe=li(M,ve);return Xe===!1&&en(A.afterSanitizeElements,M,null),Xe}if((L?L(M):M.nodeType)===il.element&&!_n(M)||(ve==="noscript"||ve==="noembed"||ve==="noframes")&&ls(Wj,M.innerHTML))return yn(M),!0;if(Z&&M.nodeType===il.text){const Xe=os(M.textContent);M.textContent!==Xe&&(Bc(s.removed,{element:M.cloneNode()}),M.textContent=Xe)}return en(A.afterSanitizeElements,M,null),!1},En=function(M,W,ve){if(Un[W]||De&&W==="patchsrc"||De&&W==="for"&&M!=="label"&&M!=="output"||pt&&(W==="id"||W==="name")&&(ve in i||ve in ks))return!1;const Ce=oe[W]||bt.attributeCheck instanceof Function&&bt.attributeCheck(W,M);if(!(ln&&ls(Re,W))){if(!(Kt&&ls(Ue,W))){if(Ce){if(!on[W]){if(!ls(Bt,ou(ve,Ze,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&M!=="script"&&vb(ve,"data:")===0&&et[M])){if(!(Xn&&!ls(_e,ou(ve,Ze,"")))){if(ve)return!1}}}}}else if(!(kl(M)&&(He.tagNameCheck instanceof RegExp&&ls(He.tagNameCheck,M)||He.tagNameCheck instanceof Function&&He.tagNameCheck(M))&&(He.attributeNameCheck instanceof RegExp&&ls(He.attributeNameCheck,W)||He.attributeNameCheck instanceof Function&&He.attributeNameCheck(W,M))||W==="is"&&He.allowCustomizedBuiltInElements&&(He.tagNameCheck instanceof RegExp&&ls(He.tagNameCheck,ve)||He.tagNameCheck instanceof Function&&He.tagNameCheck(ve))))return!1}}return!0},wl=Tt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kl=function(M){return!wl[xu(M)]&&ls(rt,M)},Wn=function(M,W,ve,Ce){if(E&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ve)switch(v.getAttributeType(M,W)){case"TrustedHTML":return X(Ce);case"TrustedScriptURL":return le(Ce)}return Ce},Nl=function(M,W,ve,Ce){try{ve?M.setAttributeNS(ve,W,Ce):M.setAttribute(W,Ce),kn(M)?yn(M):_b(s.removed)}catch{Jn(W,M)}},Zl=function(M){en(A.beforeSanitizeAttributes,M,null);const W=M.attributes;if(!W||kn(M))return;const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let Ce=W.length;const Xe=it(M.nodeName);for(;Ce--;){const Je=W[Ce],Vt=Je.name,gt=Je.namespaceURI,cn=Je.value,ct=it(Vt),Mt=cn;let fn=Vt==="value"?Mt:Lj(Mt);if(ve.attrName=ct,ve.attrValue=fn,ve.keepAttr=!0,ve.forceKeepAttr=void 0,en(A.uponSanitizeAttribute,M,ve),fn=ve.attrValue,At&&(ct==="id"||ct==="name")&&vb(fn,Sn)!==0&&(Jn(Vt,M),fn=Sn+fn),De&&ls(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,fn)){Jn(Vt,M);continue}if(ct==="attributename"&&yb(fn,"href")){Jn(Vt,M);continue}if(!ve.forceKeepAttr){if(!ve.keepAttr){Jn(Vt,M);continue}if(!wt&&ls(ew,fn)){Jn(Vt,M);continue}if(Z&&(fn=os(fn)),!En(Xe,ct,fn)){Jn(Vt,M);continue}fn=Wn(Xe,ct,gt,fn),fn!==Mt&&Nl(M,Vt,gt,fn)}}en(A.afterSanitizeAttributes,M,null)},Us=function(M){let W=null;const ve=Ts(M);for(en(A.beforeSanitizeShadowDOM,M,null);W=ve.nextNode();)if(en(A.uponSanitizeShadowNode,W,null),Kl(W,M),Zl(W),Ln(W.content)&&Us(W.content),(L?L(W):W.nodeType)===il.element){const Xe=G(W);Ln(Xe)&&(vn(Xe),Us(Xe))}en(A.afterSanitizeShadowDOM,M,null)},vn=function(M){const W=[{node:M,shadow:null}];for(;W.length>0;){const ve=W.pop();if(ve.shadow){Us(ve.shadow);continue}const Ce=ve.node,Je=(L?L(Ce):Ce.nodeType)===il.element,Vt=D(Ce);if(Vt)for(let gt=Vt.length-1;gt>=0;--gt)W.push({node:Vt[gt],shadow:null});if(Je){const gt=Y?Y(Ce):null;if(typeof gt=="string"&&it(gt)==="template"){const cn=Ce.content;Ln(cn)&&W.push({node:cn,shadow:null})}}if(Je){const gt=G(Ce);Ln(gt)&&W.push({node:null,shadow:gt},{node:gt,shadow:null})}}};return s.sanitize=function(Se){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,ve=null,Ce=null,Xe=null;if(J=!Se,J&&(Se="<!-->"),typeof Se!="string"&&!Hn(Se)&&(Se=Bj(Se),typeof Se!="string"))throw jr("dirty is not a string, aborting");if(!s.isSupported)return Se;ht?(he=Ee,oe=Te):Ss(M),(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&(he=Ls(he)),A.uponSanitizeAttribute.length>0&&(oe=Ls(oe)),s.removed=[];const Je=Lt&&typeof Se!="string"&&Hn(Se);if(Je){dn(Se);const ct=Y?Y(Se):Se.nodeName;if(typeof ct=="string"){const Mt=it(ct);if(!he[Mt]||qt[Mt])throw lt(Se),jr("root node is forbidden and cannot be sanitized in-place")}if(kn(Se))throw lt(Se),jr("root node is clobbered and cannot be sanitized in-place");try{vn(Se)}catch(Mt){throw lt(Se),Mt}}else if(Hn(Se))W=rl("<!---->"),ve=W.ownerDocument.importNode(Se,!0),ve.nodeType===il.element&&ve.nodeName==="BODY"||ve.nodeName==="HTML"?W=ve:W.appendChild(ve),vn(ve);else{if(!Ye&&!Z&&!$e&&Se.indexOf("<")===-1)return E&&Pe?X(Se):Se;if(W=rl(Se),!W)return Ye?null:Pe?U:""}W&&Oe&&yn(W.firstChild);const Vt=Je?Se:W,gt=Ts(Vt);try{for(;Ce=gt.nextNode();)Kl(Ce,Vt),Zl(Ce),Ln(Ce.content)&&Us(Ce.content)}catch(ct){throw Je&&(lt(Se),Hc(s.removed,Mt=>{Mt.element&&cs(Mt.element)})),ct}if(Je)return Hc(s.removed,ct=>{ct.element&&cs(ct.element)}),Z&&Cs(Se),Se;if(Ye){if(Z&&Cs(W),Qe)for(Xe=P.call(W.ownerDocument);W.firstChild;)Xe.appendChild(W.firstChild);else Xe=W;return(oe.shadowroot||oe.shadowrootmode)&&(Xe=Ne.call(c,Xe,!0)),Xe}let cn=$e?W.outerHTML:W.innerHTML;return $e&&he["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&ls(Pj,W.ownerDocument.doctype.name)&&(cn="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
116
|
-
`+cn),Z&&(cn=os(cn)),E&&Pe?X(cn):cn},s.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ss(Se),ht=!0,Ee=he,Te=oe},s.clearConfig=function(){un=null,ht=!1,Ee=null,Te=null,E=Q,U=""},s.isValidAttribute=function(Se,M,W){un||Ss({});const ve=it(Se),Ce=it(M);return En(ve,Ce,W)},s.addHook=function(Se,M){typeof M=="function"&&as(A,Se)&&Bc(A[Se],M)},s.removeHook=function(Se,M){if(as(A,Se)){if(M!==void 0){const W=Dj(A[Se],M);return W===-1?void 0:Oj(A[Se],W,1)[0]}return _b(A[Se])}},s.removeHooks=function(Se){as(A,Se)&&(A[Se]=[])},s.removeAllHooks=function(){A=Mb()},s}var sw=ay();const lw=1024;let aw=0;class vl{constructor(s,i){this.from=s,this.to=i}}class xn{constructor(s={}){this.id=aw++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=Ql.match(s)),i=>{let c=s(i);return c===void 0?null:[this,c]}}}xn.closedBy=new xn({deserialize:n=>n.split(" ")});xn.openedBy=new xn({deserialize:n=>n.split(" ")});xn.group=new xn({deserialize:n=>n.split(" ")});xn.isolate=new xn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});xn.contextHash=new xn({perNode:!0});xn.lookAhead=new xn({perNode:!0});xn.mounted=new xn({perNode:!0});class Qc{constructor(s,i,c,o=!1){this.tree=s,this.overlay=i,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[xn.mounted.id]}}const iw=Object.create(null);class Ql{constructor(s,i,c,o=0){this.name=s,this.props=i,this.id=c,this.flags=o}static define(s){let i=s.props&&s.props.length?Object.create(null):iw,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Ql(s.name||"",i,s.id,c);if(s.props){for(let u of s.props)if(Array.isArray(u)||(u=u(o)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[u[0].id]=u[1]}}return o}prop(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let i=this.prop(xn.group);return i?i.indexOf(s)>-1:!1}return this.id==s}static match(s){let i=Object.create(null);for(let c in s)for(let o of c.split(" "))i[o]=s[c];return c=>{for(let o=c.prop(xn.group),u=-1;u<(o?o.length:0);u++){let h=i[u<0?c.name:o[u]];if(h)return h}}}}Ql.none=new Ql("",Object.create(null),0,8);class iy{constructor(s){this.types=s;for(let i=0;i<s.length;i++)if(s[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let i=[];for(let c of this.types){let o=null;for(let u of s){let h=u(c);if(h){o||(o=Object.assign({},c.props));let g=h[1],m=h[0];m.combine&&m.id in o&&(g=m.combine(o[m.id],g)),o[m.id]=g}}i.push(o?new Ql(c.name,o,c.id,c.flags):c)}return new iy(i)}}const zd=new WeakMap,Rb=new WeakMap;var mn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(mn||(mn={}));class Fs{constructor(s,i,c,o,u){if(this.type=s,this.children=i,this.positions=c,this.length=o,this.props=null,u&&u.length){this.props=Object.create(null);for(let[h,g]of u)this.props[typeof h=="number"?h:h.id]=g}}toString(){let s=Qc.get(this);if(s&&!s.overlay)return s.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(s=0){return new uf(this.topNode,s)}cursorAt(s,i=0,c=0){let o=zd.get(this)||this.topNode,u=new uf(o);return u.moveTo(s,i),zd.set(this,u._tree),u}get topNode(){return new ws(this,0,0,null)}resolve(s,i=0){let c=Nu(zd.get(this)||this.topNode,s,i,!1);return zd.set(this,c),c}resolveInner(s,i=0){let c=Nu(Rb.get(this)||this.topNode,s,i,!0);return Rb.set(this,c),c}resolveStack(s,i=0){return ow(this,s,i)}iterate(s){let{enter:i,leave:c,from:o=0,to:u=this.length}=s,h=s.mode||0,g=(h&mn.IncludeAnonymous)>0;for(let m=this.cursor(h|mn.IncludeAnonymous);;){let x=!1;if(m.from<=u&&m.to>=o&&(!g&&m.type.isAnonymous||i(m)!==!1)){if(m.firstChild())continue;x=!0}for(;x&&c&&(g||!m.type.isAnonymous)&&c(m),!m.nextSibling();){if(!m.parent())return;x=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let i in this.props)s.push([+i,this.props[i]]);return s}balance(s={}){return this.children.length<=8?this:sm(Ql.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new Fs(this.type,i,c,o,this.propValues),s.makeTree||((i,c,o)=>new Fs(Ql.none,i,c,o)))}static build(s){return uw(s)}}Fs.empty=new Fs(Ql.none,[],[],0);class tm{constructor(s,i){this.buffer=s,this.index=i}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new tm(this.buffer,this.index)}}class Fi{constructor(s,i,c){this.buffer=s,this.length=i,this.set=c}get type(){return Ql.none}toString(){let s=[];for(let i=0;i<this.buffer.length;)s.push(this.childString(i)),i=this.buffer[i+3];return s.join(",")}childString(s){let i=this.buffer[s],c=this.buffer[s+3],o=this.set.types[i],u=o.name;if(/\W/.test(u)&&!o.isError&&(u=JSON.stringify(u)),s+=4,c==s)return u;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return u+"("+h.join(",")+")"}findChild(s,i,c,o,u){let{buffer:h}=this,g=-1;for(let m=s;m!=i&&!(ry(u,o,h[m+1],h[m+2])&&(g=m,c>0));m=h[m+3]);return g}slice(s,i,c){let o=this.buffer,u=new Uint16Array(i-s),h=0;for(let g=s,m=0;g<i;){u[m++]=o[g++],u[m++]=o[g++]-c;let x=u[m++]=o[g++]-c;u[m++]=o[g++]-s,h=Math.max(h,x)}return new Fi(u,h,this.set)}}function ry(n,s,i,c){switch(n){case-2:return i<s;case-1:return c>=s&&i<s;case 0:return i<s&&c>s;case 1:return i<=s&&c>s;case 2:return c>s;case 4:return!0}}function Nu(n,s,i,c){for(var o;n.from==n.to||(i<1?n.from>=s:n.from>s)||(i>-1?n.to<=s:n.to<s);){let h=!c&&n instanceof ws&&n.index<0?null:n.parent;if(!h)return n;n=h}let u=c?0:mn.IgnoreOverlays;if(c)for(let h=n,g=h.parent;g;h=g,g=h.parent)h instanceof ws&&h.index<0&&((o=g.enter(s,i,u))===null||o===void 0?void 0:o.from)!=h.from&&(n=g);for(;;){let h=n.enter(s,i,u);if(!h)return n;n=h}}class cy{cursor(s=0){return new uf(this,s)}getChild(s,i=null,c=null){let o=Db(this,s,i,c);return o.length?o[0]:null}getChildren(s,i=null,c=null){return Db(this,s,i,c)}resolve(s,i=0){return Nu(this,s,i,!1)}resolveInner(s,i=0){return Nu(this,s,i,!0)}matchContext(s){return Dp(this.parent,s)}enterUnfinishedNodesBefore(s){let i=this.childBefore(s),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class ws extends cy{constructor(s,i,c,o){super(),this._tree=s,this.from=i,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(s,i,c,o,u=0){for(let h=this;;){for(let{children:g,positions:m}=h._tree,x=i>0?g.length:-1;s!=x;s+=i){let _=g[s],v=m[s]+h.from,y;if(!(!(u&mn.EnterBracketed&&_ instanceof Fs&&(y=Qc.get(_))&&!y.overlay&&y.bracketed&&c>=v&&c<=v+_.length)&&!ry(o,c,v,v+_.length))){if(_ instanceof Fi){if(u&mn.ExcludeBuffers)continue;let S=_.findChild(0,_.buffer.length,i,c-v,o);if(S>-1)return new wa(new rw(h,_,s,v),null,S)}else if(u&mn.IncludeAnonymous||!_.type.isAnonymous||nm(_)){let S;if(!(u&mn.IgnoreMounts)&&(S=Qc.get(_))&&!S.overlay)return new ws(S.tree,v,s,h);let k=new ws(_,v,s,h);return u&mn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(i<0?_.children.length-1:0,i,c,o,u)}}}if(u&mn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+i:s=i<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,i,c=0){let o;if(!(c&mn.IgnoreOverlays)&&(o=Qc.get(this._tree))&&o.overlay){let u=s-this.from,h=c&mn.EnterBracketed&&o.bracketed;for(let{from:g,to:m}of o.overlay)if((i>0||h?g<=u:g<u)&&(i<0||h?m>=u:m>u))return new ws(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,i,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Db(n,s,i,c){let o=n.cursor(),u=[];if(!o.firstChild())return u;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!o.nextSibling())return u}for(;;){if(c!=null&&o.type.is(c))return u;if(o.type.is(s)&&u.push(o.node),!o.nextSibling())return c==null?u:[]}}function Dp(n,s,i=s.length-1){for(let c=n;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[i]&&s[i]!=c.name)return!1;i--}}return!0}class rw{constructor(s,i,c,o){this.parent=s,this.buffer=i,this.index=c,this.start=o}}class wa extends cy{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,i,c){super(),this.context=s,this._parent=i,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,i,c){let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],s,i-this.context.start,c);return u<0?null:new wa(this.context,this,u)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,i,c=0){if(c&mn.ExcludeBuffers)return null;let{buffer:o}=this.context,u=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,s-this.context.start,i);return u<0?null:new wa(this.context,this,u)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,i=s.buffer[this.index+3];return i<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new wa(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new wa(this.context,this._parent,s.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],i=[],{buffer:c}=this.context,o=this.index+4,u=c.buffer[this.index+3];if(u>o){let h=c.buffer[this.index+1];s.push(c.slice(o,u,h)),i.push(0)}return new Fs(this.type,s,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function oy(n){if(!n.length)return null;let s=0,i=n[0];for(let u=1;u<n.length;u++){let h=n[u];(h.from>i.from||h.to<i.to)&&(i=h,s=u)}let c=i instanceof ws&&i.index<0?null:i.parent,o=n.slice();return c?o[s]=c:o.splice(s,1),new cw(o,i)}class cw{constructor(s,i){this.heads=s,this.node=i}get next(){return oy(this.heads)}}function ow(n,s,i){let c=n.resolveInner(s,i),o=null;for(let u=c instanceof ws?c:c.context.parent;u;u=u.parent)if(u.index<0){let h=u.parent;(o||(o=[c])).push(h.resolve(s,i)),u=h}else{let h=Qc.get(u.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let g=new ws(h.tree,h.overlay[0].from+u.from,-1,u);(o||(o=[c])).push(Nu(g,s,i,!1))}}return o?oy(o):c}class uf{get name(){return this.type.name}constructor(s,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~mn.EnterBracketed,s instanceof ws)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,i){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof ws?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,i,c,this.mode));let{buffer:o}=this.buffer,u=o.findChild(this.index+4,o.buffer[this.index+3],s,i-this.buffer.start,c);return u<0?!1:(this.stack.push(this.index),this.yieldBuf(u))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,i,c=this.mode){return this.buffer?c&mn.ExcludeBuffers?!1:this.enterChild(1,s,i):this.yield(this._tree.enter(s,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&mn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&mn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:i}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let i,c,{buffer:o}=this;if(o){if(s>0){if(this.index<o.buffer.buffer.length)return!1}else for(let u=0;u<this.index;u++)if(o.buffer.buffer[u+3]<this.index)return!1;({index:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let u=i+s,h=s<0?-1:c._tree.children.length;u!=h;u+=s){let g=c._tree.children[u];if(this.mode&mn.IncludeAnonymous||g instanceof Fi||!g.type.isAnonymous||nm(g))return!1}return!0}move(s,i){if(i&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,i=0){for(;(this.from==this.to||(i<1?this.from>=s:this.from>s)||(i>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,i););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,i=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,u=this.stack.length;u>=0;){for(let h=s;h;h=h._parent)if(h.index==o){if(o==this.index)return h;i=h,c=u+1;break e}o=this.stack[--u]}for(let o=c;o<this.stack.length;o++)i=new wa(this.buffer,i,this.stack[o]);return this.bufferNode=new wa(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,i){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return Dp(this.node.parent,s);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=s.length-1,u=this.stack.length-1;o>=0;u--){if(u<0)return Dp(this._tree,s,o);let h=c[i.buffer[this.stack[u]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function nm(n){return n.children.some(s=>s instanceof Fi||!s.type.isAnonymous||nm(s))}function uw(n){var s;let{buffer:i,nodeSet:c,maxBufferLength:o=lw,reused:u=[],minRepeatType:h=c.types.length}=n,g=Array.isArray(i)?new tm(i,i.length):i,m=c.types,x=0,_=0;function v(Y,E,U,Q,H,B){let{id:N,start:X,end:le,size:de}=g,ye=_,I=x;if(de<0)if(g.next(),de==-1){let A=u[N];U.push(A),Q.push(X-Y);return}else if(de==-3){x=N;return}else if(de==-4){_=N;return}else throw new RangeError(`Unrecognized record size: ${de}`);let R=m[N],P,ae,Ne=X-Y;if(le-X<=o&&(ae=D(g.pos-E,H))){let A=new Uint16Array(ae.size-ae.skip),K=g.pos-ae.size,fe=A.length;for(;g.pos>K;)fe=q(ae.start,A,fe);P=new Fi(A,le-ae.start,c),Ne=ae.start-Y}else{let A=g.pos-de;g.next();let K=[],fe=[],ke=N>=h?N:-1,Re=0,Ue=le;for(;g.pos>A;)ke>=0&&g.id==ke&&g.size>=0?(g.end<=Ue-o&&(k(K,fe,X,Re,g.end,Ue,ke,ye,I),Re=K.length,Ue=g.end),g.next()):B>2500?y(X,A,K,fe):v(X,A,K,fe,ke,B+1);if(ke>=0&&Re>0&&Re<K.length&&k(K,fe,X,Re,X,Ue,ke,ye,I),K.reverse(),fe.reverse(),ke>-1&&Re>0){let _e=S(R,I);P=sm(R,K,fe,0,K.length,0,le-X,_e,_e)}else P=C(R,K,fe,le-X,ye-le,I)}U.push(P),Q.push(Ne)}function y(Y,E,U,Q){let H=[],B=0,N=-1;for(;g.pos>E;){let{id:X,start:le,end:de,size:ye}=g;if(ye>4)g.next();else{if(N>-1&&le<N)break;N<0&&(N=de-o),H.push(X,le,de),B++,g.next()}}if(B){let X=new Uint16Array(B*4),le=H[H.length-2];for(let de=H.length-3,ye=0;de>=0;de-=3)X[ye++]=H[de],X[ye++]=H[de+1]-le,X[ye++]=H[de+2]-le,X[ye++]=ye;U.push(new Fi(X,H[2]-le,c)),Q.push(le-Y)}}function S(Y,E){return(U,Q,H)=>{let B=0,N=U.length-1,X,le;if(N>=0&&(X=U[N])instanceof Fs){if(!N&&X.type==Y&&X.length==H)return X;(le=X.prop(xn.lookAhead))&&(B=Q[N]+X.length+le)}return C(Y,U,Q,H,B,E)}}function k(Y,E,U,Q,H,B,N,X,le){let de=[],ye=[];for(;Y.length>Q;)de.push(Y.pop()),ye.push(E.pop()+U-H);Y.push(C(c.types[N],de,ye,B-H,X-B,le)),E.push(H-U)}function C(Y,E,U,Q,H,B,N){if(B){let X=[xn.contextHash,B];N=N?[X].concat(N):[X]}if(H>25){let X=[xn.lookAhead,H];N=N?[X].concat(N):[X]}return new Fs(Y,E,U,Q,N)}function D(Y,E){let U=g.fork(),Q=0,H=0,B=0,N=U.end-o,X={size:0,start:0,skip:0};e:for(let le=U.pos-Y;U.pos>le;){let de=U.size;if(U.id==E&&de>=0){X.size=Q,X.start=H,X.skip=B,B+=4,Q+=4,U.next();continue}let ye=U.pos-de;if(de<0||ye<le||U.start<N)break;let I=U.id>=h?4:0,R=U.start;for(U.next();U.pos>ye;){if(U.size<0)if(U.size==-3||U.size==-4)I+=4;else break e;else U.id>=h&&(I+=4);U.next()}H=R,Q+=de,B+=I}return(E<0||Q==Y)&&(X.size=Q,X.start=H,X.skip=B),X.size>4?X:void 0}function q(Y,E,U){let{id:Q,start:H,end:B,size:N}=g;if(g.next(),N>=0&&Q<h){let X=U;if(N>4){let le=g.pos-(N-4);for(;g.pos>le;)U=q(Y,E,U)}E[--U]=X,E[--U]=B-Y,E[--U]=H-Y,E[--U]=Q}else N==-3?x=Q:N==-4&&(_=Q);return U}let G=[],V=[];for(;g.pos>0;)v(n.start||0,n.bufferStart||0,G,V,-1,0);let L=(s=n.length)!==null&&s!==void 0?s:G.length?V[0]+G[0].length:0;return new Fs(m[n.topID],G.reverse(),V.reverse(),L)}const Ob=new WeakMap;function sf(n,s){if(!n.isAnonymous||s instanceof Fi||s.type!=n)return 1;let i=Ob.get(s);if(i==null){i=1;for(let c of s.children){if(c.type!=n||!(c instanceof Fs)){i=1;break}i+=sf(n,c)}Ob.set(s,i)}return i}function sm(n,s,i,c,o,u,h,g,m){let x=0;for(let k=c;k<o;k++)x+=sf(n,s[k]);let _=Math.ceil(x*1.5/8),v=[],y=[];function S(k,C,D,q,G){for(let V=D;V<q;){let L=V,Y=C[V],E=sf(n,k[V]);for(V++;V<q;V++){let U=sf(n,k[V]);if(E+U>=_)break;E+=U}if(V==L+1){if(E>_){let U=k[L];S(U.children,U.positions,0,U.children.length,C[L]+G);continue}v.push(k[L])}else{let U=C[V-1]+k[V-1].length-Y;v.push(sm(n,k,C,L,V,Y,U,null,m))}y.push(Y+G-u)}}return S(s,i,c,o,0),(g||m)(v,y,h)}class TE{constructor(){this.map=new WeakMap}setBuffer(s,i,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(i,c)}getBuffer(s,i){let c=this.map.get(s);return c&&c.get(i)}set(s,i){s instanceof wa?this.setBuffer(s.context.buffer,s.index,i):s instanceof ws&&this.map.set(s.tree,i)}get(s){return s instanceof wa?this.getBuffer(s.context.buffer,s.index):s instanceof ws?this.map.get(s.tree):void 0}cursorSet(s,i){s.buffer?this.setBuffer(s.buffer.buffer,s.index,i):this.map.set(s.tree,i)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class Su{constructor(s,i,c,o,u=!1,h=!1){this.from=s,this.to=i,this.tree=c,this.offset=o,this.open=(u?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(s,i=[],c=!1){let o=[new Su(0,s.length,s,0,!1,c)];for(let u of i)u.to>s.length&&o.push(u);return o}static applyChanges(s,i,c=128){if(!i.length)return s;let o=[],u=1,h=s.length?s[0]:null;for(let g=0,m=0,x=0;;g++){let _=g<i.length?i[g]:null,v=_?_.fromA:1e9;if(v-m>=c)for(;h&&h.from<v;){let y=h;if(m>=y.from||v<=y.to||x){let S=Math.max(y.from,m)-x,k=Math.min(y.to,v)-x;y=S>=k?null:new Su(S,k,y.tree,y.offset+x,g>0,!!_)}if(y&&o.push(y),h.to>v)break;h=u<s.length?s[u++]:null}if(!_)break;m=_.toA,x=_.toA-_.toB}return o}}class CE{startParse(s,i,c){return typeof s=="string"&&(s=new dw(s)),c=c?c.length?c.map(o=>new vl(o.from,o.to)):[new vl(0,0)]:[new vl(0,s.length)],this.createParse(s,i||[],c)}parse(s,i,c){let o=this.startParse(s,i,c);for(;;){let u=o.advance();if(u)return u}}}class dw{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,i){return this.string.slice(s,i)}}function AE(n){return(s,i,c,o)=>new hw(s,n,i,c,o)}class Lb{constructor(s,i,c,o,u,h){this.parser=s,this.parse=i,this.overlay=c,this.bracketed=o,this.target=u,this.from=h}}function zb(n){if(!n.length||n.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class fw{constructor(s,i,c,o,u,h,g,m){this.parser=s,this.predicate=i,this.mounts=c,this.index=o,this.start=u,this.bracketed=h,this.target=g,this.prev=m,this.depth=0,this.ranges=[]}}const Op=new xn({perNode:!0});class hw{constructor(s,i,c,o,u){this.nest=i,this.input=c,this.fragments=o,this.ranges=u,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Fs(c.type,c.children,c.positions,c.length,c.propValues.concat([[Op,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],i=s.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[xn.mounted.id]=new Qc(i,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<s&&(s=Math.min(s,this.inner[i].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(s)}startInner(){let s=new gw(this.fragments),i=null,c=null,o=new uf(new ws(this.baseTree,this.ranges[0].from,0,null),mn.IncludeAnonymous|mn.IgnoreMounts);e:for(let u,h;;){let g=!0,m;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)g=!1;else if(s.hasNode(o)){if(i){let x=i.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(x)for(let _ of x.mount.overlay){let v=_.from+x.pos,y=_.to+x.pos;v>=o.from&&y<=o.to&&!i.ranges.some(S=>S.from<y&&S.to>v)&&i.ranges.push({from:v,to:y})}}g=!1}else if(c&&(h=pw(c.ranges,o.from,o.to)))g=h!=2;else if(!o.type.isAnonymous&&(u=this.nest(o,this.input))&&(o.from<o.to||!u.overlay)){o.tree||(mw(o),i&&i.depth++,c&&c.depth++);let x=s.findMounts(o.from,u.parser);if(typeof u.overlay=="function")i=new fw(u.parser,u.overlay,x,this.inner.length,o.from,!!u.bracketed,o.tree,i);else{let _=Hb(this.ranges,u.overlay||(o.from<o.to?[new vl(o.from,o.to)]:[]));_.length&&zb(_),(_.length||!u.overlay)&&this.inner.push(new Lb(u.parser,_.length?u.parser.startParse(this.input,Bb(x,_),_):u.parser.startParse(""),u.overlay?u.overlay.map(v=>new vl(v.from-o.from,v.to-o.from)):null,!!u.bracketed,o.tree,_.length?_[0].from:o.from)),u.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):g=!1}}else if(i&&(m=i.predicate(o))&&(m===!0&&(m=new vl(o.from,o.to)),m.from<m.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==m.from?i.ranges[x]={from:i.ranges[x].from,to:m.to}:i.ranges.push(m)}if(g&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Hb(this.ranges,i.ranges);x.length&&(zb(x),this.inner.splice(i.index,0,new Lb(i.parser,i.parser.startParse(this.input,Bb(i.mounts,x),x),i.ranges.map(_=>new vl(_.from-i.start,_.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function pw(n,s,i){for(let c of n){if(c.from>=i)break;if(c.to>s)return c.from<=s&&c.to>=i?2:1}return 0}function Ib(n,s,i,c,o,u){if(s<i){let h=n.buffer[s+1];c.push(n.slice(s,i,h)),o.push(h-u)}}function mw(n){let{node:s}=n,i=[],c=s.context.buffer;do i.push(n.index),n.parent();while(!n.tree);let o=n.tree,u=o.children.indexOf(c),h=o.children[u],g=h.buffer,m=[u];function x(_,v,y,S,k,C){let D=i[C],q=[],G=[];Ib(h,_,D,q,G,S);let V=g[D+1],L=g[D+2];m.push(q.length);let Y=C?x(D+4,g[D+3],h.set.types[g[D]],V,L-V,C-1):s.toTree();return q.push(Y),G.push(V-S),Ib(h,g[D+3],v,q,G,S),new Fs(y,q,G,k)}o.children[u]=x(0,g.length,Ql.none,0,h.length,i.length-1);for(let _ of m){let v=n.tree.children[_],y=n.tree.positions[_];n.yield(new ws(v,y+n.from,_,n._tree))}}class Ub{constructor(s,i){this.offset=i,this.done=!1,this.cursor=s.cursor(mn.IncludeAnonymous|mn.IgnoreMounts)}moveTo(s){let{cursor:i}=this,c=s-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=s&&i.enter(c,1,mn.IgnoreOverlays|mn.ExcludeBuffers)))if(i.to<=s)i.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==s.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof Fs)i=i.children[0];else break}return!1}}class gw{constructor(s){var i;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(i=c.tree.prop(Op))!==null&&i!==void 0?i:c.to,this.inner=new Ub(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(s=i.tree.prop(Op))!==null&&s!==void 0?s:i.to,this.inner=new Ub(i.tree,-i.offset)}}findMounts(s,i){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,1);for(let u=this.inner.cursor.node;u;u=u.parent){let h=(c=u.tree)===null||c===void 0?void 0:c.prop(xn.mounted);if(h&&h.parser==i)for(let g=this.fragI;g<this.fragments.length;g++){let m=this.fragments[g];if(m.from>=u.to)break;m.tree==this.curFrag.tree&&o.push({frag:m,pos:u.from-m.offset,mount:h})}}}return o}}function Hb(n,s){let i=null,c=s;for(let o=1,u=0;o<n.length;o++){let h=n[o-1].to,g=n[o].from;for(;u<c.length;u++){let m=c[u];if(m.from>=g)break;m.to<=h||(i||(c=i=s.slice()),m.from<h?(i[u]=new vl(m.from,h),m.to>g&&i.splice(u+1,0,new vl(g,m.to))):m.to>g?i[u--]=new vl(g,m.to):i.splice(u--,1))}}return c}function xw(n,s,i,c){let o=0,u=0,h=!1,g=!1,m=-1e9,x=[];for(;;){let _=o==n.length?1e9:h?n[o].to:n[o].from,v=u==s.length?1e9:g?s[u].to:s[u].from;if(h!=g){let y=Math.max(m,i),S=Math.min(_,v,c);y<S&&x.push(new vl(y,S))}if(m=Math.min(_,v),m==1e9)break;_==m&&(h?(h=!1,o++):h=!0),v==m&&(g?(g=!1,u++):g=!0)}return x}function Bb(n,s){let i=[];for(let{pos:c,mount:o,frag:u}of n){let h=c+(o.overlay?o.overlay[0].from:0),g=h+o.tree.length,m=Math.max(u.from,h),x=Math.min(u.to,g);if(o.overlay){let _=o.overlay.map(y=>new vl(y.from+c,y.to+c)),v=xw(s,_,m,x);for(let y=0,S=m;;y++){let k=y==v.length,C=k?x:v[y].from;if(C>S&&i.push(new Su(S,C,o.tree,-h,u.from>=S||u.openStart,u.to<=C||u.openEnd)),k)break;S=v[y].to}}else i.push(new Su(m,x,o.tree,-h,u.from>=h||u.openStart,u.to<=g||u.openEnd))}return i}let bw=0;class yl{constructor(s,i,c,o){this.name=s,this.set=i,this.base=c,this.modified=o,this.id=bw++}toString(){let{name:s}=this;for(let i of this.modified)i.name&&(s=`${i.name}(${s})`);return s}static define(s,i){let c=typeof s=="string"?s:"?";if(s instanceof yl&&(i=s),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new yl(c,[],null,[]);if(o.set.push(o),i)for(let u of i.set)o.set.push(u);return o}static defineModifier(s){let i=new df(s);return c=>c.modified.indexOf(i)>-1?c:df.get(c.base||c,c.modified.concat(i).sort((o,u)=>o.id-u.id))}}let _w=0;class df{constructor(s){this.name=s,this.instances=[],this.id=_w++}static get(s,i){if(!i.length)return s;let c=i[0].instances.find(g=>g.base==s&&yw(i,g.modified));if(c)return c;let o=[],u=new yl(s.name,o,s,i);for(let g of i)g.instances.push(u);let h=vw(i);for(let g of s.set)if(!g.modified.length)for(let m of h)o.push(df.get(g,m));return u}}function yw(n,s){return n.length==s.length&&n.every((i,c)=>i==s[c])}function vw(n){let s=[[]];for(let i=0;i<n.length;i++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(n[i]));return s.sort((i,c)=>c.length-i.length)}function ME(n){let s=Object.create(null);for(let i in n){let c=n[i];Array.isArray(c)||(c=[c]);for(let o of i.split(" "))if(o){let u=[],h=2,g=o;for(let v=0;;){if(g=="..."&&v>0&&v+3==o.length){h=1;break}let y=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(g);if(!y)throw new RangeError("Invalid path: "+o);if(u.push(y[0]=="*"?"":y[0][0]=='"'?JSON.parse(y[0]):y[0]),v+=y[0].length,v==o.length)break;let S=o[v++];if(v==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);g=o.slice(v)}let m=u.length-1,x=u[m];if(!x)throw new RangeError("Invalid path: "+o);let _=new Eu(c,h,m>0?u.slice(0,m):null);s[x]=_.sort(s[x])}}return uy.add(s)}const uy=new xn({combine(n,s){let i,c,o;for(;n||s;){if(!n||s&&n.depth>=s.depth?(o=s,s=s.next):(o=n,n=n.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let u=new Eu(o.tags,o.mode,o.context);i?i.next=u:c=u,i=u}return c}});class Eu{constructor(s,i,c,o){this.tags=s,this.mode=i,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}Eu.empty=new Eu([],2,null);function dy(n,s){let i=Object.create(null);for(let u of n)if(!Array.isArray(u.tag))i[u.tag.id]=u.class;else for(let h of u.tag)i[h.id]=u.class;let{scope:c,all:o=null}=s||{};return{style:u=>{let h=o;for(let g of u)for(let m of g.set){let x=i[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function jw(n,s){let i=null;for(let c of n){let o=c.style(s);o&&(i=i?i+" "+o:o)}return i}function ww(n,s,i,c=0,o=n.length){let u=new Nw(c,Array.isArray(s)?s:[s],i);u.highlightRange(n.cursor(),c,o,"",u.highlighters),u.flush(o)}function kw(n,s,i,c,o,u=0,h=n.length){let g=u;function m(x,_){if(!(x<=g)){for(let v=n.slice(g,x),y=0;;){let S=v.indexOf(`
|
|
117
|
-
`,y),k=S<0?v.length:S;if(k>y&&c(v.slice(y,k),_),S<0)break;o(),y=S+1}g=x}}ww(s,i,(x,_,v)=>{m(x,""),m(_,v)},u,h),m(h,"")}class Nw{constructor(s,i,c){this.at=s,this.highlighters=i,this.span=c,this.class=""}startSpan(s,i){i!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=i)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,i,c,o,u){let{type:h,from:g,to:m}=s;if(g>=c||m<=i)return;h.isTop&&(u=this.highlighters.filter(S=>!S.scope||S.scope(h)));let x=o,_=Sw(s)||Eu.empty,v=jw(u,_.tags);if(v&&(x&&(x+=" "),x+=v,_.mode==1&&(o+=(o?" ":"")+v)),this.startSpan(Math.max(i,g),x),_.opaque)return;let y=s.tree&&s.tree.prop(xn.mounted);if(y&&y.overlay){let S=s.node.enter(y.overlay[0].from+g,1),k=this.highlighters.filter(D=>!D.scope||D.scope(y.tree.type)),C=s.firstChild();for(let D=0,q=g;;D++){let G=D<y.overlay.length?y.overlay[D]:null,V=G?G.from+g:m,L=Math.max(i,q),Y=Math.min(c,V);if(L<Y&&C)for(;s.from<Y&&(this.highlightRange(s,L,Y,o,u),this.startSpan(Math.min(Y,s.to),x),!(s.to>=V||!s.nextSibling())););if(!G||V>c)break;q=G.to+g,q>i&&(this.highlightRange(S.cursor(),Math.max(i,G.from+g),Math.min(c,q),"",k),this.startSpan(Math.min(c,q),x))}C&&s.parent()}else if(s.firstChild()){y&&(o="");do if(!(s.to<=i)){if(s.from>=c)break;this.highlightRange(s,i,c,o,u),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function Sw(n){let s=n.type.prop(uy);for(;s&&s.context&&!n.matchContext(s.context);)s=s.next;return s||null}const Me=yl.define,Id=Me(),$i=Me(),qb=Me($i),Gb=Me($i),Yi=Me(),Ud=Me(Yi),fp=Me(Yi),_a=Me(),wr=Me(_a),pa=Me(),ma=Me(),Lp=Me(),du=Me(Lp),Hd=Me(),ze={comment:Id,lineComment:Me(Id),blockComment:Me(Id),docComment:Me(Id),name:$i,variableName:Me($i),typeName:qb,tagName:Me(qb),propertyName:Gb,attributeName:Me(Gb),className:Me($i),labelName:Me($i),namespace:Me($i),macroName:Me($i),literal:Yi,string:Ud,docString:Me(Ud),character:Me(Ud),attributeValue:Me(Ud),number:fp,integer:Me(fp),float:Me(fp),bool:Me(Yi),regexp:Me(Yi),escape:Me(Yi),color:Me(Yi),url:Me(Yi),keyword:pa,self:Me(pa),null:Me(pa),atom:Me(pa),unit:Me(pa),modifier:Me(pa),operatorKeyword:Me(pa),controlKeyword:Me(pa),definitionKeyword:Me(pa),moduleKeyword:Me(pa),operator:ma,derefOperator:Me(ma),arithmeticOperator:Me(ma),logicOperator:Me(ma),bitwiseOperator:Me(ma),compareOperator:Me(ma),updateOperator:Me(ma),definitionOperator:Me(ma),typeOperator:Me(ma),controlOperator:Me(ma),punctuation:Lp,separator:Me(Lp),bracket:du,angleBracket:Me(du),squareBracket:Me(du),paren:Me(du),brace:Me(du),content:_a,heading:wr,heading1:Me(wr),heading2:Me(wr),heading3:Me(wr),heading4:Me(wr),heading5:Me(wr),heading6:Me(wr),contentSeparator:Me(_a),list:Me(_a),quote:Me(_a),emphasis:Me(_a),strong:Me(_a),link:Me(_a),monospace:Me(_a),strikethrough:Me(_a),inserted:Me(),deleted:Me(),changed:Me(),invalid:Me(),meta:Hd,documentMeta:Me(Hd),annotation:Me(Hd),processingInstruction:Me(Hd),definition:yl.defineModifier("definition"),constant:yl.defineModifier("constant"),function:yl.defineModifier("function"),standard:yl.defineModifier("standard"),local:yl.defineModifier("local"),special:yl.defineModifier("special")};for(let n in ze){let s=ze[n];s instanceof yl&&(s.name=n)}dy([{tag:ze.link,class:"tok-link"},{tag:ze.heading,class:"tok-heading"},{tag:ze.emphasis,class:"tok-emphasis"},{tag:ze.strong,class:"tok-strong"},{tag:ze.keyword,class:"tok-keyword"},{tag:ze.atom,class:"tok-atom"},{tag:ze.bool,class:"tok-bool"},{tag:ze.url,class:"tok-url"},{tag:ze.labelName,class:"tok-labelName"},{tag:ze.inserted,class:"tok-inserted"},{tag:ze.deleted,class:"tok-deleted"},{tag:ze.literal,class:"tok-literal"},{tag:ze.string,class:"tok-string"},{tag:ze.number,class:"tok-number"},{tag:[ze.regexp,ze.escape,ze.special(ze.string)],class:"tok-string2"},{tag:ze.variableName,class:"tok-variableName"},{tag:ze.local(ze.variableName),class:"tok-variableName tok-local"},{tag:ze.definition(ze.variableName),class:"tok-variableName tok-definition"},{tag:ze.special(ze.variableName),class:"tok-variableName2"},{tag:ze.definition(ze.propertyName),class:"tok-propertyName tok-definition"},{tag:ze.typeName,class:"tok-typeName"},{tag:ze.namespace,class:"tok-namespace"},{tag:ze.className,class:"tok-className"},{tag:ze.macroName,class:"tok-macroName"},{tag:ze.propertyName,class:"tok-propertyName"},{tag:ze.operator,class:"tok-operator"},{tag:ze.comment,class:"tok-comment"},{tag:ze.meta,class:"tok-meta"},{tag:ze.invalid,class:"tok-invalid"},{tag:ze.punctuation,class:"tok-punctuation"}]);const Ew="modulepreload",Tw=function(n,s){return new URL(n,s).href},$b={},ft=function(s,i,c){let o=Promise.resolve();if(i&&i.length>0){let h=function(_){return Promise.all(_.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const g=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(i.map(_=>{if(_=Tw(_,c),_ in $b)return;$b[_]=!0;const v=_.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(!!c)for(let C=g.length-1;C>=0;C--){const D=g[C];if(D.href===_&&(!v||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${y}`))return;const k=document.createElement("link");if(k.rel=v?"stylesheet":Ew,v||(k.as="script"),k.crossOrigin="",k.href=_,x&&k.setAttribute("nonce",x),document.head.appendChild(k),v)return new Promise((C,D)=>{k.addEventListener("load",C),k.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${_}`)))})}))}function u(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return o.then(h=>{for(const g of h||[])g.status==="rejected"&&u(g.reason);return s().catch(u)})},fy={js:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await ft(async()=>{const{javascript:n}=await import("./index-B2DXcZzx.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await ft(async()=>{const{json:n}=await import("./index-B-LIRCC5.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await ft(async()=>{const{json:n}=await import("./index-B-LIRCC5.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await ft(async()=>{const{css:n}=await import("./index-Fah17-KT.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await ft(async()=>{const{css:n}=await import("./index-Fah17-KT.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await ft(async()=>{const{css:n}=await import("./index-Fah17-KT.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await ft(async()=>{const{html:n}=await import("./index-CI8_AQA6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await ft(async()=>{const{html:n}=await import("./index-CI8_AQA6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await ft(async()=>{const{html:n}=await import("./index-CI8_AQA6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await ft(async()=>{const{html:n}=await import("./index-CI8_AQA6.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await ft(async()=>{const{markdown:n}=await import("./index-Bz0WR3RW.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await ft(async()=>{const{markdown:n}=await import("./index-Bz0WR3RW.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await ft(async()=>{const{python:n}=await import("./index-CmansqyT.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await ft(async()=>{const{python:n}=await import("./index-CmansqyT.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await ft(async()=>{const{yaml:n}=await import("./index-CjvP4Ufw.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await ft(async()=>{const{yaml:n}=await import("./index-CjvP4Ufw.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await ft(async()=>{const{rust:n}=await import("./index-LuDnKNtv.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await ft(async()=>{const{cpp:n}=await import("./index-Cf0qn8gk.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await ft(async()=>{const{cpp:n}=await import("./index-Cf0qn8gk.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await ft(async()=>{const{cpp:n}=await import("./index-Cf0qn8gk.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await ft(async()=>{const{cpp:n}=await import("./index-Cf0qn8gk.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await ft(async()=>{const{cpp:n}=await import("./index-Cf0qn8gk.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await ft(async()=>{const{java:n}=await import("./index-BAlgeWgk.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await ft(async()=>{const{go:n}=await import("./index-BuubCa9v.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await ft(async()=>{const{php:n}=await import("./index-gQynn_4Z.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await ft(async()=>{const{sql:n}=await import("./index-BmU1au2p.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await ft(async()=>{const{xml:n}=await import("./index-B-uZbpTM.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await ft(async()=>{const{xml:n}=await import("./index-B-uZbpTM.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},Cw={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},Aw={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function Mw(n){const s=Aw[n.toLowerCase()]??n.toLowerCase(),i=fy[s];return i?i().catch(()=>null):null}async function Rw(n){const s=(n.split("/").pop()??"").toLowerCase(),i=Cw[s]??s.split(".").pop()??"",c=fy[i];return c?c().catch(()=>null):null}const Dw=dy([{tag:[ze.keyword,ze.modifier,ze.controlKeyword,ze.moduleKeyword],class:"cmh-key"},{tag:[ze.propertyName],class:"cmh-prop"},{tag:[ze.function(ze.variableName),ze.labelName],class:"cmh-fn"},{tag:[ze.color,ze.constant(ze.name),ze.standard(ze.name),ze.bool],class:"cmh-const"},{tag:[ze.typeName,ze.className,ze.changed,ze.annotation,ze.self,ze.namespace],class:"cmh-type"},{tag:[ze.number,ze.integer,ze.float],class:"cmh-num"},{tag:[ze.string,ze.special(ze.string),ze.regexp],class:"cmh-str"},{tag:[ze.operator,ze.operatorKeyword,ze.escape],class:"cmh-op"},{tag:[ze.meta,ze.comment],class:"cmh-comment"},{tag:ze.invalid,class:"cmh-invalid"}]);function Bd(n){return n.replace(/[&<>]/g,s=>s==="&"?"&":s==="<"?"<":">")}async function Ow(n,s){const i=s?await Mw(s):null;if(!i)return Bd(n);try{const c=i.language.parser.parse(n);let o="";return kw(n,c,Dw,(u,h)=>{o+=h?`<span class="${h}">${Bd(u)}</span>`:Bd(u)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return Bd(n)}}$t.setOptions({gfm:!0,breaks:!1});function hy(n){var i;const s=(i=n.split(".").pop())==null?void 0:i.toLowerCase();return s==="md"||s==="markdown"}async function wf(n){const s=await $t.parse(n,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await Ow(c.text,c.lang??""),c.escaped=!0}});return sw.sanitize(s)}function Yb(n,s){return{path:n.path,text:n.content,saved:n.content,eol:n.eol,encoding:n.encoding,mtime:n.mtime,size:n.size,binary:n.binary,tooLarge:n.tooLarge,mediaMime:n.mediaMime,mediaTooLarge:n.mediaTooLarge,stale:!1,revision:s,previewMode:hy(n.path)}}function Wa(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function Lw(n){return n.split("/").pop()??n}function Dr(n){const s=n.lastIndexOf("/");return s===-1?"":n.slice(0,s)}function lf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}var Tu=T_();function Xi({x:n,y:s,items:i,note:c,onClose:o}){const u=b.useRef(null),[h,g]=b.useState({left:n,top:s}),[m,x]=b.useState(()=>{const y=i.findIndex(S=>!S.disabled);return y===-1?0:y});b.useLayoutEffect(()=>{const y=u.current;if(!y)return;const S=y.getBoundingClientRect(),k=8,C=Math.max(k,Math.min(n,window.innerWidth-S.width-k)),D=Math.max(k,Math.min(s,window.innerHeight-S.height-k));g({left:C,top:D})},[n,s]),b.useLayoutEffect(()=>{var y;(y=u.current)==null||y.focus()},[]),b.useLayoutEffect(()=>{function y(k){var C;(C=u.current)!=null&&C.contains(k.target)||o()}function S(){o()}return document.addEventListener("mousedown",y),document.addEventListener("scroll",S,!0),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("scroll",S,!0)}},[o]);function _(y){y.disabled||(y.onSelect(),o())}function v(y){if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),o();return}const S=i.map((k,C)=>({item:k,index:C})).filter(k=>!k.item.disabled);if(S.length!==0){if(y.key==="ArrowDown"||y.key==="ArrowUp"){y.preventDefault();const k=y.key==="ArrowDown"?1:-1,C=S.findIndex(q=>q.index===m),D=S[(((C===-1?0:C)+k)%S.length+S.length)%S.length];D&&x(D.index);return}if(y.key==="Enter"||y.key===" "){y.preventDefault();const k=i[m];k&&_(k)}}}return Tu.createPortal(a.jsxs("div",{ref:u,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:v,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),i.map((y,S)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":y.disabled,className:"ctxmenu__item"+(S===m?" is-cursor":""),onMouseEnter:()=>x(S),onClick:()=>_(y),children:[a.jsx("span",{className:"ctxmenu__label",children:y.label}),y.hint&&a.jsx("span",{className:"ctxmenu__hint",children:y.hint})]},y.id))]}),document.body)}const zw=3500,Iw=9e3,Vb=220;function Ir({result:n,onDismiss:s}){const[i,c]=b.useState(n),[o,u]=b.useState(!1);if(b.useEffect(()=>{if(!n){c(null),u(!1);return}if(c(n),u(!1),n.url)return;const g=n.ok?zw:Iw,m=setTimeout(()=>u(!0),g),x=setTimeout(()=>c(null),g+Vb);return()=>{clearTimeout(m),clearTimeout(x)}},[n]),!i)return null;const h=()=>{u(!0),setTimeout(()=>{c(null),s==null||s()},Vb)};return a.jsxs("div",{className:"oplog "+(i.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(i.url?" oplog--dismissible":""),role:"status","aria-live":i.ok?"polite":"assertive",children:[i.message,i.url&&a.jsxs("a",{className:"oplog__link",href:i.url,target:"_blank",rel:"noreferrer",onClick:g=>g.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ja({value:n,className:s,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[u,h]=b.useState(n),g=b.useRef(null);b.useEffect(()=>{var x;(x=g.current)==null||x.select()},[]);function m(){const x=u.trim();if(!x||x===n)return o();c(x)}return a.jsx("input",{ref:g,className:s?`rename ${s}`:"rename",value:u,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:x=>h(x.target.value),onBlur:m,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),m()):x.key==="Escape"&&(x.preventDefault(),o())}})}function io({active:n}){return n?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const Uw=500,kr="application/x-ccv-fs-path",Hw=200;function Bw({open:n,tree:s,expanded:i,activePath:c,dirty:o,gitChanges:u,result:h,searchResult:g,onSearch:m,onReveal:x,onToggle:_,onOpen:v,onCreate:y,onRename:S,onMove:k,onCopy:C,onDelete:D,onRefresh:q,onClose:G,zoomed:V,onToggleZoom:L}){const[Y,E]=b.useState(""),[U,Q]=b.useState(null),[H,B]=b.useState(null),[N,X]=b.useState(null),[le,de]=b.useState(null),[ye,I]=b.useState(null),[R,P]=b.useState(null),ae=yf("(hover: hover)"),Ne=b.useRef(null),A=b.useMemo(()=>$w(u),[u]);function K(re){return!(!N||re===N.path||N.kind==="dir"&&re.startsWith(`${N.path}/`)||re===Dr(N.path))}function fe(re){return!(!ye||re===ye.path||ye.kind==="dir"&&re.startsWith(`${ye.path}/`)||ye.mode==="cut"&&re===Dr(ye.path))}function ke(re){I({path:re.path,kind:re.kind,mode:"copy"})}function Re(re){I({path:re.path,kind:re.kind,mode:"cut"})}function Ue(re){!ye||!fe(re)||(re&&!i.has(re)&&_(re),ye.mode==="cut"?(k(ye.path,re),I(null)):C(ye.path,re))}function _e(re,we){const Ve=re.touches[0];if(!Ve)return;const et={timer:0,x:Ve.clientX,y:Ve.clientY,el:re.currentTarget,fired:!1};et.timer=window.setTimeout(()=>{et.fired=!0,we(et.x,et.y,et.el)},Uw),Ne.current=et}function Ze(re){const we=Ne.current,Ve=re.touches[0];!we||!Ve||Math.hypot(Ve.clientX-we.x,Ve.clientY-we.y)>10&&(window.clearTimeout(we.timer),Ne.current=null)}function rt(re){const we=Ne.current;we&&(window.clearTimeout(we.timer),we.fired&&re.preventDefault())}function Bt(){var re;return(re=Ne.current)!=null&&re.fired?(Ne.current=null,!0):!1}function he(re,we,Ve,et){E((et==null?void 0:et.path)??""),P({x:re,y:we,opener:Ve,entry:et})}function at(){const re=R==null?void 0:R.opener;P(null),re!=null&&re.isConnected&&re.focus()}function oe(re){return{onContextMenu:we=>{we.preventDefault(),he(we.clientX,we.clientY,we.currentTarget,re)},onTouchStart:we=>_e(we,(Ve,et,nt)=>he(Ve,et,nt,re)),onTouchMove:Ze,onTouchEnd:rt,onTouchCancel:rt}}function Rt(re){re.target===re.currentTarget&&(re.preventDefault(),he(re.clientX,re.clientY,re.currentTarget,null))}function He(re){re.target===re.currentTarget&&_e(re,(we,Ve,et)=>he(we,Ve,et,null))}function qt(re){if(!(re.ctrlKey||re.metaKey)||re.target instanceof HTMLInputElement)return;const we=re.key.toLowerCase();if(we==="v"){re.preventDefault(),Ue(Pe());return}if(!Y)return;const Ve=Xb(s,Y);Ve&&(we==="c"?(re.preventDefault(),ke(Ve)):we==="x"&&(re.preventDefault(),Re(Ve)))}function Un(re){return we=>{we.dataTransfer.effectAllowed="move",we.dataTransfer.setData(kr,re.path),X({path:re.path,kind:re.kind})}}function bt(){X(null),de(null)}function Kt(re){return we=>{we.dataTransfer.types.includes(kr)&&(we.stopPropagation(),!(re.kind!=="dir"||!K(re.path))&&(we.preventDefault(),de(re.path)))}}function ln(re){return we=>{if(!we.dataTransfer.types.includes(kr)||(we.stopPropagation(),re.kind!=="dir"||!K(re.path)))return;we.preventDefault();const Ve=we.dataTransfer.getData(kr);de(null),Ve&&k(Ve,re.path)}}function Xn(re){!re.dataTransfer.types.includes(kr)||!K("")||(re.preventDefault(),de(""))}function wt(re){if(!re.dataTransfer.types.includes(kr)||!K(""))return;re.preventDefault();const we=re.dataTransfer.getData(kr);de(null),we&&k(we,"")}const[Z,De]=b.useState(""),$e=Z.trim(),ht=$e.length>0,Ee=b.useRef(null),Te=b.useRef(m);Te.current=m;function Oe(re){De(re),Ee.current&&clearTimeout(Ee.current);const we=re.trim();if(!we){Te.current("");return}Ee.current=setTimeout(()=>Te.current(we),Hw)}function Ye(re){Ee.current&&clearTimeout(Ee.current),De(""),Te.current(""),E(re.path),x(re)}const Qe=ht&&(g==null?void 0:g.query)===$e?g:null;function Pe(){if(Y==="")return"";const re=Xb(s,Y);if((re==null?void 0:re.kind)==="dir")return Y;const we=Y.lastIndexOf("/");return we===-1?"":Y.slice(0,we)}function pt(re,we){const Ve=we??Pe();Ve&&!i.has(Ve)&&_(Ve),B({parent:Ve,kind:re})}function At(){if(!R)return[];const re=et=>ae?et:void 0;if(!R.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:re("Ctrl+V"),disabled:!fe(""),onSelect:()=>Ue("")},{id:"new-file",label:"Создать файл",onSelect:()=>pt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>pt("dir","")}];const we=R.entry,Ve=[we.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>v(we.path)}:{id:"toggle",label:i.has(we.path)?"Свернуть":"Развернуть",onSelect:()=>_(we.path)},{id:"copy",label:"Копировать",hint:re("Ctrl+C"),onSelect:()=>ke(we)},{id:"cut",label:"Вырезать",hint:re("Ctrl+X"),onSelect:()=>Re(we)}];return we.kind==="dir"&&(Ve.push({id:"paste",label:"Вставить",hint:re("Ctrl+V"),disabled:!fe(we.path),onSelect:()=>Ue(we.path)}),Ve.push({id:"new-file",label:"Создать файл",onSelect:()=>pt("file",we.path)}),Ve.push({id:"new-dir",label:"Создать каталог",onSelect:()=>pt("dir",we.path)})),Ve.push({id:"rename",label:"Переименовать",onSelect:()=>Q(we.path)}),Ve.push({id:"delete",label:"Удалить",onSelect:()=>D(we)}),Ve}const Sn=ht?[]:Et("",0);function Et(re,we){const Ve=s[re],et=[];if(H&&H.parent===re&&et.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:ei(we),children:[a.jsx("span",{className:"fsrow__icon",children:H.kind==="dir"?a.jsx(hf,{}):a.jsx(pf,{})}),a.jsx(ja,{className:"rename--file",value:"",placeholder:H.kind==="dir"?"имя каталога":"имя файла",onCommit:nt=>{B(null),y(re,H.kind,nt)},onCancel:()=>B(null)})]},`draft:${re}`)),!Ve)return et.push(a.jsx("p",{className:"fsrow__pending",style:ei(we),children:"читаем…"},`wait:${re}`)),et;Ve.length===0&&!H&&et.push(a.jsx("p",{className:"fsrow__pending",style:ei(we),children:"пусто"},`empty:${re}`));for(const nt of Ve){const on=nt.kind==="dir"&&i.has(nt.path);et.push(U===nt.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:ei(we),children:[a.jsx("span",{className:"fsrow__icon",children:nt.kind==="dir"?a.jsx(hf,{open:on}):a.jsx(pf,{})}),a.jsx(ja,{className:"rename--file",value:nt.name,placeholder:"новое имя",onCommit:On=>{Q(null),S(nt.path,On)},onCancel:()=>Q(null)})]},nt.path):a.jsx(qw,{entry:nt,depth:we,open:on,active:nt.path===c,selected:nt.path===Y,dirty:o.has(nt.path),gitStatus:A.get(nt.path),dragging:(N==null?void 0:N.path)===nt.path,dropTarget:le===nt.path,cut:(ye==null?void 0:ye.mode)==="cut"&&ye.path===nt.path,onClick:()=>{Bt()||(E(nt.path),nt.kind==="dir"?_(nt.path):v(nt.path))},onRename:()=>Q(nt.path),onDelete:()=>D(nt),onDragStart:Un(nt),onDragEnd:bt,onDragOver:Kt(nt),onDrop:ln(nt),...oe(nt)},nt.path)),on&&et.push(...Et(nt.path,we+1))}return et}function Lt(){if(!Qe)return[a.jsx("p",{className:"fsrow__pending",style:ei(0),children:"ищем…"},"search:wait")];if(Qe.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:ei(0),children:"ничего не найдено"},"search:empty")];const re=Qe.entries.map(we=>a.jsx(Gw,{entry:we,gitStatus:A.get(we.path),onClick:()=>Ye(we)},we.path));return Qe.truncated&&re.push(a.jsxs("p",{className:"fsrow__pending",style:ei(0),children:["показаны первые ",Qe.entries.length," — уточните запрос"]},"search:truncated")),re}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(V?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:qt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:re=>{L&&(re.target.closest("button")||L())},children:[a.jsx(Qw,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>pt("file"),children:a.jsx(Vw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>pt("dir"),children:a.jsx(Xw,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:q,children:"↻"}),L&&a.jsx("button",{className:"sidepane__btn",title:V?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":V?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":V,onClick:L,children:a.jsx(io,{active:V})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:G,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Kw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Z,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:re=>Oe(re.target.value),onKeyDown:re=>{re.stopPropagation(),re.key==="Escape"&&(re.preventDefault(),Z?Oe(""):re.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Oe(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(le===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Xn,onDrop:wt,onContextMenu:Rt,onTouchStart:He,onTouchMove:Ze,onTouchEnd:rt,onTouchCancel:rt,children:ht?Lt():Sn}),a.jsx(Ir,{result:h}),R&&a.jsx(Xi,{x:R.x,y:R.y,items:At(),onClose:at})]})}function qw({entry:n,depth:s,open:i,active:c,selected:o,dirty:u,gitStatus:h,dragging:g,dropTarget:m,cut:x,onClick:_,onRename:v,onDelete:y,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:D,onContextMenu:q,onTouchStart:G,onTouchMove:V,onTouchEnd:L,onTouchCancel:Y}){const E="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(g?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:E,style:ei(s),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:D,onContextMenu:q,onTouchStart:G,onTouchMove:V,onTouchEnd:L,onTouchCancel:Y,children:[a.jsxs("button",{className:"fsrow__main",onClick:_,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+ff("fsrow__icon",h),children:n.kind==="dir"?a.jsx(hf,{open:i}):a.jsx(pf,{})}),a.jsx("span",{className:"fsrow__name"+ff("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),u&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:v,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:y,children:"✕"})]})}function Gw({entry:n,gitStatus:s,onClick:i}){const c=n.path.slice(0,n.path.length-n.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:ei(0),onClick:i,title:py(n),children:[a.jsx("span",{className:"fsrow__icon"+ff("fsrow__icon",s),children:n.kind==="dir"?a.jsx(hf,{}):a.jsx(pf,{})}),a.jsx("span",{className:"fsrow__name"+ff("fsrow__name",s),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function py(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function ei(n){return{"--depth":n}}function Xb(n,s){var o;const i=s.lastIndexOf("/"),c=i===-1?"":s.slice(0,i);return((o=n[c])==null?void 0:o.find(u=>u.path===s))??null}function $w(n){const s=new Map,i={added:1,modified:2},c=(o,u)=>{const h=s.get(o);(!h||i[u]>i[h])&&s.set(o,u)};for(const o of n){const u=Yw(o.status);if(!u)continue;c(o.path,u);let h=Dr(o.path);for(;c(h,u),!!h;)h=Dr(h)}return s}function Yw(n){if(n==="??")return"added";const[s="",i=""]=n;return s==="A"||s==="R"||s==="C"?"added":s==="M"||i==="M"?"modified":null}function ff(n,s){return s?` ${n}--git-${s}`:""}function hf({open:n=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?a.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function pf(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]})}function Vw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function Xw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function Qw(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function Kw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const Zw=200;function Fw({open:n,result:s,onSearch:i,onOpenMatch:c,onClose:o,zoomed:u,onToggleZoom:h}){const[g,m]=b.useState(""),x=g.trim(),_=x.length>0,v=b.useRef(null),y=b.useRef(i);y.current=i;function S(D){m(D),v.current&&clearTimeout(v.current);const q=D.trim();if(!q){y.current("");return}v.current=setTimeout(()=>y.current(q),Zw)}const k=_&&(s==null?void 0:s.query)===x?s:null;function C(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const D=[];let q="";for(const G of k.matches)G.path!==q&&(q=G.path,D.push(a.jsx("p",{className:"searchgroup__path",title:G.path,children:G.path},`path:${G.path}`))),D.push(a.jsx(Pw,{match:G,onClick:()=>c(G)},`${G.path}:${G.line}:${G.column}`));return k.truncated&&D.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),D}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(u?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:D=>{h&&(D.target.closest("button")||h())},children:[a.jsx(Jw,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:u?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":u?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":u,onClick:h,children:a.jsx(io,{active:u})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Ww,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:g,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:D=>S(D.target.value),onKeyDown:D=>{D.stopPropagation(),D.key==="Escape"&&(D.preventDefault(),g?S(""):D.currentTarget.blur())}}),g&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:_?C():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Pw({match:n,onClick:s}){const i=n.lineText.slice(0,n.column-1),c=n.lineText.slice(n.column-1,n.column-1+n.matchLength),o=n.lineText.slice(n.column-1+n.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:s,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[i,a.jsx("mark",{children:c}),o]})]})}function Jw(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function Ww(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let qd=null;function e1(){return qd||(qd=Promise.all([ft(()=>import("./index-DdH3nyWH.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),ft(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),ft(()=>import("./index-BHot-lnj.js"),[],import.meta.url),ft(()=>import("./index-nvCEaOt_.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),ft(()=>import("./codemirror-Mu11LZof.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,s,i,c,o])=>({EditorView:s.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw qd=null,n})),qd}function t1({path:n,doc:s,revision:i,goto:c,onChange:o,onSave:u}){const h=b.useRef(null),g=b.useRef(null),m=b.useRef(null),x=b.useRef(new Map),_=b.useRef(new Map),v=b.useRef(new Set),y=b.useRef(null),S=b.useRef(o),k=b.useRef(u),C=b.useRef(n),D=b.useRef(i),q=b.useRef(s);S.current=o,k.current=u,C.current=n,D.current=i,q.current=s;const[G,V]=b.useState("loading"),[L,Y]=b.useState(!1);function E(Q,H,B,N,X){const le=x.current.get(N),de=_.current.get(N)===X;if(le&&de)B.setState(le);else{const I=Q.EditorState.create({doc:q.current,extensions:[Q.basicSetup,Q.Prec.highest(Q.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(C.current),!0)}])),Q.keymap.of([Q.indentWithTab]),H.of([]),Q.editorTheme,Q.editorHighlight,Q.EditorView.updateListener.of(R=>{R.docChanged&&S.current(C.current,R.state.doc.toString())})]});x.current.set(N,I),_.current.set(N,X),B.setState(I),v.current.delete(N)}if(v.current.has(N))return()=>{};let ye=!1;return Rw(N).then(I=>{ye||!I||C.current!==N||(B.dispatch({effects:H.reconfigure(I)}),x.current.set(N,B.state),v.current.add(N))}),()=>{ye=!0}}b.useEffect(()=>{if(!h.current)return;let H=!1,B=null,N=null;V("loading"),Y(!1);const X=window.setTimeout(()=>{H||Y(!0)},200);return(async()=>{let le;try{le=await e1()}catch{window.clearTimeout(X),H||V("error");return}if(H||!h.current)return;window.clearTimeout(X);const de=new le.Compartment;y.current=de,m.current=le,N=new le.EditorView({parent:h.current}),g.current=N,B=E(le,de,N,C.current,D.current),V("ready")})(),()=>{H=!0,window.clearTimeout(X),B==null||B(),N==null||N.destroy(),g.current===N&&(g.current=null),m.current=null,y.current=null}},[]),b.useEffect(()=>{const Q=m.current,H=g.current,B=y.current;if(!(!Q||!H||!B))return E(Q,B,H,n,i)},[n,i]);const U=b.useRef(0);return b.useEffect(()=>{const Q=g.current,H=m.current;if(!Q||!H||!c||c.token===U.current)return;U.current=c.token;const B=Q.state.doc.lines,N=Math.min(Math.max(c.line,1),B),X=Q.state.doc.line(N),le=Math.min(X.from+Math.max(c.column-1,0),X.to);Q.dispatch({selection:H.EditorSelection.cursor(le),effects:H.EditorView.scrollIntoView(le,{y:"center"})}),Q.focus()},[c]),b.useEffect(()=>()=>{const Q=g.current;Q&&x.current.set(n,Q.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(G==="ready"?"":" is-hidden")}),G==="loading"&&L&&a.jsxs("div",{className:"editor__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),G==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Xl({value:n,options:s,onChange:i,className:c,title:o,ariaLabel:u,placeholder:h="—"}){const[g,m]=b.useState(!1),[x,_]=b.useState(0),v=b.useRef(null),y=b.useRef(null),S=s.find(D=>D.value===n)??null;b.useEffect(()=>{if(!g)return;const D=s.findIndex(q=>q.value===n);_(D===-1?0:D)},[g]),b.useEffect(()=>{if(!g)return;function D(q){var G;(G=v.current)!=null&&G.contains(q.target)||m(!1)}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[g]),b.useEffect(()=>{var D,q;g&&((q=(D=y.current)==null?void 0:D.querySelector(".is-cursor"))==null||q.scrollIntoView({block:"nearest"}))},[g,x]),b.useEffect(()=>{if(!g)return;const D=y.current,q=n1(v.current);if(!D||!q)return;const G=D.getBoundingClientRect().bottom-q.getBoundingClientRect().bottom;G>0&&(q.scrollTop+=Math.min(G+8,D.offsetHeight))},[g]);function k(D){m(!1),D.value!==n&&i(D.value)}function C(D){if(D.key==="Escape"){if(!g)return;D.preventDefault(),D.stopPropagation(),m(!1);return}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(D.preventDefault(),!g)return m(!0);const q=D.key==="ArrowDown"?1:s.length-1;return _(G=>(G+q)%s.length)}if(D.key==="Enter"||D.key===" "){if(D.preventDefault(),!g)return m(!0);const q=s[x];q&&k(q)}}return a.jsxs("div",{ref:v,className:"select"+(g?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":u??o,"aria-haspopup":"listbox","aria-expanded":g,onClick:()=>m(D=>!D),onKeyDown:C,children:[a.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),a.jsx(s1,{})]}),g&&a.jsx("div",{ref:y,className:"select__menu",role:"listbox","aria-label":u??o,children:s.map((D,q)=>a.jsxs("button",{type:"button",role:"option","aria-selected":D.value===n,className:"select__option"+(q===x?" is-cursor":"")+(D.value===n?" is-on":""),onMouseEnter:()=>_(q),onClick:()=>k(D),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:D.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:D.label}),D.hint&&a.jsx("span",{className:"select__hint",children:D.hint})]},D.value))})]})}function n1(n){let s=(n==null?void 0:n.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function s1(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function l1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function a1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M4.6 6.6h4"})]})}function i1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function r1({path:n,mime:s,base64:i,error:c,tooLarge:o,size:u,onRequestMedia:h}){b.useEffect(()=>{!o&&i===void 0&&c===void 0&&h(n)},[]);const g=c1(i,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",lf(u),"). Лимит — 64 МБ."]})}):c?a.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[a.jsx("p",{className:"mediaview__error",children:c}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):g?s.startsWith("image/")?a.jsx(u1,{url:g}):s.startsWith("video/")?a.jsx(f1,{url:g}):null:a.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[a.jsx("div",{className:"mediaview__progress",children:a.jsx("div",{className:"mediaview__progress-fill"})}),a.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function c1(n,s){const[i,c]=b.useState(null);return b.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),u=new Uint8Array(o.length);for(let g=0;g<o.length;g++)u[g]=o.charCodeAt(g);const h=URL.createObjectURL(new Blob([u],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[n,s]),i}const Gi=1,my=8,Gd=1.25;function o1(n){return Math.min(my,Math.max(Gi,n))}function u1({url:n}){const[s,i]=b.useState({scale:Gi,x:0,y:0}),[c,o]=b.useState(!1),u=b.useRef(null),h=b.useRef(null);function g(S,k,C){i(D=>{const q=o1(D.scale*S);if(q===D.scale)return D;if(q<=Gi)return{scale:Gi,x:0,y:0};const G=(k-D.x)/D.scale,V=(C-D.y)/D.scale;return{scale:q,x:k-q*G,y:C-q*V}})}b.useEffect(()=>{const S=u.current;if(!S)return;function k(C){C.preventDefault();const D=S.getBoundingClientRect(),q=C.clientX-D.left-D.width/2,G=C.clientY-D.top-D.height/2;g(C.deltaY<0?Gd:1/Gd,q,G)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function m(S){s.scale<=Gi||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:s.x,origY:s.y},o(!0))}function x(S){const k=h.current;!k||k.pointerId!==S.pointerId||i(C=>({...C,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function _(){h.current=null,o(!1)}const v=s.scale>Gi,y=!v&&s.x===0&&s.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:u,className:"mediaview__stage"+(v?c?" is-dragging":" is-zoomed":""),onPointerDown:m,onPointerMove:x,onPointerUp:_,onPointerCancel:_,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Gi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>g(1/Gd,0,0),children:a.jsx(a1,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=my,title:"Увеличить","aria-label":"Увеличить",onClick:()=>g(Gd,0,0),children:a.jsx(l1,{})}),a.jsx("button",{className:"btn btn--sm",disabled:y,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>i({scale:Gi,x:0,y:0}),children:a.jsx(i1,{})})]})]})}const d1=[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× — обычная"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"2",label:"2×"}];function f1({url:n}){const s=b.useRef(null),[i,c]=b.useState("1");return b.useEffect(()=>{s.current&&(s.current.playbackRate=Number(i))},[i]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Xl,{className:"mediaview__speedselect",value:i,onChange:c,ariaLabel:"Скорость воспроизведения",options:d1})]})]})}function h1({file:n,goto:s,onChange:i,onSave:c,onReload:o,onOverwrite:u,onRequestMedia:h,onTogglePreview:g}){const m=Wa(n),x=hy(n.path)&&!n.binary&&!n.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:n.path,children:n.path}),a.jsxs("span",{className:"editor__meta",children:[lf(n.size),n.eol==="crlf"&&" · CRLF"]}),x&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&g(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&g(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!m,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:m?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",m?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),m&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>u(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(r1,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",lf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",lf(n.size),"). Такие правит агент, а не браузер."]}):x&&n.previewMode?a.jsx(p1,{text:n.text}):a.jsx(t1,{path:n.path,doc:n.text,revision:n.revision,goto:s,onChange:i,onSave:c})]})}function p1({text:n}){const[s,i]=b.useState("");return b.useEffect(()=>{let c=!1;return wf(n).then(o=>{c||i(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function m1({files:n,activePath:s,busy:i,onSelect:c,onClose:o,zoomed:u,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:g=>{h&&(g.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(g=>a.jsxs("div",{className:"worktab"+(g.path===s?" is-on":""),role:"tab","aria-selected":g.path===s,onDoubleClick:m=>{h&&(m.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:g.path,onClick:()=>c(g.path),children:Lw(g.path)}),Wa(g)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${g.path}`,onClick:()=>o(g.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${g.path}`,onClick:()=>o(g.path),children:"✕"})]},g.path)),a.jsx("div",{className:"worktabs__spacer"}),h&&a.jsx("button",{className:"worktabs__zoom",title:u?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":u?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":u,onClick:h,children:a.jsx(io,{active:u})})]})}function _l(n){return n.claudeSessionId??n.id}function $d(n,s,i,c){if(!s||s.length===0)return n;const o=new Map(s.map((g,m)=>[g,m])),u=[],h=[];for(const g of n)(o.has(i(g))?u:h).push(g);return u.sort((g,m)=>o.get(i(g))-o.get(i(m))),c==="top"?[...h,...u]:[...u,...h]}function Qb(n){return n.state!=="closed"}function Kb(n){return[...n.filter(Qb),...n.filter(s=>!Qb(s))]}function Yd(n,s,i,c){if(s===i||!n.includes(s)||!n.includes(i))return null;const o=n.filter(g=>g!==s),u=o.indexOf(i)+(c==="after"?1:0),h=[...o.slice(0,u),s,...o.slice(u)];return h.every((g,m)=>g===n[m])?null:h}function lm(n,s,i,c){const o=n%10,u=n%100;return o===1&&u!==11?s:o>=2&&o<=4&&(u<12||u>14)?i:c}function gy(n){return`${n} ${lm(n,"агент","агента","агентов")}`}function g1(n){const s=n.filter(o=>o.kind==="agent").length,i=n.length-s,c=[];return s>0&&c.push(gy(s)),i>0&&c.push(`${i} ${lm(i,"задача","задачи","задач")} в фоне`),c.join(" · ")}function x1(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function b1(n){const s=Math.max(0,Math.floor(n/1e3)),i=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,u=String(o).padStart(2,"0");return i>0?`${i}:${String(c).padStart(2,"0")}:${u}`:`${c}:${u}`}function _1(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function y1({tasks:n,onStop:s}){const[i,c]=b.useState(!1),[o,u]=b.useState(()=>Date.now()),[h,g]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{g(x=>{const _=new Set(n.map(y=>y.id)),v=new Set([...x].filter(y=>_.has(y)));return v.size===x.size?x:v})},[n]);const m=x=>{g(_=>new Set(_).add(x)),s(x),window.setTimeout(()=>{g(_=>{if(!_.has(x))return _;const v=new Set(_);return v.delete(x),v})},1e4)};return a.jsxs("div",{className:i?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":i,"aria-controls":"tasks-list",onClick:()=>c(x=>!x),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:g1(n)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),i&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(x=>{const _=h.has(x.id);return a.jsxs("li",{className:_?"task is-stopping":"task",children:[a.jsxs("div",{className:"task__main",children:[a.jsxs("div",{className:"task__head",children:[a.jsx("span",{className:"task__kind",children:x1(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:b1(o-x.startedAt)})]}),a.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&a.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),a.jsxs("div",{className:"task__stats",children:[_1(x.tokens)," · ",x.toolUses," ",lm(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:_,"aria-label":`Остановить: ${x.description}`,onClick:()=>m(x.id),children:_?"Останавливается":"Стоп"})]},x.id)})})]})}const v1=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function am({className:n}){return a.jsx("img",{src:v1,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const j1=450,w1=6,k1=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy · разговоры и инструменты"},{id:"codex",label:"Codex",hint:"OpenAI · сессии, инструменты и разрешения"}];function mf({disabled:n,providers:s,onStart:i}){const c=[...new Set(s)].flatMap(H=>k1.filter(B=>B.id===H)),o=c.length>1,[u,h]=b.useState(!1),[g,m]=b.useState(0),[x,_]=b.useState({left:0,top:0}),v=b.useRef(null),y=b.useRef(null),S=b.useRef(null);function k(){S.current&&window.clearTimeout(S.current.timer),S.current=null}function C(H=!1){H||k(),m(0),h(!0)}function D(H){var B;h(!1),H&&((B=v.current)==null||B.focus())}function q(H){if(n||!o||H.button!==0)return;const B={timer:0,x:H.clientX,y:H.clientY,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,C(!0)},j1),S.current=B}function G(H){const B=S.current;!B||B.fired||Math.hypot(H.clientX-B.x,H.clientY-B.y)>w1&&k()}function V(){S.current&&!S.current.fired&&k()}function L(H){var N;if((N=S.current)!=null&&N.fired){S.current=null,H.preventDefault();return}if(n)return;const B=c[0];B&&i(B.id)}function Y(H){o&&(H.preventDefault(),!n&&C())}function E(H){if(n||!o)return;(H.key==="ArrowDown"||H.key==="ArrowUp"||H.key==="Enter"&&H.shiftKey)&&(H.preventDefault(),C())}b.useLayoutEffect(()=>{if(!u)return;const H=v.current,B=y.current;if(!H||!B)return;const N=H.getBoundingClientRect(),X=B.getBoundingClientRect(),le=8,de=Math.max(le,Math.min(N.right-X.width,window.innerWidth-X.width-le));let ye=N.top-X.height-8;ye<le&&(ye=Math.min(N.bottom+8,window.innerHeight-X.height-le)),_({left:de,top:ye})},[u]),b.useLayoutEffect(()=>{var H;u&&((H=y.current)==null||H.focus())},[u]),b.useLayoutEffect(()=>{if(!u)return;function H(B){var X,le;const N=B.target;!((X=y.current)!=null&&X.contains(N))&&!((le=v.current)!=null&&le.contains(N))&&D(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[u]);function U(H){D(!1),i(H.id)}function Q(H){if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),D(!0);return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();const B=H.key==="ArrowDown"?1:-1;m(N=>(N+B+c.length)%c.length);return}if(H.key==="Enter"||H.key===" "){H.preventDefault();const B=c[g];B&&U(B);return}H.key==="Tab"&&D(!1)}return a.jsxs("div",{className:"newsession",role:"group","aria-label":"Создать сессию",children:[a.jsx("button",{ref:v,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?u:void 0,onClick:L,onContextMenu:Y,onPointerDown:q,onPointerMove:G,onPointerUp:V,onPointerCancel:V,onPointerLeave:V,onKeyDown:E,children:"+ Сессия"}),o&&a.jsx("button",{type:"button",className:"btn btn--primary newsession__choose","aria-label":"Выбрать агента","aria-haspopup":"menu","aria-expanded":u,disabled:n,onClick:()=>u?D(!0):C(),children:a.jsx(N1,{})}),u&&o&&Tu.createPortal(a.jsx("div",{ref:y,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Q,children:c.map((H,B)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(B===g?" is-cursor":""),onMouseEnter:()=>m(B),onClick:()=>U(H),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${H.id}`,"aria-hidden":"true",children:H.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):H.id==="antigravity"?a.jsx(am,{className:"newsession__mark-logo"}):a.jsx(S1,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:H.label}),a.jsx("span",{className:"newsession__hint",children:H.hint})]})]},H.id))}),document.body)]})}function N1(){return a.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function S1(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const xy="ccv:sidebar.collapsed",by="ccv:sidebar.mode",_y="ccv:sidebar.foldersCollapsed",E1=500,hp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function T1({open:n,connected:s,status:i,workspaces:c,archivedWorkspaces:o,workspaceFolders:u,sessionFolders:h,pinnedFolders:g,sessions:m,archived:x,pinned:_,live:v,listOrder:y,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:C,activeSessionId:D,onSelectWorkspace:q,onSelectSession:G,onRenameSession:V,onStopSession:L,onPinSessions:Y,onSelectPinned:E,onCloseWorkspaces:U,onRestoreWorkspaces:Q,onArchiveSessions:H,onUnarchiveSessions:B,onCreateFolder:N,onRenameFolder:X,onSetFolderColor:le,onDeleteFolder:de,onAssignToFolder:ye,onOpenWorkspace:I,onNewSession:R,enabledProviders:P,onOpenExtensions:ae,account:Ne,onOpenAccount:A,relay:K,onOpenRelay:fe,onOpenSettings:ke,themeMode:Re,onCycleTheme:Ue,navigation:_e,dashboard:Ze=!1,onAllProjects:rt,onCompareSession:Bt}){var cl;const[he,at]=b.useState(null),[oe,Rt]=b.useState(null),[He,qt]=b.useState(null);function Un(T){return(He==null?void 0:He.folderId)===T.id?He.color??void 0:T.color}function bt(T){const ge=T&&Un(T);return ge?{"--folder-color":ge}:void 0}function Kt(T){return T?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const ln=b.useRef(void 0),[Xn,wt]=b.useState(null),[Z,De]=b.useState(""),[$e,ht]=b.useState($1),[Ee,Te]=b.useState(Y1),[Oe,Ye]=b.useState(V1);function Qe(T){Ye(T),De("");try{localStorage.setItem(by,T)}catch{}}const Pe=Z.trim().toLowerCase(),pt=Pe!=="",At=b.useMemo(()=>$d(c,y==null?void 0:y.workspaces,T=>T.id,"bottom"),[c,y]),Sn=b.useMemo(()=>{const T=$d(m,C?y==null?void 0:y.sessions[C]:void 0,_l,"top");return S?Kb(T):T},[m,y,C,S]),Et=b.useMemo(()=>{const T=$d(_,y==null?void 0:y.pinned,_l,"bottom");return S?Kb(T):T},[_,y,S]),Lt=b.useMemo(()=>$d(v,y==null?void 0:y.live,_l,"bottom"),[v,y]),re=b.useMemo(()=>pt?At.filter(T=>T.name.toLowerCase().includes(Pe)||T.path.toLowerCase().includes(Pe)):At,[At,Pe,pt]),we=b.useMemo(()=>pt?o.filter(T=>T.name.toLowerCase().includes(Pe)||T.path.toLowerCase().includes(Pe)):o,[o,Pe,pt]),Ve=b.useMemo(()=>pt?Sn.filter(T=>(T.title??"").toLowerCase().includes(Pe)):Sn,[Sn,Pe,pt]),et=b.useMemo(()=>pt?x.filter(T=>(T.title??"").toLowerCase().includes(Pe)):x,[x,Pe,pt]),nt=T=>{var ge;return((ge=c.find(Ie=>Ie.id===T))==null?void 0:ge.name)??"—"},on=T=>{var ge;return(ge=c.find(Ie=>Ie.id===T))==null?void 0:ge.path},On=b.useMemo(()=>pt?Et.filter(T=>(T.title??"").toLowerCase().includes(Pe)||nt(T.workspaceId).toLowerCase().includes(Pe)):Et,[Et,c,Pe,pt]),Wt=b.useMemo(()=>pt?Lt.filter(T=>(T.title??"").toLowerCase().includes(Pe)||nt(T.workspaceId).toLowerCase().includes(Pe)):Lt,[Lt,c,Pe,pt]),bn=!pt;function Yt(T){ht(ge=>{const Ie=ge.includes(T)?ge.filter(_t=>_t!==T):[...ge,T];try{localStorage.setItem(xy,JSON.stringify(Ie))}catch{}return Ie})}const zt=T=>!$e.includes(T);function J(T){Te(ge=>{const Ie=ge.includes(T)?ge.filter(_t=>_t!==T):[...ge,T];try{localStorage.setItem(_y,JSON.stringify(Ie))}catch{}return Ie})}const pe=T=>!Ee.includes(T),Ae=b.useMemo(()=>fu(re,u),[re,u]),Ke=b.useMemo(()=>fu(we,u),[we,u]),It=b.useMemo(()=>fu(Ve,h),[Ve,h]),an=b.useMemo(()=>fu(et,h),[et,h]),kt=b.useMemo(()=>fu(On,g,T=>T.pinnedFolderId),[On,g]),gs=b.useMemo(()=>({groups:[],ungrouped:Wt}),[Wt]),Qn=((y==null?void 0:y.workspaces.length)??0)>0,is=C?(((cl=y==null?void 0:y.sessions[C])==null?void 0:cl.length)??0)>0:!1,rn=((y==null?void 0:y.pinned.length)??0)>0,it=((y==null?void 0:y.live.length)??0)>0,un=Vd({enabled:bn,scope:"workspaces",itemKey:T=>T.id,groups:Ae.groups,ungrouped:Ae.ungrouped,onReorder:k}),ks=Vd({enabled:bn,scope:"sessions",workspaceId:C??void 0,itemKey:_l,groups:It.groups,ungrouped:It.ungrouped,onReorder:k}),Ns=Vd({enabled:bn,scope:"pinned",itemKey:_l,groups:kt.groups,ungrouped:kt.ungrouped,onReorder:k}),Ss=Vd({enabled:bn,scope:"live",itemKey:_l,groups:gs.groups,ungrouped:gs.ungrouped,onReorder:k});b.useEffect(()=>{var Ie;if(!He)return;const ge=(Ie=[...kt.groups,...Ae.groups,...Ke.groups,...It.groups,...an.groups].find(_t=>_t.folder.id===He.folderId))==null?void 0:Ie.folder;ge&&ge.color===(He.color??void 0)&&qt(null)},[He,kt,Ae,Ke,It,an]),b.useEffect(()=>()=>window.clearTimeout(ln.current),[]);const zs=mp(re),rs=mp(we),Es=mp(Ve),[Zt,Is]=b.useState(null),[_n,yn]=b.useState(null),[lt,Jn]=b.useState(null),[Kn,cs]=b.useState(null),[dn,rl]=b.useState(null),Ts=b.useRef(null);function os(T,ge){const Ie=T.touches[0];if(!Ie)return;const _t={timer:0,x:Ie.clientX,y:Ie.clientY,el:T.currentTarget,fired:!1};_t.timer=window.setTimeout(()=>{_t.fired=!0,ge(_t.x,_t.y,_t.el)},E1),Ts.current=_t}function Cs(T){const ge=Ts.current,Ie=T.touches[0];!ge||!Ie||Math.hypot(Ie.clientX-ge.x,Ie.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),Ts.current=null)}function kn(T){const ge=Ts.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&T.preventDefault())}function Ln(){var T;return(T=Ts.current)!=null&&T.fired?(Ts.current=null,!0):!1}function Hn(){const T=Zt==null?void 0:Zt.opener;Is(null),T!=null&&T.isConnected&&T.focus()}function en(){const T=_n==null?void 0:_n.opener;yn(null),T!=null&&T.isConnected&&T.focus()}function jl(){const T=lt==null?void 0:lt.opener;Jn(null),T!=null&&T.isConnected&&T.focus()}function li(){const T=Kn==null?void 0:Kn.opener;cs(null),T!=null&&T.isConnected&&T.focus()}function Kl(){const T=dn==null?void 0:dn.opener;rl(null),T!=null&&T.isConnected&&T.focus()}function En(T){return{onContextMenu:ge=>{ge.preventDefault(),Is({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:zs.targetsFor(T)})},onTouchStart:ge=>os(ge,(Ie,_t,bs)=>Is({x:Ie,y:_t,opener:bs,ids:zs.targetsFor(T)})),onTouchMove:Cs,onTouchEnd:kn,onTouchCancel:kn}}function wl(T){return{onContextMenu:ge=>{ge.preventDefault(),yn({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:rs.targetsFor(T)})},onTouchStart:ge=>os(ge,(Ie,_t,bs)=>yn({x:Ie,y:_t,opener:bs,ids:rs.targetsFor(T)})),onTouchMove:Cs,onTouchEnd:kn,onTouchCancel:kn}}function kl(T){return{onContextMenu:ge=>{ge.preventDefault(),Jn({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:Es.targetsFor(T)})},onTouchStart:ge=>os(ge,(Ie,_t,bs)=>Jn({x:Ie,y:_t,opener:bs,ids:Es.targetsFor(T)})),onTouchMove:Cs,onTouchEnd:kn,onTouchCancel:kn}}function Wn(T){return{onContextMenu:ge=>{ge.preventDefault(),cs({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:[T.id]})},onTouchStart:ge=>os(ge,(Ie,_t,bs)=>cs({x:Ie,y:_t,opener:bs,ids:[T.id]})),onTouchMove:Cs,onTouchEnd:kn,onTouchCancel:kn}}function Nl(T){return{onContextMenu:ge=>{ge.preventDefault(),rl({x:ge.clientX,y:ge.clientY,opener:ge.currentTarget,ids:[T.id]})},onTouchStart:ge=>os(ge,(Ie,_t,bs)=>rl({x:Ie,y:_t,opener:bs,ids:[T.id]})),onTouchMove:Cs,onTouchEnd:kn,onTouchCancel:kn}}const Zl=m.filter(T=>T.state!=="closed").length,Us=Zt?re.find(T=>T.id===Zt.ids[0]):void 0,vn=Zt?[{id:"close",label:Zt.ids.length>1?`Закрыть проекты (${Zt.ids.length})`:"Закрыть проект",onSelect:()=>{U(Zt.ids),zs.clear()}},...hu({folders:u,ids:Zt.ids,hasFolder:(Us==null?void 0:Us.folderId)!=null,assign:(T,ge)=>ye("workspace",T,ge),onClear:()=>zs.clear(),onNewFolder:()=>wt("workspace")}),...Zt.ids.length===1&&bn?un.menuItems(Zt.ids[0],Qn):[]]:[],Se=Zt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&Zt.ids.includes(C)&&Zl>0?` в нём сейчас незавершённых сессий: ${Zl} — при закрытии они остановятся на хосте.`:""):void 0,M=_n?we.find(T=>T.id===_n.ids[0]):void 0,W=_n?[{id:"restore",label:_n.ids.length>1?`Вернуть проекты (${_n.ids.length})`:"Вернуть проект",onSelect:()=>{Q(_n.ids),rs.clear()}},...hu({folders:u,ids:_n.ids,hasFolder:(M==null?void 0:M.folderId)!=null,assign:(T,ge)=>ye("workspace",T,ge),onClear:()=>rs.clear(),onNewFolder:()=>wt("workspace")})]:[],ve=_n?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Ce=lt?Ve.find(T=>T.id===lt.ids[0]):void 0,Xe=(Ce==null?void 0:Ce.pinned)!==!0,Je=lt?[...lt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>at(lt.ids[0])}]:[],{id:"pin",label:Xe?lt.ids.length>1?`Закрепить (${lt.ids.length})`:"Закрепить":lt.ids.length>1?`Открепить (${lt.ids.length})`:"Открепить",onSelect:()=>{Ce&&Y(Ce.workspaceId,lt.ids,Xe),Es.clear()}},{id:"archive",label:lt.ids.length>1?`Убрать в архив (${lt.ids.length})`:"Убрать в архив",onSelect:()=>{H(C,lt.ids),Es.clear()}},...hu({folders:h,ids:lt.ids,hasFolder:(Ce==null?void 0:Ce.folderId)!=null,assign:(T,ge)=>ye("session",T,ge,C),onClear:()=>Es.clear(),onNewFolder:()=>wt("session")}),...lt.ids.length===1&&bn&&Ce?ks.menuItems(_l(Ce),is):[]]:[],Vt=lt?hp:void 0,gt=Kn?On.find(T=>T.id===Kn.ids[0]):void 0,cn=Kn?[{id:"rename",label:"Переименовать",onSelect:()=>at(Kn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{gt&&Y(gt.workspaceId,[gt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{gt&&H(gt.workspaceId,[gt.id])}},...gt&>.workspaceId===C?hu({folders:h,ids:[gt.id],hasFolder:gt.folderId!=null,assign:(T,ge)=>ye("session",T,ge,gt.workspaceId),onClear:()=>{},onNewFolder:()=>wt("session")}):[],...R1(gt?hu({folders:g,ids:[gt.id],hasFolder:gt.pinnedFolderId!=null,assign:(T,ge)=>ye("pinned",T,ge),onClear:()=>{},onNewFolder:()=>wt("pinned")}):[]),...bn&>?Ns.menuItems(_l(gt),rn):[]]:[],ct=dn?Wt.find(T=>T.id===dn.ids[0]):void 0,Mt=dn?[{id:"stop",label:"Остановить",onSelect:()=>{ct&&L(ct)}},{id:"rename",label:"Переименовать",onSelect:()=>at(dn.ids[0])},{id:"pin",label:(ct==null?void 0:ct.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{ct&&Y(ct.workspaceId,[ct.id],ct.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ct&&H(ct.workspaceId,[ct.id])}},...bn&&ct?Ss.menuItems(_l(ct),it):[]]:[];function fn(T,ge){return a.jsxs("div",{"data-row-key":T.id,className:qc(T.id===C,zs.selected.includes(T.id),!1,!!ge)+un.dropClass(T.id),style:bt(ge),...En(T),children:[Kt(ge),bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...un.gripHandlers(T.id),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:Ie=>{Ln()||zs.click(Ie,T,()=>q(T.id))},onKeyDown:Ie=>un.onKeyDown(T.id,Ie),children:[a.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:T.path,children:T.path})]})]},T.id)}function Ps(T,ge){return a.jsxs("div",{className:qc(T.id===C,rs.selected.includes(T.id),!1,!!ge),style:bt(ge),...wl(T),children:[Kt(ge),a.jsxs("button",{className:"row__main",onClick:Ie=>{Ln()||rs.click(Ie,T,()=>q(T.id))},children:[a.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:W1(T)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>Q([T.id]),children:"Вернуть"})]},T.id)}function Hs(T,ge){const Ie=_l(T);return a.jsxs("div",{"data-row-key":Ie,className:qc(T.id===D,Es.selected.includes(T.id),T.provider==="antigravity",!!ge)+ks.dropClass(Ie),style:bt(ge),...he===T.id?{}:kl(T),children:[Kt(ge),he===T.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:T.title??"",onCommit:_t=>{V(T,_t),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...ks.gripHandlers(Ie),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:_t=>{Ln()||Es.click(_t,T,()=>G(T))},onKeyDown:_t=>ks.onKeyDown(Ie,_t),children:[a.jsx(Qd,{title:T.title??"Без названия",pinned:T.pinned===!0,provider:T.provider,projectName:nt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),Ze&&Bt&&a.jsx("button",{className:"hub-icon-btn",title:"Открыть вторым разговором","aria-label":`Открыть рядом: ${T.title??"Без названия"}`,onClick:()=>Bt(T),children:"◧"}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Ln()||at(T.id)},children:"✎"})]})]},T.id)}function Pi(T,ge){return a.jsxs("div",{className:qc(T.id===D,!1,T.provider==="antigravity",!!ge),style:bt(ge),children:[Kt(ge),a.jsxs("button",{className:"row__main",onClick:()=>G(T),children:[a.jsx(Qd,{title:T.title??"Без названия",pinned:!1,provider:T.provider,projectName:nt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx("span",{className:"row__meta",children:J1(T)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>B([T.id]),children:"Вернуть"})]},T.id)}function Sl(T,ge){const Ie=_l(T);return a.jsxs("div",{"data-row-key":Ie,className:qc(T.id===D,!1,T.provider==="antigravity",!!ge)+Ns.dropClass(Ie),style:bt(ge),...he===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Wn(T)},children:[Kt(ge),he===T.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:T.title??"",onCommit:_t=>{V(T,_t),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ns.gripHandlers(Ie),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Ln()||E(T)},onKeyDown:_t=>Ns.onKeyDown(Ie,_t),children:[a.jsx(Qd,{title:T.title??"Без названия",pinned:!1,provider:T.provider,projectName:nt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]})]})]},T.id)}function ai(T){const ge=_l(T);return a.jsx("div",{"data-row-key":ge,className:qc(T.id===D,!1,T.provider==="antigravity")+Ss.dropClass(ge),...he===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Nl(T)},children:he===T.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:T.title??"",onCommit:Ie=>{V(T,Ie),at(null)},onCancel:()=>at(null)})}):a.jsxs(a.Fragment,{children:[bn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ss.gripHandlers(ge),children:a.jsx(Xd,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{Ln()||E(T)},onKeyDown:Ie=>Ss.onKeyDown(ge,Ie),children:[a.jsx(Qd,{title:T.title??"Без названия",pinned:T.pinned===!0,provider:T.provider,projectName:nt(T.workspaceId),projectPath:on(T.workspaceId)}),a.jsx(gp,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Ie=>{Ie.stopPropagation(),!Ln()&&L(T)},children:a.jsx(H1,{})})]})},T.id)}function jn(T,ge){return a.jsx(I1,{folder:T,count:ge,open:pe(T.id),renaming:oe===T.id,onToggle:()=>J(T.id),onStartRename:()=>Rt(T.id),onCommitRename:Ie=>{X(T.id,Ie),Rt(null)},onCancelRename:()=>Rt(null),onDelete:()=>de(T.id),color:Un(T),onPreviewColor:Ie=>{window.clearTimeout(ln.current),qt({folderId:T.id,color:Ie})},onCommitColor:Ie=>{qt({folderId:T.id,color:Ie}),le(T.id,Ie),window.clearTimeout(ln.current),ln.current=window.setTimeout(()=>qt(null),4e3)},onResetColor:()=>{window.clearTimeout(ln.current),qt(null),le(T.id,null)}},T.id)}const xs=Ze?"section":"aside",es=c.find(T=>T.id===C)??o.find(T=>T.id===C);return a.jsxs(xs,{className:Ze?"sidebar project-dashboard":n?"sidebar sidebar--open":"sidebar","aria-label":Ze?"Обзор проекта":"Навигация",children:[Ze?a.jsxs("header",{className:"project-dashboard__head",children:[a.jsx("button",{className:"project-dashboard__back",onClick:rt,children:"← Все проекты"}),a.jsxs("div",{className:"project-dashboard__title",children:[a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("h1",{children:es==null?void 0:es.name})]}),a.jsx(mf,{disabled:!s||!C,providers:P,onStart:R})]}),a.jsx("p",{className:"project-dashboard__path",title:es==null?void 0:es.path,children:es==null?void 0:es.path}),a.jsx("p",{className:"hub-description",children:"Разговоры и история проекта. Выберите сессию, чтобы продолжить работу."}),a.jsxs("div",{className:"project-dashboard__stats",children:[a.jsxs("span",{children:[a.jsx("strong",{children:m.length})," сессий"]}),a.jsxs("span",{children:[a.jsx("strong",{children:m.filter(T=>T.state!=="closed").length})," запущено"]}),a.jsxs("span",{children:[a.jsx("strong",{children:m.filter(T=>T.state==="waiting_permission").length})," ждут ответа"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:"brand__symbol","aria-hidden":"true"}),a.jsxs("span",{className:"brand",children:["ЭФИР",a.jsx("span",{className:"brand__caption",children:"пространство возможностей"})]}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Fb[Re]}`,"aria-label":`Тема: ${Fb[Re]}. Переключить`,onClick:Ue,children:a.jsx(X1,{mode:Re})})]}),a.jsxs("div",{className:"sidebar__connection",role:"status",children:[a.jsx("span",{className:s?"dot dot--on":"dot"}),a.jsx("span",{children:s?"Пространство подключено":i})]}),_e,a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Oe==="default",className:Oe==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Qe("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Oe==="pinned",className:Oe==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Qe("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Oe==="live",className:Oe==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Qe("live"),children:[a.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),v.length>0&&a.jsx("span",{className:"sidebar__tab-count",children:v.length})]})]})]}),a.jsxs("div",{className:"fssearch fssearch--sidebar",children:[a.jsx(q1,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Z,spellCheck:!1,placeholder:Ze||Oe!=="default"?"Найти сессию…":"Найти проект…","aria-label":Ze||Oe!=="default"?"Поиск по сессиям":"Поиск по проектам",onChange:T=>De(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),Z?De(""):T.currentTarget.blur())}}),Z&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>De(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Ze?a.jsx(a.Fragment,{children:C&&a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Сессии",count:Ve.length,open:zt("sessions"),onToggle:()=>Yt("sessions"),action:{label:"Новая папка сессий",onClick:()=>{wt("session"),zt("sessions")||Yt("sessions")}}}),zt("sessions")&&a.jsxs(a.Fragment,{children:[Xn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:T=>{N("session",T,C),wt(null)},onCancel:()=>wt(null)})})}),Ve.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока ни одной"})}),It.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Hs(ge,T.folder))]},T.folder.id)),It.ungrouped.map(T=>Hs(T))]}),x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Архив",count:et.length,open:zt("archive"),onToggle:()=>Yt("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),zt("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),et.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока пусто"})}),an.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Pi(ge,T.folder))]},T.folder.id)),an.ungrouped.map(T=>Pi(T))]})]})]})}):Oe==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Закреплённые",count:On.length,open:zt("pinned"),onToggle:()=>Yt("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{wt("pinned"),zt("pinned")||Yt("pinned")}}}),zt("pinned")&&a.jsxs(a.Fragment,{children:[Xn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:T=>{N("pinned",T),wt(null)},onCancel:()=>wt(null)})})}),On.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),kt.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Sl(ge,T.folder))]},T.folder.id)),kt.ungrouped.map(T=>Sl(T))]})]}):Oe==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Запущенные",count:Wt.length,open:zt("live"),onToggle:()=>Yt("live")}),zt("live")&&a.jsxs(a.Fragment,{children:[Wt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Нет запущенных сессий"})}),Wt.map(T=>ai(T))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Проекты",count:re.length,open:zt("workspaces"),onToggle:()=>Yt("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{wt("workspace"),zt("workspaces")||Yt("workspaces")}}}),zt("workspaces")&&a.jsxs(a.Fragment,{children:[Xn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:T=>{N("workspace",T),wt(null)},onCancel:()=>wt(null)})})}),re.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока ни одного"})}),Ae.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>fn(ge,T.folder))]},T.folder.id)),Ae.ungrouped.map(T=>fn(T))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Gc,{title:"Архив проектов",count:we.length,open:zt("workspacesArchive"),onToggle:()=>Yt("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),zt("workspacesArchive")&&a.jsxs(a.Fragment,{children:[we.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:pt?"Ничего не найдено":"Пока пусто"})}),Ke.groups.map(T=>a.jsxs(b.Fragment,{children:[jn(T.folder,T.items.length),pe(T.folder.id)&&T.items.map(ge=>Ps(ge,T.folder))]},T.folder.id)),Ke.ungrouped.map(T=>Ps(T))]})]})]})}),!Ze&&a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:A,children:[a.jsx("span",{className:Ne!=null&&Ne.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Ne===null?"Аккаунт":Ne.loggedIn?Ne.email||"Вход выполнен":"Войти в аккаунт"}),(Ne==null?void 0:Ne.plan)&&a.jsx("span",{className:"chip",children:Ne.plan})]}),fe&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:fe,children:[a.jsx("span",{className:K!=null&&K.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:K===null?"Удалённый доступ":K.paired?K.connected?K.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(K==null?void 0:K.connected)&&K.clients>0&&a.jsx("span",{className:"chip",children:K.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!ae,title:"MCP-серверы и плагины",onClick:()=>ae==null?void 0:ae(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ke,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:I,children:"+ Проект"}),a.jsx(mf,{disabled:!s||!C,providers:P,onStart:R})]})]}),Zt&&a.jsx(Xi,{x:Zt.x,y:Zt.y,items:vn,note:Se,onClose:Hn}),_n&&a.jsx(Xi,{x:_n.x,y:_n.y,items:W,note:ve,onClose:en}),lt&&a.jsx(Xi,{x:lt.x,y:lt.y,items:Je,note:Vt,onClose:jl}),Kn&&a.jsx(Xi,{x:Kn.x,y:Kn.y,items:cn,note:hp,onClose:li}),dn&&a.jsx(Xi,{x:dn.x,y:dn.y,items:Mt,note:hp,onClose:Kl})]})}function qc(n,s,i,c){const o=["row"];return c&&o.push("row--foldered"),n&&o.push("row--active"),s&&o.push("row--selected"),i&&o.push("row--antigravity"),o.join(" ")}function fu(n,s,i=c=>c.folderId){const c=new Map(s.map(g=>[g.id,g])),o=new Map,u=[];for(const g of n){const m=i(g),x=m?c.get(m):void 0;if(!x){u.push(g);continue}const _=o.get(x.id);_?_.push(g):o.set(x.id,[g])}return{groups:[...o.entries()].map(([g,m])=>({folder:c.get(g),items:m})).sort((g,m)=>g.folder.name.localeCompare(m.folder.name,"ru")),ungrouped:u}}function C1(n,s,i){return[...n.flatMap(c=>c.items.map(i)),...s.map(i)]}const A1="\0ungrouped";function M1(n,s,i){const c=new Map;for(const o of n)for(const u of o.items)c.set(i(u),o.folder.id);for(const o of s)c.set(i(o),A1);return c}function pp(n,s,i,c,o){const u=[...s.map(g=>g.items),i].find(g=>g.some(m=>c(m)===n));if(!u)return null;const h=u.findIndex(g=>c(g)===n);return o==="up"?h<=0?null:{target:c(u[h-1]),position:"before"}:h===-1||h>=u.length-1?null:{target:c(u[h+1]),position:"after"}}function Vd(n){const[s,i]=b.useState(null),[c,o]=b.useState(null),u=b.useMemo(()=>C1(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),h=b.useMemo(()=>M1(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]);function g(){i(null),o(null)}function m(q,G){n.enabled&&(G.preventDefault(),G.currentTarget.setPointerCapture(G.pointerId),i(q),o(null))}function x(q,G){var U;if(!s)return;const V=(U=document.elementFromPoint(q,G))==null?void 0:U.closest("[data-row-key]"),L=V==null?void 0:V.dataset.rowKey;if(!L||L===s||h.get(L)!==h.get(s)){o(null);return}const Y=V.getBoundingClientRect(),E=G-Y.top<Y.height/2?"before":"after";o(Q=>(Q==null?void 0:Q.key)===L&&Q.position===E?Q:{key:L,position:E})}function _(q){x(q.clientX,q.clientY)}function v(){if(s&&c){const q=Yd(u,s,c.key,c.position);q&&n.onReorder(n.scope,q,n.workspaceId)}g()}function y(q,G){if(!n.enabled)return;const V=pp(q,n.groups,n.ungrouped,n.itemKey,G);if(!V)return;const L=Yd(u,q,V.target,V.position);L&&n.onReorder(n.scope,L,n.workspaceId)}function S(q,G){const V=pp(q,n.groups,n.ungrouped,n.itemKey,"up"),L=pp(q,n.groups,n.ungrouped,n.itemKey,"down"),Y=[{id:"move-up",label:"Переместить выше",disabled:!V,onSelect:()=>{if(!V)return;const E=Yd(u,q,V.target,V.position);E&&n.onReorder(n.scope,E,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!L,onSelect:()=>{if(!L)return;const E=Yd(u,q,L.target,L.position);E&&n.onReorder(n.scope,E,n.workspaceId)}}];return G&&Y.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),Y}function k(q){return s===q?" row--dragging":(c==null?void 0:c.key)===q?c.position==="before"?" row--drop-before":" row--drop-after":""}function C(q){return{onPointerDown:G=>m(q,G),onPointerMove:_,onPointerUp:v,onPointerCancel:g}}function D(q,G){!G.altKey||G.key!=="ArrowUp"&&G.key!=="ArrowDown"||(G.preventDefault(),y(q,G.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:k,gripHandlers:C,onKeyDown:D,menuItems:S}}function hu(n){return[...[...n.folders].sort((i,c)=>i.name.localeCompare(c.name,"ru")).map(i=>({id:`folder:${i.id}`,label:`В папку «${i.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,i.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(i=>n.assign(i,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function R1(n){return n.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function mp(n){const[s,i]=b.useState([]),c=b.useRef(null);function o(){i([]),c.current=null}function u(g,m,x){if(g.ctrlKey||g.metaKey){i(_=>_.includes(m.id)?_.filter(v=>v!==m.id):[..._,m.id]),c.current=m.id;return}if(g.shiftKey&&c.current){const _=n.findIndex(y=>y.id===c.current),v=n.findIndex(y=>y.id===m.id);if(_!==-1&&v!==-1){const[y,S]=_<v?[_,v]:[v,_];i(n.slice(y,S+1).map(k=>k.id));return}}o(),c.current=m.id,x()}function h(g){return s.includes(g.id)?s:(i([g.id]),c.current=g.id,[g.id])}return{selected:s,click:u,targetsFor:h,clear:o}}const D1={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},O1={width:22,height:22,borderRadius:6};function Gc({title:n,count:s,open:i,onToggle:c,hint:o,action:u}){const h=i?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:D1,"aria-expanded":i,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(yy,{open:i}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:s})]}),u&&a.jsx("button",{className:"theme-btn",style:O1,title:u.label,"aria-label":u.label,onClick:u.onClick,children:a.jsx(G1,{})})]})}const Zb={paddingLeft:22},L1={display:"flex",alignItems:"center",gap:6,width:"100%"},z1={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function I1({folder:n,count:s,open:i,renaming:c,onToggle:o,onStartRename:u,onCommitRename:h,onCancelRename:g,onDelete:m,color:x,onPreviewColor:_,onCommitColor:v,onResetColor:y}){const S=b.useRef(null),k=b.useRef(v);return k.current=v,b.useEffect(()=>{const C=S.current;if(!C)return;const D=()=>k.current(C.value);return C.addEventListener("change",D),()=>C.removeEventListener("change",D)},[c]),c?a.jsx("div",{className:"row",style:Zb,children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:n.name,placeholder:"Название папки",onCommit:h,onCancel:g})})}):a.jsxs("div",{className:"row",style:Zb,children:[a.jsxs("button",{className:"row__main",style:L1,"aria-expanded":i,title:i?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:o,children:[a.jsx(yy,{open:i}),a.jsx("span",{style:z1,children:n.name}),a.jsx("span",{className:"sidebar__count",children:s})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:u,children:"✎"}),a.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),a.jsx("input",{ref:S,type:"color",value:x??U1(),"aria-label":`Цвет папки «${n.name}»`,onChange:C=>_(C.target.value)})]}),n.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:y,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${n.name}»`,onClick:m,children:"✕"})]})}function U1(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}function yy({open:n}){return a.jsx("svg",{className:n?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Xd(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function H1(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function B1({className:n}){return a.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),a.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),a.jsx("path",{d:"M8 12.2v1.4"})]})}function q1(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function G1(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function $1(){try{const n=localStorage.getItem(xy);if(n===null)return["archive","workspacesArchive"];const s=JSON.parse(n);return Array.isArray(s)?s.filter(i=>i==="workspaces"||i==="workspacesArchive"||i==="sessions"||i==="archive"||i==="pinned"||i==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function Y1(){try{const n=localStorage.getItem(_y);if(n===null)return[];const s=JSON.parse(n);return Array.isArray(s)?s.filter(i=>typeof i=="string"):[]}catch{return[]}}function V1(){try{const n=localStorage.getItem(by);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Fb={system:"ритм системы",light:"свет",dark:"тьма"};function X1({mode:n}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?a.jsx("svg",{...s,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):n==="light"?a.jsxs("svg",{...s,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...s,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Q1(n){const s=K1(n),i=(n.tasks??[]).filter(c=>c.kind==="agent").length;return i>0?`${s} · ${gy(i)}`:s}function K1(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":Z1(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function Z1(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function F1(n){switch(n.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return n.backgroundWork?"background":P1(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function P1(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function gp({session:n,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${F1(n)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),Q1(n)]})," · ",s]})}function Qd({title:n,pinned:s,provider:i,projectName:c,projectPath:o}){return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[s&&a.jsx(B1,{className:"row__pin"}),i==="codex"&&a.jsx("span",{className:"row__provider codex-mark",title:"Codex",children:"C"}),i==="antigravity"&&a.jsx(am,{className:"row__provider"}),n]}),a.jsx("span",{className:"row__project",title:o,children:c})]})}function J1(n){const s=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${s}`:s}function W1(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Gt=n=>n.claudeSessionId??n.id;function vy(n,s,i,c){const o=new Set([...s,...i].flatMap(h=>[h.id,Gt(h)])),u=s.map(h=>{const g=n.find(m=>m.id===h.id||Gt(m)===Gt(h));return!g||g.lastSeq<=h.lastSeq&&g.updatedAt<=h.updatedAt?h:{...h,...g,pinned:h.pinned,pinnedAt:h.pinnedAt,folderId:h.folderId,pinnedFolderId:h.pinnedFolderId,archivedAt:h.archivedAt,archivedAuto:h.archivedAuto}});for(const h of n)h.workspaceId===c&&h.state!=="closed"&&!o.has(h.id)&&!o.has(Gt(h))&&u.push(h);return u}const sn=n=>{var s;return((s=n.title)==null?void 0:s.trim())||"Новый разговор"},ju=n=>["running","reconnecting"].includes(n.state)||n.backgroundWork,Or=n=>n.state!=="closed"&&n.state!=="error";function Ur(n){return n.state==="starting"?"Запускается":n.state==="waiting_permission"?"Нужен ваш ответ":n.state==="error"||n.lastTurn==="failed"?"Ошибка":n.state==="running"?"В работе":n.state==="reconnecting"?"Восстанавливает связь":n.backgroundWork?"Работает в фоне":n.state==="closed"?"На диске":n.lastTurn==="completed"?"Завершено":n.lastTurn==="interrupted"||n.lastTurn==="stopped"?"Приостановлено":"Готов к работе"}function Pb(n,s){var o;const i=new Set;let c=n;for(;!i.has(c);){i.add(c);const u=(o=s.find(h=>h.sessionId===c))==null?void 0:o.parentId;if(!u)return c;c=u}return n}function ek(){try{const n=JSON.parse(localStorage.getItem("ether:inbox.seen")??"{}");if(n&&typeof n=="object"&&!Array.isArray(n))return Object.fromEntries(Object.entries(n).filter(([,s])=>typeof s=="number"&&Number.isFinite(s)))}catch{}return{}}function tk(){try{const n=JSON.parse(localStorage.getItem("ether:conversations.open")??"[]");if(Array.isArray(n))return[...new Set(n.filter(s=>typeof s=="string"))]}catch{}return[]}function nk({connected:n,workspaces:s,send:i}){const[c,o]=b.useState(null),[u,h]=b.useState(tk),[g,m]=b.useState([]),[x,_]=b.useState({}),v=b.useRef(new Map),y=b.useRef(new Set),[S,k]=b.useState({});b.useEffect(()=>{try{localStorage.setItem("ether:conversations.open",JSON.stringify(u))}catch{}},[u]);const[C,D]=b.useState([]),q=b.useRef([]),[G,V]=b.useState({}),[L,Y]=b.useState({}),[E,U]=b.useState({}),[Q,H]=b.useState({}),[B,N]=b.useState({}),[X,le]=b.useState({}),[de,ye]=b.useState({}),I=b.useRef(null),[R,P]=b.useState([]),[ae,Ne]=b.useState(ek),[A,K]=b.useState({}),[fe,ke]=b.useState(null),Re=b.useRef(new Map),Ue=b.useRef(new Set);Ue.current=new Set(s.map(Z=>Z.id));const _e=b.useRef(null),Ze=b.useRef(G);Ze.current=G;const rt=b.useRef(Q);rt.current=Q;const Bt=b.useRef(E);Bt.current=E;const he=s.map(Z=>Z.id).sort().join("|");b.useEffect(()=>{if(!n){Re.current.clear(),y.current.clear(),v.current.clear(),m([]);return}for(const Z of s)i({type:"session.list",workspaceId:Z.id});q.current.includes("session-links")&&i({type:"session.links.get"})},[n,he,i]);const at=b.useCallback(Z=>{var $e,ht;const De=(Ee,Te)=>{if(!Ee||Ee===Te)return;_(Ye=>({...Ye,[Ee]:Te}));const Oe=yu(Ee);Oe&&!yu(Te)&&af(Te,Oe)};if(Z.type==="hello.ok"&&(q.current=Z.features??[],D(Z.features??[]),_e.current&&_e.current!==Z.hostId&&(U({}),H({}),K({}),Re.current.clear()),_e.current=Z.hostId),Z.type==="session.started"&&Z.requestId&&v.current.has(Z.requestId)){const Ee=v.current.get(Z.requestId);v.current.delete(Z.requestId),y.current.delete(Z.session.id),De(Ee.previousId,Z.session.id),m(Te=>Te.filter(Oe=>Oe!==(Ee.previousId??Z.requestId))),V(Te=>({...Te,[Z.session.id]:Z.session})),h(Te=>[...new Set([...Te.filter(Oe=>Oe!==Ee.previousId),Z.session.id])]),o(null)}if(Z.type==="session.list"){for(const Ee of Z.sessions)Ee.state!=="closed"&&!Ee.parentSessionId&&!Re.current.has(Ee.id)&&(Re.current.set(Ee.id,0),i({type:"session.sync",sessionId:Ee.id,sinceSeq:0}));Y(Ee=>({...Ee,[Z.workspaceId]:!0})),V(Ee=>{const Te=Object.fromEntries(Object.entries(Ee).filter(([,Oe])=>Oe.workspaceId!==Z.workspaceId));for(const Oe of[...vy(Object.values(Ee),Z.sessions,Z.archived,Z.workspaceId),...Z.archived])Oe.parentSessionId||(Te[Oe.id]=Oe);return Te})}if(Z.type==="session.pinned"&&V(Ee=>{const Te=new Set(Z.sessions.map(Gt)),Oe=Object.fromEntries(Object.entries(Ee).map(([Ye,Qe])=>[Ye,{...Qe,pinned:Te.has(Gt(Qe))}]));for(const Ye of Z.sessions)Oe[Ye.id]={...Ye,...Oe[Ye.id],pinned:!0,pinnedAt:Ye.pinnedAt};return Oe}),Z.type==="session.summary"||Z.type==="session.live"){const Ee=Z.type==="session.live"?Z.sessions:[Z.session];if(!q.current.includes("session-routing")&&Z.type==="session.summary")for(const[Te,Oe]of v.current){const Ye=Z.session;if(!(Ye.workspaceId!==Oe.workspaceId||Ye.provider!==Oe.provider||Ye.state==="closed"||Oe.known.has(Ye.id)&&Ye.id!==Oe.resume&&Ye.claudeSessionId!==Oe.resume)){v.current.delete(Te),De(Oe.previousId,Ye.id),m(Qe=>Qe.filter(Pe=>Pe!==(Oe.previousId??Te))),h(Qe=>[...new Set([...Qe.filter(Pe=>Pe!==Oe.previousId),Ye.id])]);break}}if(V(Te=>{const Oe={...Te};for(const Ye of Ee)if(!(Ye.parentSessionId||!Ue.current.has(Ye.workspaceId))){for(const[Qe,Pe]of Object.entries(Oe))Pe.workspaceId===Ye.workspaceId&&Qe!==Ye.id&&Gt(Pe)===Gt(Ye)&&delete Oe[Qe];Oe[Ye.id]={...Oe[Ye.id],...Ye,...Ye.state!=="closed"?{archivedAt:void 0}:{}}}return Oe}),Z.type==="session.live")for(const Te of Ee)Te.parentSessionId||!Ue.current.has(Te.workspaceId)||Re.current.has(Te.id)||(Re.current.set(Te.id,0),i({type:"session.sync",sessionId:Te.id,sinceSeq:0}))}if(Z.type==="session.events"){const Ee=Z.entries.findLast(Qe=>Qe.event.kind==="result");Ee&&K(Qe=>({...Qe,[Z.sessionId]:Ee.ts}));const Te=Z.entries.findLast(Qe=>{var Pe;return Qe.event.kind==="rewound"&&Qe.seq>(((Pe=Bt.current[Z.sessionId])==null?void 0:Pe.lastSeq)??0)}),Oe=(Te==null?void 0:Te.event.kind)==="rewound"?Te.event.toUserIndex:null,Ye=Oe===null?null:B_((($e=rt.current[Z.sessionId])==null?void 0:$e.entries)??[],Oe);Ye&&H(Qe=>({...Qe,[Z.sessionId]:{...Qe[Z.sessionId]??Zi,entries:Ye}})),U(Qe=>{let Pe=Qe[Z.sessionId]??fs;if(Te&&Te.seq>Pe.lastSeq&&Oe!==null){const pt=(Ye==null?void 0:Ye.filter(At=>At.event.kind==="user.message").length)??0;Pe={...Pe,items:q_(Pe.items,Oe,pt)}}return{...Qe,[Z.sessionId]:vu(Pe,Z.entries)}})}if(Z.type==="session.history"&&H(Ee=>({...Ee,[Z.sessionId]:H_(Ee[Z.sessionId]??Zi,Z)})),Z.type==="session.capabilities"&&N(Ee=>({...Ee,[Z.sessionId]:Z.capabilities})),Z.type==="usage.state"&&le(Ee=>({...Ee,[Z.sessionId]:Z.usage})),Z.type==="context.state"&&ye(Ee=>({...Ee,[Z.sessionId]:Z.context})),Z.type==="fs.search"&&Z.scope==="comparison"&&Z.workspaceId===((ht=I.current)==null?void 0:ht.workspaceId)&&Z.query===I.current.query){const Ee=I.current.sessionId;Ee&&k(Te=>({...Te,[Ee]:{query:Z.query,entries:Z.entries}}))}if(Z.type==="fs.dir"&&I.current&&Z.workspaceId===I.current.workspaceId&&Z.path===I.current.path){const Ee=I.current.query,Te=Ee.slice(Ee.lastIndexOf("/")+1).toLocaleLowerCase(),Oe={query:Ee,entries:Z.entries.filter(Qe=>Qe.name.toLocaleLowerCase().includes(Te))},Ye=I.current.sessionId;Ye&&k(Qe=>({...Qe,[Ye]:Oe}))}if(Z.type==="session.links"&&(P(Z.links),ke(null)),Z.type==="session.closed"&&V(Ee=>{const Te=Ee[Z.sessionId];return Te?{...Ee,[Z.sessionId]:{...Te,state:"closed",backgroundWork:!1}}:Ee}),Z.type==="error"&&["session.start","session.link","session.history","session.sync","permission.respond","prompt.send"].includes(Z.context??"")&&(ke(Z.message),Z.requestId&&v.current.has(Z.requestId))){const Ee=v.current.get(Z.requestId);v.current.delete(Z.requestId),m(Te=>Te.filter(Oe=>Oe!==(Ee.previousId??Z.requestId)))}},[i]),oe=b.useMemo(()=>Object.values(G).filter(Z=>Ue.current.has(Z.workspaceId)).sort((Z,De)=>De.updatedAt-Z.updatedAt),[G,he]),Rt=Z=>Z.state==="error"?Z.updatedAt:A[Z.id]??Z.updatedAt,He=oe.filter(Z=>{var De;return!Z.archivedAt&&(Z.state==="waiting_permission"||(((De=E[Z.id])==null?void 0:De.pending.length)??0)>0||!ju(Z)&&(Z.state==="error"||Z.lastTurn==="failed"||Z.lastTurn==="completed")&&Rt(Z)>(ae[Gt(Z)]??0))}),qt=He.filter(Z=>{var De;return Z.state==="waiting_permission"||(((De=E[Z.id])==null?void 0:De.pending.length)??0)>0}),Un=b.useCallback(Z=>Ne(De=>{const $e=Z.state==="error"?Z.updatedAt:A[Z.id]??Z.updatedAt;if((De[Gt(Z)]??0)>=$e)return De;const ht={...De,[Gt(Z)]:$e};try{localStorage.setItem("ether:inbox.seen",JSON.stringify(ht))}catch{}return ht}),[A]),bt=b.useCallback(Z=>{h(De=>De.includes(Z.id)?De:[...De,Z.id]),o(null),ke(null)},[]);b.useEffect(()=>{if(n)for(const Z of u){const De=G[Z];!De||De.state==="closed"||y.current.has(Z)||(y.current.add(Z),i({type:"session.sync",sessionId:Z,sinceSeq:0}),H($e=>({...$e,[Z]:{...$e[Z]??Zi,loading:!0}})),i({type:"session.history",sessionId:Z}),i({type:"usage.get",sessionId:Z}),i({type:"context.get",sessionId:Z}))}},[u,G,n,i]);const Kt=b.useCallback((Z,De,$e,ht=!1,Ee=$e)=>{if(!n||Ee&&!ht&&[...v.current.values()].some(Oe=>Oe.previousId===Ee))return;const Te=crypto.randomUUID();v.current.set(Te,{workspaceId:Z,provider:De,resume:$e,...Ee&&!ht?{previousId:Ee}:{},known:new Set(Object.keys(Ze.current))}),m(Oe=>[...Oe,Ee&&!ht?Ee:Te]),ke(null),i({type:"session.start",workspaceId:Z,provider:De,requestId:Te,...$e?{resume:$e,fork:ht}:{}})},[n,i]),ln=b.useCallback(Z=>{h(De=>De.filter($e=>$e!==Z))},[]),Xn=b.useCallback((Z,De)=>{var Te;const $e=Ze.current[Z];if(k(Oe=>{const Ye={...Oe};return delete Ye[Z],Ye}),De===null||!$e){((Te=I.current)==null?void 0:Te.sessionId)===Z&&(I.current=null);return}const ht=De.lastIndexOf("/"),Ee=ht>=0?De.slice(0,ht):"";I.current={workspaceId:$e.workspaceId,sessionId:Z,query:De,...ht>=0||De===""?{path:Ee}:{}},ht>=0||De===""?i({type:"fs.list",workspaceId:$e.workspaceId,path:Ee}):i({type:"fs.search",workspaceId:$e.workspaceId,query:De,scope:"comparison"})},[i]),wt=b.useCallback(()=>{if(n){ke(null);for(const Z of s)i({type:"session.list",workspaceId:Z.id});for(const Z of Object.values(Ze.current))Z.state!=="closed"&&!Z.archivedAt&&i({type:"session.sync",sessionId:Z.id,sinceSeq:0});q.current.includes("session-links")&&i({type:"session.links.get"})}},[n,s,i]);return{view:c,setView:o,openedIds:u,replacements:x,launchingIds:g,launchSession:Kt,closeConversation:ln,searchSession:Xn,contexts:S,sessions:G,allSessions:oe,loaded:L,timelines:E,histories:Q,links:R,attention:He,waiting:qt,markRead:Un,handleFrame:at,capabilities:B,usage:X,context:de,supportsLinks:C.includes("session-links"),openConversation:bt,send:i,error:fe,clearError:()=>ke(null),refresh:wt,supportsProviderDefaults:C.includes("provider-default-models"),loadHistory:(Z,De)=>{H($e=>({...$e,[Z]:{...$e[Z]??Zi,loading:!0}})),i({type:"session.history",sessionId:Z,before:De})}}}function im(n){return/read|glob|grep|search|list|fetch|browse/i.test(n)?{title:"Исследует контекст",detail:"Читает материалы и собирает сведения для вашей задачи."}:/write|edit|patch|create/i.test(n)?{title:"Вносит изменения",detail:"Работает с содержимым проекта. Детали доступны в карточке действия."}:/bash|shell|exec|command|terminal/i.test(n)?{title:"Выполняет команду",detail:"Ожидает результат выполнения. Вывод появится в журнале действий."}:/question|ask/i.test(n)?{title:"Уточняет детали",detail:"Готовит вопрос, чтобы точнее выполнить вашу задачу."}:{title:"Выполняет действие",detail:"Результат и подробности появятся в журнале по мере выполнения."}}function sk({waiting:n,activity:s,responding:i=!1}){const[c]=b.useState(Date.now),[o,u]=b.useState(0);b.useEffect(()=>{const m=window.setInterval(()=>u(Math.floor((Date.now()-c)/1e3)),1e3);return()=>window.clearInterval(m)},[c]);const h=n?{title:"Нужен ваш ответ",detail:"Процесс приостановлен. Ответьте на вопрос или рассмотрите запрос разрешения, чтобы продолжить."}:s?im(s):i?{title:"Формирует ответ",detail:"Ответ появляется постепенно. Вы можете читать его уже сейчас."}:{title:"Работает над задачей",detail:"Обрабатывает ваш запрос. Новые действия и результаты появятся здесь."},g=o<60?`${o} с`:`${Math.floor(o/60)} мин ${o%60} с`;return a.jsxs("div",{className:n?"process process--waiting":"process","aria-busy":!n,children:[a.jsxs("div",{className:"process__visual","aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("i",{})]}),a.jsxs("div",{className:"process__content",children:[a.jsxs("div",{className:"process__heading",children:[a.jsx("span",{className:"process__eyebrow",children:n?"ОЖИДАНИЕ РЕШЕНИЯ":"ПРОЦЕСС В ДВИЖЕНИИ"}),a.jsx("span",{className:"process__time","aria-label":`С начала работы: ${g}`,children:g})]}),a.jsxs("div",{role:"status",className:"process__status",children:[a.jsx("strong",{children:h.title}),a.jsx("p",{children:h.detail})]}),s&&a.jsxs("span",{className:"process__activity",children:["Действие: ",s]}),a.jsxs("div",{className:"process__steps","aria-hidden":"true",children:[a.jsx("span",{className:"is-done",children:"Запрос принят"}),a.jsx("i",{}),a.jsx("span",{className:"is-current",children:n?"Ваше решение":"В работе"}),a.jsx("i",{}),a.jsx("span",{children:"Результат"})]})]})]})}function rm(n){const s=n.findLast(o=>o.kind==="user"),i=n.findLast(o=>o.kind==="assistant"),c=n.filter(o=>o.kind==="tool").slice(-3).map(o=>{if(o.kind!=="tool")return"";const u=o.input&&typeof o.input=="object"?o.input:{},h=[u.file_path,u.path,u.command,u.query].find(g=>typeof g=="string");return`${im(o.name).title}${h?` · ${String(h).slice(0,180)}`:` · ${o.name}`}${o.isError?" · ошибка":o.result===null?" · выполняется":" · готово"}`});return{prompt:(s==null?void 0:s.kind)==="user"?s.text:"",answer:(i==null?void 0:i.kind)==="assistant"?i.text:"",actions:c}}function lk({session:n,items:s,pendingCount:i}){const[c,o]=b.useState(()=>Date.now()-n.createdAt>3e5),u=rm(s);return!u.prompt&&!u.answer&&u.actions.length===0?null:a.jsxs("section",{className:"session-recap"+(c?" is-open":""),"aria-label":"Контекст сессии",children:[a.jsxs("button",{type:"button",className:"session-recap__toggle","aria-expanded":c,onClick:()=>o(!c),children:[a.jsx("span",{"aria-hidden":"true",children:"↳"}),a.jsx("strong",{children:"Вернуться в контекст"}),a.jsx("span",{className:"session-recap__preview",children:u.prompt.slice(0,130)||"Последние действия и результат"}),a.jsx("span",{"aria-hidden":"true",children:c?"−":"+"})]}),c&&a.jsxs("div",{className:"session-recap__body",children:[u.prompt&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНЯЯ ЗАДАЧА"}),a.jsx("p",{children:u.prompt.slice(0,700)})]}),u.actions.length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЕ ДЕЙСТВИЯ"}),a.jsx("ul",{children:u.actions.map((h,g)=>a.jsx("li",{children:h},g))})]}),u.answer&&a.jsxs("div",{children:[a.jsx("span",{className:"hub-eyebrow",children:"ПОСЛЕДНИЙ ОТВЕТ"}),a.jsxs("p",{children:[u.answer.slice(0,700),u.answer.length>700?"…":""]})]}),i>0&&a.jsxs("p",{className:"hub-warning",children:["Ожидают вашего решения: ",i,". Рассмотрите запрос в разговоре или во «Входящих»."]}),["interrupted","stopped","failed"].includes(n.lastTurn??"")&&a.jsx("p",{className:"hub-warning",children:"Предыдущий ход не завершён. Можно уточнить задачу и продолжить разговор."})]})]})}function hs({title:n,children:s,actions:i,className:c,sheet:o=!1,onClose:u}){const h=b.useRef(null);return b.useEffect(()=>{function g(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),u();return}if(m.key!=="Tab")return;const x=h.current;if(!x)return;const _=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),v=_[0],y=_[_.length-1];!v||!y||(m.shiftKey&&document.activeElement===v?(m.preventDefault(),y.focus()):!m.shiftKey&&document.activeElement===y&&(m.preventDefault(),v.focus()))}return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[u]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&u()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:n}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:u,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:s}),i&&a.jsx("div",{className:"modal__actions",children:i})]})})}function jy(n,s){if(n!=="ExitPlanMode"||!s||typeof s!="object")return null;const i=s.plan;return typeof i=="string"?i:null}const Jb=3,ak=15e5;function wy(n,s){if(!s||typeof s!="object")return null;const i=s,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(n==="Write"){if(typeof i.content!="string")return null;const o=xp(i.content).map(u=>({type:"add",text:u}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=ok(ik(xp(i.old_string),xp(i.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(u=>u.type==="add").length,removed:o.filter(u=>u.type==="del").length,note:i.replace_all===!0?"все вхождения":null}}return null}function xp(n){if(n==="")return[];const s=n.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function ik(n,s){let i=0;for(;i<n.length&&i<s.length&&n[i]===s[i];)i++;let c=n.length,o=s.length;for(;c>i&&o>i&&n[c-1]===s[o-1];)c--,o--;const u=h=>({type:"ctx",text:h});return[...n.slice(0,i).map(u),...rk(n.slice(i,c),s.slice(i,o)),...n.slice(c).map(u)]}function rk(n,s){if(n.length===0&&s.length===0)return[];if(n.length===0)return s.map(_=>({type:"add",text:_}));if(s.length===0)return n.map(_=>({type:"del",text:_}));if((n.length+1)*(s.length+1)>ak)return[...n.map(_=>({type:"del",text:_})),...s.map(_=>({type:"add",text:_}))];const i=n.length,c=s.length,o=c+1,u=new Uint32Array((i+1)*o),h=(_,v)=>u[_*o+v]??0;for(let _=i-1;_>=0;_--)for(let v=c-1;v>=0;v--)u[_*o+v]=n[_]===s[v]?h(_+1,v+1)+1:Math.max(h(_+1,v),h(_,v+1));const g=[];let m=0,x=0;for(;m<i&&x<c;){const _=n[m],v=s[x];_===v?(g.push({type:"ctx",text:_}),m++,x++):h(m+1,x)>=h(m,x+1)?(g.push({type:"del",text:_}),m++):(g.push({type:"add",text:v}),x++)}for(;m<i;)g.push({type:"del",text:n[m++]});for(;x<c;)g.push({type:"add",text:s[x++]});return ck(g)}function ck(n){const s=[];let i=[];function c(){s.push(...i.filter(o=>o.type==="del")),s.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of n)o.type==="ctx"?(c(),s.push(o)):i.push(o);return c(),s}function ok(n){if(!n.some(u=>u.type!=="ctx"))return n;const s=n.map(()=>!1);n.forEach((u,h)=>{if(u.type!=="ctx")for(let g=Math.max(0,h-Jb);g<=Math.min(n.length-1,h+Jb);g++)s[g]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${uk(c.length)} без изменений`}),c=[]}return n.forEach((u,h)=>{s[h]?(o(),i.push(u)):c.push(u)}),o(),i}function uk(n){const s=n%100;if(s>=11&&s<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}function cm({diff:n}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&a.jsx("div",{className:"diff__note",children:n.note}),a.jsx("div",{className:"diff__body",children:n.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((s,i)=>a.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},i))})]})}function dk({request:n,plan:s,queued:i,collapsed:c,onCollapse:o,onAccept:u,onDecline:h}){const[g,m]=b.useState(s),[x,_]=b.useState("preview");b.useEffect(()=>{m(s),_("preview")},[n.requestId,s]);const v=g.trim().length>0;function y(){v&&u(n.requestId,g)}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:a.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[a.jsxs("div",{className:"plansheet__head",children:[a.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:a.jsx(hk,{})}),a.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",i>0&&` — ещё ${i} в очереди`]}),a.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(x==="preview"?" is-on":""),role:"tab","aria-selected":x==="preview",onClick:()=>_("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>_("source"),children:"Код"})]}),a.jsx(om,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[n.reason&&a.jsx("p",{className:"plansheet__reason",children:n.reason}),a.jsx("div",{className:"plansheet__content",children:x==="preview"?a.jsx(fk,{text:g}):a.jsx("textarea",{className:"plansheet__source",value:g,onChange:S=>m(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!v,autoFocus:!0,onClick:y,children:"Одобрить план"})]})]})})}function fk({text:n}){const[s,i]=b.useState("");return b.useEffect(()=>{let c=!1;return wf(n).then(o=>{c||i(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function hk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.4 2.5h5.6L13 5.5v7.4a.6.6 0 0 1-.6.6H4.4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z"}),a.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),a.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function om({onClick:n}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 6 4 4 4-4"})}),a.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function pk({request:n,queued:s,collapsed:i,onCollapse:c,onDecide:o}){const u=wy(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:i,children:a.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[a.jsxs("div",{className:"sheet__head",children:[a.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),a.jsx(om,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&a.jsx("p",{className:"sheet__reason",children:n.reason}),u?a.jsx(cm,{diff:u}):a.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function mk({request:n,queued:s,collapsed:i,onCollapse:c,onAnswer:o,onDecline:u}){const{questions:h}=n,[g,m]=b.useState(()=>h.map(()=>new Set)),[x,_]=b.useState(()=>h.map(()=>"")),[v,y]=b.useState(()=>Wb(h));b.useEffect(()=>{m(h.map(()=>new Set)),_(h.map(()=>"")),y(Wb(h))},[n.requestId]);const S=b.useMemo(()=>xk(h,g,x),[h,g,x]),k=S!==null;function C(Y,E){var U,Q;(Q=(U=h[Y])==null?void 0:U.options[E])!=null&&Q.preview&&y(H=>{const B=H.slice();return B[Y]=E,B})}function D(Y,E,U){m(Q=>{const H=Q.slice(),B=new Set(H[Y]);return U?B.has(E)?B.delete(E):B.add(E):B.has(E)||(B.clear(),B.add(E)),H[Y]=B,H}),E!=="other"&&C(Y,E)}function q(Y,E){_(U=>{const Q=U.slice();return Q[Y]=E,Q})}function G(){S&&o(n.requestId,S)}function V(Y){Y.key==="Enter"&&(Y.target.closest("button")||k&&(Y.preventDefault(),G()))}function L(Y){var H;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Y.key))return;const E=Array.from(Y.currentTarget.querySelectorAll("button.qsheet__option")),U=E.indexOf(document.activeElement);if(U===-1)return;Y.preventDefault();const Q=Y.key==="ArrowDown"||Y.key==="ArrowRight"?1:-1;(H=E[(U+Q+E.length)%E.length])==null||H.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:i,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от агента",onKeyDown:V,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,s>0&&` — ещё ${s} в очереди`]}),a.jsx(om,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((Y,E)=>a.jsx(gk,{q:Y,qi:E,selected:g[E]??new Set,otherText:x[E]??"",previewIndex:v[E]??null,onToggle:D,onFocusOption:C,onOtherText:q,onOptionsKeyDown:L},E))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>u(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:G,children:"Ответить"})]})]})})}function gk({q:n,qi:s,selected:i,otherText:c,previewIndex:o,onToggle:u,onFocusOption:h,onOtherText:g,onOptionsKeyDown:m}){var S;const x=n.options.some(k=>k.preview),_=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,v=i.has("other"),y=n.multiSelect?"checkbox":"radio";return a.jsxs("div",{className:"qsheet__question",children:[a.jsxs("div",{className:"qsheet__qhead",children:[a.jsx("span",{className:"chip chip--accent",children:n.header}),a.jsx("span",{className:"qsheet__qtext",children:n.question})]}),a.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:m,children:[n.options.map((k,C)=>{const D=i.has(C);return a.jsxs("button",{type:"button",role:y,"aria-checked":D,className:"qsheet__option"+(D?" is-selected":""),onClick:()=>u(s,C,n.multiSelect),onFocus:()=>h(s,C),onMouseEnter:()=>h(s,C),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},C)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:y,"aria-checked":v,className:"qsheet__option qsheet__option--other"+(v?" is-selected":""),onClick:()=>u(s,"other",n.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),v&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>g(s,k.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function Wb(n){return n.map(s=>{const i=s.options.findIndex(c=>c.preview);return i===-1?null:i})}function xk(n,s,i){const c={};for(let o=0;o<n.length;o++){const u=n[o];if(!u)continue;const h=s[o]??new Set,g=[];for(let m=0;m<u.options.length;m++){const x=u.options[m];x&&h.has(m)&&g.push(x.label)}if(h.has("other")){const m=(i[o]??"").trim();m&&g.push(m)}if(g.length===0)return null;c[u.question]=g.join(", ")}return c}function ky({hub:n,sessionId:s,onClose:i}){var _;const c=n.timelines[s],o=c==null?void 0:c.pending[0],u=b.useRef(null);if(b.useEffect(()=>{if(!o)return;const v=y=>{var D;if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),i();return}if(y.key!=="Tab")return;const S=(D=u.current)==null?void 0:D.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [tabindex="0"]'),k=S==null?void 0:S[0],C=S==null?void 0:S[S.length-1];y.shiftKey&&document.activeElement===k&&C?(y.preventDefault(),C.focus()):!y.shiftKey&&document.activeElement===C&&k&&(y.preventDefault(),k.focus())};return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[o==null?void 0:o.requestId,i]),!o)return null;const h=v=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"deny"}),g={queued:((c==null?void 0:c.pending.length)??1)-1,collapsed:!1,onCollapse:i},m=jy(o.toolName,o.input),x=(_=o.questions)!=null&&_.length?a.jsx(mk,{...g,request:{...o,questions:o.questions},onDecline:h,onAnswer:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"allow",answers:y})},o.requestId):m!==null?a.jsx(dk,{...g,request:o,plan:m,onDecline:h,onAccept:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:"allow",plan:y})},o.requestId):a.jsx(pk,{...g,request:o,onDecide:(v,y)=>n.send({type:"permission.respond",sessionId:s,requestId:v,decision:y})},o.requestId);return a.jsx("div",{ref:u,className:"hub-decision",children:x})}const Kd=[{value:"research",label:"Исследование"},{value:"implementation",label:"Реализация"},{value:"review",label:"Проверка"},{value:"other",label:"Другой этап"}];function bk({hub:n}){return a.jsxs("nav",{className:"hub-navigation","aria-label":"Управление пространством",children:[a.jsxs("button",{className:n.view==="projects"?"is-active":"",onClick:()=>n.setView("projects"),children:[a.jsx("span",{"aria-hidden":"true",children:"▦"}),"Обзор проектов",a.jsx("span",{children:Object.keys(n.loaded).length})]}),a.jsxs("button",{className:n.view==="inbox"?"is-active":"",onClick:()=>n.setView("inbox"),children:[a.jsx("span",{"aria-hidden":"true",children:"◫"}),"Входящие",n.attention.length>0&&a.jsx("span",{className:n.waiting.length?"has-attention":"",children:n.attention.length})]}),a.jsxs("button",{onClick:()=>n.setView("command"),children:[a.jsx("span",{"aria-hidden":"true",children:"⌕"}),"Найти и перейти",a.jsx("kbd",{children:"Ctrl P"})]})]})}function _k(n){var g,m,x;const{hub:s}=n,[i,c]=b.useState(null),o=i?((g=s.timelines[i])==null?void 0:g.pending.length)??0:0;b.useEffect(()=>{i&&!o&&c(null)},[i,o]),b.useEffect(()=>{const _=v=>{(v.ctrlKey||v.metaKey)&&(v.code==="KeyP"||v.key.toLowerCase()==="p")&&!v.altKey&&!v.isComposing&&(v.preventDefault(),v.stopImmediatePropagation(),v.repeat||s.setView(s.view==="command"?null:"command"))};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[s.view,s.setView]);const u={projects:"Обзор проектов",inbox:"Входящие",command:"Найти и перейти",tasks:"Ветки задачи",compare:"Открыть параллельно"},h=i?s.sessions[i]:null;return a.jsxs(a.Fragment,{children:[s.view&&!i&&a.jsxs(hs,{title:u[s.view],className:s.view==="command"?"modal--palette":"modal--hub",onClose:()=>s.setView(null),children:[!n.connected&&a.jsx("p",{className:"hub-warning",role:"status",children:"Связь с хостом прервана. Данные ниже — последнее полученное состояние."}),s.error&&a.jsxs("div",{className:"hub-error",role:"alert",children:[s.error,a.jsx("button",{onClick:s.clearError,"aria-label":"Закрыть ошибку",children:"×"})]}),s.view==="projects"&&a.jsx(yk,{...n}),s.view==="inbox"&&a.jsx(vk,{...n,onReview:c}),s.view==="command"&&a.jsx(jk,{...n}),s.view==="tasks"&&a.jsx(kk,{...n},(m=n.activeSession)==null?void 0:m.id),s.view==="compare"&&a.jsx(wk,{...n})]}),i&&h&&o>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hub-decision-context",children:[a.jsxs("div",{children:[a.jsxs("span",{className:"hub-eyebrow",children:["ВХОДЯЩИЕ · ",(x=n.workspaces.find(_=>_.id===h.workspaceId))==null?void 0:x.name]}),a.jsx("strong",{children:sn(h)})]}),a.jsx("button",{className:"btn",onClick:()=>c(null),children:"← К входящим"})]}),a.jsx(ky,{hub:s,sessionId:i,onClose:()=>c(null)})]})]})}function Ny({session:n,workspace:s,onOpen:i,onCompare:c,detail:o}){return a.jsxs("div",{className:"hub-session-row",children:[a.jsxs("button",{className:"hub-session-row__main",onClick:i,children:[a.jsx("span",{className:"hub-session-dot"+(n.state==="waiting_permission"?" is-waiting":ju(n)?" is-running":"")}),a.jsxs("span",{children:[a.jsx("strong",{children:sn(n)}),a.jsxs("small",{children:[s&&`${s} · `,n.provider," · ",o??Ur(n)]})]})]}),c&&a.jsx("button",{className:"hub-icon-btn",onClick:c,"aria-label":`Открыть рядом: ${sn(n)}`,title:"Открыть вторым разговором",children:"◧"})]})}function yk({hub:n,workspaces:s,connected:i,onSelectWorkspace:c,onSelectSession:o,onOpenWorkspace:u,onNewSession:h}){const[g,m]=b.useState(""),[x,_]=b.useState("all"),v=s.filter(y=>{if(!`${y.name} ${y.path}`.toLocaleLowerCase().includes(g.toLocaleLowerCase()))return!1;const S=n.allSessions.filter(k=>k.workspaceId===y.id&&!k.archivedAt);return x==="all"||(x==="working"?S.some(ju):S.some(k=>k.state==="waiting_permission"))});return a.jsxs("div",{className:"projects-hub",children:[a.jsx("p",{className:"hub-description",children:"Все проекты в одном месте. Видно, где идёт работа, где нужен ваш ответ и к чему вы возвращались последним."}),a.jsxs("div",{className:"hub-stats",children:[a.jsxs("div",{children:[a.jsx("strong",{children:s.length}),a.jsx("span",{children:"проектов"})]}),a.jsxs("div",{children:[a.jsx("strong",{children:n.allSessions.filter(y=>!y.archivedAt&&ju(y)).length}),a.jsx("span",{children:"сессий в работе"})]}),a.jsxs("div",{className:n.waiting.length?"has-attention":"",children:[a.jsx("strong",{children:n.waiting.length}),a.jsx("span",{children:"ждут решения"})]}),a.jsxs("div",{children:[a.jsx("strong",{children:n.attention.filter(y=>y.lastTurn==="completed"&&y.state!=="running").length}),a.jsx("span",{children:"новых результатов"})]})]}),a.jsxs("div",{className:"hub-controls",children:[a.jsx("input",{className:"hub-input","aria-label":"Найти проект",placeholder:"Название или путь проекта…",value:g,onChange:y=>m(y.target.value)}),a.jsx("button",{className:"btn btn--primary",disabled:!i,onClick:u,children:"+ Проект"}),a.jsx("button",{className:"hub-icon-btn",disabled:!i,onClick:n.refresh,"aria-label":"Обновить обзор",title:"Обновить обзор",children:"↻"})]}),a.jsx("div",{className:"hub-filters","aria-label":"Фильтр проектов",children:[["all","Все"],["working","В работе"],["waiting","Нужен ответ"]].map(([y,S])=>a.jsx("button",{"aria-pressed":x===y,onClick:()=>_(y),children:S},y))}),a.jsx("div",{className:"hub-project-grid",children:v.map(y=>{const S=n.allSessions.filter(D=>D.workspaceId===y.id&&!D.archivedAt),k=S.filter(D=>D.state==="waiting_permission").length,C=S.filter(ju).length;return a.jsxs("article",{className:"hub-project"+(k?" hub-project--waiting":""),children:[a.jsxs("div",{className:"hub-project__head",children:[a.jsxs("button",{onClick:()=>c(y.id),children:[a.jsx("span",{className:"hub-eyebrow",children:"РАБОЧЕЕ ПРОСТРАНСТВО"}),a.jsx("h3",{children:y.name})]}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("p",{className:"hub-project__path",title:y.path,children:y.path}),a.jsx("div",{className:"hub-project__counts",children:n.loaded[y.id]?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[S.length," сессий"]}),a.jsxs("span",{children:[C," в работе"]}),k>0&&a.jsxs("span",{className:"hub-warning",children:[k," ждут ответа"]})]}):a.jsx("span",{children:"Загружаются сессии…"})}),a.jsxs("div",{className:"hub-project__recent",children:[S.slice(0,3).map(D=>a.jsx(Ny,{session:D,onOpen:()=>o(D),onCompare:()=>o(D,!0)},D.id)),n.loaded[y.id]&&!S.length&&a.jsx("p",{className:"hub-muted",children:"Здесь начнётся следующий разговор."})]}),a.jsxs("button",{className:"hub-project__new",disabled:!i,onClick:()=>h(y.id),children:["+ Новый разговор ",a.jsx("span",{"aria-hidden":"true",children:"→"})]})]},y.id)})}),!v.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:s.length?"Проекты не найдены":"Начните с проекта"}),a.jsx("p",{children:s.length?"Измените запрос или фильтр.":"Откройте папку, чтобы собрать файлы и разговоры в одном пространстве."})]})]})}function vk({hub:n,workspaces:s,connected:i,onSelectSession:c,onReview:o,providerFilter:u="all"}){const[h,g]=b.useState("all"),m=_=>{var v;return _.state==="waiting_permission"||(v=n.timelines[_.id])!=null&&v.pending.length?"waiting":_.state==="error"||_.lastTurn==="failed"?"error":"result"},x=n.attention.filter(_=>(u==="all"||_.provider===u)&&(h==="all"||m(_)===h)).sort((_,v)=>(m(_)==="waiting"?0:m(_)==="error"?1:2)-(m(v)==="waiting"?0:m(v)==="error"?1:2)||v.updatedAt-_.updatedAt);return a.jsxs("div",{children:[a.jsx("p",{className:"hub-description",children:"Вопросы, разрешения, ошибки и новые результаты из всех проектов. Нерешённые запросы остаются здесь до вашего ответа."}),a.jsxs("div",{className:"hub-filters",children:[[["all","Всё"],["waiting","Требует решения"],["error","Ошибки"],["result","Результаты"]].map(([_,v])=>a.jsx("button",{"aria-pressed":h===_,onClick:()=>g(_),children:v},_)),a.jsx("button",{className:"hub-mark-all",onClick:()=>n.attention.filter(_=>(u==="all"||_.provider===u)&&m(_)!=="waiting").forEach(n.markRead),children:"Прочитать результаты"})]}),a.jsx("div",{className:"hub-inbox",children:x.map(_=>{var D,q,G,V;const v=n.timelines[_.id],y=v==null?void 0:v.pending[0],S=m(_),k=rm((v==null?void 0:v.items)??[]),C=(q=(D=y==null?void 0:y.questions)==null?void 0:D[0])==null?void 0:q.question;return a.jsxs("article",{className:"hub-inbox-item hub-inbox-item--"+S,children:[a.jsxs("div",{className:"hub-inbox-item__meta",children:[a.jsx("span",{className:"hub-pill",children:S==="waiting"?(G=y==null?void 0:y.questions)!=null&&G.length?"Вопрос":"Нужно разрешение":S==="error"?"Ошибка":"Задача завершена"}),a.jsxs("span",{children:[(V=s.find(L=>L.id===_.workspaceId))==null?void 0:V.name," · ",_.provider]})]}),a.jsx("h3",{children:sn(_)}),a.jsx("p",{children:C??(y?`${y.toolName}${y.reason?` · ${y.reason}`:""}`:k.answer.slice(0,220)||k.prompt.slice(0,220)||Ur(_))}),a.jsxs("div",{className:"hub-inbox-item__actions",children:[S==="waiting"&&y&&a.jsxs("button",{className:"btn btn--primary",disabled:!i,onClick:()=>o(_.id),children:["Рассмотреть",v.pending.length>1?` · ${v.pending.length}`:""]}),a.jsx("button",{className:"btn",onClick:()=>c(_),children:"Открыть разговор"}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>c(_,!0),children:"Открыть рядом"}),S!=="waiting"&&a.jsx("button",{className:"hub-read",onClick:()=>n.markRead(_),children:"Прочитано ✓"})]})]},_.id)})}),!x.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("span",{className:"hub-empty__orbit","aria-hidden":"true",children:"✓"}),a.jsx("strong",{children:"Всё под контролем"}),a.jsx("p",{children:"Здесь появятся новые события, требующие внимания."})]})]})}function jk({hub:n,workspaces:s,activeWorkspaceId:i,connected:c,providerFilter:o="all",onSelectSession:u,onSelectWorkspace:h,onOpenWorkspace:g,onOpenFiles:m,onOpenSettings:x,onNewSession:_}){const[v,y]=b.useState(""),[S,k]=b.useState(0),C=b.useRef(null);b.useEffect(()=>{const G=setTimeout(()=>{var V;return(V=C.current)==null?void 0:V.focus()},0);return()=>clearTimeout(G)},[]);const D=b.useMemo(()=>{const G=[{id:"projects",title:"Обзор проектов",hint:"Действие · все рабочие пространства",run:()=>n.setView("projects")},{id:"inbox",title:"Входящие",hint:"Действие · вопросы и результаты",run:()=>n.setView("inbox")},{id:"open",title:"Открыть проект",hint:"Действие · выбрать папку",run:g,disabled:!c},{id:"new",title:"Создать сессию",hint:"Действие · новый разговор в текущем проекте",run:()=>i&&_(i),disabled:!i||!c},{id:"files",title:"Открыть файлы проекта",hint:"Действие · дерево файлов и редактор",run:m,disabled:!i},{id:"settings",title:"Настройки пространства",hint:"Действие · темы и агенты",run:x},{id:"compare",title:"Открыть сессию параллельно",hint:"Действие · независимое окно сессии",run:()=>n.setView("compare")}],V=s.map(E=>({id:"p:"+E.id,title:E.name,hint:"Проект · "+E.path,run:()=>h(E.id),disabled:!1})),L=n.allSessions.filter(E=>o==="all"||E.provider===o).map(E=>{var U;return{id:"s:"+E.id,title:sn(E),hint:`${E.archivedAt?"Архив · ":"Сессия · "}${((U=s.find(Q=>Q.id===E.workspaceId))==null?void 0:U.name)??""} · ${E.provider} · ${Ur(E)}`,run:()=>u(E),disabled:!c&&E.state==="closed"}}),Y=v.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);return[...G,...V,...L].filter(E=>Y.every(U=>`${E.title} ${E.hint}`.toLocaleLowerCase().includes(U))).sort((E,U)=>Number(U.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))-Number(E.title.toLocaleLowerCase().startsWith(v.toLocaleLowerCase()))).slice(0,60)},[v,n.allSessions,s,c,i,o]),q=G=>{const V=D[G];V&&!V.disabled&&(n.setView(null),V.run())};return b.useEffect(()=>{var G;(G=document.getElementById(`hub-option-${S}`))==null||G.scrollIntoView({block:"nearest"})},[S]),a.jsxs("div",{className:"command-palette",children:[a.jsx("input",{ref:C,className:"hub-input command-palette__input",role:"combobox","aria-expanded":"true","aria-controls":"hub-command-results","aria-autocomplete":"list","aria-activedescendant":D[S]?`hub-option-${S}`:void 0,"aria-label":"Поиск проектов, сессий и действий",placeholder:"Проект, разговор или действие…",value:v,onChange:G=>{y(G.target.value),k(0)},onKeyDown:G=>{(G.key==="ArrowDown"||G.key==="ArrowUp")&&(G.preventDefault(),k(V=>D.length?(V+(G.key==="ArrowDown"?1:-1)+D.length)%D.length:0)),G.key==="Enter"&&(G.preventDefault(),q(S))}}),a.jsx("div",{className:"command-palette__results",role:"listbox",id:"hub-command-results","aria-label":"Результаты поиска",children:D.map((G,V)=>a.jsxs("button",{role:"option","aria-selected":S===V,"aria-disabled":G.disabled,disabled:G.disabled,id:`hub-option-${V}`,className:S===V?"is-selected":"",onMouseMove:()=>k(V),onClick:()=>q(V),children:[a.jsx("span",{className:"command-palette__kind","aria-hidden":"true",children:G.id.startsWith("p:")?"▦":G.id.startsWith("s:")?"◌":"↗"}),a.jsxs("span",{children:[a.jsx("strong",{children:G.title}),a.jsx("small",{children:G.hint})]}),a.jsx("span",{"aria-hidden":"true",children:"↵"})]},G.id))}),!D.length&&a.jsx("p",{className:"hub-empty",children:"Совпадений нет. Попробуйте название проекта или слово из заголовка сессии."}),a.jsxs("div",{className:"command-palette__foot",children:[a.jsx("span",{children:"↑ ↓ выбрать · Enter перейти"}),a.jsx("span",{children:"Esc закрыть"})]})]})}function wk({hub:n,workspaces:s,onSelectSession:i,providerFilter:c="all"}){const[o,u]=b.useState(""),h=n.allSessions.filter(g=>{var m;return(c==="all"||g.provider===c)&&!g.archivedAt&&`${sn(g)} ${(m=s.find(x=>x.id===g.workspaceId))==null?void 0:m.name}`.toLocaleLowerCase().includes(o.toLocaleLowerCase())});return a.jsxs("div",{children:[a.jsx("p",{className:"hub-description",children:"Выберите сессию для отдельного окна. У всех сессий одинаковые настройки и инструменты."}),a.jsx("input",{className:"hub-input",value:o,onChange:g=>u(g.target.value),"aria-label":"Найти сессию для параллельного просмотра",placeholder:"Сессия или проект…"}),a.jsx("div",{className:"hub-session-list",children:h.map(g=>{var m;return a.jsx(Ny,{session:g,workspace:(m=s.find(x=>x.id===g.workspaceId))==null?void 0:m.name,onOpen:()=>i(g,!0)},g.id)})}),!h.length&&a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Сессии не найдены"}),a.jsx("p",{children:"Измените поиск или создайте сессию в проекте."})]})]})}function kk({hub:n,activeSession:s,workspaces:i,providers:c,connected:o,onSelectSession:u,onStartStage:h}){var I;const g=s==null?void 0:s.workspaceId,m=n.allSessions.filter(R=>R.workspaceId===g),[x,_]=b.useState(s?Gt(s):""),v=m.find(R=>Gt(R)===x)??s,y=n.links.find(R=>R.sessionId===x),[S,k]=b.useState((y==null?void 0:y.parentId)??""),[C,D]=b.useState((y==null?void 0:y.stage)??"other"),[q,G]=b.useState("implementation"),[V,L]=b.useState(c.includes((s==null?void 0:s.provider)??"claude")?s.provider:c[0]??"claude"),[Y,E]=b.useState(!1),U=v?Pb(Gt(v),n.links):"",Q=m.filter(R=>Pb(Gt(R),n.links)===U).sort((R,P)=>R.createdAt-P.createdAt),H=[],B=new Set,N=(R,P)=>{var Ne;const ae=Gt(R);if(!B.has(ae)){B.add(ae),H.push({session:R,depth:P});for(const A of Q)((Ne=n.links.find(K=>K.sessionId===Gt(A)))==null?void 0:Ne.parentId)===ae&&N(A,P+1)}},X=Q.find(R=>Gt(R)===U);X&&N(X,0);for(const R of Q)B.has(Gt(R))||N(R,0);const le=R=>{_(R);const P=n.links.find(ae=>ae.sessionId===R);k((P==null?void 0:P.parentId)??""),D((P==null?void 0:P.stage)??"other")};if(!s||!v)return a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Сначала откройте сессию"}),a.jsx("p",{children:"Её можно связать с другими разговорами и продолжить отдельным этапом."})]});if(!n.supportsLinks)return a.jsxs("div",{className:"hub-empty",children:[a.jsx("strong",{children:"Обновите хост для веток задач"}),a.jsx("p",{children:"На этом компьютере работает предыдущая версия CLI. Обновите пакет командой ниже и перезапустите ccv. Проекты, поиск, входящие и разговоры доступны уже сейчас."}),a.jsx("code",{children:"npm install -g @i14ks/ccv@latest"})]});const de=v.provider===V&&V!=="antigravity",ye=m.filter(R=>{var Ne;let P=Gt(R);const ae=new Set;for(;P&&!ae.has(P);){if(P===x)return!1;ae.add(P),P=((Ne=n.links.find(A=>A.sessionId===P))==null?void 0:Ne.parentId)??null}return!0});return a.jsxs("div",{className:"task-hub",children:[a.jsx("p",{className:"hub-description",children:"Одна задача может пройти через несколько разговоров: исследование, реализацию и проверку. Связи сохраняются на хосте и доступны с других устройств."}),a.jsxs("p",{className:"hub-eyebrow",children:[(I=i.find(R=>R.id===g))==null?void 0:I.name," · ЦЕПОЧКА ЗАДАЧИ"]}),a.jsx("div",{className:"task-chain",children:H.map(({session:R,depth:P})=>{var A;const ae=n.links.find(K=>K.sessionId===Gt(R)),Ne=m.find(K=>Gt(K)===(ae==null?void 0:ae.parentId));return a.jsxs("article",{className:"task-node"+(R.id===v.id?" is-current":""),style:{marginLeft:Math.min(P,4)*14},"data-depth":P,children:[a.jsx("div",{className:"task-node__rail","aria-hidden":"true",children:(ae==null?void 0:ae.kind)==="fork"?"⑂":"○"}),a.jsxs("div",{children:[a.jsxs("span",{className:"hub-eyebrow",children:[((A=Kd.find(K=>K.value===(ae==null?void 0:ae.stage)))==null?void 0:A.label)??"Начало задачи",R.archivedAt?" · архив":""]}),a.jsx("button",{className:"task-node__title",onClick:()=>u(R),children:sn(R)}),a.jsxs("p",{children:[Ne?`Из «${sn(Ne)}» · `:"",Ur(R)," · ",R.provider]})]}),a.jsx("button",{className:"hub-icon-btn",title:"Открыть рядом","aria-label":`Открыть рядом: ${sn(R)}`,onClick:()=>u(R,!0),children:"◧"})]},R.id)})}),a.jsxs("section",{className:"hub-form-section",children:[a.jsx("h3",{children:"Связать существующие разговоры"}),a.jsx("p",{className:"hub-muted",children:"Выберите разговор, его предыдущий этап и роль в задаче."}),a.jsxs("form",{className:"hub-link-form",onSubmit:R=>{R.preventDefault(),n.send({type:"session.link",workspaceId:g,sessionId:x,parentId:S||null,stage:C})},children:[a.jsxs("label",{children:["Разговор",a.jsx("select",{value:x,onChange:R=>le(R.target.value),children:m.map(R=>a.jsx("option",{value:Gt(R),children:sn(R)},R.id))})]}),a.jsxs("label",{children:["Предыдущий этап",a.jsxs("select",{value:S,onChange:R=>k(R.target.value),children:[a.jsx("option",{value:"",children:"Самостоятельная задача"}),ye.map(R=>a.jsx("option",{value:Gt(R),children:sn(R)},R.id))]})]}),a.jsxs("label",{children:["Этап",a.jsx("select",{value:C,onChange:R=>D(R.target.value),children:Kd.map(R=>a.jsx("option",{value:R.value,children:R.label},R.value))})]}),a.jsx("button",{className:"btn",disabled:!o,children:"Сохранить связь"})]})]}),a.jsxs("section",{className:"hub-form-section",children:[a.jsx("h3",{children:"Продолжить новым этапом"}),a.jsxs("p",{className:"hub-muted",children:["Новый разговор будет связан с «",sn(v),"». Доступный контекст появится в черновике — его можно проверить перед отправкой.",v.state==="closed"&&!n.histories[v.id]&&" История не открыта: в черновике будут название и этап. Для переноса всей истории выберите ответвление разговора."]}),a.jsxs("form",{className:"hub-stage-form",onSubmit:R=>{var A,K,fe;R.preventDefault();const P=rm([...Yp(((A=n.histories[v.id])==null?void 0:A.entries)??[]),...((K=n.timelines[v.id])==null?void 0:K.items)??[]]),Ne=`Следующий этап: ${(fe=Kd.find(ke=>ke.value===q))==null?void 0:fe.label}.
|
|
119
|
-
Продолжаем задачу «${sn(v)}».${P.prompt?`
|
|
120
|
-
|
|
121
|
-
Последняя задача:
|
|
122
|
-
${P.prompt.slice(0,3e3)}`:""}${P.answer?`
|
|
123
|
-
|
|
124
|
-
Последний ответ:
|
|
125
|
-
${P.answer.slice(0,5e3)}`:""}
|
|
126
|
-
|
|
127
|
-
`;h(v,V,q,Y&&de,Ne)},children:[a.jsxs("label",{children:["Следующий этап",a.jsx("select",{value:q,onChange:R=>G(R.target.value),children:Kd.map(R=>a.jsx("option",{value:R.value,children:R.label},R.value))})]}),a.jsxs("label",{children:["Агент",a.jsx("select",{value:V,onChange:R=>{L(R.target.value),E(!1)},children:c.map(R=>a.jsx("option",{value:R,children:R==="claude"?"Claude":R==="codex"?"Codex":"Antigravity"},R))})]}),a.jsxs("label",{className:"hub-checkbox",children:[a.jsx("input",{type:"checkbox",checked:Y&&de,disabled:!de,onChange:R=>E(R.target.checked)}),a.jsxs("span",{children:["Ответвить полный разговор",!de&&a.jsx("small",{children:"Доступно с тем же агентом, если он поддерживает форки."})]})]}),a.jsx("button",{className:"btn btn--primary",disabled:!o||!c.length,children:"Создать этап →"})]})]})]})}const Nk="ccv.dictation.lang",e_="ru-RU";function Sk(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function t_(){const n=window,s=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=s.find(Sk);return!i&&s.length>0&&$l("распознавание подменено: родной реализации в странице нет"),i??s[0]??null}function Sy(){var n;try{return((n=localStorage.getItem(Nk))==null?void 0:n.trim())||e_}catch{return e_}}function $l(n,s){s===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,s)}const Ek=3,Tk=400,Ck=5,Ak=250,Mk=2e3,Rk=2e4;async function Dk(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Ok={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Sy()}`};function Lk(n){const[s]=b.useState(()=>t_()!==null),[i,c]=b.useState(!1),[o,u]=b.useState(null),h=b.useRef(null),g=b.useRef(!1),m=b.useRef(!1),x=b.useRef(n),_=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),v=b.useRef(null),y=b.useRef(!1),S=b.useRef(null),k=b.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),C=b.useCallback(()=>{k();const L=async Y=>{if(S.current=null,!(!g.current||y.current)){if(!Y&&!await Dk()){if($l("ждём ответа на запрос доступа к микрофону"),!g.current||y.current)return;S.current=setTimeout(()=>void L(!0),Rk);return}$l("движок не ответил на start()"),g.current=!1,c(!1),u("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void L(!1),Mk)},[k]);b.useEffect(()=>{x.current=n}),b.useEffect(()=>{const L=t_();if(!L)return;const Y=new L;return Y.lang=Sy(),Y.continuous=!0,Y.interimResults=!0,Y.onstart=()=>{$l("сессия открыта"),y.current=!0,k(),c(!0)},Y.onaudiostart=()=>{$l("пошёл звук с микрофона"),_.current.audio=!0},Y.onresult=E=>{var B;if(m.current)return;let U="",Q="";for(let N=E.resultIndex;N<E.results.length;N++){const X=E.results[N];if(!X)continue;const le=((B=X[0])==null?void 0:B.transcript)??"";X.isFinal?U+=le:Q+=le}const H=_.current;H.heard=!0,H.everHeard=!0,$l("распознано",{final:U,interim:Q}),x.current(U,Q)},Y.onerror=E=>{_.current.lastError=E.error,$l("ошибка движка",E.error),!(E.error==="no-speech"||E.error==="aborted")&&(g.current=!1,c(!1),u(Ok[E.error]??`Распознавание не работает: ${E.error}`))},Y.onend=()=>{m.current=!1,y.current=!1;const E=_.current,U=Date.now()-E.openedAt;if($l("сессия закрыта",{мс:U,звук:E.audio,слова:E.heard,ошибка:E.lastError||null}),!g.current){c(!1);return}if(E.dead=!E.audio&&U<Tk?E.dead+1:0,E.dead>=Ck){g.current=!1,c(!1),u(E.lastError?`Распознавание не работает: ${E.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}E.silent=E.heard?0:E.silent+1,!E.everHeard&&!E.warned&&E.silent>=Ek&&(E.warned=!0,u(E.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),v.current=setTimeout(()=>{if(v.current=null,!!g.current){E.openedAt=Date.now(),E.audio=!1,E.heard=!1,E.lastError="",C();try{Y.start()}catch{}}},Ak)},h.current=Y,()=>{g.current=!1,v.current&&clearTimeout(v.current),v.current=null,k(),Y.onend=null,Y.onresult=null,Y.onerror=null,Y.onstart=null,Y.onaudiostart=null,Y.abort(),h.current=null}},[]);const D=b.useCallback(()=>{var L;if(g.current){if(g.current=!1,$l("выключение микрофона"),v.current&&clearTimeout(v.current),v.current=null,k(),!y.current){c(!1);return}(L=h.current)==null||L.stop()}},[]),q=b.useCallback(()=>{const L=h.current;if(L){if(!window.isSecureContext){u("Микрофон доступен только по https или с localhost");return}u(null),g.current=!0,m.current=!1,v.current&&clearTimeout(v.current),v.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),$l("включение микрофона",{язык:L.lang}),C();try{L.start()}catch(Y){$l("start() не прошёл",Y)}}},[C]),G=b.useCallback(()=>{g.current?D():q()},[q,D]),V=b.useCallback(()=>{var L;g.current&&y.current&&(m.current=!0,(L=h.current)==null||L.abort())},[]);return{supported:s,listening:i,error:o,toggle:G,stop:D,drop:V}}const zk="(max-width: 860px)",n_=/^\/(\S*)$/,Ik=new Set(["model","permissions"]);function Uk(n){return Ik.has(n.name)||n.name.startsWith("__")}const Hk=new Set(["clear","rename"]),s_=/(?:^|\s)@([^\s@]*)$/,Bk=200,qk=100,Gk=190,$k=5,Yk=20*1024*1024,Vk=1568,Xk=.85;let l_=0;async function Qk(n){var v,y;if(!n.type.startsWith("image/")||n.size>Yk)return null;const s=await Kk(n);if(!s)return null;const{width:i,height:c}=s;if(i<=0||c<=0)return null;const o=Math.min(1,Vk/Math.max(i,c)),u=document.createElement("canvas");u.width=Math.max(1,Math.round(i*o)),u.height=Math.max(1,Math.round(c*o));const h=u.getContext("2d");if(!h)return null;h.drawImage(s.image,0,0,u.width,u.height),(y=(v=s.image).close)==null||y.call(v);const g=n.type==="image/png",m=g?"image/png":"image/jpeg",x=u.toDataURL(m,g?void 0:Xk),_=x.slice(x.indexOf(",")+1);return _?(l_+=1,{id:`att${l_}`,mediaType:m,data:_,previewUrl:x}):null}async function Kk(n){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(n);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const i=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(i),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(i),s(null)},c.src=i})}function Ey({disabled:n,busy:s,commands:i,showAllCommands:c=!1,suspended:o=!1,sessionTitle:u,contextResult:h,className:g,placeholder:m,draftKey:x,sendLabel:_="Отправить",autoFocus:v=!1,attachmentsEnabled:y=!0,sendBlocked:S=!1,onContextSearch:k,onCommand:C,onSend:D,onInterrupt:q,onEscape:G}){var zt;const V=yf(zk),[L,Y]=b.useState(()=>x?yu(x):""),[E,U]=b.useState(!1),[Q,H]=b.useState(0),B=b.useRef(null),N=b.useRef(null),[X,le]=b.useState({position:"fixed"}),de=b.useRef(!1),ye=b.useRef(null),[I,R]=b.useState(()=>x?yu(x).length:0),[P,ae]=b.useState([]),Ne=b.useRef(null),A=b.useCallback(J=>{!y||J.length===0||Promise.all(J.map(Qk)).then(pe=>{const Ae=pe.filter(Ke=>Ke!==null);Ae.length!==0&&ae(Ke=>[...Ke,...Ae].slice(0,$k))})},[y]);function K(J){ae(pe=>pe.filter(Ae=>Ae.id!==J))}function fe(J){var Ke;if(!y)return;const pe=(Ke=J.clipboardData)==null?void 0:Ke.items;if(!pe)return;const Ae=[];for(const It of pe){if(!It.type.startsWith("image/"))continue;const an=It.getAsFile();an&&Ae.push(an)}Ae.length!==0&&(J.preventDefault(),A(Ae))}function ke(J){const pe=J.target.files?Array.from(J.target.files):[];J.target.value="",A(pe)}b.useEffect(()=>{y||ae([])},[y]);const[Re,Ue]=b.useState([]),[_e,Ze]=b.useState(-1),rt=b.useRef(""),[Bt,he]=b.useState(""),at=Lk(b.useCallback((J,pe)=>{J&&Y(Ae=>bp(Ae,J)),he(pe.trim())},[])),oe=Bt?bp(L,Bt):L;b.useEffect(()=>{at.listening||Bt===""||(Y(J=>bp(J,Bt)),he(""))},[at.listening,Bt]),b.useEffect(()=>{var J;v&&((J=B.current)==null||J.focus())},[v]);const Rt=b.useRef(new Map),He=b.useRef(new Map),qt=b.useRef(x),Un=b.useRef({text:L,caret:I});Un.current={text:L,caret:I};const bt=b.useCallback((J,pe,Ae)=>{pe===""?(Rt.current.delete(J),He.current.delete(J)):(Rt.current.set(J,pe),He.current.set(J,Ae)),af(J,pe)},[]),Kt=at.drop;b.useLayoutEffect(()=>{const J=qt.current;if(J===x)return;qt.current=x,J&&bt(J,Un.current.text,Un.current.caret);const pe=x?Rt.current.get(x)??yu(x):"",Ae=x?He.current.get(x):void 0,Ke=Math.min(Ae??pe.length,pe.length);Y(pe),R(Ke),ye.current=[Ke,Ke],he(""),H(0),U(!1),Ze(-1),rt.current="",ae([]),Kt()},[x,bt,Kt]),b.useEffect(()=>{x&&bt(x,L,I)},[x,L,I,bt]);const ln=n?"Выберите сессию":S?"Нет VPN — отправка остановлена":m??"С чего начнём? Опишите задачу…",Xn=b.useRef(0),wt=b.useCallback(J=>{const pe=parseFloat(getComputedStyle(J).maxHeight),Ae=Number.isFinite(pe)&&pe>0?pe:Gk;J.style.height="auto";const Ke=J.scrollHeight;J.style.height=`${Math.min(Ke,Ae)}px`,J.style.overflowY=Ke>Ae?"auto":"hidden"},[]);b.useEffect(()=>{const J=B.current;J&&wt(J)},[oe,ln,n,wt]),b.useLayoutEffect(()=>{const J=B.current,pe=ye.current;!J||!pe||(ye.current=null,J.setSelectionRange(pe[0],pe[1]))}),b.useEffect(()=>{const J=B.current;if(!J)return;const pe=new ResizeObserver(([Ae])=>{const Ke=Ae==null?void 0:Ae.contentRect.width;Ke===void 0||Math.abs(Ke-Xn.current)<1||(Xn.current=Ke,wt(J))});return pe.observe(J),()=>pe.disconnect()},[wt]);const Z=at.stop;b.useEffect(()=>{n&&Z()},[n,Z]);const De=b.useMemo(()=>at.error?{ok:!1,message:at.error}:null,[at.error]),$e=b.useMemo(()=>{var Ae;const J=(Ae=n_.exec(L))==null?void 0:Ae[1];if(J===void 0)return[];const pe=J.toLowerCase();return i.filter(Ke=>(c?!Ke.name.startsWith("__"):!Uk(Ke))&&_p(Ke,pe)<Ty).sort((Ke,It)=>_p(Ke,pe)-_p(It,pe))},[L,i,c]),ht=!o&&!E&&$e.length>0,Ee=Math.min(Q,$e.length-1),Te=E||o?null:((zt=s_.exec(oe.slice(0,I)))==null?void 0:zt[1])??null,Oe=b.useRef(k);Oe.current=k,b.useEffect(()=>{if(Te===null||Te===""||Te.endsWith("/")){Oe.current(Te);return}const J=setTimeout(()=>Oe.current(Te),Bk);return()=>clearTimeout(J)},[Te]);const Ye=Te!==null&&(h==null?void 0:h.query)===Te,Qe=Ye?h.entries:[],Pe=Te!==null,pt=Pe&&!Ye,At=Math.min(Q,Math.max(Qe.length-1,0));b.useEffect(()=>{var pe,Ae;if(!ht&&!Pe)return;const J=ht?Ee:At;(Ae=(pe=N.current)==null?void 0:pe.children[J])==null||Ae.scrollIntoView({block:"nearest"})},[ht,Pe,Ee,At]);const Sn=ht||Pe;b.useLayoutEffect(()=>{var It;if(!Sn)return;const J=(It=B.current)==null?void 0:It.closest(".composer__inner");if(!J)return;const pe=()=>{var Ss;const an=J.getBoundingClientRect(),kt=window.visualViewport,gs=((kt==null?void 0:kt.offsetLeft)??0)+8,Qn=((kt==null?void 0:kt.offsetTop)??0)+8,is=gs+((kt==null?void 0:kt.width)??innerWidth)-16,rn=Qn+((kt==null?void 0:kt.height)??innerHeight)-16,it=Math.min(Math.max(260,an.width),is-gs),un=an.top-Qn-8,ks=rn-an.bottom-8,Ns=Math.min(320,Math.max(un,ks));le({position:"fixed",left:Math.max(gs,Math.min(an.left,is-it)),width:it,maxHeight:Math.max(80,Ns),top:un>=ks?Math.max(Qn,an.top-Math.min(((Ss=N.current)==null?void 0:Ss.scrollHeight)??Ns,Ns)-8):an.bottom+8,bottom:"auto",right:"auto",zIndex:80})};pe();const Ae=new ResizeObserver(pe);Ae.observe(J),window.addEventListener("resize",pe),window.addEventListener("scroll",pe,!0);const Ke=an=>{var kt,gs,Qn;!((kt=N.current)!=null&&kt.contains(an.target))&&!((Qn=(gs=B.current)==null?void 0:gs.closest(".composer"))!=null&&Qn.contains(an.target))&&U(!0)};return document.addEventListener("mousedown",Ke),()=>{Ae.disconnect(),window.removeEventListener("resize",pe),window.removeEventListener("scroll",pe,!0),document.removeEventListener("mousedown",Ke)}},[Sn,$e.length,Qe.length]);function Et(J,pe){var Ae;Y(J),R(pe),ye.current=[pe,pe],H(0),U(!1),Bt!==""&&(he(""),at.drop()),(Ae=B.current)==null||Ae.focus()}function Lt(){Y(""),he(""),H(0),R(0),U(!1),Ze(-1),rt.current="",ae([]),at.drop(),x&&bt(x,"",0)}function re(J){const pe=J.trim();if(pe===""&&P.length===0||n||S||de.current)return;const Ae=D(pe,P.length>0?P.map(Ke=>({mediaType:Ke.mediaType,data:Ke.data})):void 0);if(Ae instanceof Promise){de.current=!0,Ae.then(Ke=>{de.current=!1,Ke&&we(pe)},()=>{de.current=!1});return}Ae!==!1&&we(pe)}function we(J){J!==""&&Ue(pe=>[J,...pe.filter(Ae=>Ae!==J)].slice(0,qk)),Lt()}function Ve(J){if(J<-1||J>=Re.length)return;_e===-1&&(rt.current=L);const pe=J===-1?rt.current:Re[J]??"";Ze(J),Et(pe,pe.length)}function et(){var Ke;const J=((Ke=B.current)==null?void 0:Ke.selectionStart)??oe.length,Ae=`${J>0&&!/\s$/.test(oe.slice(0,J))?" ":""}@`;Et(oe.slice(0,J)+Ae+oe.slice(J),J+Ae.length)}function nt(J){var It;const pe=(It=s_.exec(oe.slice(0,I)))==null?void 0:It[1];if(pe===void 0)return;const Ae=I-pe.length-1,Ke=J.kind==="dir"?`@${J.path}/`:`@${J.path} `;Et(oe.slice(0,Ae)+Ke+oe.slice(I),Ae+Ke.length)}function on(){var pe;if(S)return;const J=(pe=n_.exec(oe.trim()))==null?void 0:pe[1];if(J&&C(J)){Lt();return}re(oe)}function On(J,pe){Y(J),R(pe),H(0),U(!1),Ze(-1),Bt!==""&&(he(""),at.drop())}function Wt(J){var Ke;const pe=Hk.has(J.name)?u:null,Ae=`/${J.name} `;Y(Ae+(pe??"")),R(Ae.length+((pe==null?void 0:pe.length)??0)),pe&&(ye.current=[Ae.length,Ae.length+pe.length]),H(0),(Ke=B.current)==null||Ke.focus()}function bn(J){if(C(J.name)){Y(""),H(0),U(!1);return}J.argumentHint?Wt(J):re(`/${J.name}`)}function Yt(J){if(ht){if(J.key==="ArrowDown")return J.preventDefault(),H(pe=>(Math.min(pe,$e.length-1)+1)%$e.length);if(J.key==="ArrowUp"){J.preventDefault();const pe=$e.length-1;return H(Ae=>(Math.min(Ae,pe)+pe)%$e.length)}if(J.key==="Enter"&&!J.shiftKey){J.preventDefault();const pe=$e[Ee];pe&&bn(pe);return}if(J.key==="Tab"){J.preventDefault();const pe=$e[Ee];pe&&Wt(pe);return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),U(!0);return}}if(Pe){if(J.key==="ArrowDown"&&Qe.length>0)return J.preventDefault(),H(pe=>(Math.min(pe,Qe.length-1)+1)%Qe.length);if(J.key==="ArrowUp"&&Qe.length>0){J.preventDefault();const pe=Qe.length-1;return H(Ae=>(Math.min(Ae,pe)+pe)%Qe.length)}if(J.key==="Enter"&&!J.shiftKey||J.key==="Tab"){const pe=Qe[At];if(pe){J.preventDefault(),nt(pe);return}if(J.key==="Tab")return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),U(!0);return}}if((J.key==="ArrowUp"||J.key==="ArrowDown")&&!J.shiftKey){const pe=J.currentTarget,Ae=pe.selectionStart;if(pe.selectionEnd===Ae){const It=J.key==="ArrowUp"?_e+1:_e-1;It>=-1&&It<Re.length&&requestAnimationFrame(()=>{pe.selectionStart===Ae&&pe.selectionEnd===Ae&&Ve(It)})}}if(J.key==="Escape"&&G){J.preventDefault(),J.stopPropagation(),G();return}J.key==="Enter"&&!J.shiftKey&&!V&&(J.preventDefault(),on())}return a.jsx("div",{className:g?`composer ${g}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Ir,{result:De}),Pe&&!ht&&Tu.createPortal(a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:N,style:X,"data-session-commands":x??void 0,children:[Qe.map((J,pe)=>a.jsxs("button",{role:"option","aria-selected":pe===At,className:pe===At?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(pe),onMouseDown:Ae=>{Ae.preventDefault(),nt(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[J.name,J.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:J.path}),J.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},J.path)),Qe.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:pt?"ищем…":Te?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),document.body),ht&&Tu.createPortal(a.jsx("div",{className:"cmdmenu",role:"listbox",ref:N,style:X,"data-session-commands":x??void 0,children:$e.map((J,pe)=>a.jsxs("button",{role:"option","aria-selected":pe===Ee,className:pe===Ee?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(pe),onMouseDown:Ae=>{Ae.preventDefault(),bn(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",J.name]}),J.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:J.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:J.description})]},J.name))}),document.body),P.length>0&&a.jsx("div",{className:"composer__attachments",children:P.map(J=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:J.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>K(J.id),children:a.jsx(eN,{})})]},J.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:et,children:a.jsx(Pk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:Ne,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:ke}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var J;return(J=Ne.current)==null?void 0:J.click()},children:a.jsx(Wk,{})})]}),a.jsx("textarea",{ref:B,value:oe,"aria-label":"Сообщение агенту",disabled:n,placeholder:ln,onChange:J=>On(J.target.value,J.target.selectionStart),onSelect:J=>R(J.currentTarget.selectionStart),onKeyDown:Yt,onPaste:fe}),at.supported&&a.jsx("button",{type:"button",className:at.listening?"micbtn is-on":"micbtn",title:at.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":at.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":at.listening,disabled:n,onClick:at.toggle,children:a.jsx(tN,{on:at.listening})}),s?a.jsx("button",{className:"btn",onClick:q,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:on,disabled:n||S||oe.trim()===""&&P.length===0,"aria-label":_,title:S?"Нет VPN — отправка остановлена":_,children:[a.jsx("span",{className:"sendbtn__label",children:_}),a.jsx(Jk,{})]})]}),a.jsxs("div",{className:"composer__help",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"@"})," файлы проекта ",a.jsx("span",{"aria-hidden":"true",children:"·"})," ",a.jsx("kbd",{children:"/"})," команды"]}),a.jsxs("span",{className:"composer__keyboard",children:[a.jsx("kbd",{children:"Enter"})," отправить ",a.jsx("span",{"aria-hidden":"true",children:"·"})," ",a.jsx("kbd",{children:"Shift + Enter"})," новая строка"]})]})]})})}function bp(n,s){const i=s.trim();if(i==="")return n;const c=zp(i).slice(Zk(n,i)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function Zk(n,s){const i=zp(n),c=zp(s);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((u,h)=>Fk(u,c[h]??"")))return o;return 0}function zp(n){return n.split(/\s+/).filter(s=>s!=="")}function Fk(n,s){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(n)===i(s)}function Pk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function Jk(){return a.jsx("svg",{className:"sendbtn__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function Wk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M10.8 4.2 5.9 9.1a2 2 0 0 0 2.8 2.8l4.6-4.6a3.3 3.3 0 0 0-4.7-4.7L3.9 7.3a4.6 4.6 0 0 0 6.5 6.5l4.4-4.4"})})}function eN(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function tN({on:n}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),a.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),a.jsx("path",{d:"M8 12.8v1.5"})]})}const Ty=4;function _p(n,s){const i=n.name.toLowerCase();return i===s?0:i.startsWith(s)?1:n.aliases.some(c=>c.toLowerCase().startsWith(s))?2:i.includes(s)?3:Ty}async function si(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const s=document.createElement("textarea");s.value=n,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function Ip(){try{return await navigator.clipboard.readText()}catch{return null}}const Cy=1600,Kc="Копировать",wu="Скопировано";function lo({text:n,hint:s,className:i}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const u=setTimeout(()=>o(!1),Cy);return()=>clearTimeout(u)},[c]),b.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?wu:`${Kc} ${s}`,title:c?wu:`${Kc} ${s}`,onClick:()=>{si(n).then(u=>{u&&o(!0)})},children:c?wu:Kc})}function um({items:n,busy:s,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:u=!1,onLoadHistory:h,sessionId:g,onEditMessage:m,empty:x="Опишите задачу — ответы, действия и результаты появятся здесь.",welcome:_}){var E;const v=b.useRef(null),y=b.useRef(null),S=b.useRef(!1);S.current=!!_&&n.length===0&&c.length===0;const k=b.useRef(!0),C=b.useRef(null),D=b.useRef(null),q=b.useRef(!1);b.useEffect(()=>{k.current=!0,C.current=null,q.current=!1,D.current!==null&&(clearTimeout(D.current),D.current=null)},[g]),b.useEffect(()=>{const U=v.current,Q=y.current;if(!U||!Q)return;function H(X){!U||X===U.scrollTop||(q.current=!0,U.scrollTop=X)}function B(){if(!U)return;const X=C.current;if(X){const le=i_(U,X.id);if(le){const de=le.getBoundingClientRect().top-U.getBoundingClientRect().top;H(U.scrollTop+(de-X.top))}D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{C.current=null},500);return}k.current&&H(S.current?0:U.scrollHeight)}const N=new ResizeObserver(B);return N.observe(Q),()=>{N.disconnect(),D.current!==null&&clearTimeout(D.current)}},[]);function G(){const U=v.current;if(U){if(q.current){q.current=!1;return}k.current=U.scrollHeight-U.scrollTop-U.clientHeight<80}}function V(){if(u)return;const U=v.current,Q=c[0];if(U&&Q){const H=i_(U,Q.id);H&&(C.current={id:Q.id,top:H.getBoundingClientRect().top-U.getBoundingClientRect().top})}h==null||h()}let L=0;function Y(U){return U.kind==="user"?L++:-1}return a.jsx("div",{className:"transcript",ref:v,onScroll:G,children:a.jsxs("div",{className:"stream",ref:y,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:V,disabled:u,children:u?"Загружаем…":"Показать более раннее"}),c.map(U=>a.jsx(a_,{item:U,userIndex:Y(U),onEditMessage:m},U.id)),c.length>0&&n.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&(_??a.jsx("p",{className:"empty",children:x})),n.map(U=>a.jsx(a_,{item:U,userIndex:Y(U),onEditMessage:m},U.id)),s&&a.jsx(sk,{waiting:i,activity:(E=[...n].reverse().find(U=>U.kind==="tool"&&U.result===null))==null?void 0:E.name,responding:n.some(U=>U.kind==="assistant"&&U.streaming)},g)]})})}function a_({item:n,userIndex:s,onEditMessage:i}){switch(n.kind){case"user":return a.jsx(sN,{item:n,userIndex:s,onEditMessage:i});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(lN,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(lo,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return a.jsx(iN,{item:n});case"result":return a.jsxs("div",{className:"result-line","data-item-id":n.id,children:[a.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),a.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&a.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",c_(n.inputTokens)," ↓",c_(n.outputTokens)]})]});case"notice":return a.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const nN=500;function sN({item:n,userIndex:s,onEditMessage:i}){const[c,o]=b.useState(null),[u,h]=b.useState(!1),[g,m]=b.useState(n.text),x=b.useRef(null),_=b.useRef(!1),v=yf("(max-width: 860px)"),y=b.useRef(null);function S(Q,H){o({x:Q,y:H})}function k(Q){Q.preventDefault(),S(Q.clientX,Q.clientY)}function C(Q){const H=Q.touches[0];if(!H)return;const B={timer:0,x:H.clientX,y:H.clientY,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,S(B.x,B.y)},nN),y.current=B}function D(Q){const H=y.current,B=Q.touches[0];!H||!B||Math.hypot(B.clientX-H.x,B.clientY-H.y)>10&&(window.clearTimeout(H.timer),y.current=null)}function q(Q){const H=y.current;H&&(window.clearTimeout(H.timer),H.fired&&Q.preventDefault())}function G(){m(n.text),h(!0)}function V(){h(!1)}function L(){const Q=g.trim();if(Q===""&&!(n.images&&n.images.length>0))return;const H=i==null?void 0:i(s,Q,n.images);if(H instanceof Promise){if(_.current)return;_.current=!0,H.then(B=>{_.current=!1,B&&h(!1)},()=>{_.current=!1});return}H!==!1&&h(!1)}b.useEffect(()=>{const Q=x.current;!Q||!u||(Q.style.height="auto",Q.style.height=`${Q.scrollHeight}px`)},[g,u]),b.useEffect(()=>{if(!u)return;const Q=x.current;Q&&(Q.focus(),Q.setSelectionRange(Q.value.length,Q.value.length))},[u]);function Y(Q){if(Q.key==="Escape"){Q.preventDefault(),Q.stopPropagation(),V();return}Q.key==="Enter"&&!Q.shiftKey&&!v&&(Q.preventDefault(),L())}const E=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((Q,H)=>a.jsx("img",{className:"msg--user__image",src:`data:${Q.mediaType};base64,${Q.data}`,alt:"Вложение"},H))});if(u){const Q=g.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[E,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:g,onChange:H=>m(H.target.value),onKeyDown:Y,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:V,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:L,disabled:!Q,children:"Сохранить"})]})]})]})}const U=[{id:"copy",label:"Копировать",onSelect:()=>void si(n.text)},...i?[{id:"edit",label:"Изменить",onSelect:G}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:C,onTouchMove:D,onTouchEnd:q,onTouchCancel:q,children:[E,n.text,c&&a.jsx(Xi,{x:c.x,y:c.y,items:U,onClose:()=>o(null)})]})}function i_(n,s){const i=n.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===s)return c;return null}function lN({text:n}){const[s,i]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let u=!1;return wf(n).then(h=>{u||i(aN(h))}),()=>{u=!0}},[n]),b.useEffect(()=>{const u=c.current;return()=>u.forEach(h=>clearTimeout(h))},[]);function o(u){var m,x;const h=u.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const g=((x=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:x.textContent)??"";g!==""&&si(g).then(_=>{if(!_)return;h.textContent=wu,h.setAttribute("aria-label",wu),h.classList.add("copybtn--done");const v=window.setTimeout(()=>{h.isConnected&&(h.textContent=Kc,h.setAttribute("aria-label",Up),h.classList.remove("copybtn--done"))},Cy);c.current.push(v)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const Up=`${Kc} блок кода`;function aN(n){if(!n.includes("<pre"))return n;const s=new DOMParser().parseFromString(n,"text/html");for(const i of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Up),o.title=Up,o.textContent=Kc,c.append(o)}return s.body.innerHTML}function iN({item:n}){const[s,i]=b.useState(!1),c=n.result===null,o=wy(n.name,n.input),u=n.name==="AskUserQuestion"?oN(n.input):null;return a.jsxs("div",{className:"tool"+(c&&!n.awaitingPermission?" tool--running":"")+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head","aria-expanded":s,onClick:()=>i(h=>!h),children:[a.jsx("span",{className:"tool__indicator","aria-hidden":"true",children:n.awaitingPermission?"Ⅱ":c?"◌":n.isError?"!":"✓"}),a.jsxs("span",{className:"tool__identity",children:[a.jsx("span",{className:"tool__name",children:im(n.name).title}),a.jsx("span",{className:"tool__technical",children:n.name})]}),a.jsx("span",{className:"tool__arg",children:u?cN(u):rN(n.input)}),a.jsx("span",{className:"tool__status",children:n.awaitingPermission?"Ваше решение":c?"Выполняется":n.isError?"Ошибка":"Готово"}),a.jsx("span",{className:"tool__chevron","aria-hidden":"true",children:s?"−":"+"})]}),s&&a.jsxs("div",{className:"tool__body",children:[u?a.jsx(uN,{questions:u,answers:n.answers}):o?a.jsx(cm,{diff:o}):a.jsx(r_,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!u||n.isError)&&a.jsx(r_,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function r_({text:n,hint:s,style:i}){return a.jsxs("div",{className:"codeblock",style:i,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(lo,{text:n,hint:s,className:"codeblock__copy"})]})}function rN(n){if(!n||typeof n!="object")return"";const s=n;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=s[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function cN(n){var i;const s=n.map(c=>c.header).filter(c=>c.length>0);return s.length===n.length?s.join(" · "):((i=n[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function oN(n){if(typeof n!="object"||n===null)return null;const s=n.questions;if(!Array.isArray(s)||s.length===0)return null;const i=[];for(const c of s){if(typeof c!="object"||c===null)return null;const{question:o,header:u,options:h,multiSelect:g}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const m=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:_,description:v,preview:y}=x;if(typeof _!="string"||typeof v!="string")return null;m.push({label:_,description:v,...typeof y=="string"?{preview:y}:{}})}i.push({question:o,header:typeof u=="string"?u:"",options:m,multiSelect:g===!0})}return i}function uN({questions:n,answers:s}){return a.jsx("div",{className:"tool__questions",children:n.map((i,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[i.header&&a.jsx("span",{className:"chip chip--accent",children:i.header}),a.jsx("span",{className:"tool__question-text",children:i.question})]}),a.jsx("div",{className:"tool__question-answer",children:s!=null&&s[i.question]?a.jsx("span",{className:"tool__answer-value",children:s[i.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function c_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const dN=75,fN=90;function hN({usage:n}){if(!(n!=null&&n.available))return null;const s=n.buckets??[],i=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...n.fiveHour?[{key:"five",label:"5 ч",window:n.fiveHour}]:[],...n.sevenDay?[{key:"week",label:"нед",window:n.sevenDay}]:[]];if(i.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:"usage",title:gN(n,s),"aria-label":c,children:i.map(o=>a.jsx(pN,{label:o.label,window:o.window},o.key))})}function pN({label:n,window:s}){const i=Math.round(s.utilization),c=bN(s.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:n}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${mN(i)}`,style:{width:`${i}%`}})}),a.jsxs("span",{className:"usage__pct",children:[i,"%"]}),a.jsx("span",{className:"usage__reset",title:dm(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function mN(n){return n>=fN?" usage__fill--over":n>=dN?" usage__fill--warn":""}function gN(n,s){if(s.length>0)return xN(s);const i=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,u)=>{if(!u)return;const h=dm(u.resetsAt);i.push(`${o}: ${Math.round(u.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),i.join(`
|
|
128
|
-
`)}function xN(n){const s=["Квота Antigravity"];for(const i of n){const c=dm(i.window.resetsAt),o=Math.round(i.window.utilization);s.push(`${i.title}: ${o}%${c?`, ${c}`:""}`),i.description&&s.push(i.description)}return s.join(`
|
|
129
|
-
`)}function Ay(n){if(!n)return null;const s=new Date(n);return Number.isNaN(s.getTime())?null:s}function My(n){return n.getTime()-Date.now()<1440*60*1e3}function bN(n){const s=Ay(n);return s?My(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function dm(n){const s=Ay(n);return s?`обнулится ${My(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}const _N=2e5,yN=75,vN=90;function jN({tokens:n,maxTokens:s,fetchedAt:i}){if(n===null)return null;const c=s??_N,o=Math.min(100,Math.round(n/c*100)),u=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
|
|
130
|
-
обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:u,children:[a.jsx("span",{className:"contextbar__label",children:"контекст"}),a.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`contextbar__fill${wN(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function wN(n){return n>=vN?" contextbar__fill--over":n>=yN?" contextbar__fill--warn":""}function kN({connected:n,workspaceName:s,hasSession:i,onOpenWorkspace:c,onNewSession:o,onOpenFiles:u,onOpenSettings:h}){return a.jsxs("section",{className:"welcome","aria-labelledby":"welcome-title",children:[a.jsxs("div",{className:"welcome__eyebrow",children:[a.jsx("span",{})," МЕСТО, ГДЕ ИДЕИ ОБРЕТАЮТ ФОРМУ"]}),a.jsxs("div",{className:"eclipse","aria-hidden":"true",children:[a.jsx("div",{className:"eclipse__halo"}),a.jsx("div",{className:"eclipse__orbit eclipse__orbit--outer",children:a.jsx("i",{})}),a.jsx("div",{className:"eclipse__orbit eclipse__orbit--inner",children:a.jsx("i",{})}),a.jsx("div",{className:"eclipse__body"}),a.jsx("span",{className:"eclipse__star eclipse__star--one"}),a.jsx("span",{className:"eclipse__star eclipse__star--two"}),a.jsx("span",{className:"eclipse__coordinate",children:"СВЕТ / ТЬМА"})]}),a.jsxs("h1",{id:"welcome-title",children:["От мысли",a.jsx("br",{}),"к ",a.jsx("span",{children:"возможностям."})]}),a.jsx("p",{className:"welcome__description",children:"Одно пространство для больших идей и повседневных задач. Исследуйте, создавайте, меняйте — в своём ритме."}),a.jsxs("div",{className:"welcome__context",children:[a.jsx("span",{className:n?"dot dot--on":"dot"}),s?a.jsxs(a.Fragment,{children:["Рабочее пространство ",a.jsx("strong",{children:s})]}):"Начните с пространства для вашей работы"]}),a.jsxs("div",{className:"welcome__actions",children:[a.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:i?()=>{var g;return(g=document.querySelector(".main .composer textarea"))==null?void 0:g.focus()}:s?o:c,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"01 / СОЗДАВАЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:"✧"}),a.jsx("strong",{children:i?"Начать с идеи":s?"Новый разговор":"Открыть пространство"}),a.jsx("span",{className:"welcome-card__description",children:i?"Опишите задачу своими словами. Ответы и действия появятся здесь.":s?"Создайте сессию с подключённым агентом и переходите к задаче.":"Выберите папку проекта: файлы, разговоры и результаты будут рядом."})]}),a.jsxs("button",{type:"button",className:"welcome-card",disabled:!n,onClick:s?u:c,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"02 / ИССЛЕДУЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon","aria-hidden":"true",children:a.jsxs("svg",{viewBox:"0 0 24 24",width:"27",height:"27",fill:"none",stroke:"currentColor",strokeWidth:"1.2",children:[a.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),a.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),a.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),a.jsx("path",{d:"M14 17.5h7m-3.5-3.5v7"})]})}),a.jsx("strong",{children:"Ближе к деталям"}),a.jsx("span",{className:"welcome-card__description",children:"Откройте файлы, изучите структуру и соберите контекст для следующего шага."})]}),a.jsxs("button",{type:"button",className:"welcome-card",onClick:h,children:[a.jsxs("span",{className:"welcome-card__top",children:[a.jsx("span",{className:"welcome-card__number",children:"03 / НАСТРАИВАЙТЕ"}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),a.jsx("span",{className:"welcome-card__icon welcome-card__icon--circle","aria-hidden":"true",children:"◐"}),a.jsx("strong",{children:"На вашей стороне"}),a.jsx("span",{className:"welcome-card__description",children:"Выберите свет или тьму, подключите агентов и задайте правила работы."})]})]}),a.jsxs("p",{className:"welcome__footnote",children:[a.jsx("span",{"aria-hidden":"true",children:"↳"})," Ваши инструменты. Ваш подход. Единое пространство."]})]})}function NN({sessionId:n,hub:s,workspaces:i,connected:c,suspended:o=!1,networkBlocked:u,terminalEnabled:h,onTool:g,onStop:m,onPin:x,onClose:_,onCommand:v,onSend:y,editor:S,footer:k,className:C,children:D}){var K,fe,ke,Re,Ue;const[q,G]=b.useState(!1),[V,L]=b.useState(!1),Y=((K=s.timelines[n])==null?void 0:K.pending.length)??0;b.useEffect(()=>{Y||G(!1)},[Y]);const E=s.sessions[n];if(!E)return null;const U=s.timelines[n]??fs,Q=s.histories[n]??Zi,H=Yp(Q.entries),B=s.capabilities[n],N=E.state==="running"||E.state==="waiting_permission",X=U.pending.length>0,le=E.state==="closed",de=E.state==="error",ye=i.find(_e=>_e.id===E.workspaceId),I=(B==null?void 0:B.models)??[],R=I.find(_e=>_e.value===E.model||_e.resolvedModel===E.model),P=R!=null&&R.supportsEffort?R.effortLevels.length?R.effortLevels:["low","medium","high"]:[],ae=E.provider==="codex"?G_:E.provider==="antigravity"?$_:Vp,Ne=!c||le||de||N,A=(_e,Ze)=>{_e==="control.set_model"&&s.send({type:_e,sessionId:n,model:Ze}),_e==="control.set_mode"&&s.send({type:_e,sessionId:n,mode:Ze}),_e==="control.set_effort"&&s.send({type:_e,sessionId:n,effort:Ze})};return a.jsxs("section",{className:"main session-pane"+(C?` ${C}`:""),"data-provider":E.provider,"aria-label":sn(E),children:[a.jsxs("header",{className:"session-pane__head",children:[a.jsxs("div",{className:"session-pane__identity",children:[a.jsxs("span",{className:"hub-eyebrow",children:[E.provider.toUpperCase()," · ",(ye==null?void 0:ye.name)??"ПРОЕКТ"]}),V?a.jsx(ja,{value:E.title??"",onCommit:_e=>{s.send({type:"session.rename",workspaceId:E.workspaceId,sessionId:n,title:_e}),L(!1)},onCancel:()=>L(!1)}):a.jsx("button",{className:"session-pane__title",title:"Переименовать сессию",onClick:()=>L(!0),children:sn(E)})]}),a.jsx("button",{className:"hub-icon-btn"+(E.pinned?" is-pinned":""),title:E.pinned?"Открепить":"Закрепить","aria-label":E.pinned?"Открепить сессию":"Закрепить сессию",onClick:()=>x(E),children:"☆"}),Or(E)&&a.jsx("button",{className:"hub-icon-btn",title:"Остановить CLI, сохранив разговор","aria-label":"Остановить сессию",onClick:()=>m(E),children:"■"})]}),a.jsxs("div",{className:"session-pane__controls",children:[a.jsxs("span",{className:`session-status session-status--${E.state}`,children:[a.jsx("span",{className:`session-state-dot session-state-dot--${E.state}`}),Or(E)?"Запущена":le?"Сохранена":"Ошибка"]}),a.jsx("span",{className:"session-pane__activity",children:Ur(E)}),a.jsxs("label",{children:[a.jsx("span",{children:"Модель"}),a.jsxs("select",{"aria-label":`Модель: ${sn(E)}`,disabled:Ne||!I.length,value:(R==null?void 0:R.value)??E.model??"",onChange:_e=>A("control.set_model",_e.target.value),children:[!R&&a.jsx("option",{value:E.model??"",children:E.model??"Как в CLI"}),I.map(_e=>a.jsx("option",{value:_e.value,children:_e.displayName},_e.value))]})]}),P.length>0&&a.jsxs("label",{children:[a.jsx("span",{children:"Усилие"}),a.jsxs("select",{"aria-label":`Усилие: ${sn(E)}`,value:E.effort??"",disabled:Ne,onChange:_e=>A("control.set_effort",_e.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Как в CLI"}),P.map(_e=>a.jsx("option",{children:_e},_e))]})]}),a.jsxs("label",{children:[a.jsx("span",{children:"Права"}),a.jsxs("select",{"aria-label":`Режим прав: ${sn(E)}`,value:E.permissionMode,disabled:Ne,onChange:_e=>A("control.set_mode",_e.target.value),children:[!ae.some(_e=>_e.value===E.permissionMode)&&a.jsx("option",{value:E.permissionMode,children:E.permissionMode}),ae.map(_e=>a.jsxs("option",{value:_e.value,children:[_e.value," — ",_e.hint]},_e.value))]})]}),E.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"session-toggle","aria-pressed":E.thinking,disabled:Ne,onClick:()=>s.send({type:"control.set_thinking",sessionId:n,enabled:!E.thinking}),children:"Размышления"}),P.includes("xhigh")&&a.jsx("button",{className:"session-toggle","aria-pressed":E.ultracode,disabled:Ne,onClick:()=>s.send({type:"control.set_ultracode",sessionId:n,enabled:!E.ultracode}),children:"Ultracode"}),a.jsx("button",{className:"session-toggle","aria-pressed":E.switchModelsOnFlag,disabled:Ne,onClick:()=>s.send({type:"control.set_flag_switch",sessionId:n,enabled:!E.switchModelsOnFlag}),children:"Смена модели по флагу"})]})]}),a.jsxs("nav",{className:"session-pane__tools","aria-label":`Инструменты: ${sn(E)}`,children:[[["files","Файлы"],["search","Поиск"],["git","Git"],["tasks","Ветки задачи"]].map(([_e,Ze])=>a.jsx("button",{title:_e==="files"?"Файлы проекта":Ze,onClick:()=>g(E,_e),disabled:le||de,children:Ze},_e)),h&&a.jsx("button",{onClick:()=>g(E,"terminal"),disabled:le||de,children:"Терминал"}),E.provider==="claude"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>g(E,"extensions"),disabled:le||de,children:"Расширения"}),a.jsx("button",{onClick:()=>g(E,"ask"),disabled:le||de,children:"Вопрос на полях"})]}),E.provider!=="antigravity"&&a.jsx("button",{disabled:Ne,onClick:()=>s.launchSession(E.workspaceId,E.provider,Gt(E),!0),children:"Ответвить"}),a.jsx("button",{title:"Обновить лимиты и контекст",disabled:!c||le||de,onClick:()=>{s.send({type:"usage.get",sessionId:n}),s.send({type:"context.get",sessionId:n})},children:"↻"}),a.jsx(hN,{usage:s.usage[n]??null})]}),a.jsx(jN,{tokens:((fe=s.context[n])==null?void 0:fe.tokens)??U.contextTokens,maxTokens:((ke=s.context[n])==null?void 0:ke.maxTokens)??null,fetchedAt:((Re=s.context[n])==null?void 0:Re.fetchedAt)??null}),S??a.jsxs(a.Fragment,{children:[a.jsx(lk,{session:E,items:[...H,...U.items],pendingCount:U.pending.length}),a.jsx(um,{items:U.items,busy:N,waiting:X,sessionId:n,history:H,historyHasMore:U_(Q),historyLoading:Q.loading,onLoadHistory:()=>s.loadHistory(n,$p(Q)),welcome:!le&&!de?a.jsx(kN,{connected:c,workspaceName:ye==null?void 0:ye.name,hasSession:!0,onOpenWorkspace:()=>g(E,"files"),onNewSession:()=>s.launchSession(E.workspaceId,E.provider),onOpenFiles:()=>g(E,"files"),onOpenSettings:()=>g(E,"settings")}):void 0,empty:le?"Разговор сохранён. Продолжите сессию, чтобы восстановить историю и настройки.":void 0,onEditMessage:E.provider==="antigravity"?void 0:(_e,Ze,rt)=>{if(!c||u||le||de)return!1;const Bt=()=>s.send({type:"prompt.edit",sessionId:n,userIndex:_e,text:Ze,images:rt});return y?y(E,Bt):(Bt(),!0)}}),(Ue=E.tasks)!=null&&Ue.length?a.jsx(y1,{tasks:E.tasks,onStop:_e=>s.send({type:"task.stop",sessionId:n,taskId:_e})}):null,X&&a.jsxs("button",{className:"session-pane__decision",onClick:()=>G(!0),children:["Нужен ваш ответ · запросов: ",U.pending.length,a.jsx("span",{children:"Рассмотреть →"})]}),le||de?a.jsxs("div",{className:"session-pane__resume",children:[a.jsx("p",{children:le?"Разговор сохранён на диске.":"Связь с CLI прервана."}),a.jsx("button",{className:"btn btn--primary",disabled:!c||s.launchingIds.includes(n),onClick:()=>s.launchSession(E.workspaceId,E.provider,Gt(E),!1,n),children:s.launchingIds.includes(n)?"Восстанавливается…":"Продолжить сессию"})]}):a.jsx(Ey,{className:"composer--session",suspended:o||s.view!==null||q&&X,disabled:!c,busy:N,commands:(B==null?void 0:B.commands)??[],showAllCommands:E.provider==="codex",sessionTitle:E.title,contextResult:s.contexts[n]??null,draftKey:n,sendBlocked:u,placeholder:E.state==="reconnecting"?"Сообщение отправится после восстановления связи":"Сообщение в эту сессию…",onContextSearch:_e=>s.searchSession(n,_e),onCommand:_e=>_e==="fork"?(s.launchSession(E.workspaceId,E.provider,Gt(E),!0),!0):_e==="new"||_e==="clear"?(s.launchSession(E.workspaceId,E.provider),!0):_e==="resume"?(s.setView("command"),!0):_e==="stop"?(s.send({type:"control.interrupt",sessionId:n}),!0):_e==="exit"||_e==="quit"?(m(E),!0):(v==null?void 0:v(E,_e))??!1,onEscape:()=>{N&&!X&&s.send({type:"control.interrupt",sessionId:n})},onSend:(_e,Ze)=>{if(!c||u)return!1;const rt=()=>s.send({type:"prompt.send",sessionId:n,text:_e,images:Ze});return y?y(E,rt):(rt(),!0)},onInterrupt:()=>s.send({type:"control.interrupt",sessionId:n})})]}),D,k,!o&&q&&X&&Tu.createPortal(a.jsx(ky,{hub:s,sessionId:n,onClose:()=>G(!1)}),document.body)]})}const fm=()=>({version:1,root:null,floating:[],focused:null,maximized:null,preset:"tabs"}),Cu=n=>({type:"tabs",id:crypto.randomUUID(),tabs:n,active:n[0]}),Hp=(n,s,i,c=.5)=>({type:"split",id:crypto.randomUUID(),axis:i,ratio:c,first:n,second:s});function Pn(n){return n?n.type==="tabs"?[n]:[...Pn(n.first),...Pn(n.second)]:[]}function ti(n){return[...Pn(n.root),...n.floating.map(s=>s.group)].flatMap(s=>s.tabs)}function Au(n,s){return n?s(n.type==="tabs"?n:{...n,first:Au(n.first,s),second:Au(n.second,s)}):null}function gf(n,s){if(!n)return null;if(n.type==="tabs"){const o=n.tabs.filter(u=>s.has(u));return o.length?{...n,tabs:o,active:o.includes(n.active)?n.active:o[0]}:null}const i=gf(n.first,s),c=gf(n.second,s);return i&&c?{...n,first:i,second:c}:i??c}function Ry(n,s,i,c){if(!n)return Cu([i]);if(n.id===s){if(c==="center"&&n.type==="tabs")return{...n,tabs:[...n.tabs,i],active:i};const u=Cu([i]);return c==="left"||c==="top"?Hp(u,n,c==="left"?"row":"column"):Hp(n,u,c==="bottom"?"column":"row")}if(n.type==="split")return{...n,first:o(n.first),second:o(n.second)};return n;function o(u){return Pn(u).some(h=>h.id===s)?Ry(u,s,i,c):u}}function ku(n,s){var m,x;const i=(m=[...Pn(n.root),...n.floating.map(_=>_.group)].find(_=>_.tabs.includes(s)))==null?void 0:m.id,c=new Set(ti(n).filter(_=>_!==s)),o=n.floating.flatMap(_=>{const v=gf(_.group,c);return(v==null?void 0:v.type)==="tabs"?[{..._,group:v}]:[]}),u=gf(n.root,c),h=[...Pn(u),...o.map(_=>_.group)],g=n.focused===s?((x=h.find(_=>_.id===i)??h[0])==null?void 0:x.active)??null:n.focused;return{...n,root:u,floating:o,focused:g,maximized:n.maximized&&[...Pn(u),...o.map(_=>_.group)].some(_=>_.id===n.maximized)?n.maximized:null}}function Mu(n,s){if(!ti(n).includes(s))return n;const i=g=>g.type==="tabs"&&g.tabs.includes(s)?{...g,active:s}:g,c=Math.max(0,...n.floating.map(g=>g.z))+1,o=[...Pn(n.root),...n.floating.map(g=>g.group)].find(g=>g.tabs.includes(s)),u=new Set(Pn(n.root).map(g=>g.id)),h=n.maximized&&u.has(n.maximized)&&o&&u.has(o.id)?o.id:n.maximized;return{...n,focused:s,maximized:h,root:Au(n.root,i),floating:n.floating.map(g=>g.group.tabs.includes(s)?{...g,group:i(g.group),z:c}:g)}}function xf(n,s,i,c){var m;const o=[...Pn(n.root),...n.floating.map(x=>x.group)].find(x=>x.tabs.includes(s));if((o==null?void 0:o.id)===i&&o.tabs.length===1||(o==null?void 0:o.id)===i&&c==="center")return Mu(n,s);const u=ku(n,s),h=u.floating.find(x=>x.group.id===i);if(h&&c==="center")return{...u,focused:s,floating:u.floating.map(x=>x===h?{...x,group:{...x.group,tabs:[...x.group.tabs,s],active:s}}:x)};const g=Pn(u.root).some(x=>x.id===i)?i:((m=Pn(u.root).at(-1))==null?void 0:m.id)??null;return{...u,root:Ry(u.root,g,s,c),focused:s,maximized:null}}function yp(n,s,i=!1){if(ti(n).includes(s)){const u=[...Pn(n.root),...n.floating.map(h=>h.group)].find(h=>h.tabs.includes(s));return i&&u&&u.tabs.length>1?xf(n,s,u.id,"right"):Mu(n,s)}const c=[...Pn(n.root),...n.floating.map(u=>u.group)],o=c.find(u=>u.tabs.includes(n.focused??""))??c[0];return xf(n,s,(o==null?void 0:o.id)??null,i?"right":"center")}function Dy(n,s,i=40,c=30){const o=ku(n,s);return{...o,focused:s,maximized:null,floating:[...o.floating,{group:Cu([s]),x:i,y:c,width:580,height:560,z:Math.max(0,...o.floating.map(u=>u.z))+1}]}}function SN(n,s){const i=[...new Set(n)],c={...fm(),preset:s,focused:i[0]??null};if(!i.length)return c;if(s==="floating")return{...i.reduce((m,x,_)=>Dy(m,x,24+_%4*34,20+_%4*30),c),preset:s};if(s==="tabs")return{...c,root:Cu(i)};const o=(m,x)=>m.length===1?m[0]:Hp(m[0],o(m.slice(1),x),x,1/m.length),u=i.map(m=>Cu([m]));if(s!=="grid")return{...c,root:o(u,s==="columns"?"row":"column")};const h=Math.ceil(Math.sqrt(u.length)),g=[];for(let m=0;m<u.length;m+=h)g.push(o(u.slice(m,m+h),"row"));return{...c,root:o(g,"column")}}function Oy(n){if(!n||typeof n!="object"||!("version"in n)||n.version!==1)return fm();const s=n,i=new Set,c=new Set;function o(x,_=0){if(!x||typeof x!="object"||_>24)return null;const v=x;if(typeof v.id!="string"||c.has(v.id))return null;if(c.add(v.id),v.type==="tabs"&&Array.isArray(v.tabs)){const k=v.tabs.filter(C=>typeof C=="string"&&!i.has(C)&&!!i.add(C));return k.length?{type:"tabs",id:v.id,tabs:k,active:k.includes(v.active??"")?v.active:k[0]}:null}if(v.type!=="split")return null;const y=o(v.first,_+1),S=o(v.second,_+1);return y&&S?{type:"split",id:v.id,axis:v.axis==="column"?"column":"row",ratio:typeof v.ratio=="number"&&Number.isFinite(v.ratio)?Math.max(.1,Math.min(.9,v.ratio)):.5,first:y,second:S}:y??S}const u=o(s.root),h=(x,_,v,y)=>typeof x=="number"&&Number.isFinite(x)?Math.max(v,Math.min(y,x)):_,g=(Array.isArray(s.floating)?s.floating:[]).flatMap(x=>{if(!x||typeof x!="object")return[];const _=o(x.group);return(_==null?void 0:_.type)==="tabs"?[{group:_,x:h(x.x,30,0,5e3),y:h(x.y,30,0,5e3),width:h(x.width,580,280,3e3),height:h(x.height,560,280,2400),z:h(x.z,1,0,1e6)}]:[]}),m=[...Pn(u),...g.map(x=>x.group)].flatMap(x=>x.tabs);return{version:1,root:u,floating:g,focused:m.includes(s.focused??"")?s.focused:m[0]??null,maximized:[...Pn(u),...g.map(x=>x.group)].some(x=>x.id===s.maximized)?s.maximized:null,preset:["tabs","columns","rows","grid","floating","custom"].includes(s.preset??"")?s.preset:"tabs"}}const EN={center:"Объединить во вкладки",left:"Прикрепить слева",right:"Прикрепить справа",top:"Прикрепить сверху",bottom:"Прикрепить снизу"};function TN({controller:n,sessions:s,visibleIds:i,availableIds:c=i,onOpen:o,hidden:u=!1,onClose:h,renderSession:g}){const{layout:m}=n,x=b.useRef(null),_=b.useRef(null),[v,y]=b.useState(null),[S,k]=b.useState({width:1e3,height:650}),[C,D]=b.useState(""),[q,G]=b.useState(!1),V=new Set(i),L=m.focused&&V.has(m.focused)?m.focused:i[0]??null;b.useEffect(()=>{const N=x.current;if(!N)return;const X=new ResizeObserver(()=>k({width:N.clientWidth,height:N.clientHeight}));return X.observe(N),()=>X.disconnect()},[]),b.useEffect(()=>()=>document.body.classList.remove("is-docking"),[]);const Y=N=>Pn(N).some(X=>X.tabs.some(le=>V.has(le)));function E(N,X,le){var ye;if(N.button!==0)return;const de=(ye=N.currentTarget.closest("[data-dock-group]"))==null?void 0:ye.getBoundingClientRect();de&&(n.activate(X),_.current={id:X,startX:N.clientX,startY:N.clientY,offsetX:N.clientX-de.x,offsetY:N.clientY-de.y,floating:le,moved:!1,preview:null},N.currentTarget.setPointerCapture(N.pointerId))}function U(N){var I,R;const X=_.current,le=(I=x.current)==null?void 0:I.getBoundingClientRect();if(!X||!le||!X.moved&&Math.hypot(N.clientX-X.startX,N.clientY-X.startY)<6)return;X.moved=!0,document.body.classList.add("is-docking");let de=null;const ye=Array.from(x.current.querySelectorAll("[data-dock-group]")).sort((P,ae)=>Number(ae.classList.contains("dock-group--floating"))-Number(P.classList.contains("dock-group--floating"))||Number(ae.style.zIndex||0)-Number(P.style.zIndex||0));for(const P of ye){if(((R=X.floating)==null?void 0:R.group.id)===P.dataset.dockGroup)continue;const ae=P.getBoundingClientRect();if(!ae.width||!ae.height)continue;const Ne=(N.clientX-ae.x)/ae.width,A=(N.clientY-ae.y)/ae.height;if(Ne<0||Ne>1||A<0||A>1)continue;const K=[{side:"left",value:Ne},{side:"right",value:1-Ne},{side:"top",value:A},{side:"bottom",value:1-A}].sort((ke,Re)=>ke.value-Re.value),fe=!P.classList.contains("dock-group--floating")&&K[0].value<.24?K[0].side:"center";de={groupId:P.dataset.dockGroup,side:fe,x:ae.x-le.x+(fe==="right"?ae.width/2:0),y:ae.y-le.y+(fe==="bottom"?ae.height/2:0),width:fe==="left"||fe==="right"?ae.width/2:ae.width,height:fe==="top"||fe==="bottom"?ae.height/2:ae.height};break}X.preview=de,y(de),X.floating&&!de&&n.updateFloating(X.floating.group.id,{x:Math.max(0,Math.min(S.width-100,N.clientX-le.x-X.offsetX)),y:Math.max(0,Math.min(S.height-40,N.clientY-le.y-X.offsetY))})}function Q(N,X=!1){const le=_.current;if(_.current=null,y(null),document.body.classList.remove("is-docking"),N.currentTarget.hasPointerCapture(N.pointerId)&&N.currentTarget.releasePointerCapture(N.pointerId),!(!(le!=null&&le.moved)||X)){if(le.preview)n.move(le.id,le.preview.groupId,le.preview.side);else if(!le.floating){const de=x.current.getBoundingClientRect();n.float(le.id,Math.max(0,N.clientX-de.x-120),Math.max(0,N.clientY-de.y-15))}}}function H(N,X){const le=N.tabs.filter(I=>V.has(I));if(!le.length)return null;const de=le.includes(N.active)?N.active:le[0],ye=m.maximized===N.id;return a.jsxs("section",{"data-dock-group":N.id,"data-active-session":de,"data-selected":le.includes(L??""),className:"dock-group"+(X?" dock-group--floating":"")+(ye?" dock-group--maximized":""),style:X&&!ye?{left:Math.min(X.x,Math.max(0,S.width-Math.min(X.width,S.width))),top:Math.min(X.y,Math.max(0,S.height-Math.min(X.height,S.height))),width:Math.min(X.width,S.width),height:Math.min(X.height,S.height),zIndex:10+X.z}:void 0,onPointerDownCapture:()=>{L!==de&&n.activate(de)},children:[a.jsxs("div",{className:"dock-group__head",onDoubleClick:I=>{I.target.closest("[data-window-action]")||n.maximize(N.id)},children:[X&&a.jsx(MN,{window:X,bounds:S,onMove:n.updateFloating}),a.jsx("div",{className:"dock-tabs",role:"tablist","aria-label":"Сессии группы",children:le.map(I=>a.jsxs("div",{className:"dock-tab"+(I===de?" is-active":""),children:[a.jsxs("button",{role:"tab","aria-selected":I===de,"aria-controls":`session-panel-${I}`,"data-drag-session":I,title:`${sn(s[I])} · ${Ur(s[I])}. Перетащите для стыковки.`,onClick:()=>n.activate(I),onPointerDown:R=>E(R,I,X),onPointerMove:U,onPointerUp:Q,onPointerCancel:R=>Q(R,!0),onLostPointerCapture:R=>{_.current&&Q(R,!0)},onKeyDown:R=>{R.key==="Escape"&&(_.current=null,y(null),document.body.classList.remove("is-docking"))},children:[a.jsx("span",{className:`session-state-dot session-state-dot--${s[I].state}`,"aria-hidden":"true"}),a.jsx("span",{children:sn(s[I])})]}),a.jsx("button",{className:"dock-tab__close","data-window-action":!0,"aria-label":`Закрыть вкладку: ${sn(s[I])}`,onClick:()=>h(I),children:"×"})]},I))}),a.jsxs("div",{className:"dock-group__actions",children:[a.jsx("button",{"data-window-action":!0,className:"dock-action",title:X?"Прикрепить окно":"Сделать плавающим окном","aria-label":X?"Прикрепить окно":"Сделать плавающим окном",onClick:()=>X?n.attachFloating(N.id):n.float(de),children:"▣"}),a.jsx("button",{"data-window-action":!0,className:"dock-action",title:ye?"Восстановить размер окна":"Развернуть окно","aria-label":ye?"Восстановить размер окна":"Развернуть окно",onClick:()=>n.maximize(N.id),children:ye?"❐":"□"})]})]}),a.jsx("div",{className:"dock-group__body",role:"tabpanel",id:`session-panel-${de}`,"data-session-id":de,children:g(de)}),X&&!ye&&a.jsx(AN,{window:X,bounds:S,onResize:n.updateFloating})]},N.id)}function B(N){return!N||!Y(N)?null:N.type==="tabs"?H(N):Y(N.first)?Y(N.second)?a.jsxs("div",{className:`dock-split dock-split--${N.axis}`,children:[a.jsx("div",{className:"dock-split__child",style:{flexGrow:N.ratio},children:B(N.first)}),a.jsx(CN,{axis:N.axis,ratio:N.ratio,onResize:X=>n.resizeSplit(N.id,X)}),a.jsx("div",{className:"dock-split__child",style:{flexGrow:1-N.ratio},children:B(N.second)})]},N.id):B(N.first):B(N.second)}return a.jsxs("div",{className:"session-workspace",hidden:u,children:[a.jsxs("div",{className:"dock-toolbar","aria-label":"Режим просмотра сессий",children:[a.jsx("span",{children:"Рабочая область"}),a.jsxs("select",{"aria-label":"Раскладка окон",value:m.preset,onChange:N=>n.arrange(N.target.value),children:[a.jsx("option",{value:"tabs",children:"Вкладки"}),a.jsx("option",{value:"columns",children:"Колонки"}),a.jsx("option",{value:"rows",children:"Строки"}),a.jsx("option",{value:"grid",children:"Сетка"}),a.jsx("option",{value:"floating",children:"Плавающие окна"}),a.jsx("option",{value:"custom",disabled:!0,children:"Своя раскладка"})]}),a.jsxs("select",{"aria-label":"Перейти к открытой сессии",value:L??"",onChange:N=>V.has(N.target.value)?n.activate(N.target.value):o==null?void 0:o(N.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Выберите запущенную сессию"}),c.map(N=>a.jsxs("option",{value:N,children:[sn(s[N]),V.has(N)?"":" · открыть окно"]},N))]}),n.saved.length>0&&a.jsxs("select",{"aria-label":"Сохранённая рабочая область",value:"",onChange:N=>n.restore(N.target.value),children:[a.jsx("option",{value:"",disabled:!0,children:"Сохранённые области…"}),n.saved.map(N=>a.jsx("option",{children:N},N))]}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>G(!q),children:"Сохранить раскладку"}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>n.arrange("grid"),title:"Разместить открытые сессии без перекрытий",children:"Уместить"}),a.jsx("span",{className:"dock-toolbar__hint",children:"Тяните вкладку к краю окна или в центр группы"})]}),q&&a.jsxs("form",{className:"dock-save",onSubmit:N=>{N.preventDefault(),n.save(C),G(!1),D("")},children:[a.jsx("input",{className:"hub-input",autoFocus:!0,"aria-label":"Название раскладки",placeholder:"Название рабочей области",value:C,onChange:N=>D(N.target.value)}),a.jsx("button",{className:"btn",disabled:!C.trim(),children:"Сохранить"})]}),a.jsxs("div",{className:"conversation-board dock-board",ref:x,"aria-label":"Открытые сессии",children:[a.jsx("div",{className:"dock-docked-layer",hidden:!Y(m.root),children:B(m.root)}),a.jsx("div",{className:"dock-floating-layer",children:m.floating.map(N=>H(N.group,N))}),!i.length&&a.jsxs("div",{className:"workspace-board-empty",children:[a.jsx("span",{"aria-hidden":"true",children:"◧"}),a.jsx("strong",{children:"Откройте сессии для работы"}),a.jsx("p",{children:"Обычное открытие добавляет вкладку. «Открыть параллельно» создаёт соседнее окно. Любую вкладку можно открепить и пристыковать обратно."})]}),v&&a.jsx("div",{className:"dock-preview",style:{left:v.x,top:v.y,width:v.width,height:v.height},children:a.jsx("span",{children:EN[v.side]})})]})]})}function CN({axis:n,ratio:s,onResize:i}){const c=b.useRef(null),o=()=>{c.current=null,document.body.classList.remove("is-docking")};return b.useEffect(()=>o,[]),a.jsx("div",{className:`dock-divider dock-divider--${n}`,role:"separator","aria-label":n==="row"?"Ширина окон":"Высота окон","aria-orientation":n==="row"?"vertical":"horizontal","aria-valuenow":Math.round(s*100),"aria-valuemin":10,"aria-valuemax":90,tabIndex:0,onPointerDown:u=>{u.button===0&&(c.current=u.currentTarget.parentElement.getBoundingClientRect(),u.currentTarget.setPointerCapture(u.pointerId),document.body.classList.add("is-docking"),u.preventDefault())},onPointerMove:u=>{const h=c.current;h&&i(n==="row"?(u.clientX-h.x)/h.width:(u.clientY-h.y)/h.height)},onPointerUp:o,onPointerCancel:o,onLostPointerCapture:o,onDoubleClick:()=>i(.5),onKeyDown:u=>{const h=u.key==="ArrowLeft"||u.key==="ArrowUp"?-.025:u.key==="ArrowRight"||u.key==="ArrowDown"?.025:0;h&&(u.preventDefault(),i(s+h))}})}function AN({window:n,bounds:s,onResize:i}){const c=b.useRef(null),o=(u,h)=>i(n.group.id,{width:Math.max(Math.min(280,s.width),Math.min(s.width,u)),height:Math.max(Math.min(260,s.height),Math.min(s.height,h))});return a.jsx("div",{className:"conversation-window__resize",role:"separator","aria-label":"Размер плавающего окна","aria-orientation":"vertical","aria-valuenow":Math.round(n.width),tabIndex:0,onPointerDown:u=>{if(u.button!==0)return;const h=u.currentTarget.parentElement.getBoundingClientRect();c.current={x:u.clientX,y:u.clientY,width:h.width,height:h.height},u.currentTarget.setPointerCapture(u.pointerId),u.preventDefault()},onPointerMove:u=>{const h=c.current;h&&o(h.width+u.clientX-h.x,h.height+u.clientY-h.y)},onPointerUp:()=>{c.current=null},onPointerCancel:()=>{c.current=null},onLostPointerCapture:()=>{c.current=null},onKeyDown:u=>{const h=u.key==="ArrowRight"?24:u.key==="ArrowLeft"?-24:0,g=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||g)&&(u.preventDefault(),o(n.width+h,n.height+g))},children:a.jsx("span",{"aria-hidden":"true",children:"◢"})})}function MN({window:n,bounds:s,onMove:i}){const c=b.useRef(null),o=(u,h)=>i(n.group.id,{x:Math.max(0,Math.min(s.width-Math.min(n.width,s.width),u)),y:Math.max(0,Math.min(s.height-Math.min(n.height,s.height),h))});return a.jsx("button",{"data-window-action":!0,className:"dock-float-grip",title:"Переместить плавающее окно","aria-label":"Переместить плавающее окно",onPointerDown:u=>{if(u.button!==0)return;const h=u.currentTarget.parentElement.parentElement.getBoundingClientRect(),g=u.currentTarget.closest(".dock-board").getBoundingClientRect();c.current={x:u.clientX,y:u.clientY,left:h.x-g.x,top:h.y-g.y},u.currentTarget.setPointerCapture(u.pointerId),u.preventDefault()},onPointerMove:u=>{const h=c.current;h&&o(h.left+u.clientX-h.x,h.top+u.clientY-h.y)},onPointerUp:()=>{c.current=null},onPointerCancel:()=>{c.current=null},onLostPointerCapture:()=>{c.current=null},onKeyDown:u=>{const h=u.key==="ArrowRight"?24:u.key==="ArrowLeft"?-24:0,g=u.key==="ArrowDown"?24:u.key==="ArrowUp"?-24:0;(h||g)&&(u.preventDefault(),o(n.x+h,n.y+g))},children:"⠿"})}const Ly="ether:dock-layout",RN={};function DN(){try{return Oy(JSON.parse(localStorage.getItem(Ly)??"null"))}catch{return fm()}}function ON(n,s=RN){const[i,c]=b.useState(DN),[o,u]=b.useState(()=>{try{const m=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");return m&&typeof m=="object"?Object.keys(m):[]}catch{return[]}}),h=n.join("|");b.useEffect(()=>{c(m=>{let x=m;const _=v=>{const y=new Set;let S=v;for(;s[S]&&!y.has(S);)y.add(S),S=s[S];return S};ti(m).some(v=>_(v)!==v)&&(x={...x,focused:x.focused?_(x.focused):null,root:Au(x.root,v=>v.type==="tabs"?{...v,tabs:v.tabs.map(_),active:_(v.active)}:v),floating:x.floating.map(v=>({...v,group:{...v.group,tabs:v.group.tabs.map(_),active:_(v.group.active)}}))});for(const v of ti(x))n.includes(v)||(x=ku(x,v));for(const v of n)ti(x).includes(v)||(x=yp(x,v,x.preset!=="tabs"));return x})},[h,s]),b.useEffect(()=>{try{localStorage.setItem(Ly,JSON.stringify(i))}catch{}},[i]);const g=b.useCallback((m,x=!1)=>c(_=>({...yp(_,m,x),preset:x?"custom":_.preset})),[]);return{layout:i,saved:o,open:g,activate:m=>c(x=>Mu(x,m)),close:m=>c(x=>ku(x,m)),move:(m,x,_)=>c(v=>({...xf(v,m,x,_),preset:"custom"})),float:(m,x,_)=>c(v=>({...Dy(v,m,x,_),preset:"custom"})),attachFloating:m=>c(x=>{var S,k;const _=x.floating.find(C=>C.group.id===m);if(!_)return x;let v=x,y=((S=Pn(v.root).at(-1))==null?void 0:S.id)??null;for(const[C,D]of _.group.tabs.entries())v=xf(v,D,y,C===0?"right":"center"),y=((k=Pn(v.root).find(q=>q.tabs.includes(D)))==null?void 0:k.id)??null;return v}),resizeSplit:(m,x)=>c(_=>({..._,root:Au(_.root,v=>v.type==="split"&&v.id===m?{...v,ratio:Math.max(.1,Math.min(.9,x))}:v)})),updateFloating:(m,x)=>c(_=>({..._,floating:_.floating.map(v=>v.group.id===m?{...v,...x}:v)})),maximize:m=>c(x=>({...x,maximized:x.maximized===m?null:m})),arrange:m=>c(x=>{if(m==="custom")return x;const _=SN(ti(x),m);return x.focused?Mu(_,x.focused):_}),save:m=>{const x=m.trim().slice(0,64);if(x)try{const _=JSON.parse(localStorage.getItem("ether:dock-presets")??"{}");localStorage.setItem("ether:dock-presets",JSON.stringify({..._,[x]:i})),u(Object.keys({..._,[x]:i}))}catch{}},restore:m=>{try{const x=Oy(JSON.parse(localStorage.getItem("ether:dock-presets")??"{}")[m]),_=new Set(n);let v=x;for(const y of ti(v))_.has(y)||(v=ku(v,y));for(const y of n)ti(v).includes(y)||(v=yp(v,y,v.preset!=="tabs"));c(v)}catch{}}}}const o_={codex:"Codex",claude:"Claude",antigravity:"Antigravity"};function LN({hub:n,workspaces:s,selectedWorkspaceId:i,providers:c,providerFilter:o,onProviderFilter:u,tab:h,onTab:g,sessionView:m,onSessionView:x,connected:_,status:v,onOpenSession:y,onSelectWorkspace:S,onNewSession:k,onOpenWorkspace:C,onSettings:D,onAccount:q,onRelay:G,onTheme:V,onPin:L,onManageProject:Y}){const[E,U]=b.useState(""),[Q,H]=b.useState(!1),B=h==="sessions"&&m==="live",N=s.find(R=>R.id===i),X=R=>o==="all"||R.provider===o,le=n.allSessions.filter(R=>X(R)&&(!i||R.workspaceId===i)),de=le.filter(R=>{var P;return(Q?!!R.archivedAt:h==="pinned"||!R.archivedAt)&&(h!=="pinned"||R.pinned)&&`${sn(R)} ${((P=s.find(ae=>ae.id===R.workspaceId))==null?void 0:P.name)??""}`.toLocaleLowerCase().includes(E.toLocaleLowerCase())}),ye=s.filter(R=>`${R.name} ${R.path}`.toLocaleLowerCase().includes(E.toLocaleLowerCase())),I=o==="all"?c:c.filter(R=>R===o);return a.jsxs("section",{className:"workspace-library","aria-label":"Рабочее пространство",children:[a.jsxs("header",{className:"workspace-header",children:[a.jsxs("span",{className:"workspace-header__brand",children:[a.jsx("span",{className:"brand__symbol","aria-hidden":"true"}),"ЭФИР"]}),a.jsxs("span",{className:"workspace-header__status",role:"status",children:[a.jsx("span",{className:_?"dot dot--on":"dot"}),_?"Подключено":v]}),a.jsxs("button",{className:"workspace-header__search",onClick:()=>n.setView("command"),children:["Поиск проектов и сессий ",a.jsx("kbd",{children:"Ctrl P"})]}),a.jsxs("div",{className:"workspace-header__actions",children:[a.jsxs("button",{title:"Входящие",onClick:()=>n.setView("inbox"),children:["Входящие",n.attention.filter(X).length>0&&a.jsx("span",{className:"hub-count",children:n.attention.filter(X).length})]}),a.jsx("button",{title:"Аккаунт CLI",onClick:q,children:"Аккаунт"}),a.jsx("button",{title:"Удалённый доступ",onClick:G,children:"Доступ"}),a.jsx("button",{title:"Переключить тему",onClick:V,children:"◐"}),a.jsx("button",{title:"Настройки приложения",onClick:D,children:"Настройки"})]})]}),a.jsxs("div",{className:"workspace-library__toolbar",children:[a.jsx("nav",{className:"workspace-library__tabs","aria-label":"Разделы рабочего пространства",children:[["projects","Проекты"],["sessions","Сессии"],["pinned","Закрепы"]].map(([R,P])=>a.jsx("button",{"aria-pressed":h===R,onClick:()=>{g(R),U(""),H(!1)},children:P},R))}),a.jsxs("select",{"aria-label":"Фильтр по CLI",value:o,onChange:R=>u(R.target.value),children:[a.jsx("option",{value:"all",children:"Все CLI"}),["codex","claude","antigravity"].map(R=>a.jsx("option",{value:R,children:o_[R]},R))]}),h!=="projects"&&a.jsxs("select",{"aria-label":"Фильтр по проекту",value:i??"",onChange:R=>S(R.target.value),children:[a.jsx("option",{value:"",children:"Все проекты"}),s.map(R=>a.jsx("option",{value:R.id,children:R.name},R.id))]}),a.jsx("span",{className:"workspace-library__spacer"}),a.jsx("button",{className:"btn btn--ghost",disabled:!_,onClick:C,children:"+ Проект"}),N&&a.jsx(mf,{disabled:!_||!I.length,providers:I,onStart:R=>k(N.id,R)})]}),h==="sessions"&&a.jsxs("nav",{className:"session-list-modes","aria-label":"Какие сессии показывать",children:[a.jsxs("button",{"aria-pressed":m==="all",onClick:()=>{x("all"),H(!1)},children:["Все сессии ",a.jsx("span",{children:le.filter(R=>!R.archivedAt).length})]}),a.jsxs("button",{"aria-pressed":m==="live",onClick:()=>{x("live"),H(!1)},children:["Запущенные ",a.jsx("span",{children:le.filter(Or).length})]})]}),!B&&a.jsxs("div",{className:"workspace-library__browser",children:[a.jsxs("div",{className:"workspace-library__search",children:[a.jsx("input",{className:"hub-input","aria-label":h==="projects"?"Найти проект":"Найти сессию",placeholder:h==="projects"?"Название или путь проекта…":"Название сессии или проекта…",value:E,onChange:R=>U(R.target.value)}),h!=="projects"&&!(h==="sessions"&&m==="live")&&a.jsx("button",{className:"btn btn--ghost","aria-pressed":Q,onClick:()=>H(!Q),children:"Архив"}),h==="projects"&&a.jsx("button",{className:"btn btn--ghost",onClick:()=>Y(null),children:"Папки и архив"}),a.jsx("button",{className:"hub-icon-btn",title:"Обновить",onClick:n.refresh,disabled:!_,children:"↻"})]}),h==="projects"?a.jsxs("div",{className:"workspace-projects",children:[ye.map(R=>{const P=n.allSessions.filter(ae=>ae.workspaceId===R.id&&!ae.archivedAt&&X(ae));return a.jsxs("article",{className:"workspace-project",children:[a.jsxs("button",{className:"workspace-project__open",onClick:()=>{S(R.id,!0),g("sessions")},children:[a.jsx("span",{className:"hub-eyebrow",children:"ПРОЕКТ"}),a.jsx("strong",{children:R.name}),a.jsx("small",{title:R.path,children:R.path}),a.jsxs("span",{children:[P.length," сессий · ",P.filter(Or).length," запущено"]})]}),a.jsxs("div",{className:"workspace-project__actions",children:[a.jsx(mf,{disabled:!_||!I.length,providers:I,onStart:ae=>k(R.id,ae)}),a.jsx("button",{className:"hub-icon-btn",title:"Папки и управление проектом",onClick:()=>{S(R.id),Y(R.id)},children:"⋯"})]})]},R.id)}),!ye.length&&a.jsx("p",{className:"hub-muted",children:"Проекты не найдены. Откройте папку проекта или измените фильтр CLI."})]}):a.jsxs("div",{className:"workspace-sessions",children:[de.map(R=>{var P;return a.jsxs("article",{className:`workspace-session workspace-session--${R.state}`,"data-session-state":R.state,children:[a.jsxs("button",{className:"workspace-session__open",onClick:()=>y(R),children:[a.jsxs("span",{className:"hub-eyebrow",children:[o_[R.provider]," · ",(P=s.find(ae=>ae.id===R.workspaceId))==null?void 0:P.name]}),a.jsx("strong",{children:sn(R)}),a.jsxs("small",{children:[a.jsx("span",{className:`session-state-dot session-state-dot--${R.state}`}),Or(R)?"Запущена":R.state==="closed"?"Сохранена":"Остановлена"," · ",Ur(R)]})]}),a.jsx("button",{className:"workspace-session__pin"+(R.pinned?" is-pinned":""),"aria-label":`${R.pinned?"Открепить":"Закрепить"}: ${sn(R)}`,title:R.pinned?"Открепить":"Закрепить",onClick:()=>L(R),children:"☆"}),a.jsx("button",{className:"hub-icon-btn","aria-label":`Открыть параллельно: ${sn(R)}`,title:"Открыть в параллельном просмотре",onClick:()=>y(R,!0),children:"◧"})]},R.id)}),!de.length&&a.jsx("p",{className:"hub-muted",children:h==="pinned"?"Пока нет закреплённых сессий.":"Сессии не найдены. Создайте разговор или измените фильтры."})]})]}),n.launchingIds.length>0&&a.jsx("p",{className:"workspace-library__loading",role:"status",children:"Открывается разговор…"}),n.error&&a.jsxs("div",{className:"hub-error",role:"alert",children:[n.error,a.jsx("button",{onClick:n.clearError,children:"×"})]})]})}const zN=["low","medium","high"];function zy({models:n,value:s,effort:i,ultracode:c,thinking:o,switchOnFlag:u,showSwitchOnFlag:h=!0,showUltracode:g=!0,showThinking:m=!0,className:x,onModel:_,onEffort:v,onUltracode:y,onThinking:S,onSwitchOnFlag:k}){const[C,D]=b.useState(!1),[q,G]=b.useState(0),V=b.useRef(null),L=b.useRef(null),Y=n.find(B=>B.value===s)??null,E=Y&&Y.supportsEffort?Y.effortLevels.length>0?Y.effortLevels:zN:[],U=E.includes("xhigh");b.useEffect(()=>{if(!C)return;const B=n.findIndex(N=>N.value===s);G(B===-1?0:B)},[C]),b.useEffect(()=>{if(!C)return;function B(N){var X;(X=V.current)!=null&&X.contains(N.target)||D(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[C]),b.useEffect(()=>{var B,N;C&&((N=(B=L.current)==null?void 0:B.querySelector(".is-cursor"))==null||N.scrollIntoView({block:"nearest"}))},[C,q]);function Q(B){D(!1),B.value!==s&&_(B.value)}function H(B){if(B.key==="Escape"){if(!C)return;B.preventDefault(),B.stopPropagation(),D(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!C)return D(!0);if(n.length===0)return;const N=B.key==="ArrowDown"?1:n.length-1;return G(X=>(X+N)%n.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!C)return D(!0);const N=n[q];N&&Q(N)}}return a.jsxs("div",{ref:V,className:"select"+(C?" select--open":"")+(x?` ${x}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":C,onClick:()=>D(B=>!B),onKeyDown:H,children:[(Y==null?void 0:Y.displayName)??s?a.jsx("span",{className:"select__value",children:(Y==null?void 0:Y.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):E.length>0&&i&&a.jsx("span",{className:"select__suffix",children:i}),a.jsx(IN,{})]}),C&&a.jsxs("div",{ref:L,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((B,N)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":B.value===s,className:"select__option"+(N===q?" is-cursor":"")+(B.value===s?" is-on":""),onMouseEnter:()=>G(N),onClick:()=>Q(B),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:B.displayName}),B.description&&a.jsx("span",{className:"select__hint",children:B.description})]},B.value)),E.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"modelmenu__sep",role:"separator"}),a.jsxs("div",{className:"modelmenu__row",children:[a.jsxs("span",{className:"modelmenu__label",children:["Усилие",a.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),a.jsx("span",{className:"modelmenu__levels",children:E.map(B=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":B===i,className:B===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>v(B),children:B},B))})]}),U&&g&&a.jsx(vp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),m&&(Y==null?void 0:Y.supportsThinking)!==!1&&a.jsx(vp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>S(!o)}),h&&a.jsx(vp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:u,onToggle:()=>k(!u)})]})]})}function vp({label:n,desc:s,on:i,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:s})]}),a.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function IN(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function UN({candidates:n,searching:s,agentItems:i,agentBusy:c,error:o,roots:u,created:h,onSearch:g,onAskAgent:m,onInterrupt:x,onSubmit:_,onCreate:v,onClose:y}){const[S,k]=b.useState("open"),[C,D]=b.useState(""),[q,G]=b.useState(!1),[V,L]=b.useState(""),[Y,E]=b.useState(""),[U,Q]=b.useState({git:!0,claudeMd:!0,agentsMd:!0,readme:!0}),H=C.trim(),B=H!=="",N=V.trim(),X=Y.trim(),le=N!==""&&X!=="";b.useEffect(()=>{V===""&&u.length>0&&L(u[0])},[u]);const de=b.useRef(g);de.current=g,b.useEffect(()=>{if(S!=="open")return;const P=C.trim(),ae=setTimeout(()=>de.current(P),200);return()=>clearTimeout(ae)},[C,S]);function ye(){B&&_(H)}function I(){le&&v(N,X,U)}function R(){B&&(G(!0),m(H))}return h?a.jsxs(hs,{title:"Новый проект",onClose:y,actions:a.jsx("button",{className:"btn btn--primary",onClick:y,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:h.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(P=>a.jsx("li",{children:P},P))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(hs,{title:"Новый проект",className:q&&S==="open"?"modal--wide":void 0,onClose:y,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:y,children:"Отмена"}),S==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!B,onClick:R,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!B,onClick:ye,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!le,onClick:I,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(u_,{label:"Открыть",on:S==="open",onClick:()=>k("open")}),a.jsx(u_,{label:"Создать",on:S==="create",onClick:()=>k("create")})]}),S==="open"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),a.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),a.jsx("input",{id:"workspace-path",className:"input input--mono",value:C,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:P=>D(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),ye())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(P=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:P.open,title:P.open?"Этот проект уже открыт":P.path,onClick:()=>D(P.path),onDoubleClick:()=>_(P.path),children:[a.jsx("span",{className:"find__name",children:P.name}),a.jsx("span",{className:"find__path",children:P.path}),a.jsx("span",{className:"find__note",children:qN(P)})]})},P.path))}),n.length===0&&B&&!s&&!q&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),q&&a.jsx("div",{className:"finds__agent",children:a.jsx(um,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:V,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:P=>L(P.target.value)}),u.length>0&&a.jsx("div",{className:"newproj__roots",children:u.map(P=>a.jsx("button",{type:"button",className:P===N?"newproj__root is-on":"newproj__root",title:P,onClick:()=>L(P),children:BN(P)},P))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:Y,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:P=>E(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),I())}}),a.jsx("p",{className:"newproj__preview",children:le?HN(N,X):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(Zd,{label:"AGENTS.md",desc:"инструкции проекта для Codex",on:U.agentsMd??!1,onToggle:()=>Q(P=>({...P,agentsMd:!P.agentsMd}))}),a.jsx(Zd,{label:"git init",desc:"панель истории работает сразу",on:U.git,onToggle:()=>Q(P=>({...P,git:!P.git}))}),a.jsx(Zd,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:U.claudeMd,onToggle:()=>Q(P=>({...P,claudeMd:!P.claudeMd}))}),a.jsx(Zd,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:U.readme,onToggle:()=>Q(P=>({...P,readme:!P.readme}))})]})]})]})}function u_({label:n,on:s,onClick:i}){return a.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:i,children:n})}function Zd({label:n,desc:s,on:i,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:s})]}),a.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function HN(n,s){const i=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+i+s}function BN(n){const s=n.includes("\\")?"\\":"/",i=n.split(/[\\/]/).filter(Boolean);return i.length<=2?n:`…${s}${i.slice(-2).join(s)}`}function qN(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${GN(n.sessions)}${$N(n.lastUsedAt)}`}function GN(n){const s=n%10,i=n%100;return i>=11&&i<=14?`${n} сессий`:s===1?`${n} сессия`:s>=2&&s<=4?`${n} сессии`:`${n} сессий`}function $N(n){if(!n)return"";const s=Math.floor((Date.now()-n)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const hm=7;function YN(n){const s=[],i=[];let c=1;for(const o of n){const u=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=d_(s),s[h]=o.hash);const[g,...m]=o.parents;s[h]=g??null;const x=[];g!==void 0&&x.push({from:h,to:h});for(const y of m){let S=s.indexOf(y);S===-1&&(S=d_(s),s[S]=y),x.push({from:h,to:S})}const _=[];for(let y=0;y<u.length;y++)u[y]===o.hash&&(_.push({from:y,to:h}),y!==h&&(s[y]=null));const v=[];for(let y=0;y<u.length;y++){const S=u[y];!S||S===o.hash||y===h||s[y]===S&&v.push(y)}VN(s),c=Math.max(c,s.length,h+1),i.push({commit:o,col:h,up:_,down:x,through:v})}return{rows:i,columns:Math.min(c,hm)}}function d_(n){const s=n.indexOf(null);return s!==-1?s:(n.push(null),n.length-1)}function VN(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const Iy=1500;function XN(n){const s=[];let i=!1;for(const c of n.patch.split(`
|
|
131
|
-
`)){if(s.length>=Iy){i=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:QN(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:s,added:n.added,removed:n.removed,note:KN(n,i)}}function QN(n){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!s)return n;const i=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),u=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${u} · ${o}`:`⋯ ${u}`}function KN(n,s){const i=[];return n.status==="added"&&i.push("новый файл"),n.status==="deleted"&&i.push("файл удалён"),n.status==="renamed"&&i.push(`переименован из ${n.oldPath}`),n.binary?i.push("двоичный файл"):n.patch===""&&i.push("содержимое не показано"),s&&i.push(`показаны первые ${Iy} строк`),i.length>0?i.join(" · "):null}function ZN({open:n,state:s,result:i,selected:c,busy:o,onRefresh:u,onShow:h,onCheckout:g,onPush:m,onPull:x,onPublish:_,onConnectRemote:v,onDismissResult:y,onClose:S,zoomed:k,onToggleZoom:C}){const D=YN((s==null?void 0:s.commits)??[]),q=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(G=>({value:G.name,label:G.name,hint:G.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{C&&(G.target.closest("button")||C())},children:[a.jsx(tS,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:u,children:"↻"}),C&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:C,children:a.jsx(io,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),s===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Xl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:q,onChange:G=>{G&&g(G,`ветку ${G}`)}}),a.jsx(lo,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(aS,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[a.jsx(nS,{}),"Отправить",s.ahead>0&&a.jsx("span",{className:"gitbar__count",children:s.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[a.jsx(sS,{}),"Забрать",s.behind>0&&a.jsx("span",{className:"gitbar__count",children:s.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:a.jsx(lS,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:v,children:"уже есть репозиторий"})]})}),a.jsxs("div",{className:"sidepane__scroll",children:[a.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:a.jsxs("span",{className:"gitrow__body",children:[a.jsx("span",{className:"gitrow__subject",children:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${oS(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(G=>cS(G.path)).join(", "):"незакоммиченных изменений нет"})]})}),D.rows.map(G=>a.jsx(PN,{row:G,columns:D.columns,head:G.commit.hash===s.head,local:s.hasRemote&&!G.commit.pushed,active:c===G.commit.hash,onOpen:()=>h(G.commit.hash)},G.commit.hash)),D.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Ir,{result:i,onDismiss:y})]})}const pu=50,f_=13,FN=500;function PN({row:n,columns:s,head:i,local:c,active:o,onOpen:u}){const{commit:h}=n,g=h.refs.map(iS).filter(Boolean),[m,x]=b.useState(null),_=b.useRef(null);function v(C){const D=C.touches[0];if(!D)return;const q={timer:0,x:D.clientX,y:D.clientY,fired:!1};q.timer=window.setTimeout(()=>{q.fired=!0,x({x:q.x,y:q.y})},FN),_.current=q}function y(C){const D=_.current,q=C.touches[0];!D||!q||Math.hypot(q.clientX-D.x,q.clientY-D.y)>10&&(window.clearTimeout(D.timer),_.current=null)}function S(C){const D=_.current;D&&(window.clearTimeout(D.timer),D.fired&&C.preventDefault())}function k(){const C=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void si(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void si(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void si(h.subject)}],D=new Set;for(const q of h.refs){const G=q.startsWith("tag: "),V=rS(q);!V||D.has(V)||(D.add(V),C.push({id:`ref:${V}`,label:G?"Копировать тег":"Копировать ветку",hint:V,onSelect:()=>void si(V)}))}return C}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var C;if((C=_.current)!=null&&C.fired){_.current=null;return}u()},onContextMenu:C=>{C.preventDefault(),x({x:C.clientX,y:C.clientY})},onTouchStart:v,onTouchMove:y,onTouchEnd:S,onTouchCancel:S,children:[a.jsx(JN,{row:n,columns:s,head:i,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[g.map(C=>a.jsx("span",{className:"gitrow__ref",children:C},C)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",uS(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),m&&a.jsx(Xi,{x:m.x,y:m.y,items:k(),onClose:()=>x(null)})]})}function JN({row:n,columns:s,head:i,local:c}){const o=s*f_+6,u=pu/2,h=x=>8+Math.min(x,hm-1)*f_,g=c?"3.5 2.5":void 0,m=Fd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:pu,viewBox:`0 0 ${o} ${pu}`,"aria-hidden":"true",children:[n.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:pu,style:{stroke:Fd(x)}},`t${x}`)),n.up.map((x,_)=>a.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${u-12} L${h(x.to)} ${u}`,fill:"none",style:{stroke:Fd(x.from),strokeDasharray:g}},`u${_}`)),n.down.map((x,_)=>a.jsx("path",{d:`M${h(x.from)} ${u} L${h(x.to)} ${u+12} L${h(x.to)} ${pu}`,fill:"none",style:{stroke:Fd(x.to),strokeDasharray:g}},`d${_}`)),i&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:u,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:u,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:c?void 0:m}})]})}function Fd(n){return`var(--lane-${n%hm})`}function WN({detail:n,local:s,onCheckout:i,onClose:c}){const o=n.hash==="";return a.jsxs(hs,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>i(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),a.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&a.jsxs("div",{className:"commit__head",children:[a.jsxs("div",{className:"commit__line",children:[a.jsx("p",{className:"commit__subject",children:n.subject}),a.jsx(lo,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",dS(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(lo,{text:n.hash,hint:"хеш коммита"})]}),s&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(u=>u.slice(0,8)).join(", ")]}),n.body&&a.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(u=>a.jsx(eS,{file:u,defaultOpen:n.files.length<=3},u.path+u.oldPath))]})}function eS({file:n,defaultOpen:s}){const[i,c]=b.useState(s);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),a.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&a.jsx(cm,{diff:XN(n)})]})}function tS(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function nS(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function sS(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function lS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"m13 13-2.6-2.6"})]})}function h_(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function aS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function iS(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function rS(n){const s=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function cS(n){const s=n.split("/");return s[s.length-1]??n}function oS(n){const s=n%100;if(s>=11&&s<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function uS(n){const s=Date.parse(n);if(Number.isNaN(s))return n;const i=Math.round((Date.now()-s)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(s).toLocaleDateString()}function dS(n){const s=Date.parse(n);return Number.isNaN(s)?n:new Date(s).toLocaleString()}function p_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function fS({status:n,owners:s,files:i,defaultName:c,hasCommits:o,busy:u,result:h,onRefreshStatus:g,onSaveToken:m,onPublish:x,onDismissResult:_,onClose:v}){var P;const[y,S]=b.useState(()=>p_(c)),[k,C]=b.useState(""),[D,q]=b.useState(""),[G,V]=b.useState(!0),[L,Y]=b.useState("Первый коммит"),[E,U]=b.useState(null),[Q,H]=b.useState("");b.useEffect(()=>{!k&&s.length>0&&C(s[0].login)},[k,s]),b.useEffect(()=>{i&&E===null&&U(new Set(i.files))},[i,E]);const B=(n==null?void 0:n.connected)===!0,N=s.map(ae=>({value:ae.login,label:ae.login,hint:ae.kind==="org"?"организация":void 0})),X=b.useMemo(()=>{if(!i)return[];const ae=Q.trim().toLowerCase();return ae?i.files.filter(Ne=>Ne.toLowerCase().includes(ae)):i.files},[i,Q]),le=(E==null?void 0:E.size)??0,de=B&&y.trim()!==""&&k!==""&&u===""&&(o||le>0);function ye(ae){U(Ne=>{const A=new Set(Ne??[]);return A.has(ae)?A.delete(ae):A.add(ae),A})}function I(ae){U(Ne=>{const A=new Set(Ne??[]);for(const K of X)ae?A.add(K):A.delete(K);return A})}function R(){if(!de)return;const ae=(i==null?void 0:i.files)??[];x({owner:k,name:y.trim(),description:D.trim(),private:G,include:o?[]:ae.filter(Ne=>E==null?void 0:E.has(Ne)),ignore:o?[]:ae.filter(Ne=>!(E!=null&&E.has(Ne))),message:o?"":L.trim()||"Первый коммит"})}return a.jsxs(hs,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:v,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!de,onClick:R,children:u||"Опубликовать"})]}),children:[a.jsx(hS,{status:n,onRefreshStatus:g,onSaveToken:m}),a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Имя"}),a.jsx("input",{className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",onChange:ae=>S(p_(ae.target.value))})]}),y.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),s.length>1?a.jsx(Xl,{className:"settings__select",value:k,options:N,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((P=s[0])==null?void 0:P.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:D,placeholder:"о чём проект — одной строкой",onChange:ae=>q(ae.target.value)})]}),a.jsxs("div",{className:"field publish__field",children:[a.jsx("span",{children:"Видимость"}),a.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[a.jsx(m_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:G,onClick:()=>V(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!G,onClick:()=>V(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?a.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"publish__filehead",children:[a.jsxs("span",{className:"publish__filecount",children:[le," из ",i.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>I(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>I(!1),children:"Снять все"})]}),i.files.length>8&&a.jsx("input",{className:"input publish__filter",value:Q,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:ae=>H(ae.target.value)}),a.jsx("div",{className:"publish__filelist",children:X.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):X.map(ae=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(E==null?void 0:E.has(ae))===!0,className:"publish__file",onClick:()=>ye(ae),children:[a.jsx("span",{className:"publish__box"+(E!=null&&E.has(ae)?" is-on":""),"aria-hidden":"true",children:(E==null?void 0:E.has(ae))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:ae})]},ae))}),i.truncated&&a.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Сообщение коммита"}),a.jsx("input",{className:"input",value:L,onChange:ae=>Y(ae.target.value)})]})]})]}),a.jsx(Ir,{result:h,onDismiss:_})]})}function m_({title:n,desc:s,on:i,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[n,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:s})]})]})}function hS({status:n,onRefreshStatus:s,onSaveToken:i}){const[c,o]=b.useState(""),[u,h]=b.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:n.login}),a.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&a.jsxs("p",{className:"modal__text",children:["В системе установлен ",a.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",a.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Личный токен GitHub"}),a.jsx(pS,{value:c,onChange:o,visible:u,onToggleVisible:()=>h(g=>!g),placeholder:"ghp_…"})]}),a.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",a.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",a.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&a.jsx("p",{className:"modal__error",children:n.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function pS({value:n,onChange:s,visible:i,onToggleVisible:c,placeholder:o,autoFocus:u}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:u,onChange:h=>s(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?a.jsx(gS,{}):a.jsx(mS,{})})]})}function mS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function gS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),a.jsx("path",{d:"M2 14 14 2"})]})}function xS({busy:n,result:s,onSubmit:i,onDismissResult:c,onClose:o}){const[u,h]=b.useState(""),g=/^(https?|ssh|git):\/\/\S+/i.test(u.trim())||/^[\w.-]+@[\w.-]+:.+/.test(u.trim());return a.jsxs(hs,{title:"Подключить существующий репозиторий",onClose:o,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!g||n!=="",onClick:()=>i(u.trim()),children:n||"Подключить"})]}),children:[a.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",a.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Адрес репозитория"}),a.jsx("input",{className:"input input--mono",value:u,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Enter"&&g&&n===""&&i(u.trim())}})]}),a.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",a.jsx("code",{children:"https://…"}),", ",a.jsx("code",{children:"ssh://…"}),", ",a.jsx("code",{children:"git://…"})," и"," ",a.jsx("code",{children:"git@host:path"}),"."]}),a.jsx(Ir,{result:s,onDismiss:c})]})}function bS({open:n,items:s,busy:i,ready:c,sendBlocked:o,commands:u,contextResult:h,draftKey:g,models:m,model:x,effort:_,ultracode:v,thinking:y,switchOnFlag:S,onContextSearch:k,onCommand:C,onModel:D,onEffort:q,onUltracode:G,onThinking:V,onSwitchOnFlag:L,onAsk:Y,onInterrupt:E,onReset:U,onClose:Q,zoomed:H,onToggleZoom:B}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(H?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:N=>{B&&(N.target.closest("button")||B())},children:[a.jsx(_S,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:U,children:"↻"}),B&&a.jsx("button",{className:"sidepane__btn",title:H?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":H?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":H,onClick:B,children:a.jsx(io,{active:H})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:Q,children:"✕"})]}),m.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(zy,{className:"select--compact",models:m,value:x,effort:_,ultracode:v,thinking:y,switchOnFlag:S,onModel:D,onEffort:q,onUltracode:G,onThinking:V,onSwitchOnFlag:L}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(um,{items:s,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Ey,{className:"composer--side",disabled:!c,busy:i,commands:u,sessionTitle:null,contextResult:h,draftKey:g?`side:${g}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:C,onSend:Y,onInterrupt:E,onEscape:i?E:Q})]})}function _S(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function yS({tab:n,servers:s,plugins:i,marketplaces:c,catalog:o,result:u,auth:h,remote:g,actions:m,onTab:x,onClose:_}){const v=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(hs,{title:"Расширения",className:"modal--wide",onClose:_,children:[a.jsx("div",{className:"tabs",role:"tablist",children:v.map(y=>a.jsxs("button",{role:"tab","aria-selected":n===y.id,className:n===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(y.id),children:[y.label,a.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),n==="mcp"&&a.jsx(vS,{servers:s,auth:h,remote:g,actions:m}),n==="plugins"&&a.jsx(ES,{plugins:i,marketplaces:c,actions:m}),n==="catalog"&&a.jsx(TS,{catalog:o,hasMarketplaces:c.length>0,actions:m,onMarketplaces:()=>x("plugins")}),a.jsx(Ir,{result:u})]})}function vS({servers:n,auth:s,remote:i,actions:c}){const[o,u]=b.useState(!1);return a.jsxs(a.Fragment,{children:[n.length===0&&!o&&a.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",a.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",a.jsx("code",{children:"claude mcp list"}),"."]}),a.jsx("ul",{className:"extlist",children:n.map(h=>{const g=(s==null?void 0:s.name)===h.name?s:null,m=g!==null&&g.active&&g.url==="",x=g!==null&&g.active&&g.url!=="";return a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:h.name}),a.jsx("span",{className:`chip chip--${kS(h.status)}`,children:wS[h.status]}),h.scope&&a.jsx("span",{className:"chip",children:h.scope}),h.transport&&a.jsx("span",{className:"chip",children:h.transport})]}),h.target&&a.jsx("div",{className:"extlist__meta",title:h.target,children:h.target}),h.error&&a.jsx("div",{className:"extlist__error",children:h.error}),h.tools.length>0&&a.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",h.tools.length," · ",h.tools.slice(0,6).join(", "),h.tools.length>6&&"…"]}),a.jsxs("div",{className:"extlist__actions",children:[h.status==="needs-auth"&&a.jsx("button",{className:x?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:m,onClick:()=>c.mcpAuth(h.name),children:m?"Запускаем вход…":x?"Начать заново":"Авторизовать"}),a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"reconnect"),children:"Переподключить"}),h.status==="disabled"?a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"enable"),children:"Включить"}):a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"disable"),children:"Выключить"}),h.editable&&a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>c.mcpRemove(h.name),children:"Удалить"})]}),g&&a.jsx(jS,{auth:g,remote:i,actions:c})]},h.name)})}),o?a.jsx(NS,{onCancel:()=>u(!1),onSubmit:(h,g)=>{c.mcpAdd(h,g),u(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>u(!0),children:"+ Сервер"})})]})}function jS({auth:n,remote:s,actions:i}){const[c,o]=b.useState("");function u(){const m=c.trim();m!==""&&(i.mcpAuthCallback(n.name,m),o(""))}if(!n.active)return n.error?a.jsx("div",{className:"extlist__error",children:n.error}):n.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[s&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),u())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:u,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:s?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),g=n.callbackExpected&&(s?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[n.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!s&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),g,n.error&&a.jsx("div",{className:"extlist__error",children:n.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const wS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function kS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function NS({onSubmit:n,onCancel:s}){const[i,c]=b.useState(""),[o,u]=b.useState("stdio"),[h,g]=b.useState(""),[m,x]=b.useState(""),[_,v]=b.useState(""),y=o==="stdio",S=i.trim()!==""&&(y?h.trim()!=="":m.trim()!=="");function k(){if(S)if(y){const[C,...D]=SS(h);n(i.trim(),{transport:"stdio",command:C??"",args:D,env:g_(_)})}else n(i.trim(),{transport:o,url:m.trim(),headers:g_(_)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:C=>c(C.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Xl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:C=>u(C)}),y?a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),a.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:C=>g(C.target.value)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:C=>x(C.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[y?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:_,spellCheck:!1,placeholder:y?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:C=>v(C.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function g_(n){const s={};for(const i of n.split(`
|
|
132
|
-
`)){const c=i.trim();if(!c)continue;const o=c.indexOf("="),u=c.indexOf(":"),h=o===-1?u:u===-1?o:Math.min(o,u);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function SS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function ES({plugins:n,marketplaces:s,actions:i}){const[c,o]=b.useState("");return a.jsxs(a.Fragment,{children:[n.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:n.map(u=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:u.name}),a.jsx("span",{className:u.enabled?"chip chip--ok":"chip chip--mute",children:u.enabled?"включён":"выключен"}),u.version&&u.version!=="unknown"&&a.jsx("span",{className:"chip",children:u.version}),u.scope&&a.jsx("span",{className:"chip",children:u.scope})]}),u.marketplace&&a.jsx("div",{className:"extlist__meta",children:u.marketplace}),u.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",u.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(u.id,!u.enabled),children:u.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(u.id),children:"Удалить"})]})]},u.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:s.map(u=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:u.name})}),u.source&&a.jsx("div",{className:"extlist__meta",children:u.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(u.name),children:"Отключить"})})]},u.name))}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:u=>o(u.target.value),onKeyDown:u=>{u.key!=="Enter"||c.trim()===""||(u.preventDefault(),i.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const mu=30;function TS({catalog:n,hasMarketplaces:s,actions:i,onMarketplaces:c}){const[o,u]=b.useState(""),[h,g]=b.useState(""),[m,x]=b.useState(mu),[_,v]=b.useState(""),y=b.useMemo(()=>[...new Set(n.map(C=>C.category).filter(Boolean))].sort(),[n]),S=b.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(C=>h&&C.category!==h?!1:k?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{u(k.target.value),x(mu)}}),a.jsx(Xl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...y.map(k=>({value:k,label:k}))],onChange:k=>{g(k),x(mu)}})]}),S.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:S.slice(0,m).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>i.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),S.length>m&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(k=>k+mu),children:["Ещё ",Math.min(mu,S.length-m)," из ",S.length-m]})}),a.jsxs("div",{className:"extform",children:[a.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>v(k.target.value),onKeyDown:k=>{k.key!=="Enter"||_.trim()===""||(k.preventDefault(),i.pluginInstall(_.trim()),v(""))}}),a.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{i.pluginInstall(_.trim()),v("")},children:"Установить"})]})]})]})}function CS({status:n,login:s,actions:i,remote:c,runningSessions:o,onReconnect:u,reconnectBlocked:h,reconnectHint:g,onClose:m}){const[x,_]=b.useState(""),[v,y]=b.useState(!1),[S,k]=b.useState(!1),C=u!==null&&(n==null?void 0:n.loggedIn)===!0&&!S&&!v,D=b.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const V=s.output.trim();return V===""?null:{ok:!0,message:V}},[s.error,s.output]);function q(V=x){const L=V.trim();L!==""&&(i.submitCode(L),_(""))}function G(){if(o>0){y(!1),k(!0);return}i.login("claudeai",!0)}return a.jsxs(hs,{title:"Аккаунт",onClose:m,children:[n===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):n.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:n.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:RS[n.method]??n.method}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization})]}):a.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",a.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?a.jsx(DS,{login:s,remote:c,code:x,onCode:_,onSubmit:q,onCancel:i.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Ir,{result:D}),S&&a.jsx("p",{className:"account__warn",role:"alert",children:AS(o)}),C&&h&&a.jsx("p",{className:"account__note",children:g}),a.jsx("div",{className:`extbar${n!=null&&n.loggedIn?" account__bar":""}`,children:n!=null&&n.loggedIn?a.jsxs(a.Fragment,{children:[C&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
133
|
-
${g}`,"aria-label":"Переподключить сессию",disabled:h,onClick:u,children:[a.jsx(MS,{}),"Переподключить"]}),S?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:G,children:"Сменить аккаунт"}),v?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),i.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{k(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function AS(n){const s=n%10,i=n%100,c=s===1&&i!==11,o=c?"сессия":s>=2&&s<=4&&(i<12||i>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function MS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const RS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function DS({login:n,remote:s,code:i,onCode:c,onSubmit:o,onCancel:u}){var k;const[h,g]=b.useState(null),m=b.useRef(""),x=b.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const _=b.useCallback(async C=>{const{code:D,onCode:q,onSubmit:G}=x.current;if(C&&D.trim()!=="")return;const V=await Ip();if(V===null){C||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const L=V.trim();if(!x_(L)){C||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(m.current===L)return;m.current=L}g(null),q(L),G(L)},[]);b.useEffect(()=>{if(!n.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[n.awaitingCode,_]);const v=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",y=i.trim()!==""&&!x_(i),S=h??(y?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),a.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),a.jsxs("div",{className:"account__raw",children:[a.jsx("span",{className:"account__rawurl",children:n.url}),a.jsx(lo,{text:n.url,hint:"ссылку входа"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),a.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),a.jsxs("details",{className:"account__fallback",children:[a.jsx("summary",{children:"Браузер не открылся"}),a.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),a.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{g(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),o())}}),v&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),S&&a.jsx("p",{className:"account__note account__note--code",children:S})]}),n.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:n.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:u,children:"Отменить вход"})})]})}function x_(n){const s=n.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[i,c]=s.split("#");return!!i&&!!c&&!/\s/.test(s)}function OS({state:n,onPair:s,onUnpair:i,onClose:c}){const[o,u]=b.useState(""),[h,g]=b.useState(""),[m,x]=b.useState(!1),_=b.useRef(null),v=(n==null?void 0:n.paired)===!0;b.useEffect(()=>{var S;v||(S=_.current)==null||S.focus()},[v]),b.useEffect(()=>{x(!1),v&&u("")},[v,n==null?void 0:n.error]);const y=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(hs,{title:"Удалённый доступ",onClose:c,children:v?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:b_(y)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),a.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),a.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):a.jsxs("div",{className:"relay",children:[a.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),a.jsxs("ol",{className:"relay__steps",children:[a.jsxs("li",{children:["Откройте ",a.jsx("b",{children:b_(y)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(x(!0),s(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:S=>u(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Как назвать этот компьютер"}),a.jsx("input",{className:"input",value:h,onChange:S=>g(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function b_(n){try{return new URL(n).host}catch{return n}}const jp=[{id:"codex",label:"Codex",hint:"OpenAI Codex CLI · вход через /login или codex login"},{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],LS="",zS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],IS=Vp.map(n=>({value:n.value,label:n.value,hint:n.hint})),Pd=3600*1e3,US=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Yc={"6h":6*Pd,"24h":24*Pd,"48h":48*Pd,"168h":168*Pd,never:0};function HS(n){return Yc[n]??Yc["48h"]}const BS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Jd=60*1e3,Vc={"5m":5*Jd,"10m":10*Jd,"30m":30*Jd,"60m":60*Jd,never:0};function qS(n){return Vc[n]??Vc["10m"]}function GS(n){const s=Object.entries(Vc).find(([,i])=>i===n);return s?s[0]:Object.keys(Vc).reduce((i,c)=>Math.abs(Vc[c]-n)<Math.abs(Vc[i]-n)?c:i)}function $S(n){const s=Object.entries(Yc).find(([,i])=>i===n);return s?s[0]:Object.keys(Yc).reduce((i,c)=>Math.abs(Yc[c]-n)<Math.abs(Yc[i]-n)?c:i)}const YS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Xc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function VS(n){return Xc[n]??Xc.off}function __(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function XS(n){const s=Object.entries(Xc).find(([,i])=>i===n);return s?s[0]:Object.keys(Xc).reduce((i,c)=>Math.abs(Xc[c]-n)<Math.abs(Xc[i]-n)?c:i)}const QS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function KS({themeMode:n,onThemeChange:s,settings:i,models:c,providerModels:o={},supportsProviderDefaults:u=!0,relayState:h,networkState:g,local:m,onChange:x,onEnableShell:_,onDisableShell:v,onOpenRelay:y,onClose:S}){const k=i===null,[C,D]=b.useState(""),[q,G]=b.useState(null),V=!k&&i.networkGuardEnabled,L=(i==null?void 0:i.networkGuardBlockedCountries)??[];function Y(){const N=C.trim().toUpperCase();if(N!==""){if(!/^[A-Z]{2}$/.test(N)){G("Нужен код из двух латинских букв, например RU или CN.");return}if(L.includes(N)){G(`Код ${N} уже в списке.`);return}G(null),D(""),x({networkGuardBlockedCountries:[...L,N]})}}const E=!k&&i.terminalEnabled===!0,U=!k&&i.liveSessionsFirst===!0,Q=!E,H=N=>{const X=o[N]??(N==="claude"?c:[]);return[{value:LS,label:"Как в CLI",hint:"Из настроек этого CLI"},...X.map(le=>({value:le.value,label:le.displayName,hint:le.description})),...N==="claude"&&!X.length?zS:[]]};function B(){var N,X;return(h==null?void 0:h.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:Q,onClick:y,children:"Связать компьютер"})]}):(N=h.shell)!=null&&N.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",h.shell.confirmedAt&&` Включено ${new Date(h.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:Q,onClick:v,children:"Запретить"})]}):(X=h.shell)!=null&&X.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:h.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:Q,onClick:_,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),m?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:Q,onClick:_,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:Q,onClick:_,children:"Прислать письмо"})]})]})}return a.jsx(hs,{title:"Настройки",onClose:S,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Тема оформления"}),a.jsx("p",{className:"settings__hint",children:"Свет и тьма — два состояния одного пространства. Оформление одинаково для всех подключённых агентов."}),a.jsx(Xl,{title:"Тема оформления",value:n,options:[{value:"system",label:"Ритм системы",hint:"следовать настройке вашего устройства"},{value:"light",label:"Свет",hint:"молочные поверхности и мягкие тени"},{value:"dark",label:"Тьма",hint:"графит, светящиеся орбиты и глубокие тени"}],onChange:N=>s(N)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Xl,{className:"settings__select",value:$S(i.autoArchiveAfterMs),options:US,onChange:N=>x({autoArchiveAfterMs:HS(N)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Xl,{className:"settings__select",value:GS(i.autoStopAfterMs),options:BS,onChange:N=>x({autoStopAfterMs:qS(N)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:i.limitStopFiveHourPct,onChange:N=>x({limitStopFiveHourPct:__(N.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:i.limitStopSevenDayPct,onChange:N=>x({limitStopSevenDayPct:__(N.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":V,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:V?"switch is-on":"switch",onClick:()=>x({networkGuardEnabled:!V}),children:a.jsx("span",{className:"switch__knob"})})]}),V&&g&&a.jsx("p",{className:g.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:g.status==="blocked"?g.reason??"Маршрут не прошёл проверку.":g.country?`Сейчас: ${g.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:V?"settings__field":"settings__field settings__nested is-disabled",children:[a.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),a.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[L.map(N=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:N}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${N} из списка`,disabled:!V,onClick:()=>x({networkGuardBlockedCountries:L.filter(X=>X!==N)}),children:"×"})]},N)),L.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:N=>{N.preventDefault(),Y()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:C,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!V,"aria-label":"Код страны, две буквы","aria-invalid":q!==null,onChange:N=>{D(N.target.value.toUpperCase()),G(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!V||C.trim()==="",children:"Добавить"})]}),q&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:q})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Xl,{className:"settings__select",value:XS(i.autoSaveAfterPauseMs),options:YS,onChange:N=>x({autoSaveAfterPauseMs:VS(N)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),jp.map(N=>{const X=(i==null?void 0:i.enabledProviders)??["claude","antigravity","codex"],le=!k&&X.includes(N.id),de=le&&X.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${N.id}`,"aria-hidden":"true",children:N.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):N.id==="antigravity"?a.jsx(am,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:N.label}),a.jsx("span",{className:"settings__hint",children:de?"Хотя бы один агент должен остаться включённым":N.hint})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":le,"aria-label":N.label,disabled:de,title:de?"Хотя бы один агент должен остаться включённым":void 0,className:le?"switch is-on":"switch",onClick:()=>{const ye=jp.map(I=>I.id).filter(I=>I===N.id?!le:X.includes(I));x({enabledProviders:ye})},children:a.jsx("span",{className:"switch__knob"})})]},N.id)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),jp.map(N=>{var X,le;return a.jsxs("div",{className:"settings__field settings__model-default",children:[a.jsx("label",{className:"settings__field-label",htmlFor:`default-model-${N.id}`,children:N.label}),a.jsxs("div",{children:[a.jsx("input",{id:`default-model-${N.id}`,className:"hub-input",list:`default-model-options-${N.id}`,"aria-label":`Модель по умолчанию: ${N.label}`,disabled:k||!u,placeholder:"Как в CLI",defaultValue:((X=i==null?void 0:i.startModels)==null?void 0:X[N.id])??(N.id==="claude"?i==null?void 0:i.startModel:"")??"",onBlur:de=>{var I;const ye=de.currentTarget.value.trim()||null;ye!==(((I=i==null?void 0:i.startModels)==null?void 0:I[N.id])??(N.id==="claude"?i==null?void 0:i.startModel:null)??null)&&x({startModels:{[N.id]:ye}})},onKeyDown:de=>{de.key==="Enter"&&de.currentTarget.blur()}},`${N.id}:${((le=i==null?void 0:i.startModels)==null?void 0:le[N.id])??(N.id==="claude"?i==null?void 0:i.startModel:"")??""}`),a.jsx("datalist",{id:`default-model-options-${N.id}`,children:H(N.id).filter(de=>de.value).map(de=>a.jsx("option",{value:de.value,children:de.label},de.value))}),a.jsxs("small",{className:"settings__hint",children:["Выберите доступную модель или введите её ID. Пустое поле — настройки ",N.label,"."]})]})]},N.id)}),!k&&!u&&a.jsx("p",{className:"hub-warning",children:"Обновите ccv на компьютере, чтобы настроить модель отдельно для каждого CLI."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав Claude Code при старте"}),k?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Xl,{className:"settings__select",value:i.startPermissionMode,options:IS,onChange:N=>x({startPermissionMode:N}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":U,"aria-label":"Запущенные сессии сверху",className:U?"switch is-on":"switch",onClick:()=>x({liveSessionsFirst:!U}),children:a.jsx("span",{className:"switch__knob"})})]})}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),a.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),a.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:QS.map(N=>{const X=!k&&i.folderAccess===N.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":X,disabled:k,className:"access__card"+(X?" is-on":"")+(N.risky?" access__card--risky":""),onClick:()=>x({folderAccess:N.value}),children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[N.title,N.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:N.description})]})]},N.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),k?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":E,"aria-label":"Терминал",className:E?"switch is-on":"switch",onClick:()=>x({terminalEnabled:!E}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(Q?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),k?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[Q&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),B()]})]})]})]})})}const y_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function ZS(n){if(!n)return"срок неизвестен";const s=new Date(n);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function FS({handoff:n,onContinue:s,onShow:i,onDismiss:c}){if(n.continuedAt!==void 0){const o=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${y_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return a.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",o,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:i,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[n.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[y_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",ZS(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:i,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function PS({handoff:n,onClose:s}){const[i,c]=b.useState("");return b.useEffect(()=>{let o=!1;return wf(n.text).then(u=>{o||c(u)}),()=>{o=!0}},[n.text]),a.jsx(hs,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:i}})})}function JS({state:n}){return a.jsxs("div",{className:"netguard",role:"alert",children:[a.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),a.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),a.jsxs("div",{className:"netguard__copy",children:[a.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const bf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},WS=12e3;function eE(n){const s=n%10,i=n%100;return s===1&&i!==11?"сессии":"сессиях"}function tE({notices:n,onDismiss:s}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(i=>a.jsx(nE,{notice:i,onDismiss:()=>s(i.id)},i.id))})}function nE({notice:n,onDismiss:s}){return b.useEffect(()=>{const i=window.setTimeout(s,WS);return()=>window.clearTimeout(i)},[s]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:n.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",bf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",eE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",bf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function sE(n,s,i=Date.now()){if(!n||!n.available||!s)return null;const c=[["fiveHour",n.fiveHour,s.limitStopFiveHourPct],["sevenDay",n.sevenDay,s.limitStopSevenDayPct]];for(const[o,u,h]of c){if(!u||h<=0||u.utilization<h)continue;const g=Date.parse(u.resetsAt);if(!(!Number.isFinite(g)||g<=i))return{limit:o,utilization:u.utilization,resetsAt:g}}return null}function lE(n,s=Date.now()){const i=new Date(n),c=i.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return i.toDateString()===new Date(s).toDateString()?c:`${i.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const aE=16;function iE({pane:n,width:s,onResize:i,onReset:c}){const o=Rr[n],u=b.useRef(null);b.useEffect(()=>()=>{u.current&&document.body.classList.remove("is-resizing")},[]);function h(v){var D;const y=v.closest(".app"),S=y==null?void 0:y.querySelector(n==="sidebar"?":scope > .sidebar":n==="comparison"?".comparison":`.sidepane--${n}`),k=(S==null?void 0:S.getBoundingClientRect().width)??s,C=((D=y==null?void 0:y.querySelector(".main"))==null?void 0:D.getBoundingClientRect().width)??ib;return{width:k,max:Math.max(o.min,Math.min(o.max,k+C-ib))}}function g(v){v.button===0&&(u.current={x:v.clientX,...h(v.currentTarget)},v.currentTarget.setPointerCapture(v.pointerId),document.body.classList.add("is-resizing"),v.preventDefault())}function m(v){const y=u.current;if(!y)return;const S=o.side==="left"?v.clientX-y.x:y.x-v.clientX;i(Math.min(y.max,y.width+S))}function x(v){u.current&&(u.current=null,v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),document.body.classList.remove("is-resizing"))}function _(v){const y=v.key==="ArrowRight"?1:v.key==="ArrowLeft"?-1:0;if(y===0)return;v.preventDefault();const S=h(v.currentTarget);i(Math.min(S.max,S.width+y*aE*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:g,onPointerMove:m,onPointerUp:x,onPointerCancel:x,onLostPointerCapture:x,onDoubleClick:c,onKeyDown:_,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const rE=16;function cE({height:n,onResize:s,onReset:i}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const _=x.getBoundingClientRect().height-Cv;return Math.round(n+Math.max(0,_))}function u(x){x.button===0&&(c.current={y:x.clientY,height:n,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const _=c.current;if(!_)return;const v=_.y-x.clientY;s(_.height+v,_.max)}function g(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function m(x){const _=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;_!==0&&(x.preventDefault(),s(n+_*rE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":X_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:u,onPointerMove:h,onPointerUp:g,onPointerCancel:g,onDoubleClick:i,onKeyDown:m,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function v_(){const n=document.documentElement,s=getComputedStyle(n),i=G=>s.getPropertyValue(G).trim(),c=i("--surface"),o=i("--text"),u=i("--text-2"),h=i("--muted"),g=i("--accent"),m=i("--accent-fg"),x=i("--select"),_=i("--danger"),v=i("--ok"),y=i("--warn"),S=i("--cm-fn"),k=i("--cm-key"),C=i("--cm-type"),D=j_(o,c,55),q=G=>j_(G,"#ffffff",25);return{background:c,foreground:o,cursor:g,cursorAccent:m,selectionBackground:x,black:D,brightBlack:h,red:_,brightRed:q(_),green:v,brightGreen:q(v),yellow:y,brightYellow:q(y),blue:S,brightBlue:q(S),magenta:k,brightMagenta:q(k),cyan:C,brightCyan:q(C),white:u,brightWhite:o}}function oE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ga=null;function uE(n){return ga||(ga=document.createElement("span"),ga.style.position="fixed",ga.style.width="0",ga.style.height="0",ga.style.opacity="0",ga.style.pointerEvents="none",document.body.appendChild(ga)),ga.style.color=n,getComputedStyle(ga).color}function j_(n,s,i){return uE(`color-mix(in srgb, ${n} ${100-i}%, ${s} ${i}%)`)}let Wd=null;function dE(){return Wd||(Wd=Promise.all([ft(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),ft(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),ft(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),ft(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,s,i])=>({Terminal:n.Terminal,FitAddon:s.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(n=>{throw Wd=null,n})),Wd}function fE({terminals:n,activeId:s,blocked:i,error:c,onDismissError:o,height:u,offset:h,mobile:g=!1,zoomed:m,onToggleZoom:x,onSelect:_,onOpen:v,onClose:y,onInput:S,onResize:k,onAttach:C,onHide:D,registerSink:q}){const[G,V]=b.useState(()=>v_());return b.useEffect(()=>{const L=new MutationObserver(()=>V(v_()));return L.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>L.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(g?" termpanel--mobile":"")+(!g&&m?" termpanel--zoomed":""),style:g?{height:u,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:m?void 0:{height:u},children:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:L=>{x&&(L.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(L=>a.jsxs("div",{role:"tab","aria-selected":L.id===s,className:"termtab"+(L.id===s?" is-on":"")+(L.exitCode!==null?" termtab--exited":""),onDoubleClick:Y=>{x&&(Y.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:L.cwd,onClick:()=>_(L.id),children:L.title}),L.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${L.exitCode}`,children:L.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${L.title}»`,onClick:()=>y(L.id),children:"✕"})]},L.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:v,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),x&&a.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:a.jsx(io,{active:m})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:D,children:"✕"})]}),c&&n.length>0&&a.jsx(w_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(w_,{message:c,onRetry:i?null:v,onDismiss:o}):i?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:v,children:"Открыть терминал"})]}),n.map(L=>a.jsx(pE,{id:L.id,exitCode:L.exitCode,active:L.id===s,theme:G,mobile:g,onInput:S,onResize:k,onAttach:C,registerSink:q},L.id))]})]})}function w_({message:n,strip:s=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:u,details:h}=hE(n);return a.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),u&&a.jsx("p",{className:"termfail__hint",children:u}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[i&&a.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function hE(n){const[s="",...i]=n.trim().split(`
|
|
134
|
-
|
|
135
|
-
`),c=s.split(`
|
|
136
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:i.join(`
|
|
137
|
-
|
|
138
|
-
`).trim()}}function pE({id:n,exitCode:s,active:i,theme:c,mobile:o,onInput:u,onResize:h,onAttach:g,registerSink:m}){const x=b.useRef(null),_=b.useRef(null),v=b.useRef(!1),y=b.useRef(o);y.current=o;const S=b.useRef(c),k=b.useRef(s),[C,D]=b.useState("loading"),[q,G]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let L=!1,Y=null;D("loading"),G(!1);const E=window.setTimeout(()=>{L||G(!0)},200);return(async()=>{var Ne;let U;try{U=await dE()}catch{window.clearTimeout(E),L||D("error");return}if(L||!x.current)return;window.clearTimeout(E);const{Terminal:Q,FitAddon:H,WebLinksAddon:B}=U,N=new Q({fontFamily:oE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),X=new H;N.loadAddon(X),N.loadAddon(new B),N.open(x.current),_.current=N,N.attachCustomKeyEventHandler(A=>{if(A.type!=="keydown"||!(A.ctrlKey||A.metaKey))return!0;if(A.key==="`")return A.preventDefault(),!1;if(A.key==="c"||A.key==="C"){const fe=N.getSelection();return fe?(A.preventDefault(),si(fe),!1):!A.shiftKey}return A.key==="v"||A.key==="V"?(A.preventDefault(),Ip().then(fe=>{fe&&N.paste(fe)}),!1):!0});const le=A=>{A.preventDefault();const K=N.getSelection();if(K){si(K),N.clearSelection();return}Ip().then(fe=>{fe&&N.paste(fe)})};(Ne=N.element)==null||Ne.addEventListener("contextmenu",le);const de=N.onData(A=>u(n,A));let ye={cols:N.cols,rows:N.rows},I=null;const R=N.onResize(({cols:A,rows:K})=>{I!==null&&window.clearTimeout(I),I=window.setTimeout(()=>{I=null,!(A===ye.cols&&K===ye.rows)&&(ye={cols:A,rows:K},h(n,A,K))},100)}),P=new ResizeObserver(()=>{try{X.fit()}catch{return}y.current&&N.scrollToBottom()});P.observe(x.current);const ae=m(n,A=>{A.kind==="buffer"&&N.reset(),N.write(A.data)});g(n),k.current!==null&&!v.current&&(v.current=!0,N.write(`\r
|
|
139
|
-
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
140
|
-
`)),i&&N.focus(),Y=()=>{var A;I!==null&&window.clearTimeout(I),P.disconnect(),(A=N.element)==null||A.removeEventListener("contextmenu",le),de.dispose(),R.dispose(),ae(),N.dispose(),_.current=null},D("ready")})(),()=>{L=!0,window.clearTimeout(E),Y==null||Y(),Y=null}},[n]),b.useEffect(()=>{if(!o)return;const V=x.current;if(!V)return;let L=null,Y=0,E=!1;const U=N=>{N.pointerType==="mouse"||L!==null||(L=N.pointerId,Y=N.clientY,E=!1)},Q=N=>{if(N.pointerId!==L)return;const X=Y-N.clientY;if(!E){if(Math.abs(X)<4)return;E=!0,V.setPointerCapture(N.pointerId)}Y=N.clientY;const le=V.querySelector(".xterm-viewport");le&&(le.scrollTop+=X)},H=N=>{N.pointerId===L&&(V.hasPointerCapture(N.pointerId)&&V.releasePointerCapture(N.pointerId),L=null,E=!1)},B=N=>N.stopPropagation();return V.addEventListener("pointerdown",U),V.addEventListener("pointermove",Q),V.addEventListener("pointerup",H),V.addEventListener("pointercancel",H),V.addEventListener("touchmove",B,{capture:!0}),()=>{V.removeEventListener("pointerdown",U),V.removeEventListener("pointermove",Q),V.removeEventListener("pointerup",H),V.removeEventListener("pointercancel",H),V.removeEventListener("touchmove",B,{capture:!0}),L!==null&&V.hasPointerCapture(L)&&V.releasePointerCapture(L)}},[o]),b.useEffect(()=>{S.current=c,_.current&&(_.current.options.theme=c)},[c]),b.useEffect(()=>{var V;i&&((V=_.current)==null||V.focus())},[i]),b.useEffect(()=>{if(k.current=s,s===null){v.current=!1;return}if(v.current)return;const V=_.current;V&&(v.current=!0,V.write(`\r
|
|
141
|
-
\x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
|
|
142
|
-
`))},[s]),a.jsxs("div",{className:"termview"+(i?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&q&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),C==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const Bp="ccv:last-session",mE=300*1e3,gE=1e4;function xE(){try{const n=localStorage.getItem(Bp);if(!n)return null;const s=JSON.parse(n);if(typeof s!="object"||s===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=s;return typeof i!="string"||c!==null&&typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function bE(n,s){const i=n.find(o=>o.id===s);if(i)return i;const c=n.filter(o=>cv(o.path).includes(s));return c.length===1?c[0]:void 0}function _E(n,s){return n.id===s.sessionId?!0:s.claudeSessionId?n.id===s.claudeSessionId||n.claudeSessionId===s.claudeSessionId:!1}const yE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},wp=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],vE={active:!1,url:"",awaitingCode:!1,output:"",error:null};function k_(n,s,i){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return s;const o=i[c===-1?"":n.slice(0,c)];if(!o)return null;const u=n.slice(c+1).toLowerCase();return u===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(u)).sort((h,g)=>N_(h.name,u)-N_(g.name,u))}}function N_(n,s){return n.toLowerCase().startsWith(s)?0:1}function S_(n,s){const i=n.find(o=>o.value===s)??n.find(o=>o.resolvedModel===s),c=s&&!i?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(i==null?void 0:i.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function jE(){var _c;const n=b.useRef(null),s=b.useRef(null),i=b.useRef(!1),c=b.useRef(new Set),o=b.useCallback(p=>{var O;return(O=n.current)==null?void 0:O.send(p)},[]),u=b.useCallback(p=>{var O,ce,qe;if(p.type==="session.start"){const ot=crypto.randomUUID();s.current={requestId:ot,workspaceId:p.workspaceId,provider:p.provider,resume:p.resume,known:new Set(c.current),draft:(O=s.current)==null?void 0:O.draft},(ce=n.current)==null||ce.send({...p,requestId:ot})}else(qe=n.current)==null||qe.send(p)},[]),[h,g]=b.useState(!1),[m,x]=b.useState("Нет связи с хостом"),[_,v]=b.useState(null),[y,S]=b.useState(null),k=(y==null?void 0:y.status)==="blocked",[C,D]=b.useState(!1),q=b.useMemo(()=>nf()==="relay",[]),[G,V]=b.useState([]),L=nk({connected:h,workspaces:G,send:o}),Y=ON(L.openedIds,L.replacements),[E,U]=b.useState(null),Q=b.useRef(L.handleFrame);Q.current=L.handleFrame;const[H,B]=b.useState([]),[N,X]=b.useState([]),[le,de]=b.useState([]),[ye,I]=b.useState([]),[R,P]=b.useState([]),[ae,Ne]=b.useState([]),[A,K]=b.useState([]),[fe,ke]=b.useState([]),[Re,Ue]=b.useState(null),[_e,Ze]=b.useState(null),[rt,Bt]=b.useState(null),[he,at]=b.useState(null),[oe,Rt]=b.useState(null),[He,qt]=b.useState(null),[Un,bt]=b.useState(fs),[Kt,ln]=b.useState(Zi),[Xn,wt]=b.useState(!1),[Z,De]=b.useState(()=>{try{const p=localStorage.getItem("ether:library.tab");if(p==="sessions"||p==="pinned")return p}catch{}return"projects"}),[$e,ht]=b.useState(()=>{try{return localStorage.getItem("ether:library.project")||null}catch{return null}}),[Ee,Te]=b.useState(()=>{try{return localStorage.getItem("ether:session-list")==="live"?"live":"all"}catch{return"all"}});b.useEffect(()=>{try{localStorage.setItem("ether:session-list",Ee)}catch{}},[Ee]);const Oe=Z==="sessions"&&Ee==="live",Ye=L.allSessions.filter(Or),Qe=Ye.map(p=>p.id).sort().join("|"),Pe=b.useRef(new Set);b.useEffect(()=>{if(!Oe){Pe.current.clear();return}const p=Y.layout.focused;let O=!1;for(const ce of Ye)Pe.current.has(ce.id)||(Pe.current.add(ce.id),L.openedIds.includes(ce.id)||(Y.open(ce.id),L.openConversation(ce),O=!0));O&&p&&Y.activate(p)},[Oe,Qe]),b.useEffect(()=>{try{localStorage.setItem("ether:library.tab",Z),localStorage.setItem("ether:library.project",$e??"")}catch{}},[Z,$e]);const[pt,At]=b.useState(null),[Sn,Et]=b.useState(!1),[Lt,re]=b.useState(()=>{try{const p=localStorage.getItem("ether:provider-filter");if(p&&["all","codex","claude","antigravity"].includes(p))return p}catch{}return"all"});b.useEffect(()=>{try{localStorage.setItem("ether:provider-filter",Lt)}catch{}},[Lt]);const[we,Ve]=b.useState(!1),et=yf("(max-width: 860px)"),[nt,on]=b.useState(!1);b.useEffect(()=>{et||on(!1)},[et]);const[On,Wt]=b.useState(!1),[bn,Yt]=b.useState([]),[zt,J]=b.useState(!1),[pe,Ae]=b.useState(fs),[Ke,It]=b.useState(null),[an,kt]=b.useState(null),[gs,Qn]=b.useState([]),[is,rn]=b.useState(null),[it,un]=b.useState(null),[ks,Ns]=b.useState([]),[Ss,zs]=b.useState([]),[rs,Es]=b.useState([]),[Zt,Is]=b.useState([]),[_n,yn]=b.useState(null),[lt,Jn]=b.useState(null),[Kn,cs]=b.useState({}),[dn,rl]=b.useState(null),[Ts,os]=b.useState({}),[Cs,kn]=b.useState(null),[Ln,Hn]=b.useState([]),[en,jl]=b.useState(!1),[li,Kl]=b.useState(null),[En,wl]=b.useState(null),kl=(En==null?void 0:En.enabledProviders)??["claude","antigravity","codex"],[Wn,Nl]=b.useState(!1),[Zl,Us]=b.useState(vE),[vn,Se]=b.useState(null),[M,W]=b.useState(null),[ve,Ce]=b.useState(!1),[Xe,Je,Vt]=kv(),gt=Tv(),[cn,ct]=b.useState(!1),[Mt,fn]=b.useState(null),[Ps,Hs]=b.useState(null),[Pi,Sl]=b.useState(null),[ai,jn]=b.useState(null),[xs,es]=b.useState(null),[cl,T]=b.useState(""),[ge,Ie]=b.useState(null),[_t,bs]=b.useState([]),[Hr,Ji]=b.useState(!1),[_s,El]=b.useState(null),[Br,Fl]=b.useState(!1),[Js,ii]=b.useState(!1),[Tl,Cl]=b.useState({}),[ka,Wi]=b.useState([""]),[Na,Ws]=b.useState([]),[qr,Al]=b.useState(null),[kf,Pl]=b.useState(null),[er,Gr]=b.useState(null),[tr,nr]=b.useState(null),[Nf,ro]=b.useState(null),[$r,Ou]=b.useState({}),[ri,Lu]=b.useState({}),[sr,Yr]=b.useState(!1),[zu,co]=b.useState(null),[Vr,oo]=b.useState(null),Iu=b.useRef(0),Xr=b.useRef(null),[Qr,uo]=b.useState(!1),[Kr,lr]=b.useState([]),[fo,Jl]=b.useState(null),[Sf,ar]=b.useState(null),ir=Av(),Zr=Lv(et&&Qr),ci=b.useRef(new Map),Wl=(En==null?void 0:En.terminalEnabled)===!0,Ml=nf()==="relay"&&((_c=_==null?void 0:_.shell)==null?void 0:_c.enabled)!==!0,ho=b.useRef(!1),Ef=b.useCallback((p,O)=>(ci.current.set(p,O),()=>{ci.current.get(p)===O&&ci.current.delete(p)}),[]),[Sa,oi]=b.useState(!1),[po,ea]=b.useState(null),[ui,Fr]=b.useState(fs),[Bs,rr]=b.useState(null),[di,Rl]=b.useState({}),Ea=b.useRef([]),[hn,Pr]=b.useState(null);function Uu(p){Pr(O=>O===p?null:p)}b.useEffect(()=>{(et||hn==="terminal"&&!Qr||hn==="files"&&!Js||hn==="search"&&!sr||hn==="git"&&!cn||hn==="ask"&&!Sa||hn==="main"&&Na.length===0)&&Pr(null)},[hn,et,Qr,Js,sr,cn,Sa,Na.length]);const[Tf]=b.useState(xE),Jr=b.useRef(Tf),fi=b.useRef(!1),Bn=b.useRef(null),Wr=b.useRef(null),ts=b.useRef(null),hi=b.useRef(0),zn=b.useRef(null),mo=b.useRef(0);Bn.current=oe,zn.current=he,mo.current=Un.lastSeq;const go=b.useRef(Kt);go.current=Kt;const ol=b.useRef(null),ec=b.useRef(0);ec.current=ui.lastSeq;const tc=b.useRef(null),Dl=b.useRef(""),Ta=b.useRef(null),el=b.useRef([]),nc=b.useRef([""]);el.current=Na,nc.current=ka;const pi=b.useRef(new Map),ul=b.useRef(new Set),dl=b.useRef(null),Ca=b.useRef(null),xo=b.useRef(0),tl=b.useRef(new Set);b.useEffect(()=>{const p=gv();if(!p)return;n.current=p;const O=()=>{g(p.connected),x(p.statusText)};p.onStatus(O),p.onReconnect(()=>{O(),os({});const ot=Bn.current;ot&&p.send({type:"session.sync",sessionId:ot,sinceSeq:mo.current});const An=ol.current;An&&p.send({type:"session.sync",sessionId:An,sinceSeq:ec.current})});const ce=p.on(ot=>{Q.current(ot),Hu(ot)});p.connect();const qe=window.setInterval(()=>{O(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(qe),p.close()}},[]);const Hu=b.useCallback(p=>{var ce,qe,ot,An,Ys,Ga,yc,ys,Ds,Hl,vc,zo,Bl;const O=xe=>{var We,ut,Le;const je=(We=s.current)==null?void 0:We.draft;s.current=null,je&&af(xe.id,je),((ut=ts.current)==null?void 0:ut.workspaceId)===xe.workspaceId&&(af(xe.id,ts.current.text),ts.current=null),Bn.current=xe.id,at(xe.workspaceId),Rt(xe.id),(Le=n.current)==null||Le.send({type:"session.sync",sessionId:xe.id,sinceSeq:0})};switch(p.type){case"hello.ok":i.current=((ce=p.features)==null?void 0:ce.includes("session-routing"))??!1,g(!0);break;case"workspace.list":{V(p.workspaces),B(p.archived),at(We=>{var xt;if(We)return We;const ut=Jr.current,Le=ut&&bE(p.workspaces,ut.workspaceId);return ut&&Le&&Le.id!==ut.workspaceId&&(Jr.current={...ut,workspaceId:Le.id}),(Le==null?void 0:Le.id)??((xt=p.workspaces[0])==null?void 0:xt.id)??null});const xe=Ta.current;if(!xe)break;const je=p.workspaces.find(We=>NE(We.path,xe));if(!je)break;Ta.current=null,Wt(!1),at(je.id);break}case"workspace.candidates":if(p.query.trim()!==Dl.current)break;Yt(p.candidates),p.source==="host"&&J(!1);break;case"finder.opened":tc.current=p.sessionId;break;case"workspace.roots":Qn(p.roots);break;case"workspace.created":if(at(p.workspace.id),p.warnings.length===0){Wt(!1),kt(null);break}rn({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==zn.current)break;P(xe=>vy(xe,p.sessions,p.archived,p.workspaceId)),Ne(p.archived);break;case"folder.list":X(p.workspaceFolders),de(p.sessionFolders),I(p.pinnedFolders??[]);break;case"session.pinned":K(p.sessions);break;case"session.live":for(const xe of p.sessions)c.current.add(xe.id);ke(p.sessions);break;case"order.state":Bt(p.order);break;case"session.summary":if(!i.current&&s.current){const xe=s.current,je=p.session;!je.parentSessionId&&je.workspaceId===xe.workspaceId&&je.state!=="closed"&&(!xe.provider||xe.provider===je.provider)&&(!((qe=xe.known)!=null&&qe.has(je.id))||xe.resume===je.id||xe.resume===je.claudeSessionId)&&O(je)}if(c.current.add(p.session.id),p.session.id===tc.current){It(p.session);break}if(p.session.parentSessionId){p.session.id===ol.current&&rr(p.session);break}if(ke(xe=>{const je=xe.findIndex(ut=>ut.id===p.session.id);if(p.session.state==="closed")return je===-1?xe:xe.filter(ut=>ut.id!==p.session.id);if(je===-1)return[...xe,p.session];const We=xe.slice();return We[je]=p.session,We}),P(xe=>{const je=xe.findIndex(ut=>ut.id===p.session.id);if(je===-1)return[p.session,...xe];const We=xe.slice();return We[je]=p.session,We}),K(xe=>{const je=xe.findIndex(ut=>ut.id===p.session.id);if(je===-1)return xe;const We=xe.slice();return We[je]={...p.session,pinned:!0,...xe[je].pinnedAt?{pinnedAt:xe[je].pinnedAt}:{}},We}),((ot=Wr.current)==null?void 0:ot.sessionId)===p.session.id){const xe=Wr.current;p.session.state==="error"?Wr.current=null:p.session.state!=="closed"&&(Wr.current=null,(An=n.current)==null||An.send({type:"prompt.send",sessionId:xe.sessionId,text:xe.text,images:xe.images}))}break;case"session.started":{if(p.requestId!==((Ys=s.current)==null?void 0:Ys.requestId))break;O(p.session);break}case"usage.state":p.sessionId===Bn.current&&(Se(p.usage),Ce(!1));break;case"context.state":p.sessionId===Bn.current&&(W(p.context),Ce(!1));break;case"session.capabilities":p.sessionId===Bn.current&&qt(p.capabilities);break;case"session.events":if(p.sessionId===ol.current){Fr(xe=>vu(xe,p.entries));break}if(p.sessionId===tc.current){Ae(xe=>vu(xe,p.entries));break}if(p.sessionId!==Bn.current)break;for(const xe of p.entries){if(xe.event.kind!=="rewound")continue;const je=xe.event.toUserIndex,We=B_(go.current.entries,je),ut=We.reduce((Le,xt)=>xt.event.kind==="user.message"?Le+1:Le,0);ln(Le=>({...Le,entries:We})),bt(Le=>({...Le,items:q_(Le.items,je,ut)}))}bt(xe=>vu(xe,p.entries));break;case"session.history":if(p.sessionId!==Bn.current)break;ln(xe=>H_(xe,p));break;case"side.opened":{if(p.parentSessionId!==Bn.current)break;ol.current=p.sessionId,ea(p.sessionId);const xe=Ea.current;Ea.current=[];for(const je of xe)je(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Bn.current)break;ol.current=null,ea(null),Fr(fs),rr(null);break;case"git.state":if(p.workspaceId!==zn.current)break;fn(p.state);break;case"git.commit":if(p.workspaceId!==zn.current)break;Hs(p.detail);break;case"git.result":if(p.workspaceId!==zn.current)break;jn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Hs(null),Sl(null),Ji(!1),Fl(!1));break;case"git.busy":if(p.workspaceId!==zn.current)break;T(p.label);break;case"git.files":if(p.workspaceId!==zn.current)break;El({files:p.files,truncated:p.truncated});break;case"github.status":Ie(p.status);break;case"github.owners":bs(p.owners);break;case"fs.dir":if(p.workspaceId!==zn.current)break;Cl(xe=>({...xe,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==zn.current)break;if(p.scope!=="tree"){const xe=p.scope;Lu(je=>({...je,[xe]:{query:p.query,entries:p.entries}}));break}ro({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==zn.current)break;co({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==zn.current)break;const xe=ul.current.delete(p.file.path);Ws(We=>{const ut=We.findIndex(Mn=>Mn.path===p.file.path);if(ut===-1)return[...We,Yb(p.file,++xo.current)];const Le=We[ut],xt=We.slice();return xt[ut]=Le.saved===p.file.content&&!Wa(Le)?{...Le,mtime:p.file.mtime,size:p.file.size,stale:!1}:Yb(p.file,++xo.current),xt}),xe&&Al(p.file.path);const je=Xr.current;je&&je.path===p.file.path&&(Xr.current=null,oo({...je,token:++Iu.current}));break}case"fs.media":{if(p.workspaceId!==zn.current)break;tl.current.delete(p.path),Ws(xe=>xe.map(je=>je.path===p.path?{...je,mediaBase64:p.base64,mediaError:void 0}:je));break}case"fs.mediaFailed":{if(p.workspaceId!==zn.current)break;tl.current.delete(p.path),Ws(xe=>xe.map(je=>je.path===p.path?{...je,mediaError:p.message}:je));break}case"fs.saved":{if(p.workspaceId!==zn.current)break;const xe=pi.current.get(p.path);pi.current.delete(p.path);const je=xe!==void 0;Ws(ut=>ut.map(Le=>Le.path!==p.path?Le:je?{...Le,saved:xe,mtime:p.mtime,size:p.size,stale:!1}:{...Le,stale:!0}));const We=el.current.find(ut=>ut.path===p.path);!je&&We&&!Wa(We)&&((Ga=n.current)==null||Ga.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(yc=n.current)==null||yc.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==zn.current)break;if(Pl({ok:p.ok,message:p.message}),p.ok||pi.current.delete(p.path),p.conflict&&Ws(je=>je.map(We=>We.path===p.path?{...We,stale:!0}:We)),Ca.current===p.path){const je=Ca.current;Ca.current=null,p.ok&&(ul.current.add(je),(ys=n.current)==null||ys.send({type:"fs.read",workspaceId:p.workspaceId,path:je}))}const xe=dl.current;if(p.ok&&xe&&xe.to===p.path){dl.current=null;const je=We=>We===xe.from?xe.to:We.startsWith(`${xe.from}/`)?xe.to+We.slice(xe.from.length):We;Ws(We=>We.map(ut=>({...ut,path:je(ut.path)}))),Al(We=>We===null?null:je(We)),Wi(We=>We.map(je)),Cl(We=>{const ut={};for(const[Le,xt]of Object.entries(We))Le===xe.from||Le.startsWith(`${xe.from}/`)||(ut[Le]=xt);return ut})}p.ok&&((Ds=n.current)==null||Ds.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==zn.current)break;lr(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==zn.current)break;ar(null),lr(xe=>{const je=xe.findIndex(ut=>ut.id===p.terminal.id);if(je===-1)return[...xe,p.terminal];const We=xe.slice();return We[je]=p.terminal,We}),ho.current&&(ho.current=!1,Jl(p.terminal.id));break;case"term.buffer":(Hl=ci.current.get(p.id))==null||Hl({kind:"buffer",data:p.data});break;case"term.data":(vc=ci.current.get(p.id))==null||vc({kind:"data",data:p.data});break;case"term.exit":lr(xe=>xe.map(je=>je.id===p.id?{...je,exitCode:p.exitCode}:je));break;case"term.closed":lr(xe=>xe.filter(je=>je.id!==p.id));break;case"mcp.list":p.sessionId===Bn.current&&Ns(p.servers);break;case"mcp.auth":p.sessionId===Bn.current&&Jn(p.state);break;case"plugin.list":if(p.sessionId!==Bn.current)break;zs(p.plugins),Es(p.marketplaces),Is(p.catalog);break;case"operation.result":p.sessionId===Bn.current&&yn(p.result);break;case"auth.status":Kl(p.status);break;case"relay.state":v(p.state);break;case"network.state":S(p.state);break;case"settings.state":wl(p.settings);break;case"handoff.state":cs(xe=>{if(!p.handoff){if(!(p.sessionId in xe))return xe;const je={...xe};return delete je[p.sessionId],je}return{...xe,[p.sessionId]:p.handoff}});break;case"handoff.written":os(xe=>{if(!(p.sessionId in xe))return xe;const je={...xe};return delete je[p.sessionId],je}),p.handoff&&Bn.current===p.sessionId?kn(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":hi.current+=1,Hn(xe=>[...xe,{id:hi.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Us(p.state),p.state.active&&jl(!0);break;case"session.closed":ke(xe=>xe.filter(je=>je.id!==p.sessionId)),P(xe=>xe.map(je=>je.id===p.sessionId?{...je,state:"closed"}:je));break;case"error":p.context==="session.start"&&p.requestId===((zo=s.current)==null?void 0:zo.requestId)&&(s.current=null,bt(xe=>({...xe,items:[...xe.items,{id:crypto.randomUUID(),kind:"notice",tone:"error",text:p.message}]}))),console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Ta.current=null,kt(p.message)),(Bl=p.context)!=null&&Bl.startsWith("term.")&&ar(p.message);break}},[]);b.useEffect(()=>{he&&u({type:"session.list",workspaceId:he})},[he,u]),b.useEffect(()=>{h&&u({type:"session.pins"})},[h,u]),b.useEffect(()=>{h&&u({type:"settings.get"})},[h,u]),b.useEffect(()=>{if(h)return u({type:"session.drafts",sessionIds:z_()}),yv(p=>u({type:"session.drafts",sessionIds:p}))},[h,u]),b.useEffect(()=>{if(fi.current)return;const p=Jr.current;if(!p||!he)return;if(p.sessionId===null){fi.current=!0;return}if(he!==p.workspaceId){fi.current=!0;return}if(oe){fi.current=!0;return}if(R.length===0)return;const O=R.find(ce=>_E(ce,p));fi.current=!0,O&&O.state!=="closed"&&Ra(O)},[R,he,oe]),b.useEffect(()=>{!he||Ml||!Wl||u({type:"term.list",workspaceId:he})},[he,Ml,Wl,u]),b.useEffect(()=>{Jl(p=>{var O;return p&&Kr.some(ce=>ce.id===p)?p:((O=Kr[0])==null?void 0:O.id)??null})},[Kr]),b.useEffect(()=>{On&&u({type:"workspace.roots"})},[On,u]);const cr=b.useCallback(()=>{const p=Bn.current;p&&(Ce(!0),u({type:"usage.get",sessionId:p}),u({type:"context.get",sessionId:p}))},[u]);b.useEffect(()=>{if(!ve)return;const p=window.setTimeout(()=>Ce(!1),gE);return()=>window.clearTimeout(p)},[ve]);const bo=b.useMemo(()=>{const p=Math.max((vn==null?void 0:vn.fetchedAt)??0,(M==null?void 0:M.fetchedAt)??0);return p>0?p:null},[vn==null?void 0:vn.fetchedAt,M==null?void 0:M.fetchedAt]);b.useEffect(()=>{if(W(null),!oe)return;cr();const p=()=>{document.hidden||cr()},O=window.setInterval(p,mE),ce=()=>{document.hidden||cr()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(O),document.removeEventListener("visibilitychange",ce)}},[oe,cr]),b.useEffect(()=>{if(!oe){ln(Zi);return}ln({...Zi,loading:!0}),u({type:"session.history",sessionId:oe})},[oe,u]),b.useCallback(()=>{!oe||Kt.loading||!U_(Kt)||(ln(p=>({...p,loading:!0})),u({type:"session.history",sessionId:oe,before:$p(Kt)}))},[oe,Kt,u]),b.useMemo(()=>Yp(Kt.entries),[Kt.entries]);const ne=b.useMemo(()=>R.find(p=>p.id===oe)??null,[R,oe]),or=oe?(ne==null?void 0:ne.claudeSessionId)??oe:null,ur=or?Kn[or]??null:null;b.useEffect(()=>{or&&u({type:"handoff.get",sessionId:or})},[or,u]),b.useEffect(()=>{dn&&!(dn.sessionId in Kn)&&rl(null)},[Kn,dn]),b.useMemo(()=>{var ce;if(!vn)return null;const p=(((ce=vn.buckets)==null?void 0:ce.length)??0)>0,O=(ne==null?void 0:ne.provider)!=="claude";return p===O?vn:null},[vn,ne==null?void 0:ne.provider]),"Обновить лимиты и контекст"+(bo?`
|
|
143
|
-
обновлено в ${new Date(bo).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""),b.useEffect(()=>{document.documentElement.dataset.provider=(ne==null?void 0:ne.provider)??"claude"},[ne==null?void 0:ne.provider]),b.useEffect(()=>{(ne==null?void 0:ne.provider)!=="claude"&&oi(!1)},[ne==null?void 0:ne.provider]);const sc=G.find(p=>p.id===he)??H.find(p=>p.id===he)??null;b.useEffect(()=>{if(!he||!oe)return;const p={workspaceId:he,sessionId:oe,claudeSessionId:(ne==null?void 0:ne.claudeSessionId)??null};try{localStorage.setItem(Bp,JSON.stringify(p))}catch{}},[he,oe,ne==null?void 0:ne.claudeSessionId]);function _o(p){Ta.current=p,kt(null),u({type:"workspace.open",path:p})}function nl(p,O,ce){kt(null),u({type:"workspace.create",parent:p,name:O,init:ce})}function lc(p){if(Dl.current=p,!p){Yt([]),J(!1);return}J(!0),u({type:"workspace.find",query:p})}function qs(p){Dl.current=p,Ae(fs),u({type:"workspace.find.agent",query:p})}function mi(){Wt(!1),kt(null),rn(null),Yt([]),Ae(fs),It(null),Dl.current="",Ta.current=null}function Aa(){const p=Bn.current;p&&ol.current&&u({type:"side.reset",sessionId:p}),ol.current=null,ea(null),Fr(fs),rr(null),Rl({}),Ea.current=[]}function ac(p){u({type:"workspace.close",workspaceIds:p}),!(!he||!p.includes(he))&&(Aa(),at(null),Rt(null),P([]),Ne([]),bt(fs),qt(null),Ve(!1))}function ic(p,O){u({type:"session.archive",workspaceId:p,sessionIds:O}),oe&&(O.includes(oe)||ne!=null&&ne.claudeSessionId&&O.includes(ne.claudeSessionId))&&(Aa(),Rt(null),bt(fs),qt(null),Ve(!1))}function yo(p){u({type:"workspace.restore",workspaceIds:p})}function Ma(p,O,ce){u({type:"folder.create",scope:p,name:O,workspaceId:ce})}function Bu(p,O){u({type:"folder.rename",folderId:p,name:O})}function rc(p,O){u({type:"folder.setColor",folderId:p,color:O})}function gi(p){u({type:"folder.delete",folderId:p})}function Af(p,O,ce,qe){u({type:"folder.assign",scope:p,itemId:O,folderId:ce,workspaceId:qe})}function qn(p,O=!1){De("sessions"),Te("live"),$e&&$e!==p.workspaceId&&ht(null),L.setView(null),L.markRead(p),Et(!1),Y.open(p.id,O),L.openConversation(p),(p.state==="closed"||p.state==="error")&&L.launchSession(p.workspaceId,p.provider,Gt(p),!1,p.id)}function xi(p,O=kl[0]??"claude"){De("sessions"),Te("live"),L.setView(null),Et(!1),ht(p),L.launchSession(p,O)}function fl(p,O){if(O==="settings"){Tn();return}if(O==="account"){Oa();return}p.id!==oe&&bi(p),U({sessionId:p.id,tool:O,toggle:p.id===oe})}b.useEffect(()=>{if(!E||E.sessionId!==oe)return;const p=E.tool;U(null),(p==="files"||p==="search"||p==="git")&&(ii(O=>p==="files"&&(!E.toggle||!O)),Yr(O=>p==="search"&&(!E.toggle||!O)),ct(O=>p==="git"&&(!E.toggle||!O))),p==="terminal"&&uo(!0),p==="tasks"&&L.setView("tasks"),p==="extensions"&&dc("mcp"),p==="ask"&&oi(!0)},[E,oe]),b.useEffect(()=>{ne&&!L.openedIds.includes(ne.id)&&L.openConversation(ne)},[ne==null?void 0:ne.id]);function qu(p,O,ce,qe,ot){De("sessions"),Te("live"),L.setView(null),ne&&L.openConversation(ne),fr(p.workspaceId),s.current={requestId:"",draft:ot},u({type:"session.start",workspaceId:p.workspaceId,provider:O,taskParent:Gt(p),taskStage:ce,...qe?{resume:Gt(p),fork:!0}:{}}),wt(!1)}function dr(p){L.setView(null),ht(p||null),De("sessions"),Te("all"),wt(!1)}function ta(){if(!oe)return;L.closeConversation(oe),Rt(null),fi.current=!0;const p={workspaceId:he??"",sessionId:null,claudeSessionId:null};Jr.current=p;try{localStorage.setItem(Bp,JSON.stringify(p))}catch{}}function fr(p){Aa(),Df(),at(p),Rt(null),bt(fs),qt(null),Ve(!1),fn(null),Hs(null),Sl(null),jn(null),T(""),Ji(!1),El(null),Fl(!1),lr([]),Jl(null)}function cc(p,O,ce){u({type:"session.pin",workspaceId:p,sessionIds:O,pinned:ce})}function vo(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function oc(p){if(vo(p)){Ue(p);return}u({type:"session.close",sessionId:p.id})}function Gs(p,O,ce){Bt(qe=>{const ot=qe??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!ce)return qe;const An={...ot.sessions};return O&&O.length>0?An[ce]=O:delete An[ce],{...ot,sessions:An}}return{...ot,[p]:O??[]}}),u({type:"order.set",scope:p,ids:O,...ce?{workspaceId:ce}:{}})}function bi(p){p.workspaceId!==he&&fr(p.workspaceId),Ra(p)}function Ra(p){if(wt(!1),Aa(),bt(fs),qt(null),Ve(!1),p.state==="closed"){Rt(null),u({type:"session.start",workspaceId:p.workspaceId,resume:p.id,provider:p.provider});return}Rt(p.id),u({type:"session.sync",sessionId:p.id,sinceSeq:0})}function uc(p,O=ne){const ce=(O==null?void 0:O.provider)!=="claude"?null:sE((O?L.usage[O.id]:null)??vn,En);return ce?new Promise(qe=>{Ze(ot=>(ot==null||ot.resolve(!1),{warning:ce,resolve:qe}))}).then(qe=>(qe&&p(),qe)):(p(),!0)}function Da(p){_e&&(_e.resolve(p),Ze(null))}function As(p){const O=fe.find(ce=>(ce.claudeSessionId??ce.id)===p.sessionId&&ce.state!=="closed");Ol(p.workspaceId,p.sessionId,p.text),O&&u({type:"session.close",sessionId:O.id})}function $s(p){Ol(p.workspaceId,p.claudeSessionId??p.id,null)}function Ol(p,O,ce){ts.current=ce===null?null:{workspaceId:p,text:ce},p!==he?fr(p):(Aa(),Rt(null),qt(null),bt(fs),Ve(!1)),u({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:O,...ce===null?{}:{fromHandoff:!0}}),wt(!1)}b.useEffect(()=>{Cs&&(kn(null),As(Cs))},[Cs]);function hl(p){Ts[p.id]||(os(O=>({...O,[p.id]:!0})),u({type:"session.handoff",sessionId:p.id}))}function pl(p){u({type:"handoff.dismiss",sessionId:p})}function Ll(p,O){u({type:"session.rename",sessionId:p.id,title:O,workspaceId:p.workspaceId}),P(ce=>ce.map(qe=>qe.id===p.id?{...qe,title:O}:qe))}function dc(p){oe&&(wt(!1),yn(null),Jn(null),un(p),u({type:"mcp.list",sessionId:oe}),u({type:"plugin.list",sessionId:oe}))}const jo={mcpAction:(p,O)=>{oe&&(yn(null),u({type:"mcp.action",sessionId:oe,name:p,action:O}))},mcpAuth:p=>{oe&&(yn(null),Jn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),u({type:"mcp.auth",sessionId:oe,name:p}))},mcpAuthCallback:(p,O)=>{oe&&u({type:"mcp.auth_callback",sessionId:oe,name:p,callbackUrl:O})},mcpAdd:(p,O)=>{oe&&u({type:"mcp.add",sessionId:oe,name:p,draft:O})},mcpRemove:p=>{oe&&u({type:"mcp.remove",sessionId:oe,name:p})},pluginInstall:p=>{oe&&u({type:"plugin.install",sessionId:oe,spec:p})},pluginUninstall:p=>{oe&&u({type:"plugin.uninstall",sessionId:oe,id:p})},pluginToggle:(p,O)=>{oe&&u({type:"plugin.toggle",sessionId:oe,id:p,enabled:O})},marketplaceAdd:p=>{oe&&u({type:"marketplace.add",sessionId:oe,source:p})},marketplaceRemove:p=>{oe&&u({type:"marketplace.remove",sessionId:oe,name:p})}};function Oa(){wt(!1),jl(!0),u({type:"auth.status"})}const fc={login:(p,O)=>u({type:"auth.login",mode:p,switchAccount:O}),submitCode:p=>u({type:"auth.code",code:p}),cancel:()=>u({type:"auth.cancel"}),logout:()=>u({type:"auth.logout"})};function Tn(){wt(!1),Nl(!0),u({type:"settings.get"})}function tn(p){wl(O=>O&&{...O,...p,startModels:{...O.startModels??{claude:O.startModel??null,codex:null,antigravity:null},...p.startModels}}),u({type:"settings.update",settings:p})}function yt(p){!oe||k||u({type:"side.ask",sessionId:oe,text:p})}function na(){oe&&(u({type:"side.reset",sessionId:oe}),ol.current=null,ea(null),Fr(fs),rr(null),Rl({}),Ea.current=[])}function ns(p){const O=ol.current;if(O){p(O);return}const ce=Bn.current;ce&&(Ea.current.push(p),u({type:"side.open",sessionId:ce}))}function hc(){he&&u({type:"git.state",workspaceId:he})}function sa(p){he&&(Sl(p),u({type:"git.show",workspaceId:he,ref:p}))}function wo(p,O){jn(null),es({target:p,label:O})}function Gu(){!he||!xs||(u({type:"git.checkout",workspaceId:he,target:xs.target}),es(null))}function _i(){he&&(jn(null),u({type:"git.push",workspaceId:he}))}function La(p){he&&(jn(null),u({type:"git.pull",workspaceId:he,merge:p}))}function ko(){he&&(jn(null),El(null),Ji(!0),u({type:"github.status"}),u({type:"github.owners"}),u({type:"git.files",workspaceId:he}))}function hr(p){he&&(jn(null),u({type:"git.publish",workspaceId:he,...p}))}function No(p){he&&(jn(null),u({type:"git.remote",workspaceId:he,url:p}))}function za(){jn(null),Fl(!0)}function zl(p){u({type:"github.token",token:p}),u({type:"github.owners"})}function la(){u({type:"github.status"}),u({type:"github.owners"})}b.useEffect(()=>{if(!(!Js||!he))for(const p of ka)p in Tl||u({type:"fs.list",workspaceId:he,path:p})},[Js,ka,Tl,he,u]);function Il(p){Wi(O=>O.includes(p)?O.filter(ce=>ce!==p):[...O,p])}function So(p){if(!p){ro(null);return}he&&u({type:"fs.search",workspaceId:he,query:p})}function Eo(p){if(!p){co(null);return}he&&u({type:"fs.grep",workspaceId:he,query:p})}const yi=b.useCallback((p,O)=>{Ou(ot=>({...ot,[p]:O}));const ce=zn.current;if(O===null||!ce)return;const qe=O.lastIndexOf("/");if(qe!==-1){u({type:"fs.list",workspaceId:ce,path:O.slice(0,qe)});return}if(O===""){u({type:"fs.list",workspaceId:ce,path:""});return}u({type:"fs.search",workspaceId:ce,query:O,scope:p})},[u]);b.useMemo(()=>k_($r.mention??null,ri.mention??null,Tl),[$r.mention,ri.mention,Tl]);const pc=b.useMemo(()=>k_($r.side??null,ri.side??null,Tl),[$r.side,ri.side,Tl]);function Ia(p){vi(p.path,{line:p.line,column:p.column})}function Zn(p){const O=[];let ce=Dr(p.path);for(;O.push(ce),!!ce;)ce=Dr(ce);Wi(qe=>{const ot=new Set(qe);for(const An of O)ot.add(An);return p.kind==="dir"&&ot.add(p.path),[...ot]}),p.kind==="file"&&vi(p.path)}function vi(p,O){if(el.current.find(qe=>qe.path===p)){Al(p),O&&oo({path:p,...O,token:++Iu.current});return}he&&(O&&(Xr.current={path:p,...O}),ul.current.add(p),u({type:"fs.read",workspaceId:he,path:p}))}function mc(p,O=!1){const ce=el.current,qe=ce.find(Ys=>Ys.path===p);if(qe&&Wa(qe)&&!O){nr(p);return}nr(null);const ot=ce.findIndex(Ys=>Ys.path===p),An=ce.filter(Ys=>Ys.path!==p);Ws(An),Al(Ys=>{var Ga;return Ys===p?((Ga=An[Math.min(ot,An.length-1)])==null?void 0:Ga.path)??null:Ys})}function gc(p,O=!1){const ce=el.current.find(qe=>qe.path===p);!ce||!he||!O&&!Wa(ce)||(pi.current.set(p,ce.text),u({type:"fs.write",workspaceId:he,path:p,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...O?{force:!0}:{}}))}function Mf(p){he&&u({type:"fs.read",workspaceId:he,path:p})}function Rf(p){he&&(tl.current.has(p)||(tl.current.add(p),u({type:"fs.readMedia",workspaceId:he,path:p})))}const Cn=b.useRef(new Map);function To(p){const O=Cn.current,ce=O.get(p);ce&&clearTimeout(ce);const qe=(En==null?void 0:En.autoSaveAfterPauseMs)??0;qe<=0||O.set(p,setTimeout(()=>{O.delete(p);const ot=el.current.find(An=>An.path===p);ot&&Wa(ot)&&!ot.stale&&gc(p)},qe))}function pr(p,O,ce){if(!he)return;const qe=p?`${p}/${ce}`:ce;Pl(null),O==="file"&&(Ca.current=qe),u({type:"fs.create",workspaceId:he,path:qe,kind:O})}function mr(p,O){if(!he)return;const ce=Dr(p),qe=ce?`${ce}/${O}`:O;Pl(null),dl.current={from:p,to:qe},u({type:"fs.rename",workspaceId:he,path:p,to:qe})}function Co(p,O){if(!he)return;const ce=p.slice(p.lastIndexOf("/")+1),qe=O?`${O}/${ce}`:ce;qe!==p&&(Pl(null),dl.current={from:p,to:qe},u({type:"fs.rename",workspaceId:he,path:p,to:qe}))}function ji(p,O){he&&(Pl(null),u({type:"fs.copy",workspaceId:he,path:p,toDir:O}))}function wi(p){he&&(Pl(null),Gr(null),u({type:"fs.delete",workspaceId:he,path:p.path}),Ws(O=>O.filter(ce=>ce.path!==p.path&&!ce.path.startsWith(`${p.path}/`))),Al(O=>O&&(O===p.path||O.startsWith(`${p.path}/`))?null:O))}function Df(){Cl({}),Wi([""]),Ws([]),Al(null),Pl(null),ro(null),co(null),Ou({}),Lu({}),oo(null),ul.current.clear(),pi.current.clear(),tl.current.clear(),Xr.current=null,dl.current=null,Ca.current=null}function $u(){!he||Ml||!Wl||(ar(null),ho.current=!0,u({type:"term.open",workspaceId:he,cols:80,rows:24}))}function Of(p){u({type:"term.close",id:p})}b.useEffect(()=>{function p(O){if(O.key!=="Escape")return;if(hn!==null){const qe=O.target;if(!(qe instanceof HTMLElement&&qe.closest(".termview, .editor, .sidepane"))){Pr(null);return}}if(!oe||Un.pending.length>0)return;const ce=O.target;ce instanceof HTMLElement&&ce.closest('.sidepane, .editor, .session-pane, [role="dialog"], [role="menu"]')||u({type:"control.interrupt",sessionId:oe})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[oe,Un.pending.length,u,hn]),b.useEffect(()=>{function p(O){O.key!=="`"||!(O.ctrlKey||O.metaKey)||Wl&&(O.preventDefault(),uo(ce=>!ce))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Wl]);const Yu=b.useMemo(()=>{const p=(He==null?void 0:He.commands)??[];return p.length===0||(ne==null?void 0:ne.provider)!=="claude"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...wp]},[He,ne==null?void 0:ne.provider]);function Ua(p){if((ne==null?void 0:ne.provider)==="codex"){if(p==="new"||p==="clear")return xi(ne.workspaceId,"codex"),!0;if(p==="resume")return L.setView("command"),!0;if(p==="stop")return u({type:"control.interrupt",sessionId:ne.id}),!0;if(p==="exit"||p==="quit")return u({type:"session.close",sessionId:ne.id}),ta(),!0}if(p==="fork"&&(ne==null?void 0:ne.provider)==="codex"&&oe&&!gl){const ce=ne;return L.openConversation(ce),Rt(null),qt(null),bt(fs),u({type:"session.start",workspaceId:ce.workspaceId,provider:"codex",resume:ce.id,fork:!0}),!0}const O=yE[p];return O&&(ne==null?void 0:ne.provider)==="claude"?(dc(O),!0):(ne==null?void 0:ne.provider)!=="claude"||!wp.some(ce=>ce.name===p)?!1:(Oa(),p==="logout"&&fc.logout(),p==="switch-account"&&fc.login("claudeai",!0),!0)}const Ao=(ne==null?void 0:ne.state)==="waiting_permission",ml=(ne==null?void 0:ne.state)==="reconnecting",gl=(ne==null?void 0:ne.state)==="running"||ml||Ao,Ms=Un.pending[0]??null,Mo=Ms?jy(Ms.toolName,Ms.input):null,[xc,Ro]=b.useState(()=>new Set);Ms&&xc.has(Ms.requestId),Ms&&Ms.questions&&Ms.questions.length>0,b.useEffect(()=>{!cn&&!Js||!he||gl||u({type:"git.state",workspaceId:he})},[cn,Js,he,gl,u]),b.useEffect(()=>{if(!(gl||!he)){Js&&Cl(p=>{const O={};for(const[ce,qe]of Object.entries(p))nc.current.includes(ce)||(O[ce]=qe);return O});for(const p of el.current)Wa(p)||u({type:"fs.read",workspaceId:he,path:p.path})}},[gl,he,Js,u]),(ne==null?void 0:ne.cwd)??(He==null||He.cwd);const Do=(He==null?void 0:He.models)??[],gr=(ne==null?void 0:ne.model)??(He==null?void 0:He.model)??null,{rows:aa,selected:Ha}=S_(Do,gr),ki=Bs?{model:Bs.model,effort:Bs.effort,ultracode:Bs.ultracode,thinking:Bs.thinking,switchOnFlag:Bs.switchModelsOnFlag}:{model:di.model??gr,effort:di.effort??(ne==null?void 0:ne.effort)??null,ultracode:di.ultracode??(ne==null?void 0:ne.ultracode)??!1,thinking:di.thinking??(ne==null?void 0:ne.thinking)??!0,switchOnFlag:di.switchOnFlag??(ne==null?void 0:ne.switchModelsOnFlag)??!0},Oo=S_(Do,ki.model),Ni=(Bs==null?void 0:Bs.state)==="running",Ba=qr?Na.find(p=>p.path===qr)??null:null,bc=new Set(Na.filter(Wa).map(p=>p.path)),ia=p=>a.jsx(iE,{pane:p,width:gt.widths[p],onResize:O=>gt.setWidth(p,O),onReset:()=>gt.reset(p)}),Ul=p=>et?null:()=>Uu(p),Vu=(ne==null?void 0:ne.provider)==="codex"?G_:(ne==null?void 0:ne.provider)==="antigravity"?$_:Vp;He&&(ne==null||ne.permissionMode,Vu.map(p=>({value:p.value,label:p.value,hint:p.hint}))),aa.length>0&&(ne==null||ne.effort,ne==null||ne.ultracode,ne==null||ne.thinking,ne==null||ne.switchModelsOnFlag,ne==null||ne.provider,ne==null||ne.provider,ne==null||ne.provider),ne==null||ne.state;const ra=()=>{oe&&u({type:"session.reconnect",sessionId:oe})},Xu=ml?"Сессия уже поднимает новый процесс":gl?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён";oe&&(ml||(ne==null||ne.state));const ca=ur?a.jsx(FS,{handoff:ur,onContinue:()=>As(ur),onShow:()=>rl(ur),onDismiss:()=>pl(ur.sessionId)}):null;ne&&ne.totalCostUsd>0&&`${ne.totalCostUsd.toFixed(3)}`,ne==null||ne.provider,ne&&ne.state;const qa=ne?Ts[ne.id]===!0:!1,xr=Dv({onLongPress:()=>{ne&&$s(ne)},onClick:()=>{ne&&hl(ne)},disabled:qa});ne&&ne.state!=="closed"&&ne.provider==="claude"&&{className:qa||xr.holding,style:`${xr.thresholdMs}`,...xr.handlers};const oa=Ba?a.jsxs(a.Fragment,{children:[Na.length>0&&a.jsx(m1,{files:Na,activePath:qr,busy:gl,onSelect:Al,onClose:p=>mc(p),zoomed:hn==="main",onToggleZoom:Ul("main")}),a.jsx(h1,{file:Ba,goto:(Vr==null?void 0:Vr.path)===Ba.path?Vr:null,onChange:(p,O)=>{Ws(ce=>ce.map(qe=>qe.path===p?{...qe,text:O}:qe)),To(p)},onSave:p=>gc(p),onReload:Mf,onOverwrite:p=>gc(p,!0),onRequestMedia:Rf,onTogglePreview:p=>Ws(O=>O.map(ce=>ce.path===p?{...ce,previewMode:!ce.previewMode}:ce))})]}):void 0,ua=a.jsx(a.Fragment,{children:Qr&&Wl&&a.jsxs(a.Fragment,{children:[!et&&hn!=="terminal"&&a.jsx(cE,{height:ir.height,onResize:ir.setHeight,onReset:ir.reset}),a.jsx(fE,{mobile:et,zoomed:hn==="terminal",onToggleZoom:Ul("terminal"),terminals:Kr,activeId:fo,blocked:Ml,error:Sf,onDismissError:()=>ar(null),height:et?Zr.height:ir.height,offset:et?{top:Zr.offsetTop,left:Zr.offsetLeft}:void 0,onSelect:Jl,onOpen:$u,onClose:Of,onInput:(p,O)=>u({type:"term.input",id:p,data:O}),onResize:(p,O,ce)=>u({type:"term.resize",id:p,cols:O,rows:ce}),onAttach:p=>u({type:"term.attach",id:p}),onHide:()=>uo(!1),registerSink:Ef})]})}),Rs=pt??$e??he,Lo=(p=!1)=>a.jsx(T1,{dashboard:p,onAllProjects:()=>{Et(!1),De("projects"),ht(null)},onCompareSession:O=>qn(O,!0),open:p||Xn,connected:h,status:m,workspaces:G,archivedWorkspaces:H,workspaceFolders:N,sessionFolders:le.filter(O=>O.workspaceId===Rs),pinnedFolders:ye,sessions:R.filter(O=>O.workspaceId===Rs&&(Lt==="all"||O.provider===Lt)),archived:ae.filter(O=>O.workspaceId===Rs&&(Lt==="all"||O.provider===Lt)),pinned:A.filter(O=>Lt==="all"||O.provider===Lt),live:fe.filter(O=>Lt==="all"||O.provider===Lt),listOrder:rt,liveSessionsFirst:(En==null?void 0:En.liveSessionsFirst)===!0,onReorder:Gs,activeWorkspaceId:Rs,activeSessionId:oe,onPinSessions:cc,onSelectPinned:qn,onCloseWorkspaces:ac,onRestoreWorkspaces:yo,onArchiveSessions:ic,onUnarchiveSessions:O=>{Rs&&u({type:"session.unarchive",workspaceId:Rs,sessionIds:O})},onCreateFolder:Ma,onRenameFolder:Bu,onSetFolderColor:rc,onDeleteFolder:gi,onAssignToFolder:Af,onSelectWorkspace:O=>{At(O),dr(O)},onSelectSession:qn,onRenameSession:Ll,onStopSession:oc,onOpenWorkspace:()=>Wt(!0),onNewSession:O=>Rs&&xi(Rs,O),enabledProviders:kl,onOpenExtensions:oe&&(ne==null?void 0:ne.provider)==="claude"?()=>dc("mcp"):null,account:li,onOpenAccount:Oa,relay:_,onOpenRelay:q?null:()=>D(!0),onOpenSettings:Tn,themeMode:Xe,onCycleTheme:Vt,navigation:a.jsx(bk,{hub:L})},p?Rs:"navigation");return a.jsxs("div",{className:"app app--workspace"+(Oe?" app--running":" app--catalog"),style:gt.style,children:[a.jsx(LN,{hub:L,workspaces:G,selectedWorkspaceId:$e,providers:kl,providerFilter:Lt,onProviderFilter:re,tab:Z,onTab:p=>{De(p),p==="pinned"&&ht(null)},connected:h,status:m,sessionView:Ee,onSessionView:Te,onOpenSession:qn,onSelectWorkspace:(p,O)=>{ht(p||null),De("sessions"),O&&Te("all")},onNewSession:xi,onOpenWorkspace:()=>Wt(!0),onSettings:Tn,onAccount:Oa,onRelay:()=>D(!0),onTheme:Vt,onPin:p=>cc(p.workspaceId,[p.id],!p.pinned),onManageProject:p=>{At(p),Et(!0)}}),Sn&&a.jsx(hs,{title:pt?"Управление проектом":"Папки и архив проектов",className:"modal--hub modal--project-manager",onClose:()=>Et(!1),children:Lo(pt!==null)}),a.jsx(Bw,{open:Js,tree:Tl,expanded:new Set(ka),activePath:qr,dirty:bc,gitChanges:(Mt==null?void 0:Mt.changed)??[],result:kf,searchResult:Nf,onSearch:So,onReveal:Zn,onToggle:Il,onOpen:vi,onCreate:pr,onRename:mr,onMove:Co,onCopy:ji,onDelete:Gr,onRefresh:()=>{Pl(null),Cl({}),hc()},onClose:()=>ii(!1),zoomed:hn==="files",onToggleZoom:Ul("files")}),Js&&hn!=="files"&&ia("files"),a.jsx(Fw,{open:sr,result:zu,onSearch:Eo,onOpenMatch:Ia,onClose:()=>Yr(!1),zoomed:hn==="search",onToggleZoom:Ul("search")}),sr&&hn!=="search"&&ia("search"),a.jsx(ZN,{open:cn,state:Mt,result:ai,selected:Pi,busy:cl,onRefresh:hc,onShow:sa,onCheckout:wo,onPush:_i,onPull:La,onPublish:ko,onConnectRemote:za,onDismissResult:()=>jn(null),onClose:()=>ct(!1),zoomed:hn==="git",onToggleZoom:Ul("git")}),cn&&hn!=="git"&&ia("git"),a.jsx(TN,{controller:Y,sessions:L.sessions,hidden:!Oe,availableIds:Ye.filter(p=>(Lt==="all"||p.provider===Lt)&&(!$e||p.workspaceId===$e)).map(p=>p.id),onOpen:p=>qn(L.sessions[p]),visibleIds:L.openedIds.filter(p=>L.sessions[p]&&Or(L.sessions[p])&&(Lt==="all"||L.sessions[p].provider===Lt)&&(!$e||L.sessions[p].workspaceId===$e)),onClose:p=>{Y.close(p),L.closeConversation(p),p===oe&&ta()},renderSession:p=>a.jsxs(NN,{sessionId:p,hub:L,workspaces:G,connected:h,suspended:!Oe,networkBlocked:k,terminalEnabled:Wl,onTool:fl,onStop:oc,onPin:O=>cc(O.workspaceId,[O.id],!O.pinned),onClose:()=>{Y.close(p),L.closeConversation(p)},onSend:(O,ce)=>uc(ce,O),onCommand:(O,ce)=>O.provider==="claude"&&["mcp","plugins","plugin"].includes(ce)?(fl(O,"extensions"),!0):O.provider==="claude"&&wp.some(qe=>qe.name===ce)?(Oa(),!0):!1,editor:oe===p?oa:void 0,footer:oe===p?ua:void 0,className:oe===p&&(hn==="main"||hn==="terminal")?"main--zoomed":void 0,children:[y&&k&&a.jsx(JS,{state:y}),oe===p&&ca]})}),a.jsx(bS,{open:Sa,items:ui.items,busy:Ni,ready:oe!==null,sendBlocked:k,commands:Yu,contextResult:pc,draftKey:oe,models:Oo.rows,model:Oo.selected,effort:ki.effort,ultracode:ki.ultracode,thinking:ki.thinking,switchOnFlag:ki.switchOnFlag,onContextSearch:p=>yi("side",p),onCommand:Ua,onModel:p=>{p&&(Rl(O=>({...O,model:p})),ns(O=>u({type:"control.set_model",sessionId:O,model:p})))},onEffort:p=>{Rl(O=>({...O,effort:p,ultracode:!1})),ns(O=>u({type:"control.set_effort",sessionId:O,effort:p}))},onUltracode:p=>{Rl(O=>({...O,ultracode:p,...p?{effort:"xhigh"}:{}})),ns(O=>u({type:"control.set_ultracode",sessionId:O,enabled:p}))},onThinking:p=>{Rl(O=>({...O,thinking:p})),ns(O=>u({type:"control.set_thinking",sessionId:O,enabled:p}))},onSwitchOnFlag:p=>{Rl(O=>({...O,switchOnFlag:p})),ns(O=>u({type:"control.set_flag_switch",sessionId:O,enabled:p}))},onAsk:yt,onInterrupt:()=>{po&&u({type:"control.interrupt",sessionId:po})},onReset:na,onClose:()=>oi(!1),zoomed:hn==="ask",onToggleZoom:Ul("ask")}),Sa&&hn!=="ask"&&ia("ask"),(cn||Sa||Js||sr)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{ct(!1),oi(!1),ii(!1),Yr(!1)}}),Ps&&a.jsx(WN,{detail:Ps,local:((Mt==null?void 0:Mt.hasRemote)??!1)&&(Mt==null?void 0:Mt.commits.some(p=>p.hash===Ps.hash&&!p.pushed))===!0,onCheckout:wo,onClose:()=>{Hs(null),Sl(null)}}),_e&&a.jsxs(hs,{title:"Лимит плана почти исчерпан",onClose:()=>Da(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>Da(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>Da(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[bf[_e.warning.limit][0].toUpperCase(),bf[_e.warning.limit].slice(1)," использован на"," ",Math.round(_e.warning.utilization)," %, сброс в"," ",lE(_e.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),Re&&a.jsx(hs,{title:"Остановить сессию?",onClose:()=>Ue(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ue(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{u({type:"session.close",sessionId:Re.id}),Ue(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),xs&&a.jsxs(hs,{title:"Переключить рабочее дерево?",onClose:()=>es(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>es(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Gu,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",xs.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),gl&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Mt&&Mt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Mt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Hr&&a.jsx(fS,{status:ge,owners:_t,files:_s,defaultName:(sc==null?void 0:sc.name)??"",hasCommits:Mt===null||Mt.head!=="",busy:cl,result:ai,onRefreshStatus:la,onSaveToken:zl,onPublish:hr,onDismissResult:()=>jn(null),onClose:()=>Ji(!1)}),Br&&a.jsx(xS,{busy:cl,result:ai,onSubmit:No,onDismissResult:()=>jn(null),onClose:()=>Fl(!1)}),er&&a.jsx(hs,{title:er.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Gr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Gr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>wi(er),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[er.path," будет удалён с диска",er.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),tr&&a.jsx(hs,{title:"Закрыть без сохранения?",onClose:()=>nr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>nr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>mc(tr,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{gc(tr),mc(tr,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",tr," есть несохранённые правки."]})}),it&&a.jsx(yS,{tab:it,servers:ks,plugins:Ss,marketplaces:rs,catalog:Zt,result:_n,auth:lt,remote:q,actions:jo,onTab:un,onClose:()=>un(null)}),en&&a.jsx(CS,{status:li,login:Zl,actions:fc,remote:q,runningSessions:R.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:oe?()=>{ra(),jl(!1)}:null,reconnectBlocked:gl,reconnectHint:Xu,onClose:()=>jl(!1)}),C&&a.jsx(OS,{state:_,onPair:(p,O)=>u({type:"relay.pair",code:p,...O?{name:O}:{}}),onUnpair:()=>u({type:"relay.unpair"}),onClose:()=>D(!1)}),Wn&&a.jsx(KS,{themeMode:Xe,onThemeChange:Je,settings:En,supportsProviderDefaults:L.supportsProviderDefaults,models:(ne==null?void 0:ne.provider)==="claude"?(He==null?void 0:He.models)??[]:[],providerModels:Object.fromEntries(["claude","codex","antigravity"].map(p=>{var O;return[p,((O=Object.entries(L.capabilities).find(([ce,qe])=>{var ot;return((ot=L.sessions[ce])==null?void 0:ot.provider)===p&&qe.models.length}))==null?void 0:O[1].models)??((ne==null?void 0:ne.provider)===p?(He==null?void 0:He.models)??[]:[])]})),relayState:_,networkState:y,local:nf()==="local",onChange:tn,onEnableShell:()=>u({type:"relay.shell.enable"}),onDisableShell:()=>u({type:"relay.shell.disable"}),onOpenRelay:()=>{Nl(!1),D(!0)},onClose:()=>Nl(!1)}),On&&a.jsx(UN,{candidates:bn,searching:zt,agentItems:pe.items,agentBusy:(Ke==null?void 0:Ke.state)==="running",error:an,roots:gs,created:is,onSearch:lc,onAskAgent:qs,onInterrupt:()=>{const p=tc.current;p&&u({type:"control.interrupt",sessionId:p})},onSubmit:_o,onCreate:nl,onClose:mi}),dn&&a.jsx(PS,{handoff:dn,onClose:()=>rl(null)}),a.jsx(_k,{providerFilter:Lt,hub:L,connected:h,workspaces:G,activeWorkspaceId:he,activeSession:ne,providers:kl,onSelectSession:qn,onSelectWorkspace:dr,onOpenWorkspace:()=>{L.setView(null),Wt(!0)},onOpenSettings:()=>{L.setView(null),Tn()},onOpenFiles:()=>{L.setView(null),ii(!0),Yr(!1),ct(!1)},onNewSession:xi,onStartStage:qu}),a.jsx(tE,{notices:Ln,onDismiss:p=>Hn(O=>O.filter(ce=>ce.id!==p))})]})}function wE(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function kE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),a.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),a.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function NE(n,s){return E_(n)===E_(s)}function E_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function SE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Uy=document.getElementById("root");if(!Uy)throw new Error("#root not found");iv.createRoot(Uy).render(a.jsx(b.StrictMode,{children:a.jsx(jE,{})}));export{lw as D,mn as I,xn as N,CE as P,yl as T,Ql as a,iy as b,Fs as c,TE as d,dy as e,Su as f,ww as h,AE as p,ME as s,ze as t};
|